2022-03-08 23:10:41 -08:00
---
id: serial-module
title: Serial communication module
sidebar_label: Serial communication
2022-04-24 15:32:31 -07:00
sidebar_position: 4
2022-03-08 23:10:41 -08:00
---
2022-04-01 14:07:46 -07:00
2022-03-18 05:53:08 -07:00
import PluginModule from '@site/docs/_blocks/_plugin_module.mdx';
2022-03-08 23:10:41 -08:00
## About
This is a simple interface to send messages over the mesh network by sending strings over a serial port.
Default is to use RX GPIO 16 and TX GPIO 17.
2022-04-22 09:13:30 -07:00
<PluginModule name="serial_plugin" rename="serial_module" />
2022-03-18 05:53:08 -07:00
2022-03-08 23:10:41 -08:00
## Basic Usage:
1. Enable the module by setting `serial_module_enabled` to `1`.
2. Set the pins (`serial_module_rxd` / `serial_module_rxd`) for your preferred RX and TX GPIO pins. On tbeam boards it is recommended to use:
- RXD 35
- TXD 15
3. Set `serial_module_timeout` to the amount of time to wait before we consider your packet as "done".
4. (Optional) In serial_module.h set the port to `PortNum_TEXT_MESSAGE_APP`if you want to send messages to/from the general text message channel.
5. Connect to your device over the serial interface at `38400 8N1`.
6. Send a packet up to 240 bytes in length. This will get relayed over the mesh network.
7. (Optional) Set `serial_module_echo` to `1` and any message you send out will be echoed back to your device.
:::note
The device must be restarted after the settings have been changed for the module to take effect.
:::
## TODO (in this order):
- Define a verbose RX mode to report on mesh and packet information.
:::note
This won't happen any time soon.
:::
2022-05-16 12:52:39 -07:00
## Configuration
Configuration details are available on the [Device Settings](/docs/settings) pages. Configuring the Serial Module requires configuring the following modules:
- [Serial Module](/docs/settings/modules/serial-module)
2022-03-08 23:10:41 -08:00
## Known Problems
- Until the module is initialized by the startup sequence, the TX pin is in a floating state. Device connected to that pin may see this as "noise".
- Will not work on NRF and the Linux device targets.