Posts: 8
Threads: 2
Joined: Nov 2019
Reputation:
0
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
Posts: 652
Threads: 18
Joined: Aug 2015
Reputation:
22
2020 Feb 05, 04:28 PM
(This post was last modified: 2020 Feb 05, 08:40 PM by dan.)
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>
Posts: 8
Threads: 2
Joined: Nov 2019
Reputation:
0
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
Posts: 652
Threads: 18
Joined: Aug 2015
Reputation:
22
2020 Feb 06, 06:31 PM
(This post was last modified: 2020 Feb 06, 06:32 PM by dan.)
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>
Posts: 8
Threads: 2
Joined: Nov 2019
Reputation:
0
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
Posts: 652
Threads: 18
Joined: Aug 2015
Reputation:
22
2020 Feb 09, 06:00 PM
(This post was last modified: 2020 Feb 09, 06:05 PM by dan.)
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>