HTTP GET help

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mra2ko
Normal user
Posts: 85
Joined: 06 Dec 2021, 08:32
Location: Czech Republic

HTTP GET help

#1 Post by mra2ko » 15 Jan 2024, 11:16

Hi,
i would like send direct from my devices info to this web (bellow), but i test it and not working, anyone who can help me ?

http://in.zivyobraz.eu/?import_key=secureKey&TASK=VALUE

I would like send for example 5 tasks and also 5 values

Thank

User avatar
Ath
Normal user
Posts: 3950
Joined: 10 Jun 2018, 12:06
Location: NL

Re: HTTP GET help

#2 Post by Ath » 15 Jan 2024, 12:48

That server redirects immediately from http:// to https:// and that's not (yet) supported by ESPEasy :?
/Ton (PayPal.me)

mra2ko
Normal user
Posts: 85
Joined: 06 Dec 2021, 08:32
Location: Czech Republic

Re: HTTP GET help

#3 Post by mra2ko » 15 Jan 2024, 12:58

Ath wrote: 15 Jan 2024, 12:48 That server redirects immediately from http:// to https:// and that's not (yet) supported by ESPEasy :?
This URL is just " real example" but is http, no https...

User avatar
Ath
Normal user
Posts: 3950
Joined: 10 Jun 2018, 12:06
Location: NL

Re: HTTP GET help

#4 Post by Ath » 15 Jan 2024, 13:11

mra2ko wrote: 15 Jan 2024, 12:58
Ath wrote: 15 Jan 2024, 12:48 That server redirects immediately from http:// to https:// and that's not (yet) supported by ESPEasy :?
This URL is just " real example" but is http, no https...
Then check your server logs on that site to see why it's not accepted, maybe you need to use PostToHTTP instead of SendToHTTP ? Or some credentials should be included?
/Ton (PayPal.me)

mra2ko
Normal user
Posts: 85
Joined: 06 Dec 2021, 08:32
Location: Czech Republic

Re: HTTP GET help

#5 Post by mra2ko » 15 Jan 2024, 13:18

Ath wrote: 15 Jan 2024, 13:11
mra2ko wrote: 15 Jan 2024, 12:58
Ath wrote: 15 Jan 2024, 12:48 That server redirects immediately from http:// to https:// and that's not (yet) supported by ESPEasy :?
This URL is just " real example" but is http, no https...
Then check your server logs on that site to see why it's not accepted, maybe you need to use PostToHTTP instead of SendToHTTP ? Or some credentials should be included?
No extra credentials need, because "login" is the "secureKey"

http://in.zivyobraz.eu/?import_key=secureKey&TASK=VALUE

Pls i need know step by step, what to configure, becase I dont know what i do wrong.... :/

Thank

User avatar
Ath
Normal user
Posts: 3950
Joined: 10 Jun 2018, 12:06
Location: NL

Re: HTTP GET help

#6 Post by Ath » 15 Jan 2024, 13:39

Ath wrote: 15 Jan 2024, 12:48 That server redirects immediately from http:// to https:// and that's not (yet) supported by ESPEasy :?
^ This is the issue..., redirect could have been emphasized too ;)
/Ton (PayPal.me)

mra2ko
Normal user
Posts: 85
Joined: 06 Dec 2021, 08:32
Location: Czech Republic

Re: HTTP GET help

#7 Post by mra2ko » 15 Jan 2024, 13:50

Ath wrote: 15 Jan 2024, 13:39
Ath wrote: 15 Jan 2024, 12:48 That server redirects immediately from http:// to https:// and that's not (yet) supported by ESPEasy :?
^ This is the issue..., redirect could have been emphasized too ;)
This url redirect you to https, because user id not exist, i am not able here post my id (in this case the url not redirect co https)
System realy working with http get

User avatar
Ath
Normal user
Posts: 3950
Joined: 10 Jun 2018, 12:06
Location: NL

Re: HTTP GET help

#8 Post by Ath » 15 Jan 2024, 13:54

What exact command do you use from rules to transfer your data?
/Ton (PayPal.me)

mra2ko
Normal user
Posts: 85
Joined: 06 Dec 2021, 08:32
Location: Czech Republic

Re: HTTP GET help

#9 Post by mra2ko » 15 Jan 2024, 14:47

Ath wrote: 15 Jan 2024, 13:54 What exact command do you use from rules to transfer your data?
I send direct from devices to controler, is wrong ?

User avatar
Ath
Normal user
Posts: 3950
Joined: 10 Jun 2018, 12:06
Location: NL

Re: HTTP GET help

#10 Post by Ath » 15 Jan 2024, 16:04

mra2ko wrote: 15 Jan 2024, 14:47 I send direct from devices to controler, is wrong ?
No, that can be just fine, but please show your controller configuration (what controller are you using?) (you should mask or remove the secureKey), and did you enable the checkbox for that controller on the device settings page?
/Ton (PayPal.me)

mra2ko
Normal user
Posts: 85
Joined: 06 Dec 2021, 08:32
Location: Czech Republic

Re: HTTP GET help

#11 Post by mra2ko » 15 Jan 2024, 19:52

Ath wrote: 15 Jan 2024, 16:04
mra2ko wrote: 15 Jan 2024, 14:47 I send direct from devices to controler, is wrong ?
No, that can be just fine, but please show your controller configuration (what controller are you using?) (you should mask or remove the secureKey), and did you enable the checkbox for that controller on the device settings page?
I use:
generic http
use hostname
Controller Hostname: in.zivyobraz.eu/?import_key=xxxxxxxxx&
.
.
.
Now testing
Controller Publish: %vname1%=%val1%
Enabled yes....

I think problem is in Controller Publish. Can you help pls, for exact formula

Device:
task1
name: vname1
Values: val1
Last edited by TD-er on 15 Jan 2024, 20:50, edited 1 time in total.
Reason: Removed user account info

User avatar
Ath
Normal user
Posts: 3950
Joined: 10 Jun 2018, 12:06
Location: NL

Re: HTTP GET help

#12 Post by Ath » 15 Jan 2024, 20:08

Did you also enable the Controller checkbox on the Device settings page?

You might want to edit your previous message, I think there is some data that shouldn't be there :shock:
/Ton (PayPal.me)

mra2ko
Normal user
Posts: 85
Joined: 06 Dec 2021, 08:32
Location: Czech Republic

Re: HTTP GET help

#13 Post by mra2ko » 15 Jan 2024, 21:16

Ath wrote: 15 Jan 2024, 20:08 Did you also enable the Controller checkbox on the Device settings page?

You might want to edit your previous message, I think there is some data that shouldn't be there :shock:
Dont worry, import key is random text....
You mean in exact device "send to controler" or ?

User avatar
Ath
Normal user
Posts: 3950
Joined: 10 Jun 2018, 12:06
Location: NL

Re: HTTP GET help

#14 Post by Ath » 15 Jan 2024, 21:33

Yes, for the device that's supposed to have the data sent out, the Controller checkbox for Generic HTTP should be enabled.
/Ton (PayPal.me)

mra2ko
Normal user
Posts: 85
Joined: 06 Dec 2021, 08:32
Location: Czech Republic

Re: HTTP GET help

#15 Post by mra2ko » 15 Jan 2024, 21:42

Ath wrote: 15 Jan 2024, 21:33 Yes, for the device that's supposed to have the data sent out, the Controller checkbox for Generic HTTP should be enabled.
Yes, I have it....
Pls the Controller Publish is configured ok or ?

Controller Publish: %vname1%=%val1%

User avatar
Ath
Normal user
Posts: 3950
Joined: 10 Jun 2018, 12:06
Location: NL

Re: HTTP GET help

#16 Post by Ath » 15 Jan 2024, 21:59

It does look fine to me, what is the value name used? something common like temp ?

Can you view the serial log, to see if something useful is being shown there when the controller is publishing the data to the url?
/Ton (PayPal.me)

mra2ko
Normal user
Posts: 85
Joined: 06 Dec 2021, 08:32
Location: Czech Republic

Re: HTTP GET help

#17 Post by mra2ko » 16 Jan 2024, 07:59

Ath wrote: 15 Jan 2024, 21:59 It does look fine to me, what is the value name used? something common like temp ?

Can you view the serial log, to see if something useful is being shown there when the controller is publishing the data to the url?
Hm, thats the problem.... I dont check before

162762: HTTP : C008 in.zivyobraz.eu/?import_key=XXXXXXXXX& GET... failed HTTP code: -1 connection failed
162763: HTTP : C008 connection failed (220/0)
162772: ADC : Analog value: 4 = 4.00

But this exactl url normally working in other devives as http get. Any idea ?
Tnx

TD-er
Core team member
Posts: 9266
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTTP GET help

#18 Post by TD-er » 16 Jan 2024, 09:11

Can the hostname be resolved by the DNS set in ESPEasy?

Also I don't see the task value in the GET url in the logs

TD-er
Core team member
Posts: 9266
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTTP GET help

#19 Post by TD-er » 16 Jan 2024, 22:39

In the controller you only need to put the hostname and not the http:// prefix, nor anything else of the URL.
So I think you should use something like this as "publish" block:

Code: Select all

/?import_key=xxxxxxxxx&TASK=[adc#Analog]

TD-er
Core team member
Posts: 9266
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HTTP GET help

#20 Post by TD-er » 16 Jan 2024, 22:41

Also the timeout should be set to 1000 msec when connecting to an external host.

mra2ko
Normal user
Posts: 85
Joined: 06 Dec 2021, 08:32
Location: Czech Republic

Re: HTTP GET help

#21 Post by mra2ko » 21 Jan 2024, 17:12

Thank to TD-er for a help... !
I send also pic for a setup, maybee help someone in future...
http.JPG
http.JPG (87.04 KiB) Viewed 4988 times

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest