Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issuing shell cmd's
#1
I see that SIP can also issue Linux shell commands when a station is turned on or of. How is this done?

I tried to install the cli_control plugin. With it enabled, none of the existing station programming worked. I did not try any shell commands and had to disable the plugin to get normal programmed station control working again.

Dale
Reply
#2
Hi Dale,


The cli_control plugin disables output from the Pi's GPIO pins.


I probably should add an option to keep the GPIO pins active.




For now, if you can edit the cli_control.py file in the SIP/plugins folder you can comment out line 12 to keep the GPIO pins active. for example use nano to edit the file:




from the SIP/plugins folder

nano cli_control.py

add # to the start of line 12 so it is

# gv.use_gpio_pins = False  # Signal SIP to not use GPIO pins



This will allow the pins to function and the commands to be sent at the same time.



Dan
<p><br></p>
Reply
#3
Dan,
Thats great and will do exactly what I need.
It would be useful for the cli gui to use some syntax for each channel like Y, <your command> for gpio and command and N, <your command> for cli command only.

In any case, this will do for me now.
Thanks!
Dale
Reply
#4
Dale,

FYI:
I added an option to disable the GPIO pins on the cli_control plugin's setup page. The GPIO pins are now active by default.

Regarding your suggestion to have the commands control individual pins; It is pretty complicated because the SIP's original capability was to control stations through shift registers and there is not a direct relationship between the GPIO pins and the stations. I will give it some thought as it would be a good feature.

Dan
<p><br></p>
Reply
#5
Great, Ill try the new plugin this week. Could the per station control with a mask register for the shift reg value?
With CLI commands, is there a way to know the programmed time for the station? I will be running a program that takes a runtime as a argument.
I can hard code a longer time then use a kill command in the stop time if necessary.

Dale
Reply
#6
(2020 Feb 08, 06:41 PM)kraftor80 Wrote: Great, Ill try the new plugin this week. Could the per station control with a mask register for the shift reg value?
With CLI commands, is there a way to know the programmed time for the station? I will be running a program that takes a runtime as a argument.
I can hard code a longer time then use a kill command in the stop time if necessary.

Dale
The programs are held in gv.pd, a list of dicts.
Take a look at the file SIP/data/programData.json which is the saved version.

Also, the file SIP/gv_reference.txt describes SIP's variables.

HTH

Edit:
When a program is running the schedule is held in gv.rs (run schedule).

Dan
<p><br></p>
Reply
#7
Regarding the possibility to selectively activate individual GPIO pins; It might be done if you are not using shift register output.

For example the relay board plugins (relay_board and relay_16) use a selected set of pins for direct control of relay channels. If you don't need to enable/disable the pins dynamically you could probably set up a plugin that selects which pins are active.

This is just from a quick look at the relay_16 plugin but I think it is probably doable.

Another possibility is to use a bit-mask similar to the way stations can be configured to ignore rain sensor input but this would probably require changes to the core SIP code. - Not sure about this without further investigation.

Dan
<p><br></p>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)