Meshtastic

New Plugin -- SerialPlugin

Hi!

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!

Cheers!

7 Likes

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.

1 Like

We can use the new pi pico in usb otg?

https://www.raspberrypi.org/documentation/pico/getting-started/#getting-started-with-c

http://www.daveakerman.com/?p=2737

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?

You got it! No need to compile.

It’ll need to be recompiled to go over the regular text channel.

Darn. That’s a bridge too far for our group. Any chance you could add a parameter setting to enable/disable this and also change the gpio mappings?

The option to change the gpio mappings is already in there. No need to compile from scratch.

What’s your use for needing to send and received serial data from over the regular text channel?

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.

1 Like

You can change the GPIO now without having to re-compile. That’s already there.

The python API can access the information on other channels other than just a text channel. That will work for you to.

Sounds like everything will work just fine out of the box. :slight_smile:

You assume we can use the API… not developers, hence trying to use what is available through the plugins or python command line utility.

Those features described are available through the use of the Python CLI, just have a read of its docs

1 Like

If my the CLI you mean the python command line, how can I read a message?

1 Like

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.

2 Likes

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.

1 Like

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.)

2 Likes

17 posts were split to a new topic: GO CLI Usage Help