![]() |
Issuing shell cmd's - Printable Version +- SIP (https://nosack.com/sipforum) +-- Forum: SIP (Sustainable Irrigation Platform) (https://nosack.com/sipforum/forumdisplay.php?fid=1) +--- Forum: Installation and set up questions (https://nosack.com/sipforum/forumdisplay.php?fid=2) +--- Thread: Issuing shell cmd's (/showthread.php?tid=201) |
Issuing shell cmd's - kraftor80 - 2020 Feb 05 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 RE: Issuing shell cmd's - dan - 2020 Feb 05 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 RE: Issuing shell cmd's - kraftor80 - 2020 Feb 06 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 RE: Issuing shell cmd's - dan - 2020 Feb 06 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 RE: Issuing shell cmd's - kraftor80 - 2020 Feb 08 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 RE: Issuing shell cmd's - dan - 2020 Feb 09 (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?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 RE: Issuing shell cmd's - dan - 2020 Feb 09 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 |