Report Bugs Here

Moderator: Mmiscool

User avatar
By TheWaldorfer
#46789 @martinayotte: Yep. Of course. Coming from VB.Net I forgot that :-) I only had to encode SPACE. Other chars like öäüß work without encoding. Thank's

@thelazyone: A20. Must be something else in your code. Can you post the complete program?

Here my program with encoding (Space only):

Code: Select alldev = "ESP1"
st = 0
p = 2
Pi p st
print "ESP ist waiting for Pin " & p & " to change..."
interrupt p [gpio]
Wait
[gpio]
Pi p nst
if nst = 0 then
   url = "192.168.178.23/esp/pin.php?Action=Message&mfrom=" & dev & "&mto=System&mtype=1&mess=Door/Window opened äöüß"
   gosub [urlencode]
   print wget(url)
else
   url = "192.168.178.23/esp/pin.php?Action=Message&mfrom=" & dev & "&mto=System&mtype=2&mess=Door/Window closed äöüß"
   gosub [urlencode]
   print wget(url)
end if
st = nst
wait

[urlencode]
url = replace(url," ", "+")
print url
return
User avatar
By thelazyone
#46937 TheWaldorfer thx for info.
I have simplified my code as much as possible, only one line of code left:
Code: Select allwget("192.168.1.198/jaskiniatroli/inc/get.php?minfo=s1/30")

and an error:
Failed to reach end of input expression, likely malformed input


Variable Dump:
wget("192.168.1.198/jaskiniatro = error
wget("192.168.1.198/jaskiniatronfo=s1/30) = error


When I remove
=
sign, I get no error.

I use NodeMCU V3, A21 4MB.
User avatar
By TheWaldorfer
#46993 Hm. My examples are tested. Even if they may not work at your ESP (other ip address, etc.) there should be no error. wget() does just nothing if an address isn't available (happens to me when I forget to start Apache).

Just to be sure:

You have an Apache Server with php (e.g. XAMPP)running @ address 192.168.1.198?

For a test:

Just open your browser and type:

192.168.1.198/jaskiniatroli/inc/get.php?minfo=s1/30

This must work. The other message "Failed to reach end of input expression, likely malformed input" really looks like a typo. Please be careful of Copy&Paste. One time I copied some code and there were strange chars in the code. At the start I flashed with 512MB which caused file i/o problems when saving/loading programs.

If everything else fails (typos checked) I would re-Flash the ESP (maybe it's not a 4MB one?)
User avatar
By thelazyone
#47015 THANKS TheWaldorfer, this
wget() does just nothing if an address isn't available (happens to me when I forget to start Apache)
led me to solution of my problem.
Windows firewall somehow began to block connections from my home network. Opening port 80 fixed it, and now it works again.

And yes, i use Apache Server with php, (WAMP Server) on my PC, as a base for my "smart home" project.


BUT...
This works
Code: Select alllet myurl1 = "192.168.1.198/jaskiniatroli/inc/get.php?minfo=s7/50"
wget(myurl1)


This dont work, and gives me error I've mention before
Code: Select allwget("192.168.1.198/jaskiniatroli/inc/get.php?minfo=s7/50")