Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2016-01-22 21:22:54

hendrik
Member
Registered: 2015-11-01
Posts: 49

http request

Hi,
Is there any information/ example code available on how to use http request? My idea is to control a z wave device with http.

Thanks

Offline

#2 2016-01-25 08:45:18

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: http request

You can use the EPC block to call wget. Our GitHub repository contains examples on using the EPC function block.

Alternatively, you can check whether your Z-Wave device has a serial gateway/API. In that case, you might be able to control it using the REXLANG function block instead of the HTTP request.

Can you post here more information about the device?

Offline

#3 2016-01-26 22:06:03

hendrik
Member
Registered: 2015-11-01
Posts: 49

Re: http request

I am using a UZB1 stick - zwave.me
http://razberry.z-wave.me/docs/zwayDev.pdf

Offline

#4 2016-01-27 15:13:08

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: http request

Thanks for the update. There is no serial API available for your device. Using JSON API and the EPC block is the only solution at the moment.

Offline

#5 2016-01-29 21:16:10

hendrik
Member
Registered: 2015-11-01
Posts: 49

Re: http request

Ok thanks.

Offline

#6 2016-10-05 13:13:38

hendrik
Member
Registered: 2015-11-01
Posts: 49

Re: http request

I am dealing with HTTP requests again and to be honest I do not have a lot of experience in this. I will receive the following request "GET /200ESTOP1ActiveHTTP/1.1\r\n\n" from a controller (Client) - see attached.

I want to use the EPC block to convert this into something useful - see attached. Please advice.Capture.pnghttp.png

Offline

#7 2016-10-05 14:53:41

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: http request

Hi Hendrik,
as far as I understand, the zWay acts as a server, which provides data to clients. You should be issuing HTTP GET commands. Try reading the data from RPi command line first. Something like this should work

 wget http://YOURIP:8083/ZWaveAPI/Data/* -O -

where you need to use the IP of your RPi and replace the * with any meaningful path (I have no experience with zWave, sorry).

Once you are able to retrieve the data from command line, you can use the EPC block to do this job for you.

Jaroslav

PS This will be much easier in the new version of REX, but still you need to know how to retrieve the data from command line.

Offline

#8 2016-10-05 16:59:58

hendrik
Member
Registered: 2015-11-01
Posts: 49

Re: http request

I am working on a different project/ different controller (not Zway). I requested more info from controller manufacture but no luck. The controller will be on the same subnet with static IP

Offline

#9 2016-10-06 11:56:28

hendrik
Member
Registered: 2015-11-01
Posts: 49

Re: http request

Hi,
I was calling a few Tkinter scripts from Unipi cmd and it worked fine, but when I call it from the EPC block there is no response. I have used the EPC block before and had no issues.

Not sure what the issue could be?

Offline

#10 2016-10-06 13:19:14

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: http request

Hi Hendrik,
please start a new topic and describe your current problem. Unless you provide sufficient information, it's hard to help. What Tkinter scripts are you trying to call, what is the purpose and what is the output of the script(s)? How do you call the script from command line? Are there any parameters? If possible, upload the scripts and REX source files...

Jaroslav

Offline

Board footer

Powered by FluxBB