Second round of questions from me! I assume it’s best to start it in a new thread like this…
Now I’m trying to understand the publish-subscribe topics, and keep thinking in terms of MQTT topics, but those are different. I feel close but can’t quite interpret the definitions over at meshtastic-python.
Q1
The documentation is not clear - can I define my own topics? Or sub-topics at least. It’s looking like the topics are baked in and assigned upon receipt of data or other events. There isn’t a ‘topic’ parameter in the sendText or sendData definition. I believe that means I’ll need to examine the actual data packet to trigger other functions.
Seems like I can define my own handlers to any random topic, but I don’t think that helps…
def bar(packet, interface): print(f"bar bar {packet}") pub.subscribe(bar, "foo")
Q2
meshtastic.connection.lost
- What constitutes a lost connection? From playing around with it, it seems that this is triggered when I unplug the USB device from the computer. But I don’t know how to drop it from the mesh network to otherwise test (turning off other radios didn’t do it)
Q3
- meshtastic.receive.user(packet)
- meshtastic.receive.data(packet)
These two are not really defined. I see there are .position
, .user
, and .data
under meshtastic.receive
.
Is ‘packet’ part of the topic?
Would .data
refer to something sent via sendData
, or sendText
?
Topic .user
must be to do with node devices connecting to form the mesh network?
Thank you!