Strange behaviour of system() call
Posted: 18 Aug 2013 16:56
I intend to use Gordon Hendersons wiringPi software (http://wiringPi.com) to drive my Somfy sunshades from OpenRemote (see my post http://www.openremote.org/display/forum ... t-22875010)
I use the wiringPi module (gpio command) in the following script:
#!/bin/sh
PIN=$1
gpio mode $PIN out
gpio write $PIN 1
sleep 0.1
gpio write $PIN 0
I have the script stored as: /opt/z-way-server/automation/GPIO.sh
This works fine if called from the Raspberry Pi command line.
However if I call it from within Javascript with a system() call as:
(http://raspberry:8083/JS/Run/system("/o ... on/GPIO.sh " %2B 12))
I do get error 32512. This error does not appear if I put a # sign before the last line.
I have worked this through with PoltoS, where we concluded that the system() call itself works OK
Something funny seems to be happening in that last line of the GPIO script
Anybody out here who has a clue of what may be wrong?
Thanks,
Pieter
I use the wiringPi module (gpio command) in the following script:
#!/bin/sh
PIN=$1
gpio mode $PIN out
gpio write $PIN 1
sleep 0.1
gpio write $PIN 0
I have the script stored as: /opt/z-way-server/automation/GPIO.sh
This works fine if called from the Raspberry Pi command line.
However if I call it from within Javascript with a system() call as:
(http://raspberry:8083/JS/Run/system("/o ... on/GPIO.sh " %2B 12))
I do get error 32512. This error does not appear if I put a # sign before the last line.
I have worked this through with PoltoS, where we concluded that the system() call itself works OK
Something funny seems to be happening in that last line of the GPIO script
Anybody out here who has a clue of what may be wrong?
Thanks,
Pieter