Serial, MQTT, and Ambient Light Modules
Serial Module
The Serial module lets external hardware send and receive Meshtastic messages over a UART serial connection — enabling integration with microcontrollers, GPS units, custom sensors, and computer software.
Modes of Operation
| Mode | Description | Use Case |
|---|---|---|
| DEFAULT | Raw bytes in/out, app-layer messages | Arduino/ESP32 integration |
| SIMPLE | Newline-delimited text in/out | Simple text message bridging |
| PROTO | Protobuf framing | Full programmatic access |
| NMEA | Outputs NMEA sentences from node GPS | Feeding position to chartplotters |
| CALTOPO | CalTopo-compatible position format | SAR map integration |
Configuration
meshtastic --set serial.enabled true
meshtastic --set serial.mode SIMPLE
meshtastic --set serial.rxd 16
meshtastic --set serial.txd 17
meshtastic --set serial.baud BAUD_9600
RXD/TXD pin numbers are board-specific. In SIMPLE mode, text sent to the serial port (terminated with newline) is broadcast as a mesh message; received mesh messages are printed as text to the serial port.
MQTT Module
The MQTT module directly connects a Meshtastic node to an MQTT broker (internet required), enabling cloud integration without a separate gateway computer.
meshtastic --set mqtt.enabled true
meshtastic --set mqtt.address "mqtt.meshtastic.org"
meshtastic --set mqtt.username "meshdev"
meshtastic --set mqtt.password "large4cats"
meshtastic --set mqtt.root "msh"
meshtastic --set mqtt.uplink_enabled true
meshtastic --set mqtt.downlink_enabled false
uplink_enabled sends local mesh packets to the broker. downlink_enabled receives packets from the broker and re-broadcasts locally — useful for extending the mesh over the internet but can cause feedback loops if misconfigured. Start with downlink disabled until you understand the topology.
Topic Structure
Meshtastic publishes to: msh/{region}/{channel_name}/{packet_type}
Example: msh/US/LongFast/text for text messages on the LongFast channel in the US region. Subscribe with wildcards: msh/US/# to receive all traffic from US nodes.
Ambient Light Sensor Module
When a supported ambient light sensor (BH1750, VEML7700, or TSL2591) is connected via I2C, this module adjusts the screen backlight brightness automatically based on ambient light conditions — reducing battery drain in dark environments and ensuring readability in sunlight.
meshtastic --set ambient_lighting.led_state true
meshtastic --set ambient_lighting.current 10
Also works with RGB LED hardware (NeoPixel/WS2812) to set a status color. current is the LED current in milliamps (for current-controlled LEDs). For the screen backlight use case, no explicit configuration is needed beyond enabling the module — brightness is automatically managed.
No comments to display
No comments to display