This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create action from switch attached to GPIO
#13
(2017-05-24, 07:50 PM)PaddyB Wrote: Trying to break it put it keeps on working....???
Cleaned out all the other actions and gpio pin definitions.

Here's what I have from openplotter.conf

I short gpio pin 26 to ground and opencpn drops a waypoint at the boat gps position.


[GPIO]
sensors = [[u'test', 'in', u'26', u'up']]
________________
[ACTIONS]
triggers = [[1, u'sensors.test.value', 2, '0', [['ACT2', 'sudo /home/pi/scripts/dropmark.sh', 0.0, 0]]]]
Thanks for that clue. Interesting I checked the conf file and for some reason the script name in my conf file had a newline character on the end "....../mob.sh\n'" I have no idea what put that there it wasn't me and wasn't showing in the command in the actions panel of OP. 

Anyway I manually deleted the \n and everything now works as advertised. 

In the attached image I have pushed the red button on the left, top, of my plotter; the MOB marker has appeared and the alarm switch (top right) has illuminated. Pushing the illuminated switch cancels the alarm. 

Other actions will be configured to sound alarms too. Ideally AIS CP etc.. but that is another story. 

Cheers


Attached Files Image(s)
   
Reply


Messages In This Thread
RE: Create action from switch attached to GPIO - by Littlechay - 2017-05-25, 12:47 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)