A while ago i started on a new custom roof / power device indi driver.
I have made it out of pending personal needs, but "i think" it's so useful that i uploaded it to github in hope that someone can benefit from it.
At the moment it's only tested on the bench, but when i get closer to finishing my observatory it will be used in production and kept up to date.
I have added a readme to the project with summary, installation notes and an example of use.
There are quite a few images in the readme, but i'll add some here to see if someone gets interested.
The driver supports simulation, so if you want to check it out you can
good stuff there, I would definitely add some roof sensors (micro switches) and put it in your code.
Also, what would happen if you were to have a USB reset? Do the relays stays on/off on power loss to the USB port?
The USBRelay2 devices will stay powered on as long as it has power, so a power loss will reset them.
In my set up i will have the odroid on constantly and the devices on a powered hub. I will also only use the power switches for tings like power for mount and camera. Those devices would be affected by a powerloss anyway. Using the connect mapping will be helpful to ensure necessary devices get powered on when connecting. There are litium battery style PSUs for RasPi and Odroid, and one of those will ensure power to the switches.
Its still in early testing, but i think ill find use for it
My plan for making sure the roof stops in fully opened and closed position is to have physical switches that cuts of one of the leads coming from the open device (when fully opened), and one of the (swapped) leads coming from the close device (when fully closed). I might modify that plan when it comes to installing, but don't think its necessary to have sensors that is more fragile when a sturdy push switch can be used. A combination for safety might be wise
When i get a chance to, i will update the readme on github with an example wire layout.
I use two linear actuators to open up the lid of my box, they have build in end switches. And also have 3 micro-switches to confirm the position of the lid. They show me: close ~ opening ~ open (and revers when closing).
It's all linked to the GPIO of the Odroid C1, controlling a relay board.
It would be nice to implement some ting like that.
I could use switches to update the abs position to sensor info. Like 0%, 50% an 100%
The abs position now is calculated by elapsed time, so it could possible drift over time. It does reset when connecting and reconnecting, but true sensor data is more reliable.
When i have build my obsy and start using it, i might add on to the features as real life experience will show needs.
I am thinking of adding a parking switch with the options always, and only if mount parked. I might have to conserve some space, and end up with a need to park mount before roof.