This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
projects:amateur_radio:meshtastic:getting_started [2024/06/20 18:05] – [Python CLI Quickstart] don't enable mqtt while configuring lora Andrew Yong | projects:amateur_radio:meshtastic:getting_started [2025/05/25 14:27] (current) – [Enable MQTT Forwarding] Use LuciferNet MQTT and add privacy warning Andrew Yong | ||
---|---|---|---|
Line 5: | Line 5: | ||
===== Reasons to Use Meshtastic ===== | ===== Reasons to Use Meshtastic ===== | ||
- | < | + | < |
- | < | + | Meshtastic® is a project that enables you to use inexpensive LoRa radios as a long range off-grid communication platform in areas without existing or reliable communications infrastructure. This project is 100% community driven and open source! |
+ | |||
+ | < | ||
+ | |||
+ | </ | ||
==== For Laypersons ==== | ==== For Laypersons ==== | ||
Line 38: | Line 42: | ||
- **[[https:// | - **[[https:// | ||
- **[[https:// | - **[[https:// | ||
- | - **[[https:// | + | |
==== Meshtastic Devices ==== | ==== Meshtastic Devices ==== | ||
Line 46: | Line 50: | ||
:?: The device hardware for 868/915/923 MHz selection is the same, just with different antennae in the box; 433 MHz has hardware differences and can't be used for 900 MHz band | :?: The device hardware for 868/915/923 MHz selection is the same, just with different antennae in the box; 433 MHz has hardware differences and can't be used for 900 MHz band | ||
- | * Portable All-In-One Devices (screen, battery, GPS, antenna, sensor(s), enclosure, | + | |
- | * [[https:// | + | |
- | * Portable All-In-One Kits (screen, battery, GPS, antenna, sensor(s)) | + | * Elecrow |
- | * [[https://www.lilygo.cc/ | + | |
- | * [[https://www.lilygo.cc/ | + | * [[https:// |
- | * [[https://www.lilygo.cc/ | + | * LILYGO |
- | * DIY Kits (screen, antenna, optional battery; suitable for home/office use or powering with USB power bank) | + | * [[https://lilygo.cc/ |
+ | * [[https:// | ||
+ | * RAK Wireless | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | | ||
+ | * Seeed Studio | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * **DIY Kits** (screen, antenna, optional battery; suitable for home/office use or powering with USB power bank) | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
- | :!: Heltec devices are missing USB-C Configuration Channel resistors, so USB-C PD compliant supplies will likely not supply power. Using a USB-A to USB-C cable solves this issue. LILYGO boards have the correct CC resistors (i.e. 5.1 kΩ from pins CC1 and CC2 to ground) and do not have this issue. | + | :!: Some Heltec |
==== Meshtastic Software ==== | ==== Meshtastic Software ==== | ||
Line 69: | Line 86: | ||
==== Antennae ==== | ==== Antennae ==== | ||
- | * With appropriate frequency for configured region | + | |
- | | + | * 915 MHz are usually fine for SG_923 (LongFast default frequency is 917.125 MHz) |
- | | + | * Some devices bundle an antenna, they may not have best resonance at 923 MHz but are good enough to start with |
- | === Antenna Suggestions | + | === Antenna Suggestions === |
- | * **Taoglas TI.92.2113** - SMA 2 dBi hinged dipole; | + | * [[projects:amateur_radio: |
* **Ziisor TX915-JKD-20** - SMA 3.5 dBi hinged dipole; [[http:// | * **Ziisor TX915-JKD-20** - SMA 3.5 dBi hinged dipole; [[http:// | ||
* **Ziisor TX915-JZLW-15** - U.FL 3 dBi fixed dipole; [[https:// | * **Ziisor TX915-JZLW-15** - U.FL 3 dBi fixed dipole; [[https:// | ||
- | * **BETAFPV Moxon V2**- SMA 5.9 dBi directional 2-element yagi?; [[https:// | + | * |
==== Nice to Haves ==== | ==== Nice to Haves ==== | ||
- | * **Battery** | + | |
* For mobile nodes that have battery connectors and onboard lithium-ion chargers | * For mobile nodes that have battery connectors and onboard lithium-ion chargers | ||
* For battery backup of stationary nodes | * For battery backup of stationary nodes | ||
Line 96: | Line 114: | ||
- Appropriate USB COM port drivers must be installed (Windows/ | - Appropriate USB COM port drivers must be installed (Windows/ | ||
- Put the device into programming mode | - Put the device into programming mode | ||
- | * Battery powered devices: Connect USB cable, hold the boot button, tap the reset button, release the boot button | ||
- | * USB powered devices: Hold the boot button, connect USB cable, release the boot button | ||
- Select your board and the latest firmware at [[https:// | - Select your board and the latest firmware at [[https:// | ||
+ | - Follow the on-screen instructions to put the device in bootloader/ | ||
- Click //Flash//, // | - Click //Flash//, // | ||
- Select //Full Erase and Install// if this is the first time installing Meshtastic, this will wipe any leftover data from factory programming | - Select //Full Erase and Install// if this is the first time installing Meshtastic, this will wipe any leftover data from factory programming | ||
- | |||
- | For more experienced ESP32 users, standard tools and methods to flash ESP32 can be used as well, with files from the [[https:// | ||
- | |||
===== First Use Configuration ===== | ===== First Use Configuration ===== | ||
Line 109: | Line 123: | ||
==== Region Configuration ==== | ==== Region Configuration ==== | ||
- | A freshly installed Meshtastic device must have its region | + | A freshly installed Meshtastic device must have its region |
Devices are only visible to, and can only communicate with, devices configured with the same region. | Devices are only visible to, and can only communicate with, devices configured with the same region. | ||
- | * **Android/ | + | * **Android/ |
* **Python CLI**: '' | * **Python CLI**: '' | ||
Line 123: | Line 137: | ||
* Duty cycle: 10% | * Duty cycle: 10% | ||
* IMDA TS SRD band: 26a | * IMDA TS SRD band: 26a | ||
+ | * You will need a 433 MHz Meshtastic device **(868/ | ||
* **SG_923** <- use this, it has higher output power, no duty cycle restriction and is also allocated to LPWAN | * **SG_923** <- use this, it has higher output power, no duty cycle restriction and is also allocated to LPWAN | ||
* Frequency band: 917 - 923 MHz | * Frequency band: 917 - 923 MHz | ||
* ERP: 100 mW (20 dBm) | * ERP: 100 mW (20 dBm) | ||
* IMDA TS SRD band: 30d (not 30b/30c as [[https:// | * IMDA TS SRD band: 30d (not 30b/30c as [[https:// | ||
- | | + | * You will need an 868/915/923 MHz Meshtastic device **(433 MHz devices do NOT support 923 MHz)** |
+ | | ||
- | ==== Meshtastic Channel Configuration | + | ==== Enable MQTT Forwarding |
- | * Meshtastic channels are logical channels (like Telegram channels, WhatsApp groups) | + | Because we don't currently have enough nodes in Singapore |
- | * Primary - Telemetry and position data | + | |
- | * Secondary - Free to use, up to 7 channels | + | |
- | * Channel named “admin” is a special channel used to configure | + | |
- | * Name and encryption configured per-channel | + | |
- | * Shareable as QR code or a deeplink URL | + | |
- | **Creating | + | In future, when a full mesh is formed, MQTT can be disabled for a truly decentralized and private mesh, or left enabled as a backup in case of dead zones in the mesh. |
- | Motivations: | + | **Your personal data (sensor, position, telemetry, etc.) are sent out to the public Internet with this configuration. |
- | * Encrypt | + | Disable |
- | * Don't send plaintext GPS position messages over MQTT forwarding | + | |
- | * Don't send plaintext telemetry over MQTT forwarding | + | |
- | * Connectivity with SG_923 Meshtastic users on the default SG_923 LongFast channel | + | |
- | * Rebroadcast public SG_923 Meshtastic traffic | + | |
- | + | ||
- | Steps (the easy way): | + | |
- | + | ||
- | - [[user: | + | |
- | - Install the channel and LoRa settings with the URL | + | |
- | * **Android/ | + | |
- | * **Python CLI**: '' | + | |
- | + | ||
- | Steps (the hard way, adapted from [[https:// | + | |
- | + | ||
- | - Ensure | + | |
- | - On your PRIMARY channel, set channel | + | |
- | - Configure and enable a SECONDARY channel named '' | + | |
- | - If your LoRa channel is at the default ('' | + | |
- | * '' | + | |
- | + | ||
- | ==== Enable MQTT Forwarding ==== | + | |
- | + | ||
- | Because we don't currently have enough nodes in Singapore to form a full mesh, we need to enable MQTT forwarding to use the Internet as a backhaul to forward messages between isolated nodes and meshes. | + | |
- | + | ||
- | The node must either be connected to Wi-Fi directly (mesh router-client to MQTT bridge), or be paired with an Android or iOS device with "MQTT Client Proxy" enabled (mobile node). | + | |
- | + | ||
- | In future, when a full mesh is formed, MQTT can be disabled for a truly decentralized and private mesh, or left enabled as a backup in case of dead zones in the mesh. | + | |
* **Android/ | * **Android/ | ||
- | - In //Modules// -> //MQTT// | + | - In **Modules** -> //**MQTT**// |
- | - //Enabled//: on | + | - **Enabled**: //**on**// |
- | - Portable nodes with BLE to phone only: //MQTT Client Proxy//: on | + | - **MQTT Client Proxy**: //**on**// (Portable nodes with BLE to phone only) |
- | - Leave the other settings at defaults to use the Meshtastic public MQTT server | + | - **MQTT server**: //**mqtt.lucifernet.com**// |
- | - In //Channels// | + | - In **Channels** |
- | - '' | + | - **LongFast** -> **MQTT Uplink**: //**on**//; **MQTT Downlink**: //**on**// |
* **Python CLI**: | * **Python CLI**: | ||
- '' | - '' | ||
Line 212: | Line 196: | ||
- '' | - '' | ||
- | :?: To find GPS coordinates for your address, you can use the [[https:// | + | :?: To find GPS coordinates for your address, you can use the [[https:// |
- | :!: Please write to [[me@ndoo.sg]] if you have a site to offer for a Wi-Fi to MQTT router; we will sponsor the hardware. | + | |
===== Build, Buy or 3D Print Enclosure for your Meshtastic Device ===== | ===== Build, Buy or 3D Print Enclosure for your Meshtastic Device ===== | ||
Line 220: | Line 203: | ||
Have a look at [[.device_enclosures: | Have a look at [[.device_enclosures: | ||
+ | |||
===== Python CLI Quickstart ===== | ===== Python CLI Quickstart ===== | ||
- | If you have used Meshtastic before and just want to switch over to SG_923, here are all the commands you need to get configured. | + | If you have used Meshtastic before and just want to switch over to SG_923, here is a configuration file to quickly configure your device for SG_923, and an MQTT server operated by [[https:// |
- | <code bash> | + | **Your personal data (sensor, position, telemetry, etc.) are sent out to the public Internet with this configuration.** |
- | # Licensed hams | + | |
- | meshtastic --set-ham [YOUR_CALLSIGN] --set-owner-short | + | |
- | # Other users | + | |
- | meshtastic --set-owner [LONG_NAME] --set-owner-short | + | |
- | # Set region | + | **Disable the MQTT module if you are not comfortable with this. You can also decrease position precision in each channel' |
- | meshtastic --set lora.region 18 && sleep 15 | + | |
- | # Set channel and tx power (don't configure it at the same time as changing regions) | + | - **Download [[https:// |
- | meshtastic --set lora.channel_num 4 --set lora.tx_power 0 && sleep 15 | + | - Linux/MacOS CLI\\ '' |
+ | - Windows CLI\\ '' | ||
+ | | ||
+ | - **Deploy the configuration**\\ '' | ||
+ | Android/iOS app: Skip ahead to [[# | ||
- | # IF Portable device | ||
- | meshtastic --set mqtt.enabled true --set mqtt.proxy_to_client_enabled true | ||
- | |||
- | # ELSEIF Stationary MQTT router | ||
- | meshtastic | ||
- | |||
- | # ENDIF | ||
- | |||
- | # IF configuring channels via channel URL | ||
- | meshtastic --seturl [CONTACT ME FOR URL] | ||
- | |||
- | # ELSEIF configuring channels manually | ||
- | meshtastic --ch-longfast | ||
- | meshtastic --ch-set name 9V1 --ch-index 0 | ||
- | meshtastic --ch-set psk [CONTACT ME FOR PSK] --ch-index 0 | ||
- | meshtastic --ch-set downlink_enabled true --ch-index 0 --ch-set uplink_enabled true --ch-index 0 | ||
- | meshtastic --ch-set name LongFast --ch-index 1 | ||
- | meshtastic --ch-set psk 0x01 --ch-index 1 | ||
- | meshtastic --ch-set downlink_enabled true --ch-index 1 --ch-set uplink_enabled true --ch-index 1 | ||
- | meshtastic --ch-enable --ch-index 1 | ||
- | |||
- | # ENDIF | ||
- | |||
- | </ | ||
- | |||
- | Android/iOS app: Skip ahead to [[# | ||
===== Other Meshtastic Notes ===== | ===== Other Meshtastic Notes ===== | ||
Line 268: | Line 225: | ||
==== Data Rates ==== | ==== Data Rates ==== | ||
- | ^ Channel setting | + | ^ Channel setting |
- | | Short Range / Fast | Short Fast | **10.94 kbps** | + | | Short Range / Fast | Short Fast | **10.94 kbps** |
- | | Short Range / Slow | Short Slow | **6.25 kbps** | + | | Short Range / Slow | Short Slow | **6.25 kbps** |
- | | Medium Range / Fast | + | | Medium Range / Fast | Medium Fast | **3.52 kbps** |
- | | Medium Range / Slow | + | | Medium Range / Slow | Medium Slow | **1.95 kbps** |
- | | Long Range / Fast | + | | Long Range / Fast | Long Fast | **1.07 kbps** |
- | | Long Range / Moderate | + | | Long Range / Moderate |
- | | Long Range / Slow | + | | Long Range / Slow | Long Slow | **0.18 kbps** |
- | | Very Long Range / Slow | Very Long Slow | **0.09 kbps** | + | |
- [[https:// | - [[https:// | ||
Line 283: | Line 240: | ||
* Windows 11's built in Python binaries did not work out of the box with Meshtastic, I had to install Python' | * Windows 11's built in Python binaries did not work out of the box with Meshtastic, I had to install Python' | ||
- Install latest Python from [[https:// | - Install latest Python from [[https:// | ||
- | - <code bash>pip install --upgrade pip</ | + | - <code bash> |
- | - <code bash>pip install meshtastic</ | + | python3 -m pip install --upgrade pip |
+ | </ | ||
+ | - <code bash> | ||
+ | pip3 install meshtastic | ||
+ | </ | ||
==== Entering ESP32 Download Mode ==== | ==== Entering ESP32 Download Mode ==== | ||
Line 298: | Line 259: | ||
- Insert power supply | - Insert power supply | ||
- Release BOOT after 2 seconds | - Release BOOT after 2 seconds | ||
+ | |||
+ |