Custom service (HTTP request) - pywws sending the same data over and over

20 views
Skip to first unread message

Steen Eiler Jørgensen

unread,
Feb 20, 2021, 10:43:53 AM2/20/21
to pywws
Based on the temperaturnu template, I've made a module to send a HTTP request to my Node-RED server. It receives the data fine enough, and returns a 200 status code to the pywws module.

But after a while I discovered that it's the same data point it's sending over and over. I've pu ['data'] in the live-section of weather.ini, and when I start pywws-livelog -vvv /home/pi/weather/data, I get

16:37:08:urllib3.connectionpool:http://data:1880 "GET /wx?json=%7B'pressure_abs_hpa':%20'940.8',%20'rain_mm':%20'0.0',%20'rain_last_24hours_mm':%20'0.0',%20'idx':%20'2021-02-20%2015:16:05',%20'wind_ave_mps':%20'0.00',%20'rain_last_hour_mm':%20'0.0',%20'temp_out_c':%20'6.1',%20'rain_day_mm':%20'0.0',%20'wind_gust_mps':%20'0.00',%20'hum_in':%20'39',%20'wind_chill_c':%20'6.1',%20'pressure_rel_hpa':%20'940.8',%20'temp_in_c':%20'24.9'%7D HTTP/1.1" 200 328
16:37:08:data:server response "{"json":"{'pressure_abs_hpa': '940.8', 'rain_mm': '0.0', 'rain_last_24hours_mm': '0.0', 'idx': '2021-02-20 15:16:05', 'wind_ave_mps': '0.00', 'rain_last_hour_mm': '0.0', 'temp_out_c': '6.1', 'rain_day_mm': '0.0', 'wind_gust_mps': '0.00', 'hum_in': '39', 'wind_chill_c': '6.1', 'pressure_rel_hpa': '940.8', 'temp_in_c': '24.9'}"}"
16:37:09:pywws.weatherstation:live_data new data
16:37:09:pywws.regulartasks:doing task sections ['live']
16:37:09:pywws.weatherstation:delay 1, pause 41.0509
16:37:48:urllib3.connectionpool:Starting new HTTP connection (1): data:1880

over and over. The time is always 15:16:05 even here almost half an hour later. And the values never change.

What am I overlooking?

Jim Easterbrook

unread,
Feb 20, 2021, 10:52:32 AM2/20/21
to py...@googlegroups.com
On 20/02/2021 15:40, Steen Eiler Jørgensen wrote:
> Based on the temperaturnu template, I've made a module to send a HTTP
> request to my Node-RED server. It receives the data fine enough, and
> returns a 200 status code to the pywws module.
>
> But after a while I discovered that it's the same data point it's
> sending over and over.

[snip]

> The time is always 15:16:05 even here almost half an hour
> later. And the values never change.
>
> What am I overlooking?

Did you keep the #live# directive at the start of the template in your
module?
--
Jim Easterbrook <http://www.jim-easterbrook.me.uk/>

Steen Eiler Jørgensen

unread,
Feb 21, 2021, 11:25:07 AM2/21/21
to pywws
A-ha. That was it. Thanks! :-)
Reply all
Reply to author
Forward
0 new messages