OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) How to read current station status? Re: Re: How to read current station status?

#24835

andrew
Participant

@snewman – The interval program was initially written by Ray, and ported to python for use with a Raspberry Pi by Dan Kimberling.


@Virtus
– This question is probably a bit out of scope for this thread, and is best answered by Ray or Dan. If your question is aimed at understanding at a higher level how shift registers work and are used in the interval program, then @Virtus’s response is probably good enough. When any program (including the interval program) desires to change the state of a station, it must specify the entire state for all stations, and will overwrite the existing state completely. In the interface between the RPi and the controller board, there is no notion of “just change the state of station X”. You are always indicating the entire state of all stations and the existing state is always overwritten in its entirety. If, on the other hand, you really want to know precisely what happens in the circumstances you described, the answer may be a bit more complicated. Dan is probably best suited to answer, but from what I can see in the code (and I’ve only taken a cursory glance), you may actually get some very strange results. It appears that if you set manual mode while a program is already running, the manual mode thread will actually be competing with the main loop that is executing the normal program, and it looks like they’ll just go on interfering with each other until either the program ends, or the manual mode is turned off. Each of the competing threads will, during the course of their respective executions, be setting various states for all of the stations Unless I’m missing something (and in fact I probably am), this would be a bug, but not a particularly important one.