Activating a relay board from iPhone App

Hello,
I have relay boards of the type ZADSR161DPDTProXR_WEB-i that used to be controlled using an iphone App by sending commands to http://192.168.77.77/cgi-bin/runcommand.sh (which is the address/IP of the relay)

For some time, these boards were not used, and now when trying to use them again, they are not responsive, even though the app hasn’t changed. The boards are working normally since accessing them directly by their url,is possible, but what could be going wrong? should anything be changed to the app? and where can I find some documentation about how the app should work?

Thanks

Nicolas

Hi Nicolas,

The cgi-bin/runcommand.sh requires additional arguments that form the command the board receives to carry out. Can you send me the full url command? It should look like: http://192.168.1.12/cgibin/runcommand.sh?151:cmd=254,109,1r1t300:cmd=254,110,1r1t300:cmd=254,101,1r1t300

Also an easy mistake would be to not have the wifi on on the app and be connected to the same network as the Web-i.

You can find more information on the command structure of the Web-i’s runcommand.sh at https://ncd.io/web-i-webrelay-xbee-interface-quick-start-guide/

Hello,

Can you please explain the second point. There is a router disttibuting a range of ips. The web-i has a fixed ip from the same range and the iphone connects to the same router thru wifi to be able to send commands to the relay. It has always been like this, and it was working. Please advise. Thanks

What app are you using to control the board?

Can you determine the exact http command being sent to the board?

Is the ready light on on the board?

What power supply is being used to power the board?

The app has been developed on iOS to control the relay. The commands sent to control the relay are like below:

To check if the relay is working |http://192.168.77.77/cgi-bin/runcommand.sh|
For different functions in the app, the below:

|3|Mains Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,108,1|
|4|Mains Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,100,1|
|5|Release All Commands|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,129,0|
|6|Projection Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,109,1|
|7|Projection Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,101,1|
|8|DVD Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,110,1|
|9|DVD Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,102,1|
|10|TV Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,111,1|
|11|TV Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,103,1|
|12|JBM Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,112,1|
|13|JBM Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,104,1|
|14|SURV. Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,113,1|
|15|SURV. Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,105,1|
|16|TUNER Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,114,1|
|17|TUNER Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,106,1|
|18|- VOL Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,115,1|
|19|- VOL Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,107,1|
|20|+ VOL Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,108,2|
|21|+ VOL Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,100,2|
|22|PLAY Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,109,2|
|23|PLAY Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,101,2|
|24|STOP Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,110,2|
|25|STOP Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,102,2|
|26|<- REW Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,111,2|
|27|<- REW Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,103,2|
|28|ENTER Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,112,2|
|29|ENTER Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,104,2|
|30|FF -> Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,113,2|
|31|FF -> Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,105,2|
|32|CH DOWN Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,114,2|
|33|CH DOWN Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,106,2|
|34|CH UP Pressed|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,115,2|
|35|CH UP Released|http://192.168.77.77/cgi-bin/runcommand.sh?354:cmd=254,107,2|

Is the syntax correct?

Thanks

Those commands look accurate. The r1t300 in my above commands structure improve the speed of the communications by telling the module how many bytes you’re expecting and how long to wait until it times out, but I they aren’t required.

If the app hasn’t changed and its the same device and that device’s relays still works through the UI at the given URL then I’m not sure what could be going on.

Its possible that IoS changed the way they handle HTTP GET requests.

What does the board return if you paste one of those runcommand URLs into a browser?

I realize this is a 2 year old POST but i am desperate. I’m also having the same issue, the board simply returns “ok” whenever I paste the runcommand URL in a browse but nothing actually happens . It’s been driving me crazy trying to figure out whats wrong, any help would be GREATLY appreciated.

@tuscotsystem,
What command are you attempting to send to the controller. Also what is the model number of the controller you are using?

Thanks a Million for reaching out!
The Controller is a Fusion 48-Channel SPDT Relay Controller with 16 GPIO or ADC and I2C . We are trying to use simple HTTP GET , to turn on and off relays. An exact copy and paste of the a command that we are trying to use is " http://192.168.1.102/cgi-bin/runcommand.sh?rndvar:cmd=254,108,1r1t300"
Web -i workings perfectly fine , however runcommand does nothing , it simply returns “ok”

The commands you are sending need to be API encoded I believe. Try:
http://192.168.1.102/cgi-bin/runcommand.sh?rndvar:cmd=170,3,254,108,1,24r1t300
Let me know if that works or not.

Travis…YOU ARE THE MAN!! , It worked !! . Taking what you said about the api .
I applied the same concept to turn off the relay with http://192.168.1.102/cgi-bin/runcommand.sh?rndvar:cmd=170,3,254,100,1,16r1t300. And that worked flawlessly … I would buy you a beer if could , but thanks will have to do

No problem at all. Fusion controllers require that all commands be sent in API format. If you have any other questions please don’t hesitate to ask.