Generic HTTP Advanced - PHP - MySQL

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
gorogdaniel
Normal user
Posts: 15
Joined: 21 Feb 2020, 17:33

Generic HTTP Advanced - PHP - MySQL

#1 Post by gorogdaniel » 21 Feb 2020, 17:40

Hi,

i am new on this Forum and try to set up my ESP but i cant resolve the problem and i dont know what i made wrong.

I set up a mySql server and i have a php Script wich import me the value.

But i cant bring it to run.

The HTTP Post is not working from this Device.

I have try a lot of scripts and i lose already 2 days to search the problem.

so i say PLEASEEEEEEEEEES Help me :D

Thank you very much :oops:
Attachments
5.jpg
5.jpg (206.57 KiB) Viewed 8796 times
4.jpg
4.jpg (478.95 KiB) Viewed 8796 times
3.jpg
3.jpg (241.54 KiB) Viewed 8796 times
2.jpg
2.jpg (236.61 KiB) Viewed 8796 times
1.jpg
1.jpg (225.9 KiB) Viewed 8796 times

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Generic HTTP Advanced - PHP - MySQL

#2 Post by ThomasB » 21 Feb 2020, 18:26

1. Please state which version of ESPEasy you are using.
2. Confirm the PHP script works. That is to say, validate it without using the ESPEasy device. That way you can determine if the problem is due to the ESPEasy controller settings.
3. Monitor ESPEasy's system log messages. They may help you diagnose the problem.
4. I noticed that the URI in the controller (see last image) is calling the "add.php" script. But the PHP file's name is "add2.php" (see first image).
5. I believe your HTTP controller should be using GET instead of POST. GET carries the request parameter appended in the URI string while POST carries it in the HTTP body.

- Thomas

gorogdaniel
Normal user
Posts: 15
Joined: 21 Feb 2020, 17:33

Re: Generic HTTP Advanced - PHP - MySQL

#3 Post by gorogdaniel » 23 Feb 2020, 11:02

hi,

thank you very much for responding.

i change my php script and test it like you say and now the values are working to put it inside the mysql if i acces directly the link.

http://vps767964.ovh.net/test3.php?temp ... rature2=22

my system info is:
Build:⋄
20104 - Mega
System Libraries:⋄
ESP82xx Core 2.7.0-dev stage, NONOS SDK 2.2.2-dev(bb83b9b), LWIP: 2.1.2 PUYA support
Git Build:⋄
mega-20200204
Plugins:⋄
79 [Normal] [Testing]
Build Time:⋄
Feb 4 2020 23:07:39
Binary Filename:⋄
ESP_Easy_mega-20200204_test_beta_ESP8266_4M1M.bin
and the log is:
31147: HX711: ChanA: -3405674.000
31325: ADC : Analog value: 123 = 1.745
32696: WD : Uptime 1 ConnectFailures 0 FreeMem 14096 WiFiStatus 3
46147: HX711: ChanA: -3405683.000
46328: ADC : Analog value: 123 = 1.745
49135: DS : Temperature: 22.00 (28-41-55-d-21-19-1-b9)
51149: HX711: ChanA: -3405997.000
51337: ADC : Analog value: 123 = 1.745
59377: DS : Temperature: 22.00 (28-41-55-d-21-19-1-b9)
61149: HX711: ChanA: -3406118.000
61329: ADC : Analog value: 123 = 1.745
62694: WD : Uptime 1 ConnectFailures 0 FreeMem 14976 WiFiStatus 3
64497: DS : Temperature: 22.00 (28-41-55-d-21-19-1-b9)
71147: HX711: ChanA: -3406081.000
71334: ADC : Analog value: 123 = 1.745
74741: DS : Temperature: 22.00 (28-41-55-d-21-19-1-b9)
76147: HX711: ChanA: -3406133.000
76328: ADC : Analog value: 123 = 1.745
79863: DS : Temperature: 22.00 (28-41-55-d-21-19-1-b9)
81147: HX711: ChanA: -3405697.000
81331: ADC : Analog value: 123 = 1.745
84982: DS : Temperature: 22.00 (28-41-55-d-21-19-1-b9)
86147: HX711: ChanA: -3405674.000
86347: ADC : Analog value: 124 = 1.760
90102: DS : Temperature: 22.00 (28-41-55-d-21-19-1-b9)
91148: HX711: ChanA: -3405825.000
91323: ADC : Analog value: 124 = 1.760
92694: WD : Uptime 2 ConnectFailures 0 FreeMem 15000 WiFiStatus 3
95222: DS : Temperature: 22.00 (28-41-55-d-21-19-1-b9)
96148: HX711: ChanA: -3405825.000
96331: ADC : Analog value: 123 = 1.745
my actual controller configuration is this:
1.png
1.png (89.42 KiB) Viewed 8733 times
and the device values are here:
2.png
2.png (122.41 KiB) Viewed 8733 times
i dont know what i made wrong but i dont get the values.

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

Re: Generic HTTP Advanced - PHP - MySQL

#4 Post by TD-er » 23 Feb 2020, 11:18

Not sure if it is also applicable to this case, but please test also with the latest build.
There was an issue with URL encoding, which was fixed in the last build.
In short, it did contain too much HEX-encoded characters.
It was reported as an issue in Generic HTTP, but I don't see why it could not also affect the Generic HTTP Advanced plugin.
See this issue: https://github.com/letscontrolit/ESPEasy/issues/2878

gorogdaniel
Normal user
Posts: 15
Joined: 21 Feb 2020, 17:33

Re: Generic HTTP Advanced - PHP - MySQL

#5 Post by gorogdaniel » 23 Feb 2020, 12:54

Thank You very much. I flash to the new version and now it work more or less :D

the esp post data to the database but not the value :))

i have in the database %temperature% not the value of the sensor

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

Re: Generic HTTP Advanced - PHP - MySQL

#6 Post by TD-er » 23 Feb 2020, 16:43

There is no system variable named %temperature%, so you need to use [taskname#varname]
For example if your task is called "bme" and your temp variable is called "T" then use [bme#T] which will then be replaced with the current value of that sensor value.

gorogdaniel
Normal user
Posts: 15
Joined: 21 Feb 2020, 17:33

Re: Generic HTTP Advanced - PHP - MySQL

#7 Post by gorogdaniel » 23 Feb 2020, 18:53

TD-er wrote: 23 Feb 2020, 16:43 There is no system variable named %temperature%, so you need to use [taskname#varname]
For example if your task is called "bme" and your temp variable is called "T" then use [bme#T] which will then be replaced with the current value of that sensor value.
Thanks very much for the greate support.

I pay you a coffe on patreon :D i hope you get it soon ;D

Post Reply

Who is online

Users browsing this forum: No registered users and 61 guests