Closed chconnor closed 7 months ago
For the record, if I comment out the calls to self.ver, and remove the ver: {} from str, things seem to work OK... I can dev.read(x) and it seems to pick up the value correctly. (It's returning a non-integer version string, which breaks the parsing.)
I'm not getting success trying to use the callback though... maybe you can see a flaw in my test program? I'm not much of a python programmer but I expected this to print out lines whenever the pin goes low/high; I'm using "input" just to keep it from exiting:
#!/bin/python3
import numato_gpio as gpio
my_device_id = 0
gpio.discover()
dev = gpio.devices[my_device_id]
dev.setup(7, gpio.IN)
def callback(port, level):
print("{edge:7s} edge detected on port {port} "
"-> new logic level is {level}".format(
edge="Rising" if level else "Falling",
port=port,
level="high" if level else "low")
)
dev.add_event_detect(7, callback, gpio.BOTH)
dev.notify = True
input()
Ah... the 8 port devices don't have the notify feature. That's... really annoying. I wish Numato made that clear on the website.
Hi @chconnor , sorry for not responding for so long. You found it out yourself, the version numbers had to be integers. I fixed this with v0.12.0
. With 0.13.0
I'll raise errors with clear messages indicating when a device (yes, the 8 port devices) doesn't support notifications, but the user tries to use the "notification API" (notify
property or add_event_detect
method). This way, you might have found out quicker that your device doesn't support notifications.
Closing this issue, as the version issue is resolved and the notification issue needs another piece of hardware...
Howdy -- having trouble not seeing a device. This is this unit, with pull-ups.
Ubuntu 22.04.1 server, updated; python 3.10.6. numato_gpio version 0.11.0.dev0 user is in dialout group
Here's the troubleshooting output:
Any ideas? Thanks!