In partnership with Cambria Corporation, we have a new plugin for Meshtastic – the SerialPlugin.
This is a really cool plugin. You turn it on with the Meshtastic Python API or soon, Meshtastic Web. With it turned on, a serial port will be enabled on your device.
Any messages sent to this serial port will be sent back out to all other devices on the mesh network. Any message on the same channel will then be sent back to over the serial port.
An example use case would be if you want to integrate your Arduino project and let your Meshtastic Device handle all the protocol, handshaking and everything else to pass messages to and from the Meshtastic network.
Right now it only works for esp32 targets but wouldn’t be too difficult to make it work for other platforms too.
This will be available in the next published alpha device firmware.
More information is in the comments of the source code. Feedback would really be appreciated!
Great work! This is really neat stuff. I can think of a number of use cases.
I’m curious if anyone has experimented with connecting to USB to serial devices from Android? I have to imagine somebody has rigged up some python script to run in Termux. I think it might be neat to eventually have devices set up to run off of a USB OTG adapter for power / communication over serial as opposed to BLE, especially if more low-power hardware without BLE / WiFi capabilities starts becoming supported.
I’m keen to give this a try, but can this be used without having to compile a custom build (i.e. using a –set command)?
Also, I see the comments in the code seems to suggest it doesn’t send those messages on the standard text message channel. Can we enable that using a –set parameter?
Finally, can you suggest a working pair of gpios for a TTGO Lora32 v2, which seems to be a different configuration to the t-beams?
We’re wanting to use Node-red to send and respond to IOT data, so need a simple way to either send/receive messages via serial or through the meshtastic python app.
Using different hardware (t-beam and ttgo lora32 v2) means we need to be able to map gpios without any compiling, ideally just enabling and then setting the parameters for the plugin.
The serial plugin docs on the settings section is somewhat sparse. The range test plugin is definitely the best documented at the moment. The plugins are documented in two spots currently so I’m not sure if it’s better elsewhere. I’ll try to take a stab at this next week.
Thanks. From what I can see, there is no way without becoming a developer for me to use the current python CLI to receive/retrieve the latest message(s). The Serial_plugin looks useful, but seems to hide the messages on a seperate channel, not the main message one, which would be nice to be able to set with a simple CLI parameter.
You could use the range test plugin to see messages. I know some people leave it on so that they have a csv of messages since there isn’t any persistence in the device code. Then it would be available at meshtastic.local/static.
(I believe this is also why the CLI tool can’t currently retrieve messages because once they’ve been retransmitted and forwarded to the Bluetooth connection they are forgotten except for the ID so the device knows if it’s seen the message yet.)