Probably I have simple software problem but I don’t get it how the indidrivers work.
I have a split roof roll-off observatory. Now I want to automize the opening and closing. It seems to be very simple because I do not need limit switches and so on. Two roller shutter drives with internal limit switches for fully open and fully closes are moving the two parts of the roof.
In other words I just press open (till it reaches the end position) and the roof is open.
In automation I use a relay for open and one for close to override the manual switch. The signals coming from a raspberry pi. A simple Python script will do the job.
Now my question, how can the indi_rolloff driver use the Python script? Or must I write a c++ routine an integrate it into the driver?
The indi server runs on that particular raspberry pi. Btw, there Node8266 connected via USB what provides weather and cloud data for the indi_weather radio driver ( thanks Wolfgang). That shout be the step for automization for emergency weather mount and dome parking.
My imaging gear is connected to another, dedicated RPi4.
Any hint or idea? I would be very thankful and appreciate it.
I use the INDI "Dome Scripting Gateway" driver to open/close my observatory roof. I use a relay driven linear actuator that has internal limit switches to stop the actuator motor at both ends of its motion ends.
As I don't have access to the internal limit switches of the actuator, I also use external limit switches to indicate roof fully closed and roof fully opened status so I can issue commands to turn off the power to the actuator. All is run using Python scripts that I have modified to control the relays and inputs of a TSIR04 USB relay board from Tinysine. Other USB relay boards could also be used.
if you want, I can provide you with the Python scripts by the end of the week, as I am not close to the observatory.
Hoping this provides you with useful info, good luck.
BTW, I like very much the way your roof opens, as I am considering modifying mine to something similar. Any water entering during heavy rain?
thank you for you answer. It sounds very similar to my setup. Please send the Python scripts.
I’m not sure about those additional limit switches. Why do you need them.
In my case I would trust the internal limit switches and use a time constant ( sleep 20 s) instead.
I will check the scripting tool because I never used it. Is there a chance to use weather date from the PWS close the roof? I hope you know what I mean.
I can't answer all of your questions now as I am not home, where the scripts are, but the reason why I used external limit switches is because here in Canada the weather can go to extremes and, as the cold weather and potential snow or solidified freezing rain slows down the linear actuator and makes it work harder, I want to be certain that the roof is fully opened (or closed) before unparking the scope. My roof not being a roll-off but rather a clamshell like the weight is a factor. I'll send a picture of it later, when I get home.
I do not recall having to write the connect script but I will provide you with the info I have.
Back home and I am sending you the Python scripts I use for my roof. As mentioned earlier, I use a USB relay board made by Tinysine, the TSIR04, so the scripts are written to be used with a series of Python tools available on github as: github.com/amorphic/tosr0x . It should be fairly simple to modify them to work with the Raspberry PI GPIO lines.
Of all the scripts in the RoofScripts.tgz file I send, only connect.py, park.py, unpark.py and disconnect.py are used. I have put comments in the Python scripts and they should be easy to follow. If you have questions, don't hesitate to let me know. The scripts normally go in the "/usr/share/indi/scripts/" folder but you can change the location in the 'Options' tab of the "Dome Scripting Gateway" driver.
how is Christmas in Canada? Do you have snow and cold temperatures? It’s kinda rare here over in Germany.
Since days we have rain and temps about 2 to 12 C. No white Christmas.
I used to live, about 20 yr ago in Louisiana for 4 years. And a colleague of mine had the same name as you Gagnon. But Steve with his first name.
I will study your scripts. Thanks again.
But one last question, do you automatically control the roof movements with the EKOS driver buttons, do you know what I mean?
I hope you had a nice and peaceful Christmas and you stay well.
I have studied you roof scripts with this USB relais. It is quite straight forward and I can understand it quite easily. Only thing I could not understand is how did you connect the limit switches ot the relais or to a Pi? In your unpark.py script is a comment about a Pin 2 connection but seems to be controlled by the relais driver.
I ordered 4 limit switches and a electronic lock to keep the roof tide and secured against gusts and rain. I try to incorporate this into the unpark and park scripts.
Sorry I did not reply to your previous message, with the COVID and my aging mother, the Christmas Holidays were a bit more ectic; but that's not our subject here. As far as the weather, we had mild and cloudy/rainy weather and on the only clear day, transparency was lousy so, no good astrophotography.
To answer your questions,
1) Roof control from KStars/Ekos/INDI: the roof can be unparked and parked from the buttons available with each application (dome conrtol in KStars, INDI dome driver tab, etc...). It even works, as it should, with the Weather Radio/Watchdog driver pair if weather is inclement.
2) Limit switches: I use a relay board that has four 10 amps relay outputs as well as four digital inputs (Tinysine TSIR04) and I modified the orifginal python script used to only drive relays, so it can now read the digital inputs. Those relay boards with inputs seem to be less used than the relay-only boards (Tinysine and Devantech make one). On a Raspberry PI or an ODroid (which I use), one could use GPIO pins to drive the relays as well as read the state of the limit switches; that would save some space as well as a USB port. I haven't looked into using the GPIO pins from my ODroid as I wasn't aware, at the time, that they could be used with Linux. I will likely consider using GPIO in a future version of the control electronics for the observatory, though.
Let me know if you have any more questions.
Wishing you all a wonderful COVID-free and cloud-free 2021!