Shared access to IO class
1462 Views - Created 19/07/2019
I am using my Raspberry Pi to run my heating and solar and I use the expander Pi to control a set of 20 relays.I have a python daemon that runs 24/7 controling the relays and all is working fine.
However, whilst the daemon was running I ran another python script to test some new functionality. The next day I found the Hot water system didn't kick in because, it seems, I had stolen the connection to the Expander IO interface. No error was detected and the relays failed to fire but the daemon continued as if everything was ok.
This is not a major issue, now I think I understand what happened, but is there a way I can tell the communication has failed. I possibly could check the state of the relay after setting it on but it would be nice to know if there is a correct method to solve this issue. I presume if I call ExpanderPi.IO() again and get a new instance of the class I could re-establish connection.
Any advice would be very useful.
iobus = ExpanderPi.IO(reset=False)
otherwise the ports are set to input.
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.