meshtastic / python

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

Device needs newer python client #75

Closed tcote19 closed 3 years ago

tcote19 commented 3 years ago

I may be flashing my TTGO Tbeam with the wrong firmware but I've tried a few different .bin files and continue to receive this message when running the "Example Usage" script provided on the API page:

https://meshtastic.github.io/Meshtastic-python/meshtastic/index.html#example-usage

ERROR:root:Error while handling message from radio This device needs a newer python client, please "pip install --upgrade meshtastic"

This is the script I'm messing with:

import meshtastic
from pubsub import pub

def onReceive(packet, interface): # called when a packet arrives
    print(f"Received: {packet}")

def onConnection(interface, topic=pub.AUTO_TOPIC): # called when we (re)connect to the radio
    # defaults to broadcast, specify a destination ID if you wish
    interface.sendText("hello mesh")

pub.subscribe(onReceive, "meshtastic.receive")
pub.subscribe(onConnection, "meshtastic.connection.established")
# By default will try to find a meshtastic device, otherwise provide a device path like /dev/ttyUSB0
interface = meshtastic.SerialInterface()
geeksville commented 3 years ago

yes - that script should work, but you'll need to use 1.1.x python libs to talk to 1.1.x devices or 1.2.x python libs to talk to 1.2 devices. See post I liked in other thread. related kinda a dup of: https://github.com/meshtastic/Meshtastic-device/issues/754