I see there are Phython modules, localdio and localain, for accessing the local digital and analog IO on an X4H but I do not see how I can make an instance of either. That is I assume I need to instantize the modules with something like this:
DIOlocal = localDIN(address)
But how do I get the address of the local IO ports?
In other words; for zigbee devices I can use ‘getnodelist()’ and get each device source arrdress. Is there an equivalent way to get the source address of the X4H IO?
So it seems the ‘digihw.py’ module is required to access the local IO (digital and analog) on the CP X4H. But I do not have a copy of this module. Could you point me to a link where I can get a copy?
No, the digihw is a builtin, there is no .PY file - the import hooks into the interface between Python and the underlying OS directly.
Also, the Wiki page for digihw is woofully incomplete. It does not talk about these functions. Why not? I don’t know.
Download the DigiXBeeDrivers mentioned above.
Technically, the local ain/dio is handled by the coordinator XBee, so for any address asked for you’d use the gateway’s coordinator MAC. This should be hidden from you if you use the provided examples.
I have been attempting to use the localain.py and localdio.py modules with only limited success. Here is what I have experienced so far:
The localain.py module has a ‘def calibration’ proc. From my testing it seems not to work, I get a key error, soI have just commented it out. Doing so has allowed the mod to work
Hello,
UPDATE: I had someone with an X4H try this script and it threw an exception. We will do some more testing and let you know what we may find.
Thanks,
Nathan