HTTP request support?

9 years 8 months ago #824 by freol
HTTP request support? was created by freol
Hi,

Does EasyIoT support http requests or something similar?

I would like to be able to update a "sensor" in EasyIoT from another raspberry pi, preferably using python. The other raspberry pi is wifi-connected to same network as the EasyIoT-raspi.

Any suggestions?

Thanks in advance :)

Please Log in or Create an account to join the conversation.

9 years 8 months ago - 9 years 8 months ago #827 by EasyIoT
Replied by EasyIoT on topic HTTP request support?

freol wrote: Hi,

Does EasyIoT support http requests or something similar?

I would like to be able to update a "sensor" in EasyIoT from another raspberry pi, preferably using python. The other raspberry pi is wifi-connected to same network as the EasyIoT-raspi.

Any suggestions?

Thanks in advance :)


Yes, use Virtual driver and virtual nodes and then call

http://[IP address]Api/EasyIoT/Control/Module/Virtual/[address]ControlLevel/[value]
for analog
or
http://[IP address]Api/EasyIoT/Control/Module/Virtual/[address]ControlOn/
http://[IP address]Api/EasyIoT/Control/Module/Virtual/[address]ControlOff/
for digital

IP adress - EasyIoT server address
address - virtual module address
value - temperature value

Use basic authentication - username and password is the same as EasyIoT login.

Please Log in or Create an account to join the conversation.

9 years 8 months ago #832 by freol
Replied by freol on topic HTTP request support?

EasyIoT wrote:

freol wrote: Hi,

Does EasyIoT support http requests or something similar?

I would like to be able to update a "sensor" in EasyIoT from another raspberry pi, preferably using python. The other raspberry pi is wifi-connected to same network as the EasyIoT-raspi.

Any suggestions?

Thanks in advance :)


Yes, use Virtual driver and virtual nodes and then call

http://[IP address]Api/EasyIoT/Control/Module/Virtual/[address]ControlLevel/[value]
for analog
or
http://[IP address]Api/EasyIoT/Control/Module/Virtual/[address]ControlOn/
http://[IP address]Api/EasyIoT/Control/Module/Virtual/[address]ControlOff/
for digital

IP adress - EasyIoT server address
address - virtual module address
value - temperature value

Use basic authentication - username and password is the same as EasyIoT login.



Thanks for the response. Unfortunately I can only get the digital part of it working

When calling the url for the digital sensor, I get the following response:
[{ "ResponseValue" : "1" }]
and the sensor is updated accordingly in the web interface. Nice!

But, for the analog sensor, I get no response, no popup, no update, nothing.

The weird (?) part is that if icall the analog sensor using one of the digital urls, i get a response as above and a popup in the web interface. But the analog sensor is not updated.

Maybe the url for updating the analog sensor has an error in it somewhere or am I missing something obvious?

Thanks in advance!

Please Log in or Create an account to join the conversation.

9 years 8 months ago #833 by EasyIoT
Replied by EasyIoT on topic HTTP request support?

freol wrote:

EasyIoT wrote:

freol wrote: Hi,

Does EasyIoT support http requests or something similar?

I would like to be able to update a "sensor" in EasyIoT from another raspberry pi, preferably using python. The other raspberry pi is wifi-connected to same network as the EasyIoT-raspi.

Any suggestions?

Thanks in advance :)


Yes, use Virtual driver and virtual nodes and then call

http://[IP address]Api/EasyIoT/Control/Module/Virtual/[address]ControlLevel/[value]
for analog
or
http://[IP address]Api/EasyIoT/Control/Module/Virtual/[address]ControlOn/
http://[IP address]Api/EasyIoT/Control/Module/Virtual/[address]ControlOff/
for digital

IP adress - EasyIoT server address
address - virtual module address
value - temperature value

Use basic authentication - username and password is the same as EasyIoT login.



Thanks for the response. Unfortunately I can only get the digital part of it working

When calling the url for the digital sensor, I get the following response:
[{ "ResponseValue" : "1" }]
and the sensor is updated accordingly in the web interface. Nice!

But, for the analog sensor, I get no response, no popup, no update, nothing.

The weird (?) part is that if icall the analog sensor using one of the digital urls, i get a response as above and a popup in the web interface. But the analog sensor is not updated.

Maybe the url for updating the analog sensor has an error in it somewhere or am I missing something obvious?

Thanks in advance!


Try with url and / at the end. I think this is bug in current version. I've fixed that in my version and will be included in next release.

Please Log in or Create an account to join the conversation.

9 years 8 months ago #834 by freol
Replied by freol on topic HTTP request support?
Ok, doesnt work with the extra / at the end either. Will be waiting patiently on the next release then :D

Please Log in or Create an account to join the conversation.

9 years 8 months ago #835 by EasyIoT
Replied by EasyIoT on topic HTTP request support?

freol wrote: Ok, doesnt work with the extra / at the end either. Will be waiting patiently on the next release then :D


It should work, because WEB interface updates value that way. Try this in WEB browser:

http://localhost/Api/EasyIoT/Control/Module/Virtual/N2S0/ControlLevel/2/

Just change localhost -> IP address, N2S0 -> module address and 2 - value.

Please Log in or Create an account to join the conversation.

Time to create page: 0.273 seconds

Forum latest

  • No posts to display.