SendToHTTP not work corectly in mega-20191003

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mackowiakp
Normal user
Posts: 183
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

SendToHTTP not work corectly in mega-20191003

#1 Post by mackowiakp » 03 Oct 2019, 18:00

I am using the following set of rules to support PMSx003 and BMP180. For the purposes of PMSx003 support, I compile my own FW version based on "normal", adding it in the define_plugin_sets.h file _P053_PMSx003.ino and at the same time "commenting" on some unnecessary .ino files/drivers like P1 Gateway etc. So the size of the file after compilation is about 800k.
In addition, I need to use the rule for PMSx003 support because the device driver is not fully implemented yet. In particular, this applies to extending the lifespan of the laser diode.

Code: Select all

//BMP180 related
On Temperatura-i-Barometr#Temperatura do
If [Temperatura-i-Barometr#Temperatura]<60 and [Temperatura-i-Barometr#Cisnienie]<1100
 SendToHTTP 192.168.0.25,8080,/json.htm?type=command&param=udevice&idx=60&nvalue=0&svalue=[Temperatura-i-Barometr#Temperatura];[Temperatura-i-Barometr#Cisnienie];0;0
 SendToHTTP 192.168.0.25,8080,/json.htm?type=command&param=udevice&idx=116&nvalue=0&svalue=[Temperatura-i-Barometr#Temperatura]
 SendToHTTP 192.168.0.25,8080,/json.htm?type=command&param=udevice&idx=117&nvalue=0&svalue=[Temperatura-i-Barometr#Cisnienie]
EndIf
EndOn

// PMS related
On Rules#Timer=4 do 
 gpio,14,0
 gpio,14,1
 gpio,16,1
 timerSet,3,30
endon

On Rules#Timer=3 do
 TaskRun,5
 SendToHTTP 192.168.0.25,8080,/json.htm?type=command&param=udevice&idx=64&nvalue=0&svalue=[Jakosc-powietrza#pm1-0];[Jakosc-powietrza#pm2-5];[Jakosc-powietrza#pm10]
 gpio,16,0
 timerSet,4,240
endon
Up to version 20190926 it worked fine. Version 20190928 I have not tested. In version 20191003 there were additional improvements to WiFi - ADC issue, very importand for me. At the same version, there were changes in the rules and HTTP as release notes stands.
Logs indicate that all SendToHTTP are done correctly but Domoticz does not receive them. As I wrote, up to version 20190926 everything worked fine. So I came back to this version. What the problem it could be?
Last edited by mackowiakp on 04 Oct 2019, 07:05, edited 1 time in total.

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

Re: SendToHTTP not work corectly in mega-20191003

#2 Post by TD-er » 03 Oct 2019, 22:23

What core version do you use?
And about the ADC "fix"... I'm afraid it will not be as well fixed as you hope it would be.

mackowiakp
Normal user
Posts: 183
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: SendToHTTP not work corectly in mega-20191003

#3 Post by mackowiakp » 04 Oct 2019, 06:19

@TD-er. "No bugs, no software" as I heard from IBM DB2 mainframe guru. An other sentence from Cisco. "Cisco has no bugs. Cisco has only undocumented feature". So I noticed "undocumented feature" concerning SendToHTTP.
Whats about "undocumented feature" with WiFi/ADC, since first improvement of this issue, the situation is much, much better. I dont use "sleep" functionality (where the issue is still disturbing as You stated). But my "private" watchdog does not reboots nodeMCU. The one based on "keepalive" send from server to nodeMCU`s, resetting timer. If keepalive was not received during 15 minutes, nodeMCU reboots. So I noticed that there was not such "WiFi hangs" since this first improvement.
I use 2.5.2 core. I'm just compiling the "normal 4M1M" version with the PMS driver added and some other drivers (unnecessary) removed.

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

Re: SendToHTTP not work corectly in mega-20191003

#4 Post by TD-er » 04 Oct 2019, 11:51

You could enable the rules debug to see how the lines are being parsed.

Can you try sending the same request to some Apache web server? Just to see in its logs if the GET request is received.

I notice you are using a minus sign in your variable names. Maybe these are being considered as something that has to be computed?
But then you should not see the SendToHTTP entries in the logs anyway.

You can also store the computed values you use in the URL into a variable using the "let" command and read those when formatting the URL in the sendtohttp command.
This way you can also monitor the stored variables.
You can also log them using the "LogEntry" command.

mackowiakp
Normal user
Posts: 183
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: SendToHTTP not work corectly in mega-20191003

#5 Post by mackowiakp » 05 Oct 2019, 15:54

You could enable the rules debug to see how the lines are being parsed.
Rules are parsed properly. And proper values are included in SendToHTTP command. See at "Device" list. All measurements are done in proper way and placed in appropriate field of sensor:
PMS.png
PMS.png (134.76 KiB) Viewed 1432 times
Can you try sending the same request to some Apache web server? Just to see in its logs if the GET request is received.
Will try but I lost custom FW based on mega-20191003 and still have a problem with Platformio. But its another story. Will ask for help in other topic.
I notice you are using a minus sign in your variable names. Maybe these are being considered as something that has to be computed?
But then you should not see the SendToHTTP entries in the logs anyway.
"Minuses" in variable names does not disturb anything. I use it (see screenshot above) both in "native" sending readouts to Domoticz and in SendToHTTP. In both cases values are proper in easyESP logs. So no computation is done because of this "minuses" in names.
You can also store the computed values you use in the URL into a variable using the "let" command and read those when formatting the URL in the sendtohttp command.
This way you can also monitor the stored variables.
As I wrote, both in "native" sending readouts to Domoticz and in SendToHTTP, values/readouts are proper in easyESP logs.

I have to mention once more that this situation occurs in ver mega-20191003. mega-20190926 works perfectly, even without self reboots.

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

Re: SendToHTTP not work corectly in mega-20191003

#6 Post by TD-er » 05 Oct 2019, 17:01

OK, I will have a look at the changes in ESPeasy since the previous build.
I also had a report of someone else about not working time matching in the last build.
So there is probably something unintentionally changed in the rules parsing.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 13 guests