Page 1 of 1

Help with openHAB IP control

Posted: Mon Nov 05, 2018 11:30 pm
by xluorp
Longtime iRule user looking for a replacement. I am impressed so far by Demopad but have run into a snag that I can't solve. I have set up several ip devices that are working fine but my openHAB device will not communicate (openhabian on RaspberryPi). This has always worked fine in iRule.
Using Hercules I have picked up what is being sent out.

From Demopad:

Code: Select all

/classicui/CMD?theater_group_dimmer=100{0D}{0A}
From iRule:

Code: Select all

GET /classicui/CMD?theater_group_dimmer=100 HTTP/1.1{0D}{0A}Host: 192.168.1.42:8080{0D}{0A}Accept: */*{0D}{0A}Accept-Language: en-us{0D}{0A}Connection: keep-alive{0D}{0A}Accept-Encoding: gzip, deflate{0D}{0A}User-Agent: iRule/4977 CFNetwork/974.2.1 Darwin/18.0.0{0D}{0A}{0D}{0A}
I have tried pasting the iRule command that was received by Hercules into Demopad but that did not work. I read in this forum about how to convert a command to "GET" but that did not wok either.

I am grateful for any help, Thanks

Re: Help with openHAB IP control

Posted: Sat Nov 10, 2018 2:57 am
by xluorp
OK, after hours of testing and sifting through this forum, I finally found the answer. I post here to save others the time.
You must use HTTP/1.0\x0D\x0A after the command. Not HTTP/1.1 The suffix \x0D\x0A must be part of the command even though it is set in the device. So in my case the command would be;

Code: Select all

GET /classicui/CMD?theater_group_dimmer=100 HTTP/1.0 \x0D\x0A

Re: Help with openHAB IP control

Posted: Sat Nov 10, 2018 10:36 am
by DemoPad
Note that Hercules represents hexadecimal characters in {0D} format for example, you would need to swap to \x0D format within DemoPad. I suspect the HTTP/1.1 approach would have worked if these changes were made to the iRule command, but if HTTP/1.0 works anyway then it requires less parameters.

Re: Help with openHAB IP control

Posted: Sun Nov 11, 2018 6:53 pm
by xluorp
OK, yes, I see that now. Thanks for your comment.