Synchronet v3.21e-Win32 (install) has been released (Mar-2026).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howto:mqtt [2023/08/04 20:29] – It's "MQTT" digital manhowto:mqtt [2025/09/11 23:00] (current) – ↷ Links adapted because of a move operation digital man
Line 1: Line 1:
 ====== MQTT ====== ====== MQTT ======
 +
 +===== Setup =====
 +
 This is a bit of a stub for MQTT but it'll help you get going, on Ubuntu at least. This is a bit of a stub for MQTT but it'll help you get going, on Ubuntu at least.
  
-First, you'll need sbbs v320a_dev from gitThis is documented elsewhere+First, you'll need Synchronet v3.20a or later.
  
-Once compiled and installed, run scfg, make some small change and then save. This will now add a mqtt section to main.ini. Change the host and port (default to 127.0.0.1 port 1883)+Then install the Mosquitto broker and client:
  
    sudo apt install mosquitto mosquitto-clients    sudo apt install mosquitto mosquitto-clients
Line 21: Line 24:
  
    sudo systemctl start mosquitto    sudo systemctl start mosquitto
- 
  
 At this point you should probably rebuild sbbs so that libmosquitto will be picked up and included in libsbbs.so. You can verify this with the following command: At this point you should probably rebuild sbbs so that libmosquitto will be picked up and included in libsbbs.so. You can verify this with the following command:
Line 30: Line 32:
 If there is no response to the command, then a recompile is necessary. If there is no response to the command, then a recompile is necessary.
  
 +Run [[util:SCFG]] and go to Networks->MQTT. Change the `Broker Address` and `Port` to match your installed Mosquitto broker's configuration (default 127.0.0.1 and port 1883) and set `Enabled` to `Yes`.
  
 Now start sbbs and you should see the following lines in your log Now start sbbs and you should see the following lines in your log
Line 37: Line 40:
    Dec 12 02:13:08 bbs synchronet: MQTT connecting to broker 127.0.0.1:1883    Dec 12 02:13:08 bbs synchronet: MQTT connecting to broker 127.0.0.1:1883
  
-If you see a "failure: 14" message then your broker isn't running.+If you see a "failure: 14" messagethen your broker isn't running.
  
 At this point you should see messages from sbbs being passed into the Mosquitto broker At this point you should see messages from sbbs being passed into the Mosquitto broker
Line 46: Line 49:
 ``` ```
  
-Now, to install a client to view the messages.+Now, if you want to install a GUI client to view the messages.
  
    wget https://www.emqx.com/en/downloads/MQTTX/v1.9.0/MQTTX_1.9.0_amd64.deb    wget https://www.emqx.com/en/downloads/MQTTX/v1.9.0/MQTTX_1.9.0_amd64.deb
Line 121: Line 124:
  
 For collecting data and viewing, I highly recommend Node-Red. You can find installation instructions online and should be able to figure its usage but I highly recommend using the current node.js (Node 18 currently) and install the Dashboard module (which will not run on the Ubuntu provided version of node.js). For collecting data and viewing, I highly recommend Node-Red. You can find installation instructions online and should be able to figure its usage but I highly recommend using the current node.js (Node 18 currently) and install the Dashboard module (which will not run on the Ubuntu provided version of node.js).
 +
 +===== WebSockets =====
 +
 +New browser-based Web Monitor and Node Spy features have been added in 3.20, which are powered by MQTT.  The first time you load either of these features you'll be prompted to provide the Hostname and WebSocket Ports for your MQTT server (these are different than the WebSocket ports used to power fTelnet).
 +
 +Keep in mind that it's your web browser connecting to the MQTT server, so you need to provide a hostname that is reachable by your web browser (e.g. if your BBS is running on a VPS, then localhost won't be a good choice for the Hostname, unless you plan to remote into that VPS and launch a browser from there).
 +
 +For the WebSocket ports, you'll need to update your Mosquitto server's configuration to listen on additional ports, because it doesn't do this by default.  The config file does a pretty good job of explaining this, but just to give a working example here's what my config file looks like (of course the cert paths will be different for you):
 +
 +    # mqtt protocol standard port
 +    listener 1883
 +    
 +    # mqtt protocol ssl port
 +    listener 8883
 +    certfile C:\Retsyn\Certificates\bbs.ftelnet.ca.pem
 +    keyfile C:\Retsyn\Certificates\bbs.ftelnet.ca.key.pem
 +    
 +    # websocket protocol standard port
 +    listener 1884
 +    protocol websockets
 +    socket_domain ipv4
 +    
 +    # websocket protocol ssl port
 +    listener 8884
 +    protocol websockets
 +    socket_domain ipv4
 +    certfile C:\Retsyn\Certificates\bbs.ftelnet.ca.pem
 +    keyfile C:\Retsyn\Certificates\bbs.ftelnet.ca.key.pem
 +
 +My understanding is that the SSL certs created by the Synchronet Let's Encrypt client can be converted to a format that is usable by Mosquitto, but I haven't investigated that because I run a separate client to handle my SSL certs.  If someone else goes through the conversion process, please add the steps/commands here!
 +
 +===== Security =====
 +
 +It is VERY important that you DO NOT open any of the MQTT ports to the general public.  Sensitive information may be published to some topics, and other topics allow controlling your BBS (eg downing nodes).  So please make sure your MQTT ports are behind a firewall, and if you want to make use of the Web Monitor or Node Spy features, then only IP addresses belonging to you should be allowed through.
  
 ===== See Also ===== ===== See Also =====
   * [[:howto:|howto index]]   * [[:howto:|howto index]]
-  * [[:ref:mqtt|Synchronet MQTT Topic Naming and Payload Scheme]]+  * [[monitor:mqtt|Synchronet MQTT Topic Naming and Payload Scheme]]
  
 {{tag>mqtt}} {{tag>mqtt}}