Merge branch 'master' of ssh://github.com-sigma/sigmahour/Meshtastic

This commit is contained in:
sigmahour 2022-10-31 14:01:23 -04:00
commit 18fb999121
2 changed files with 15 additions and 6 deletions

View file

@ -7,9 +7,9 @@ sidebar_position: 4
## Bridging networks ## Bridging networks
Meshtastic networks in different locations beyond the reach of LoRa can be easily bridged together using MQTT. The simplest option is to connect your mesh to the official Meshtastic MQTT broker. This makes your devices appear on the world map, and provides a copy of your mesh traffic, translated into JSON. All you have to do to join the public MQTT server is to Enable MQTT and set uplink and downlink on the channels that you want to share over MQTT. Meshtastic networks in different locations beyond the reach of LoRa can be easily bridged together using MQTT. The simplest option is to connect your mesh to the official Meshtastic MQTT broker. This makes your devices appear on the world map, and provides a copy of your mesh traffic, translated into JSON. All you have to do to join the public MQTT server is to Enable MQTT and set uplink and downlink on the channels that you want to share over MQTT. The default device configuration using the public MQTT Server is encrypted.
You can also share channel settings with a remote network and enable encryption for MQTT, encryption is off by default for MQTT. You can also specify your own private MQTT broker and specify authentication for that broker to bridge several mesh networks together, via the internet (or just a local IP network). You can also share channel settings with a remote network. If you use the default meshtastic MQTT server, packets are always encrypted. If you use a custom MQTT broker (ie set `mqtt.address`), the `mqtt.encryption_enabled` setting applies, which by default is false. You can also specify your own private MQTT broker and specify authentication for that broker to bridge several mesh networks together, via the internet (or just a local IP network).
You can find the settings available for MQTT [here](https://meshtastic.org/docs/settings/moduleconfig/mqtt). You can find the settings available for MQTT [here](https://meshtastic.org/docs/settings/moduleconfig/mqtt).
@ -19,7 +19,7 @@ Using or emitting packets directly in/from smart home control software such as H
When MQTT is enabled, the Meshtastic device simply uplinks and/or downlinks every raw protobuf packet that it sees to the MQTT broker. In addition, some packet types are serialized or deserialized from/to JSON messages for easier use in consumers. All packets are sent to the broker, whether they originate from another device on the mesh, or the gateway node itself. When MQTT is enabled, the Meshtastic device simply uplinks and/or downlinks every raw protobuf packet that it sees to the MQTT broker. In addition, some packet types are serialized or deserialized from/to JSON messages for easier use in consumers. All packets are sent to the broker, whether they originate from another device on the mesh, or the gateway node itself.
Packets may be encrypted. If you use the default meshtastic MQTT server, packets are always encrypted. If you use a custom MQTT broker (ie set `mqtt_server`), the `mqtt_encryption_enabled` setting applies, which by default is false. Packets may be encrypted. If you use the default meshtastic MQTT server, packets are always encrypted. If you use a custom MQTT broker (ie set `mqtt.address`), the `mqtt.encryption_enabled` setting applies, which by default is false.
IMPORTANT: When MQTT is turned on, you are potentially broadcasting your entire mesh traffic onto the public internet. This includes messages and position information. IMPORTANT: When MQTT is turned on, you are potentially broadcasting your entire mesh traffic onto the public internet. This includes messages and position information.
@ -227,6 +227,15 @@ if __name__ == '__main__':
### Using MQTT with Node-RED ### Using MQTT with Node-RED
Below is a valid json envelope for information sent by MQTT to a device for broadcast onto the mesh.
```
{
"sender":"whatever you want to be the SENDER",
"type":"sendtext",
"payload": text or a json object go here
}
```
Node-RED is a free cross-platform programming tool for wiring together hardware, APIs, and online services developed originally by IBM for IOT. It is widely used for home automation by many non-professional programmers and runs well on Pi's. Node-red has many plug-in modules written by the community. I will use this platform as a practical example on how to interface with the MQTT features of Meshtastic. Everything can be done from GUI's without using command line. Node-RED is a free cross-platform programming tool for wiring together hardware, APIs, and online services developed originally by IBM for IOT. It is widely used for home automation by many non-professional programmers and runs well on Pi's. Node-red has many plug-in modules written by the community. I will use this platform as a practical example on how to interface with the MQTT features of Meshtastic. Everything can be done from GUI's without using command line.
Step one: use http://client.meshtastic.org/ one of the Apple apps or the CLI to connect to your device and adjust these settings. Step one: use http://client.meshtastic.org/ one of the Apple apps or the CLI to connect to your device and adjust these settings.

View file

@ -26,9 +26,9 @@ to keep the Bluetooth link alive for eight hours (any usage of the Bluetooth pro
```shell title="Expected Output" ```shell title="Expected Output"
# You should see a result similar to this: # You should see a result similar to this:
mydir$ meshtastic --set wait_bluetooth_secs 28800 mydir$ meshtastic --set bluetooth.wait_bluetooth_secs 28800
Connected to radio... Connected to radio...
Setting preference wait_bluetooth_secs to 28800 Setting bluetooth.wait_bluetooth_secs to 28800
Writing modified preferences to device... Writing modified preferences to device...
``` ```
@ -41,7 +41,7 @@ meshtastic --setlat 25.2 --setlon -16.8 --setalt 120
Or to configure an ESP32 based board to join a Wifi network as a station: Or to configure an ESP32 based board to join a Wifi network as a station:
```shell ```shell
meshtastic --set network.wifi_ssid mywifissid --set network.wifi_password mywifipsw meshtastic --set network.wifi_ssid mywifissid --set network.wifi_psk mywifipsw
``` ```
:::note :::note