meshtastic / python

The Python CLI and API for talking to Meshtastic devices
https://meshtastic.org
339 stars 150 forks source link

Receive text API call? #98

Closed sokoow closed 3 years ago

sokoow commented 3 years ago

Hi All,

I trawled your objects and docs seeking for non blocking or at least blocking receive call in this API - but it's missing. Any plans on adding it ?

geeksville commented 3 years ago

Received messages (in both text and binary) are asynchronously delivered as publishes. So you just subscribe to meshtastic.receive.data. or just meshtastic.receive (if you want to receive all messages). Or if you just want text meshtastic.receive.text. per https://github.com/meshtastic/Meshtastic-python/blob/master/meshtastic/__init__.py#L24

Example usage here: https://github.com/meshtastic/Meshtastic-python/blob/master/meshtastic/test.py#L148

Does that help?

geeksville commented 3 years ago

btw @sokoow sorry for the late reply - just noticed this one...

sokoow commented 3 years ago

thanks @geeksville