SIP
usage of gpio by another program - Printable Version

+- SIP (https://nosack.com/sipforum)
+-- Forum: SIP (Sustainable Irrigation Platform) (https://nosack.com/sipforum/forumdisplay.php?fid=1)
+--- Forum: Installation and set up questions (https://nosack.com/sipforum/forumdisplay.php?fid=2)
+--- Thread: usage of gpio by another program (/showthread.php?tid=103)



usage of gpio by another program - astrogerard - 2017 Sep 28

Hi all,

Does anyone know if it is possible to use raspi3 gpio pins which are not in use by SIP (if there are any) by another program?

Background; SIP is running on my raspi3 which is located in a shed in the back of the garden. The shed has a few doors of which one of them is on the public road. I would like to create small alarm system through some basic python code to read a few magnetic sensors on the doors. These sensors are preferably connected to a few gpio pins on the raspi.

Any help on this is welcome.

Thanks in advance,
Gerard


RE: usage of gpio by another program - dan - 2017 Sep 28

As long as SIP is running in the background you should be able to run another program at the same time. Any GPIO pins that are not connected to the sprinkler system can be used by the other program.


RE: usage of gpio by another program - astrogerard - 2017 Sep 28

Thanks Dan,
I'm already did some testing but when I init/set a gpio port before starting SIP the relay board will not be initialized. Maybe I did use a port which was in use by SIP but I don't use the port to connect something to it. Looking at gpio_pins.py the rain sensor en relay ports should also not be used for other purposes. I wander id there are more ports kind a reserved for SIP.

I will give it another try.
--Gerard


RE: usage of gpio by another program - dan - 2017 Sep 29

The GPIO pins listed in gpio_pins.py are the only ones used by SIP. You should probably have SIP set up to start automatically before you other program. This will have SIP running in the background and the other program should not interfere with it.

If you start SIP from the command line you can add "&" (without the "") to the command to have SIP run in the background. for example:
python sip.py &