diff --git a/docs/assets/pymc-mqtt1.png b/docs/assets/pymc-mqtt1.png new file mode 100644 index 0000000..e5afb9c Binary files /dev/null and b/docs/assets/pymc-mqtt1.png differ diff --git a/docs/assets/pymc-mqtt2.png b/docs/assets/pymc-mqtt2.png new file mode 100644 index 0000000..2ef324b Binary files /dev/null and b/docs/assets/pymc-mqtt2.png differ diff --git a/docs/assets/pymc-mqtt3.png b/docs/assets/pymc-mqtt3.png new file mode 100644 index 0000000..3d7031b Binary files /dev/null and b/docs/assets/pymc-mqtt3.png differ diff --git a/docs/mqtt-pymc.md b/docs/mqtt-pymc.md index 9c56441..3348f60 100644 --- a/docs/mqtt-pymc.md +++ b/docs/mqtt-pymc.md @@ -2,7 +2,7 @@ These instructions cover adding the MeshMapper MQTT broker to an existing pyMC-Repeater installation. If you haven't set up pyMC-Repeater yet, refer to the [pyMC documentation](https://github.com/rightup/pyMC_Repeater) first. -*Thanks to mrzarquon for providing the information for this guide.* +*Thanks to mrzarquon and yellowcooln for providing the information for this guide.* ## Prerequisites @@ -10,13 +10,37 @@ These instructions cover adding the MeshMapper MQTT broker to an existing pyMC-R ## Adding the MeshMapper Broker -### 1. Stop the Service +### Option 1. Add MeshMapper from the UI + +This is the easiest way to add MeshMapper to an existing pyMC-Repeater installation. + +1. Open **Configuration > Observer**. +2. Click **Edit** next to **Observer Configuration**. + +![Observer configuration screen](assets/pymc-mqtt1.png) + +3. Click **From Template**. +4. Select **MeshMapper**. + +![MeshMapper template selection](assets/pymc-mqtt2.png) + +5. Click **Save Settings**. +6. Open the **Terminal** option on the left. +7. Enter `restart` to restart the service. + +![Restarting pyMC-Repeater from the terminal](assets/pymc-mqtt3.png) + +### Option 2. Add MeshMapper manually + +If you prefer, you can still add MeshMapper by editing the config file directly. + +#### 1. Stop the Service ```bash sudo systemctl stop pymc-repeater ``` -### 2. Edit the Configuration +#### 2. Edit the Configuration Open the pyMC-Repeater config file: @@ -24,50 +48,44 @@ Open the pyMC-Repeater config file: sudo nano /etc/pymc_repeater/config.yaml ``` -Add `mqtt.meshmapper.cc` to the `additional_brokers` field under the `letsmesh` section: - -```yaml -letsmesh: - enabled: true - iata_code: YOW # Replace with your region's IATA code - broker_index: 0 - additional_brokers: - - name: mqtt.meshmapper.cc - host: mqtt.meshmapper.cc - port: 443 - audience: mqtt.meshmapper.cc - status_interval: 300 -``` - -If you don't want to send logs to LetsMesh and only want to use MeshMapper, set `broker_index` to `-2`: +Add `mqtt.meshmapper.cc` to the `brokers` field under the `brokers` section: ```yaml -letsmesh: - enabled: true - iata_code: YOW # Replace with your region's IATA code - broker_index: -2 - additional_brokers: - - name: mqtt.meshmapper.cc - host: mqtt.meshmapper.cc - port: 443 - audience: mqtt.meshmapper.cc - status_interval: 300 +mqtt: + iata_code: # e.g., "SFO", "LHR", "Test" + status_interval: 300 # How often a status message is sent (in seconds) + owner: "" + email: "" + brokers: + - name: MeshMapper + enabled: true + transport: websockets + host: mqtt.meshmapper.cc + port: 443 + format: letsmesh + disallowed_packet_types: [] + retain_status: false + tls: + enabled: true + insecure: false + use_jwt_auth: true + audience: mqtt.meshmapper.cc ``` Save and exit (`Ctrl+X`, then `Y`, then `Enter`). -### 3. Start the Service +#### 3. Start the Service ```bash sudo systemctl start pymc-repeater ``` -### 4. Verify the Connection (Optional) +#### 4. Verify the Connection (Optional) Follow the logs to confirm the broker connection is working: ```bash -sudo journalctl -u pymc-repeater.service -f | grep LetsMeshHandler +sudo journalctl -u pymc-repeater.service -f | grep MeshMapper ``` ## Verifying Your Observer