Meshtastic

Sending packets from within mesh

Hi,

Currently I am trying to use the meshnet to send gps latitude and longitude from one lora module to another. The goal is to create a text packet, much like you can do with the android app, but instead send binary lat and lon every X seconds so i can see the location of all my mesh devices on the phone.

The problem is that i cannot find a way to send a text message from within the mesh, I am not very well versed with python or kotlin (the serial link and the android app) and run into a dead end when trying to see what I should put into a packet before it can properly be send around the mesh . The c++ (meshtastic device) part looks like it only takes a message and forwards it.

For example in the python code for the serial link with the mesh device in init.py, it seems to be using the protobuf to create a packet, however I cannot find the mesh_pb.MeshPacket() as a real method to fill the entire packet.
def sendData(self, byteData, destinationId=BROADCAST_ADDR, dataType=mesh_pb2.Data.OPAQUE, wantAck=False, wantResponse=False): """Send a data packet to some other node""" meshPacket = mesh_pb2.MeshPacket() meshPacket.decoded.data.payload = byteData meshPacket.decoded.data.typ = dataType meshPacket.decoded.want_response = wantResponse self.sendPacket(meshPacket, destinationId, wantAck=wantAck)

So is it possible to create a text/byte message from within the mesh and where should i start looking?

1 Like

bumping cause I would really like to know if this is possible

alas - for 1.0 we stayed very focused on our initial use-case (a useful tool for hikers etc) except for the addition of a python API. So for now, if you want to use meshtastic programmatically you are probably better off using the python API (and treating the devices as ‘black boxes’).

Internally in the device C++ code the plumbing is there so you can send/receive data packets. That’s what the rest of the app uses. But ideally it needs some cleanup. That cleanup will happen soonish (next couple of months?) as part of the first tasks for the 1.1 release. More info in this thread: Extension of the functionality of devices Meshtastic