SendToHTTP problem with URL lenght?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
jopare
Normal user
Posts: 11
Joined: 29 Oct 2018, 20:15

SendToHTTP problem with URL lenght?

#1 Post by jopare » 19 Feb 2019, 21:30

Hi, currently I'm struggling with SendToHTTP with a longer URL. In general my config works when i use for example the following rule:

Code: Select all

on System#Boot do
gpio,2,0 
endon 
on Push#state do
if [Push#state]=1
SendToHTTP 192.168.0.50,8085,/room?cmd=set%20VC20_Steckdose_03%20on
else
gpio,2,0
endif
endon
No trouble with that, the above URL works from any Browser and also from this rule. When i try the same rule with the following URL, it doesn't work:
192.168.0.16,80,/control/trigger_event? ... rom_piface
But, this URL works also from any Browser. One, maybe interessting thing is, that the URL is trunkated in the log. The last 7 characters are missing.
I've also modified the required IPaddress, port, userid and password in the Generic HTTP device configuration. Any help will be appreciated, thanks in advance.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: SendToHTTP problem with URL lenght?

#2 Post by grovkillen » 19 Feb 2019, 21:44

Yes you're probably hitting the max length for a rule/command line.

Possible to shorten the URL?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

jopare
Normal user
Posts: 11
Joined: 29 Oct 2018, 20:15

Re: SendToHTTP problem with URL lenght?

#3 Post by jopare » 19 Feb 2019, 21:55

Unfortunately I can't shorten the URL. What's the max. length? I've read about a limitation problem in former releases but as far as i understood this was eliminated.
Thanks so far.

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

Re: SendToHTTP problem with URL lenght?

#4 Post by TD-er » 20 Feb 2019, 00:58

It may very well be the limit for these is 80 bytes.
The parameter (separated by a ',') has a length of 100 bytes in your example and I guess the limit for those is 80.
That still doesn't explain why you're missing 7 bytes.
The entire line is 128 bytes

Code: Select all

SendToHTTP 192.168.0.16,80,/control/trigger_event?event_name=OnButPressed_roomsystem.0&event_source=alsapi.keyboard.from_piface
And that one may be limited to 120 bytes, which makes loosing 7 bytes a lot more likely.

Thing is we have had a lot of strange crashes, which appeared to be stack overflows while parsing the rules.
So it has been 240 bytes a while ago, but that's been lowered to keep the stack from overflowing.
A lot of this parsing has been looked into already to lower memory usage, but I guess if there's still some limit like this one, it hasn't been altered yet.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: SendToHTTP problem with URL lenght?

#5 Post by grovkillen » 20 Feb 2019, 05:46

jopare wrote: 19 Feb 2019, 21:55 Unfortunately I can't shorten the URL. What's the max. length? I've read about a limitation problem in former releases but as far as i understood this was eliminated.
Thanks so far.
SendToHTTP,192.168.0.16,80,/control/trigger_event?event_name=OnButPressed_roomsystem.0&event_source=alsapi.keyboard.from_piface

Just a thought, if you have any control over the receiving end you should get those event names shorten (bold in the text above).
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

jopare
Normal user
Posts: 11
Joined: 29 Oct 2018, 20:15

Re: SendToHTTP problem with URL lenght?

#6 Post by jopare » 20 Feb 2019, 20:35

Thanks for your suggestions, I got it fixed with a very short Hostname instead of the IP-address.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: SendToHTTP problem with URL lenght?

#7 Post by grovkillen » 20 Feb 2019, 21:49

Good you got it fixed
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests