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
Strange behaviour of system() call
Strange behaviour of system() call
Since 29-12-2016 I am no longer a moderator for this forum
I solved the problem, I
I solved the problem, I should have placed the path (/usr/local/bin/) to the gpio command in the batchfile
Since 29-12-2016 I am no longer a moderator for this forum
Re: Strange behaviour of system() call
Hello,
Stupid question what do I have to install to run JavaScripts remotely? (http://raspberry:8083/JS/Run/system)
Thank you very much
Bart
Stupid question what do I have to install to run JavaScripts remotely? (http://raspberry:8083/JS/Run/system)
Thank you very much
Bart
Re: Strange behaviour of system() call
What do you expect system will do for you? In other words what do you try to achieve?
Since 29-12-2016 I am no longer a moderator for this forum
Re: Strange behaviour of system() call
execute a gpio command remotely. preferably in the same way as the zwaveApi (example: http//razberryIP:8083/ZWaveAPI/Run/devices[4].instances[0].commandClasses[0x43].data[1])
I concluded from your example in the initial post, that this would be easy.
I concluded from your example in the initial post, that this would be easy.
Re: Strange behaviour of system() call
Sorry, I missed this post.puesb wrote:execute a gpio command remotely. preferably in the same way as the zwaveApi (example: http//razberryIP:8083/ZWaveAPI/Run/devices[4].instances[0].commandClasses[0x43].data[1])
I concluded from your example in the initial post, that this would be easy.
Did you follow all the instructions from the Sunshades example?
If you want to follow my example you do have to install wiringPi as decribed there, and amongst others make sure that you have the shell script command in .syscommands
Since 29-12-2016 I am no longer a moderator for this forum