×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Best way to run indi_setprop to automaticaly configure a device (focuser) ?

  • Posts: 4
  • Thank you received: 0
What would be the best/easiest way to run indi_setprop to configure a device (a Moonlite focuser).?

When my Astroberry boots up I have the drivers to Start automatically. I would like to the drivers to load, then automatically run a script using indi_setprop to send specific config settings to the focuser (and other devices?).

Thank you!
3 years 7 months ago #57798

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

  • Posts: 983
  • Thank you received: 375
Rub indi_setprop without any options and you get al available options.
3 years 7 months ago #57886

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

  • Posts: 4
  • Thank you received: 0
Sorry, I probably wasn't clear about what I'd like to do. I'd like to have an automatic process that sends settings to my focuser in the boot process.

I was thinking about adding something in crontab, so when I boot the AstoBerry it will start the INDI server, then pass the settings with indi_setptop. My concern is if I add a crontab line running a script with the indi_setprop command and parameters and the INDI server has not started yet, then the settings will not apply ?

I guess I'm asking is there a way to boot up the AstroBerry server and after the INDI server is running, somehow automatically run something (a shell script?) that sends settings to a device?

Hope this is clear, sorry for the confusion.
Thank You.
3 years 7 months ago #57889

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

  • Posts: 216
  • Thank you received: 120
If you start your indi server using a systemd service, you can create a second service that depends on the first.

Running a service with systemd only once, you'd need to add
Type=oneshot

You would also need to add
[Unit]
Requires=indiserver.service
After=indiserver.service

You need both Requires and After. Otherwise systemd will start the second service at the same time as indiserver, and you want

More info on writing systemd unit files:

wiki.archlinux.org/index.php/Systemd#Writing_unit_files

If you really want it like cron, see using systemd as a cron replacement:
wiki.archlinux.org/index.php/Systemd/Timers
Last edit: 3 years 7 months ago by Rick Bassham.
3 years 7 months ago #57892

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

Moderators: Radek Kaczorek
Time to create page: 1.059 seconds