Shared access to IO class
The Expander Pi is an Analogue, Digital and RTC development Interface for the Raspberry Pi
19/07/2019
Posted by:
mikeb
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.
Mike
20/07/2019
Posted by:
mikeb
iobus = ExpanderPi.IO(reset=False)
otherwise the ports are set to input.
Silly me.
Mike
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.