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.

Ah ha! Has this been incorporated into the latest build? If not, how does one get this? Thank you!

I thought this might be the case. I tried it, and I could not get it to work. Thank you.

Hi, fe2o3. Would you mind sharing python command line(s) to do what you did to be able to send text over secondary? I’m a python noob, and I don’t know how to call sendData. Thank you in advance.

meshtastic --sendtext test --ch-index 1

The dm is going to be in the phone apps much more quickly which is

meshtastic --sendtext test --dest 1245636556

What ‘garth’ says is fine. The problem is the Python code doesn’t pass the channel index to the sendtext method. I was hoping that Kevin would put the two lines I’ve indicated above into the release but that hasn’t happened yet. :-\

The code in that pull is merged and has been released, so if something is missing we are going to need a new pull.

Thanks, garth. In your example, what destination is “–dest 1245636556”?

Thanks for your reply.

The code has changed around a bit since then so I’ll have a gander at how to put the changes in the current files.

the node number you are sending a dm to

Cross posting here since there’s overlap:

Wanted to see if anyone has executed a successful test message on a secondary channel from Meshtastic Python >= v1.2.47

Don’t have my radios up and running yet.

Thanks, especially to mkinney for the commits! :grin:

Side-note/question: I don’t see a related issue tracker for Meshtastic Android, is this issue present in that code? Not a developer, just an IT guy trying to look at source, got confused between channel (long/slow, etc) vs. primary/secondary. Just wondering.

The only client at this point with any secondary channel texting support is the Python CLI. DMs are in the Web App and Python CLI and are coming to the next iOS release.

2 Likes