def onReceive(packet): # called when a packet arrives
print(f"Received: {packet}")
def onConnection(): # 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.StreamInterface()
ERROR:root:Error handling FromRadio, possibly corrupted? Some optional args unknown in call to sendMessage('('meshtastic', 'connection', 'established')', interface): interface
Traceback (most recent call last):
File "C:\Users\user\git\test\lib\site-packages\meshtastic\__init__.py", line 501, in __reader
self._handleFromRadio(self._rxBuf[HEADER_LEN:])
File "C:\Users\user\git\test\lib\site-packages\meshtastic\__init__.py", line 250, in _handleFromRadio
self._connected()
File "C:\Users\user\git\test\lib\site-packages\meshtastic\__init__.py", line 202, in _connected
pub.sendMessage("meshtastic.connection.established", interface=self)
File "C:\Users\user\git\test\lib\site-packages\pubsub\core\publisher.py", line 216, in sendMessage
topicObj.publish(**msgData)
File "C:\Users\user\git\test\lib\site-packages\pubsub\core\topicobj.py", line 433, in publish
self._getListenerSpec().check(msgData)
File "C:\Users\user\git\test\lib\site-packages\pubsub\core\topicargspec.py", line 229, in check
raise SenderUnknownMsgDataError(self.topicNameTuple,
pubsub.core.topicargspec.SenderUnknownMsgDataError: Some optional args unknown in call to sendMessage('('meshtastic', 'connection', 'established')', interface): interface
import meshtastic
from pubsub import pub
def onReceive(packet, interface): # called when a packet arrives
print(f"Received: {packet}")
def onConnection(interface, 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.StreamInterface()
and I receive this error:
ERROR:root:Error handling FromRadio, possibly corrupted? Some required args missing in call to sendMessage(‘meshtastic.connection.established’, interface): topic
Traceback (most recent call last):
File “C:\Users\user\git\test\lib\site-packages\meshtastic_init_.py”, line 501, in __reader
self._handleFromRadio(self.rxBuf[HEADER_LEN:])
File "C:\Users\user\git\test\lib\site-packages\meshtastic_init.py", line 250, in _handleFromRadio
self.connected()
File "C:\Users\user\git\test\lib\site-packages\meshtastic_init.py", line 202, in _connected
pub.sendMessage(“meshtastic.connection.established”, interface=self)
File “C:\Users\user\git\test\lib\site-packages\pubsub\core\publisher.py”, line 216, in sendMessage
topicObj.publish(**msgData)
File “C:\Users\user\git\test\lib\site-packages\pubsub\core\topicobj.py”, line 433, in publish
self._getListenerSpec().check(msgData)
File “C:\Users\user\git\test\lib\site-packages\pubsub\core\topicargspec.py”, line 222, in check
raise SenderMissingReqdMsgDataError(
pubsub.core.topicargspec.SenderMissingReqdMsgDataError: Some required args missing in call to sendMessage(‘meshtastic.connection.established’, interface): topic
ERROR:root:Node not found for fromId
Received: {‘from’: 862621965, ‘to’: 862621333, ‘decoded’: {‘user’: {‘id’: ‘!c44f336a910d’, ‘longName’: ‘Unknown 910d’, ‘shortName’: ‘?0D’, ‘macaddr’: ‘xE8zapEN’}}, ‘id’: 1323205705, ‘rxSnr’: 9.75, ‘hopLimit’: 3, ‘fromId’: None, ‘toId’: ‘!c44f336a8e95’}
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.StreamInterface()
I Receive that after some minutes:
ERROR:root:Node not found for fromId
Received: {‘from’: 862621965, ‘to’: 4294967295, ‘decoded’: {‘position’: {}}, ‘id’: 1323205740, ‘rxSnr’: 11.5, ‘hopLimit’: 3, ‘fromId’: None, ‘toId’: ‘^all’}
I open a second Topic for the sender: I have error also
hmm - what version of the firmware is on the devices? (it is printed on the screen at power on, or you can run meshtastic --info to get it)
It is possible that I’ve accidentially made a non backward compatible change in the python lib and the firmware that ttgo is prepopulating is pretty old…