Ok here is the gist if what im hoping to do. Ive tried looking through the forum, and ive gotten topics that were close, but i didnt see anything exactly like what i was looking for:
So i want my arduino to be able to send a message (text string) to an attached node and have it sent through the mesh and have it appear as a normal text message to that node.
Is there a way to have the arduino define the specific node it is going to send to? Or can it only send to “broadcast all”?
Then i want whatever text messages that are sent to the node that the arduino is attached to, to be sent to the arduino as a string (to be displayed or used for whatever purpose).
Take a look at the examples, it’s essentially what you want to do. You can interface your Arduino with your node utilizing the serial module. If you have the mode set to TXTMSG, the node will transmit the message received over serial from your arduino as a text message over the mesh (on the default channel).
Ok, sounds good.
So where can i find these examples?
This might be a sort of “talk to me like i dont know what im doing” type of things. Well in some aspects.
Well actually i think i figured out how to have text from the arduino sent out to the mesh, and text from the mesh be sent to the arduino.
I just now want to be able to write an arduino program that essentially does:
“Send text string A to node 1, send text string B to node 2, and send text string C to Node 3”.
Im just not sure how to have the arduino essentially change the message destination. I know on both canned messaging and messaging through the phone, you can select individual nodes to send your messages to, but im not sure how to get the arduino to switch/choose the recipient. Is there a command string that i need to have the arduino send before it sends the message?
As mentioned above, using the TXTMSG mode it will be broadcasted on the default channel. If you want to have full control, you need the PROTO mode, which exposes the full API as explained in the link above.
It seems there are not yet any examples for that mode, but this repository might give you a start. I think there’s not an example for constructing a text message, but here is how e.g. another packet is constructed and send to the radio: https://github.com/meshtastic/Meshtastic-arduino/blob/master/src/mt_protocol.cpp#L52.
But i want to send different messages to individual nodes.
Like for example, my dad, myself, and my brother each have a messanger i made for them with a cardKB and a heltec v3. We can decide who we are sending messages to by scrolling through using tab and the arrow keys. But i want the arduino to be able to essentially “scroll through” the contacts like i do with canned messaging.
It sounds like i need to do “protobuff” for that then?
I’m having some trouble looking through the examples and understanding what to do.
If i was to say edit that attached code to send to a certain node, it sounds like if i enabled protobuff on the node that is directly attached to my arduino, id have to edit the code like:
Include protoBuffModule.h
Include NodeInfoModule.h
But them im not 100% sure how to use those modules to set the message desitnation