The serial module config options are: Enabled, Echo, Mode, Receive GPIO, Transmit GPIO and Sender. Serial Module config uses an admin message sending a
This is a simple interface to send messages over the mesh network by sending strings over a serial port. Anything you send the node will be turned into a message sent out over the mesh, and anything received from the mesh will be sent to the serial port. Note that this module does not (yet) allow arbitrary protobuf commands to be sent over the serial connection.
Serial Module Config Values
Enables the serial module.
If set, any packets you send will be echoed back to your device.
Defaults to 'Simple'.
SIMPLEoperate as an dumb UART tunnel. What goes in will come out, Requires a channel named 'serial'.
PROTOExposes the Protobuf Client API on this serial port. You can use this to connect from another device. API Reference
TEXTMSGWill send the string received over the serial port as a Text Message for Display on the other devices.
NMEAWill output a NMEA 0183 Data stream containing the internal GPS or fixed position and other node locations as Waypoints (WPL).
Receive GPIO Pin
Set the GPIO pin to the RXD pin you have set up.
Transmit GPIO Pin
Set the GPIO pin to the TXD pin you have set up.
Connect the TX pin to the other device's RX pin, and vice versa. Connect their grounds to each other (not necessary if they're both plugged into the same USB power source.)
The serial baud rate.
The amount of time to wait before we consider your packet as "done".
Once module settings are changed, a reset is required for them to take effect.
Serial Module Config Client Availability
Serial Module Config options are available for Android.
- Open the Meshtastic App
- Navigate to: Vertical Ellipsis (3 dots top right) > Module Settings > Serial Config
All serial module config options are available on iOS, iPadOS and macOS at Settings > Modules > Serial.
All serial module config options are available in the python CLI. Example commands are below:
|serial.rxd||GPIO Pin Number 1-39||Default of |
|serial.txd||GPIO Pin Number 1-33||Default of |
|serial.timeout||Default of |
Because the device will reboot after each command is sent via CLI, it is recommended when setting multiple values in a config section that commands be chained together as one.
meshtastic --set serial.enabled true --set serial.echo true
meshtastic --set serial.enabled true
meshtastic --set serial.enabled false
meshtastic --set serial.echo true
meshtastic --set serial.echo false
meshtastic --set serial.mode DEFAULT
meshtastic --set serial.mode PROTO
meshtastic --set serial.rxd 7
meshtastic --set serial.txd 28
meshtastic --set serial.baud BAUD_DEFAULT
meshtastic --set serial.baud BAUD_576000
meshtastic --set serial.timeout 15
All serial module config options are available in the Web UI.
GPIO access is fundamentally dangerous because invalid options can physically damage or destroy your hardware. Ensure that you fully understand the schematic for your particular device before trying this as we do not offer a warranty. Use at your own risk.
This module requires attaching a peripheral accessory to your device. It will not work without one.
Default is to use RX GPIO 16 and TX GPIO 17.
Enable the module by setting
Set the pins (
serial.txd) for your preferred RX and TX GPIO pins. On tbeam boards it is recommended to use:
- RXD 13
- TXD 14
serial.timeoutto the amount of time to wait before we consider your packet as "done".
(Optional) set serial.mode to TEXTMSG if you want to send messages to/from the general text message channel
Connect to your device over the serial interface at
With tio –
tio -e -b 38400 -f none /dev/myserialport
Send a packet up to 237 bytes in length. This will get relayed over the mesh network.
1and any message you send out will be echoed back to your device.
Interfacing PIR Sensor With External Microcontroller
The following is an example of using a Raspberry Pi Pico connected to a PIR sensor to detect motion. When motion is detected, a message is sent via. serial to the T-Beam. The T-Beam transmits the message as text over the default channel by utilizing the serial module in TXTMSG mode.
- Raspberry Pi Pico running CircuitPython
- T-Beam V1.1 running Meshtastic
- PIR Sensor (Adafruit Breadboard Model)
Meshtastic Software Configuration
- Serial module enabled, mode: TXTMSG
- GPIO Pins (For T-Beam) RX 13, TX 14
- 38400 Baud
- TX pin 14 on the T-Beam to RX pin 2 on the Pico
- RX pin 13 on the T-Beam to TX pin 1 on the Pico
- PIR sensor Vcc and GND pins to Vcc/GND on breadboard respectively
- PIR sensor trigger line to Pico GPIO28 (Pico pin 34)
- GND pin on T-Beam to GND pin 38 on the Pico
- GND pin 38 on the Pico to breadboard ground rail
- 3V3 pin 36 on the Pico to the breadboard positive voltage rail
- Optional, to power the Pico off of the T-Beam instead of USB:
- Connect 5V pin on T-Beam to Vbus pin 40 on the Pico
Circuit Python Code
# Setup PIR sensor on GP28
pir = digitalio.DigitalInOut(board.GP28)
pir.direction = digitalio.Direction.INPUT
# Setup serial UART connection TX/RX on (GP0/GP1)
uart = busio.UART(board.GP0, board.GP1, baudrate=38400, timeout=0)
if(pir.value == True):
uart.write(bytes("Motion Detected", "ascii"))