Feedback from HTTP Request

149 views
Skip to first unread message

Schlabibu Sirius

unread,
Aug 8, 2014, 5:51:23 AM8/8/14
to
Hi!
I have to control some relay cards Controlled over a Network controller using the http protocol. 

It's working totaly fine with Javsscript CF.Request ( where i can log the body of the Request with Remote Debugging), with an HTTP system and with manually crafted http commands over an TCP Client. I just cant process the data, which are send in .js format from the controller, to create a feedback function with it.

HTTP Request is:

admin:ad...@192.168.1.10/ioreg.js

 

The js. file looks like this:

var IO=new Array (0x00,0x00,0x00,0x008D,0x0126,0x00B7,0x008D,0x004F,0x0035,0x003F,0x0042)
var IS=new Array (0xFF,0xFF,0x00)
var N=new Array ("P3.1","P3.2","P3.3","P3.4","P3.5","P3.6","P3.7","P3.8","P5.1","P5.2","P5.3","P5.4","P5.5","P5.6","P5.7","P5.8","ADC.1","ADC.2","ADC.3","ADC.4","ADC.5","ADC.6","ADC.7","ADC.8","Port 1","Port 2","Port 3","Port 4","Port 5","Port 6","Port 7","Port 8")

I already created loopback http systems to match the feedback with (.*). Not working. I read on another thread where someone is parsing an XML file in order to do the feedback. Is it possible to parse a .js file? Or any other idea? 
Thanks for looking in!

PS: Im using a Lan-Bridge as a multiplexer in the middle of it. And i dont know how to craft CF.Request commands which will go the way over the Lan bridge. :/

Steve

unread,
Aug 8, 2014, 1:07:48 PM8/8/14
to comman...@googlegroups.com
You could use the the Javascript eval command to convert these strings into JS commands. Then just use each value in your code.

eg.
digitalio1 = IO[0];
digitalio2 = IO[1];
analogio1 = IO[2];
etc.

Schlabibu Sirius

unread,
Aug 13, 2014, 10:18:14 AM8/13/14
to comman...@googlegroups.com


Am Freitag, 8. August 2014 19:07:48 UTC+2 schrieb Steve:
You could use the the Javascript eval command to convert these strings into JS commands. Then just use each value in your code.

eg.
digitalio1 = IO[0];
digitalio2 = IO[1];
analogio1 = IO[2];
etc.

Thats a good Idea. Still, since the controller only accepts one connection and i rly need the LanBridge as Multiplexer for 2 control devices, i firstly need to grab the BodyResponse from that request which has to go its way over the lan bridge. So your Idea it doesnt help at this state.But i definitely keep that advice in mind. If i craft the http request manualy and sent it over the Bridge, is the .JS body of the request somehow processable? i couldnt get any feedback so far, spent hours on the debugging monitor.
I tried the command sendData to reach the controller over his dedicated slot on the LanBridge. Theres bytes being sent, but you cant fit Javascript Commands in 'SendData'. 
Hope this helps to understand. Sorry that i dont post code. I could, but im pretty sure there are no Syntax Errors. Well.. So far :)

Barry Gordon

unread,
Aug 13, 2014, 11:24:39 AM8/13/14
to comman...@googlegroups.com

From what I understand of your problem:

 

You really need to run the code through a syntax checker to ensure there are no syntax errors.

 

Place a CF.log just before the sending of the CF.request (or the CF.send, if you at the TCP protocol level as opposed to http) to ensure you get there.

 

If the device you are communicating with is using http then a CF.request should return at least the status plus the body if there is a body being returned.

 

If there is no return from the CF.request then there is a high probability, but not a certainty, that the problem is not in the iviewer.

--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusio...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jarrod Bell

unread,
Aug 13, 2014, 8:21:13 PM8/13/14
to comman...@googlegroups.com
Note that the LAN Bridge does not multiplex HTTP connections, only raw TCP or UDP.

HTTP connections are generally not held open, so you dont have issues with multiple devices connecting at once.

Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


Reply all
Reply to author
Forward
0 new messages