×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

[SOLVED] Improve rolloffino INDI driver

  • Posts: 50
  • Thank you received: 1
Hi everyones, first of all this is a suggestion for my point of view.

i have a new project on my mind its do the rolloffino driver more complete

i notice that now on rolloffino indi driver have only one auxiliary switch and i think this its a little poor because on a remote observatory normally we have more switches to controle, like for for example in my case i need 3 auxiliary switches more, to controle some things like room lights, infrarred webcam, switch on and off mount...

So, i know that in an arduino board we can from GPIO2 to GPIO13 pin so this its up to 12 relays.

In rolloffino sketch i can add more RELAYs , in my case, for example i add up to 9, see image added this its very easy and its no a problem for my programming knowledge

My problem its to modify and customize indi rolloffino driver to add more auxiliary switches, see image attached to see more details from my idea.

I know that i have to edit those files
rolloffino.cpp
rolloffino.h
But my C+ programming knowledge its not enought to do this custom improvement

Somebody know how modify INDI rolloffino driver?
Last edit: 3 months 2 weeks ago by Javier Albella.
3 months 2 weeks ago #101063
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 1
Finally i found a solution for this editing files rolloffino.cpp and rolloffino.h

So now i have 4 auxiliary switches.

I attach a zip with files modified if somebody want to do this improve, follow these steps:

1 - Sketch rolloff.ino file in a arduino board
2 - Compile INDI-rolloffino Driver with rolloffino.cpp and rolloffino.h attached files
3 - Follow compile-indi-core.txt to compile indi-core
4 - Follow compile-new-indi-driver.txt to compile new indi-rolloffino driver with our changes
5 - Pin connections between arduino and relay board
Arduino to Relay board
Pin4 to relay1
Pin5 to relay2
Pin6 to relay3
Pin7 to relay4
Pin8 to relay5
Pin9 to relay6
Pin10 to relay7
Pin11 to relay8
Pin GND to GND relay board
PIN 5V to 5V Relay Board
6 - Connect Arduino board to ekos and start driver rolloffino.

That's all folks!!!
Regards.
3 months 2 weeks ago #101068
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 1191
  • Thank you received: 371
Sounds good, Javier! It would be great if you post this as PR, so that all could participate from this enhancement. If you need assistance for it, happy to help.

Cheers
Wolfgang
3 months 2 weeks ago #101073

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 1
Hi Wolf,

how is that done? how i post this as PR?

Thanks,
Regards.
3 months 2 weeks ago #101076

Please Log in or Create an account to join the conversation.

  • Posts: 1191
  • Thank you received: 371
3 months 2 weeks ago #101077

Please Log in or Create an account to join the conversation.

  • Posts: 322
  • Thank you received: 42
If you apply a PR, don't edit the rolloff.ino.standard as shown. Add an additional example sketch with your changes. The rolloff.ino.standard needs to retain the original relay polarity and pin numbering to match the standard Uno relay shield. That helps those who do not want to be involved with any code editing get on-line without any software changes.

Limiting the number of relays was intentional to limit it to just the purpose of controlling the roof. There was some discussion at the time of the Observatory being extended. Rather then put other observatory like functions in the individual roof/dome drivers. In the meantime there were 3rdparty drivers able to read and set particular pins.
3 months 1 week ago #101089

Please Log in or Create an account to join the conversation.

  • Posts: 50
  • Thank you received: 1
Hi Wolfwang and wotaloka.I am not ready to create a new Pull Request, i don't feel safe to do it.
If any of you want to upload it, I'll give you the code and you can do it. I attachedlast updated files on this post.
There are 3 files:

To INDI Driver:
rolloffino.cpp
rolloffino.h

and for arduino board a new rolloff.ino based on standard but with some modifications like this:
PIN connexion:
// Define name to pin assignments
#define SWITCH_1 A0
#define SWITCH_2 A1
#define SWITCH_3 A2
#define SWITCH_4 A3

#define RELAY_1 4
#define RELAY_2 7
#define RELAY_3 8
#define RELAY_4 12
#define RELAY_5 9
#define RELAY_6 10
#define RELAY_7 11

RELAY MODE:
HIGH Normally Open (NO)
LOW Normally Closed (NC)

RELAY Functionality:
RELAY_1 -> OPEN Roof -> HOLD 0, HIGH MODE (NO)
RELAY_2 -> CLOSE Roof -> HOLD 0, HIGH MODE (NO)
RELAY_3 -> ABORT Roof movement -> HOLD 0, HIGH MODE (NO)
RELAY_3 -> LOCK Roof -> HOLD 1, HIGH MODE (NO)
RELAY_4 -> Auxiliary1 switch -> HOLD 1, HIGH MODE (NO) -> Activate to close Relay (LOW MODE) (NC)
RELAY_5 -> Auxiliary2 switch -> HOLD 1, HIGH MODE (NO) -> Activate to close Relay (LOW MODE) (NC)
RELAY_6 -> Auxiliary3 switch -> HOLD 1, HIGH MODE (NO) -> Activate to close Relay (LOW MODE) (NC)
RELAY_7 -> Auxiliary4 switch -> HOLD 1, LOW MODE (NC) -> Desactivate to open Relay (HIGH MODE) (NO)

NOTES:
RELAY_3 have two functions Abort and lock roof
RELAY_7 its a switcher for deactivate something, like for example a IR camera that normally its activated, but its needed to desactivate before you start to work.
RELAY 4,5,6 It is switcher to activate something that normally shold be desactivated, like mount, lights from observatory, etc..
3 months 1 week ago #101108
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 322
  • Thank you received: 42
Javier,

I think your changes are fine and on point for personal use. They have been requested more than once.

Since I do not agree that the driver is the place for these functions I do not plan to do the PR. I would prefer that the functions be tied to the Observatory. Or if too difficult put them in a new observatory oriented utility driver. That could be combined with any of the dome/rolloff drivers. If the developers think the changes should reside in this driver so be it.

I'll just list some of my objections to extending the rolloff driver which was intended to remain the same while any changes are restricted to the remote end. That keeps changes out of the INDI environment and keeps the driver ignorant of what is going on to operate the roof. It is defined by what it does not do as much as by what it does.

We have to imagine that any change to the driver will be running against old remotes

Adding implied functions to the driver might result in support issues. Hopefully not and the existing Arduino implementations out there reject the use of new functions. But we should not break existing installations with protocol conflicts or pin overloading. We can define the purpose of relays and assignment of pins in our own implementations but not in general, it is not under our control. Some years ago a person wrote their own implementation, no clue as to what that involved. The next auto update of INDI should not disturb that install.

With existing installs the driver interface will imply that the check boxes do something but there is nothing on the other end to act upon them.

In the same way the driver does not deal with switches, relays or pins, we do not know what the driver is talking to. It does not have to be an Arduino, it could just as well be a Python script. My own implementation is an Arduino but does not have any relays and most of the pins are covered by a TFT shield. All I'm interested in seeing come in is open close and are you done yet messages. At the present time we can provide for a turn key no coding required solution to a completely personalized implementation. But the driver remains the same by restricting its function.

While it is easy and convenient to drop things in I do not care for it.
Why somebody is having a problem with their camera, power supply or they are locked out of their observatory is not a core concern of the roof driver.

Regards
Tom
3 months 1 week ago #101112

Please Log in or Create an account to join the conversation.

Time to create page: 0.721 seconds