Skip to content

GPIO Watch crash if write gpio to 0 #110

@KiwiHC16

Description

@KiwiHC16

Equipment e480 is controlled by c500:

c480:

$ meshtastic --port /dev/ttyUSB0 --gpio-rd 0x10 --dest \!f244c480 
Connected to radio
Reading GPIO mask 0x10 from !f244c480
GPIO read response gpio_value=16

$ meshtastic --port /dev/ttyUSB0 --gpio-watch 0x10 --dest \!f244c480
Connected to radio
Watching GPIO mask 0x10 from !f244c480
Received RemoteHardware typ=GPIOS_CHANGED, gpio_value=16

c500

meshtastic --gpio-wrb 4 1 --dest \!f244c480

c480:

Received RemoteHardware typ=WRITE_GPIOS, gpio_value=16

c500:

meshtastic --gpio-wrb 2 1 --dest \!f244c480

c480:

Received RemoteHardware typ=WRITE_GPIOS, gpio_value=4

c500:

meshtastic --gpio-wrb 2 0 --dest \!f244c480

c480:

ERROR:root:Unexpected error in deferred execution <class 'KeyError'>
Traceback (most recent call last):
  File "/var/www/.local/lib/python3.7/site-packages/meshtastic/util.py", line 86, in _run
    o()
  File "/var/www/.local/lib/python3.7/site-packages/meshtastic/__init__.py", line 696, in <lambda>
    topic, packet=asDict, interface=self))
  File "/var/www/.local/lib/python3.7/site-packages/pubsub/core/publisher.py", line 216, in sendMessage
    topicObj.publish(**msgData)
  File "/var/www/.local/lib/python3.7/site-packages/pubsub/core/topicobj.py", line 452, in publish
    self.__sendMessage(msgData, topicObj, msgDataSubset)
  File "/var/www/.local/lib/python3.7/site-packages/pubsub/core/topicobj.py", line 482, in __sendMessage
    listener(data, self, allData)
  File "/var/www/.local/lib/python3.7/site-packages/pubsub/core/listener.py", line 237, in __call__
    cb(**kwargs)
  File "/var/www/.local/lib/python3.7/site-packages/meshtastic/remote_hardware.py", line 11, in onGPIOreceive
    print(f'Received RemoteHardware typ={hw["typ"]}, gpio_value={hw["gpioValue"]}')
KeyError: 'gpioValue'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions