Meshtastic

Sendtext over secondary channel

While the documentation has a section about using secondary channels,
Multiple channel support | Meshtastic ,
all it covers is creation and deletion.

Is there currently a way, at least through the Python API, to send a text message
over a secondary channel? Configuration done via URL. Meshtastic.py version 1.2.40
with TBeam and TLORAs at version 1.2.45.

If not then I’ll quit fooling with them.
-Rusty-

1 Like

It has been a little while since I played with it but I think you need two commands in the python api, first set the channel index you want and then use sendtext

That’s what I thought too but, even after reloading the firmware into my TBEAM and 2 TLORAs,
I’m still getting all messages sent on the secret channel received by all units.

Oh well…

Looking at the python API, it appears to be possible. Take a look at __init__.py, function sendText; it encodes the text to UTF-8 bytes, sets the destination and port (to TEXT_MESSAGE_APP), and calls sendData, which takes a channelIndex input, defaulting to 0. Try calling sendData yourself with a non-zero channel index. If you’re still getting the message for the secret channel on all devices, that hints there’s a bug.

OK, using sendData() with all the appropriate finagling to send a text
message does appear to work. sendText() could probably use a channelIndex
option argument and allowing the meshtastic.py script to pass the ch-index arg
to sendText().

That will get me going. Thanks!

1 Like

I’ve created a pull request implementing that on the API. Fairly simple, I think.

I just tweaked the meshtastic package. I have rather minimal diff’s if you’d like.