OpenMarine
[SOLVED] 0.11.3a action commands not working - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: Bug Reports (https://forum.openmarine.net/forumdisplay.php?fid=4)
+--- Thread: [SOLVED] 0.11.3a action commands not working (/showthread.php?tid=474)



[SOLVED] 0.11.3a action commands not working - Littlechay - 2017-04-30

I am trying to us a sensor, in this case a 1W sensor using sig K handle environment.water.temperature.value to trigger actions. 

I set up the trigger with the trigger as above, operator >= and value 303 (30 Centigrade)

I set two actions, the first just shows a message; which works fine

the second should operate set a GPIO output high using the command 


Code:
echo 1 > /sys/class/gpio/gpio16/value


This works fine from the command line in the terminal but nothing happens in OP. When I run OP from the command line there are no error messages.

Any ideas?


RE: 0.11.3a action commands not working - Sailoog - 2017-05-02

There are some linux arguments that the python interpreter can not digest and this is an example. It does not like the symbol >. There would be a solution changig the way these arguments are interpreted but it could create a security issue. Let me try something.

Anyway, what you are trying to do it will be possible soon. When you define a GPIO output in GPIO tab it will appear as a new action to set this GPIO to High or Low. On next update.


RE: 0.11.3a action commands not working - Littlechay - 2017-05-03

Sounds great. Looking forward to trying it.

On the case of my plotter I have an red illuminated button (momentary close). When I get an alarm condition the I illuminate the button via the above GPIO pin. I haven't connected it yet but the idea is to have another action which resets the alarm condition when the button is pressed. Ideally the first press will silence the buzzer (also activated via a relay on the GPIO pin) and turn the light off - I would then like a second press to completely clear any existing messages.

Is there a way to implement this second press situation in OP ?


RE: 0.11.3a action commands not working - PaddyB - 2017-05-03

(2017-05-03, 05:34 AM)Littlechay Wrote: Sounds great. Looking forward to trying it.

On the case of my plotter I have an red illuminated button (momentary close). When I get an alarm condition the I illuminate the button via the above GPIO pin. I haven't connected it yet but the idea is to have another action which resets the alarm condition when the button is pressed. Ideally the first press will silence the buzzer (also activated via a relay on the GPIO pin) and turn the light off - I would then like a second press to completely clear any existing messages.

Is there a way to implement this second press situation in OP ?

Maybe node-red would be a way to do this?


RE: 0.11.3a action commands not working - Littlechay - 2017-05-04

(2017-05-02, 04:20 PM)Sailoog Wrote: There are some linux arguments that the python interpreter can not digest and this is an example. It does not like the symbol >. There would be a solution changig the way these arguments are interpreted but it could create a security issue. Let me try something.

Anyway, what you are trying to do it will be possible soon. When you define a GPIO output in GPIO tab it will appear as a new action to set this GPIO to High or Low. On next update.

(2017-05-03, 10:47 AM)PaddyB Wrote:
(2017-05-03, 05:34 AM)Littlechay Wrote: Sounds great. Looking forward to trying it.

On the case of my plotter I have an red illuminated button (momentary close). When I get an alarm condition the I illuminate the button via the above GPIO pin. I haven't connected it yet but the idea is to have another action which resets the alarm condition when the button is pressed. Ideally the first press will silence the buzzer (also activated via a relay on the GPIO pin) and turn the light off - I would then like a second press to completely clear any existing messages.

Is there a way to implement this second press situation in OP ?

Maybe node-red would be a way to do this?

I don't know. Can Node-Red interact with physical controls?

Or are you suggesting that Node-Red get passed the physical button action from OP/Signal K and then return an action to OP to clear the messages? 

I haven't played with Node Red much yet. I need to get all my instruments accurately reporting into Signal K first before I get fancy. Smile


RE: 0.11.3a action commands not working - Littlechay - 2017-05-09

(2017-05-02, 04:20 PM)Sailoog Wrote: There are some linux arguments that the python interpreter can not digest and this is an example. It does not like the symbol >. There would be a solution changig the way these arguments are interpreted but it could create a security issue. Let me try something.

Anyway, what you are trying to do it will be possible soon. When you define a GPIO output in GPIO tab it will appear as a new action to set this GPIO to High or Low. On next update.

I see the action to set up a GPIO has been added in the latest version. But how do I set it as an action?

I have set GPIO 16 as, output, pull-up

I have tried "Command" and then entering <sensors.alarmLight> in the data section but that seems to have zero effect.

Chris


RE: 0.11.3a action commands not working - Sailoog - 2017-05-09

Sorry Littlechay I have not added gpio actions yet as I promised you. First I wanted to publish I2C changes. Next update is coming soon with gpio and mqtt actions.


RE: 0.11.3a action commands not working - Sailoog - 2017-05-12

GPIO output actions are working now in v0.11.5


RE: 0.11.3a action commands not working - Littlechay - 2017-05-13

Yes confirmed for me. Thanks. Smile


RE: 0.11.3a action commands not working - PaddyB - 2017-05-13

(2017-05-12, 08:03 PM)Sailoog Wrote: GPIO output actions are working now in v0.11.5

Yay! Fuel transfer pump working again after I broke node red gpio Cool

Thanx