Hello everyone from Russia! I am new to this forum and am very glad that there is such a project as INDI. Thanks to him, we almost finished the construction of a robotic observatory. THANKS to INDI developers!
Now about the problem. It is necessary to make control of a self-made rolling roof through the indi_rolloff_dome driver (for example). Use Arduino as a controller with a relay that is connected via USB to the INDI server. I can’t find the driver documentation anywhere, or the protocol, or the examples.
Please help with an example of Arduino firmware for working with drivers:
- indi_rolloff_dome OR Talon6
So for INDI rolloff driver to work you need your Arduino to provide the following:
1. Open roof command.
2. Close roof command.
3. Open roof sensor (roof is fully opened).
4. Close roof sensor (roof is fully closed).
Yes, I made a roof drive using a gearbox and a stepper motor. Now the roof is controlled by a remote control.
I wrote a program on Arduino + Ethernet W5100 + 2 relays. This program creates a web server where there are two buttons, they control the relays, which in turn close the contacts of the roof drive and the roof closes / opens. I want to make it controlled via INDI (for example, I saw in INDI the possibility of NOT closing the roof while the telescope is NOT parked).
The following commands are implemented:
1. Opening the roof
2. Closing the roof
3. Contact position sensor "ROOF CLOSED"
4. Contact position sensor "ROOF OPEN"
I don’t understand how INDI drivers (for example indi_rolloff_dome OR Talon6) send commands to the microcontroller (Arduino). For example on TTL port? Any text commands? For example, if I knew that the indi_rolloff_dome driver sends the OPEN command via the TTL port, I could easily accept it on Arduino and close the necessary relay.
Help understand what commands send drivers to the microcontroller?
I can offer: github.com/wotalota/indi-rolloffino.git as an example from which you can develop your own.
It is a INDI rolloff roof driver and includes two different implementations of Arduino programs communicating over
USB. It presently only works using USB, I have not looked into what it would take especially on the Arduino side to
support Ethernet. The driver is packaged as a third party driver except for the install directions being from the
perspective that it is not already included. I mean to ask Jasem if it can be included as an option.
See readme.txt for a brief overview of the protocol and INSTALL for build directions.
After the build you should be able to see the rolloffino as an option under Dome when you edit the EKos profile.
The driver works with the Observatory module and weather drivers as you would expect. I am presently using it with
the Vantage, WeatherMeta and WeatherProxy for a rain detector.
If you study the included rolloff.ino programs I think it will be straight forward to include the I/O interface into your own.
rolloff.ino.boutons written by forum member Christophe, maintains state and controls relays to stop roof movement
when end of travel is detected. rolloff.ino.ar1450 which I use relies on the stop built into an external motor controller.
Both will signal the fully opened/closed condition back to the driver.
Thank you so much, everything worked out! I figured out how to write drivers and how INDI interacts with Arduino thanks to you! I wrote my own firmware for Arduino, because the algorithm of the roof is slightly different for me. Now, one of these days I will install the telescope parking sensors, limit switches for the roof position and I will install all of this. The main thing is that now everyone is working. Thank! When I finish, I'll post the photos and show the result.
Congratulations on getting it all figured out and working. When you update to KStars 3.4.3 and INDI 1.8.6 there will be an error from the roof driver. The roof driver build procedure will need to be repeated. I just made the correction today, it was using a routine which is no longer available to check for a weather alert before opening the roof. The watchdog driver now provides improved handling to protect the observatory against bad weather.
If you wish, I can add your Arduino sketch and any notes about the motor control you provide as another example in the git repository.