I wrote to new Search List Extensions (SLE) but the script is repeated 18 times

51 views
Skip to first unread message

Gianluca Contessa

unread,
Mar 20, 2024, 8:08:54 AMMar 20
to weewx-development
I wrote to new Search List Extensions (SLE). Everything works fine, but I noticed from the weewx log that the script is repeated 18 times, and not just once as it should be. in fact, weewx delays more than a minute to generate the files. I don't understand where is the issue.


Mar 20 10:25:43 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET / HTTP/1.1" 200 12219

Mar 20 10:25:43 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:43 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET /san-giovanni-nepomuceno/ HTTP/1.1" 200 17870

Mar 20 10:25:43 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): my.meteoblue.com:443

Mar 20 10:25:44 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:25:44 CET (1710926744)

Mar 20 10:25:45 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://my.meteoblue.com:443 "GET /images/meteogram?temperature_units=C&wind_units=kmh&precipitation_units=mm&iso2=it&lat=40.6249&lon=15.1035&asl=138&tz=Europe%2FRome&apikey=jhMJTOUVRNvs25m4&lang=it&location_name=Quadrivio&windspeed_units=kmh&sig=019aad2a754640de4dcc7cef14e5a258 HTTP/1.1" 200 82323

Mar 20 10:25:45 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IHDR' 16 13

Mar 20 10:25:45 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'PLTE' 41 768

Mar 20 10:25:45 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'tRNS' 821 256

Mar 20 10:25:45 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'pHYs' 1089 9

Mar 20 10:25:45 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IDAT' 1110 65536

Mar 20 10:25:45 raspberrypi weewxd[11529]: INFO user.richiesta_token: Immagine salvata con successo in /var/www/html/weewx/previsione/previsione.png

Mar 20 10:25:45 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.3bmeteo.com:443

Mar 20 10:25:45 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.3bmeteo.com:443 "GET /meteo/quadrivio HTTP/1.1" 200 None

Mar 20 10:25:46 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): graph.facebook.com:443

Mar 20 10:25:46 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:25:46 CET (1710926746)

Mar 20 10:25:46 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://graph.facebook.com:443 "GET /v19.0/3479353805541966/accounts?access_token=EAATInc3craQBO4TVblpp4l4j6ZB8l6XRLLoWILxwMZAZBGLvfpZARk84dzoFJeI9yuuD5SWu3sv84MeCLe35oXKet3aASFE9ZBwtIZBupstk0RdmQbjZCtvUZCW2F8RZBrfOgB9nTLDjz6MBtwbW6SCxUvZA1lR0z6qDxDri2k4aQA4O5EbcqGLhkUhUekDeTZB7PQZD HTTP/1.1" 200 505

Mar 20 10:25:46 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:46 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET / HTTP/1.1" 200 12219

Mar 20 10:25:46 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:46 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET /san-giovanni-nepomuceno/ HTTP/1.1" 200 17870

Mar 20 10:25:47 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): my.meteoblue.com:443

Mar 20 10:25:47 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://my.meteoblue.com:443 "GET /images/meteogram?temperature_units=C&wind_units=kmh&precipitation_units=mm&iso2=it&lat=40.6249&lon=15.1035&asl=138&tz=Europe%2FRome&apikey=jhMJTOUVRNvs25m4&lang=it&location_name=Quadrivio&windspeed_units=kmh&sig=019aad2a754640de4dcc7cef14e5a258 HTTP/1.1" 200 82323

Mar 20 10:25:47 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IHDR' 16 13

Mar 20 10:25:47 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'PLTE' 41 768

Mar 20 10:25:47 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'tRNS' 821 256

Mar 20 10:25:47 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'pHYs' 1089 9

Mar 20 10:25:47 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IDAT' 1110 65536

Mar 20 10:25:47 raspberrypi weewxd[11529]: INFO user.richiesta_token: Immagine salvata con successo in /var/www/html/weewx/previsione/previsione.png

Mar 20 10:25:47 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.3bmeteo.com:443

Mar 20 10:25:47 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:25:48 CET (1710926748)

Mar 20 10:25:47 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.3bmeteo.com:443 "GET /meteo/quadrivio HTTP/1.1" 200 None

Mar 20 10:25:48 raspberrypi weewxd[11529]: DEBUG user.tablegenerator: Generated tables in 0.01 seconds. refreshed: 0 old used: 17

Mar 20 10:25:48 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): graph.facebook.com:443

Mar 20 10:25:48 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://graph.facebook.com:443 "GET /v19.0/3479353805541966/accounts?access_token=EAATInc3craQBO4TVblpp4l4j6ZB8l6XRLLoWILxwMZAZBGLvfpZARk84dzoFJeI9yuuD5SWu3sv84MeCLe35oXKet3aASFE9ZBwtIZBupstk0RdmQbjZCtvUZCW2F8RZBrfOgB9nTLDjz6MBtwbW6SCxUvZA1lR0z6qDxDri2k4aQA4O5EbcqGLhkUhUekDeTZB7PQZD HTTP/1.1" 200 509

Mar 20 10:25:48 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:48 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET / HTTP/1.1" 200 12219

Mar 20 10:25:49 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:49 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET /san-giovanni-nepomuceno/ HTTP/1.1" 200 17870

Mar 20 10:25:49 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): my.meteoblue.com:443

Mar 20 10:25:49 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://my.meteoblue.com:443 "GET /images/meteogram?temperature_units=C&wind_units=kmh&precipitation_units=mm&iso2=it&lat=40.6249&lon=15.1035&asl=138&tz=Europe%2FRome&apikey=jhMJTOUVRNvs25m4&lang=it&location_name=Quadrivio&windspeed_units=kmh&sig=019aad2a754640de4dcc7cef14e5a258 HTTP/1.1" 200 82323

Mar 20 10:25:49 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IHDR' 16 13

Mar 20 10:25:49 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'PLTE' 41 768

Mar 20 10:25:49 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'tRNS' 821 256

Mar 20 10:25:49 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'pHYs' 1089 9

Mar 20 10:25:49 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IDAT' 1110 65536

Mar 20 10:25:49 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:25:50 CET (1710926750)

Mar 20 10:25:50 raspberrypi weewxd[11529]: INFO user.richiesta_token: Immagine salvata con successo in /var/www/html/weewx/previsione/previsione.png

Mar 20 10:25:50 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.3bmeteo.com:443

Mar 20 10:25:50 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.3bmeteo.com:443 "GET /meteo/quadrivio HTTP/1.1" 200 None

Mar 20 10:25:50 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): graph.facebook.com:443

Mar 20 10:25:51 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://graph.facebook.com:443 "GET /v19.0/3479353805541966/accounts?access_token=EAATInc3craQBO4TVblpp4l4j6ZB8l6XRLLoWILxwMZAZBGLvfpZARk84dzoFJeI9yuuD5SWu3sv84MeCLe35oXKet3aASFE9ZBwtIZBupstk0RdmQbjZCtvUZCW2F8RZBrfOgB9nTLDjz6MBtwbW6SCxUvZA1lR0z6qDxDri2k4aQA4O5EbcqGLhkUhUekDeTZB7PQZD HTTP/1.1" 200 504

Mar 20 10:25:51 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:51 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET / HTTP/1.1" 200 12219

Mar 20 10:25:51 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:51 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET /san-giovanni-nepomuceno/ HTTP/1.1" 200 17870

Mar 20 10:25:52 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): my.meteoblue.com:443

Mar 20 10:25:52 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:25:52 CET (1710926752)

Mar 20 10:25:52 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://my.meteoblue.com:443 "GET /images/meteogram?temperature_units=C&wind_units=kmh&precipitation_units=mm&iso2=it&lat=40.6249&lon=15.1035&asl=138&tz=Europe%2FRome&apikey=jhMJTOUVRNvs25m4&lang=it&location_name=Quadrivio&windspeed_units=kmh&sig=019aad2a754640de4dcc7cef14e5a258 HTTP/1.1" 200 82323

Mar 20 10:25:52 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IHDR' 16 13

Mar 20 10:25:52 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'PLTE' 41 768

Mar 20 10:25:52 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'tRNS' 821 256

Mar 20 10:25:52 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'pHYs' 1089 9

Mar 20 10:25:52 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IDAT' 1110 65536

Mar 20 10:25:52 raspberrypi weewxd[11529]: INFO user.richiesta_token: Immagine salvata con successo in /var/www/html/weewx/previsione/previsione.png

Mar 20 10:25:52 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.3bmeteo.com:443

Mar 20 10:25:52 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.3bmeteo.com:443 "GET /meteo/quadrivio HTTP/1.1" 200 None

Mar 20 10:25:53 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): graph.facebook.com:443

Mar 20 10:25:53 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://graph.facebook.com:443 "GET /v19.0/3479353805541966/accounts?access_token=EAATInc3craQBO4TVblpp4l4j6ZB8l6XRLLoWILxwMZAZBGLvfpZARk84dzoFJeI9yuuD5SWu3sv84MeCLe35oXKet3aASFE9ZBwtIZBupstk0RdmQbjZCtvUZCW2F8RZBrfOgB9nTLDjz6MBtwbW6SCxUvZA1lR0z6qDxDri2k4aQA4O5EbcqGLhkUhUekDeTZB7PQZD HTTP/1.1" 200 506

Mar 20 10:25:53 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:53 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET / HTTP/1.1" 200 12219

Mar 20 10:25:53 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:54 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:25:54 CET (1710926754)

Mar 20 10:25:54 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET /san-giovanni-nepomuceno/ HTTP/1.1" 200 17870

Mar 20 10:25:54 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): my.meteoblue.com:443

Mar 20 10:25:54 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://my.meteoblue.com:443 "GET /images/meteogram?temperature_units=C&wind_units=kmh&precipitation_units=mm&iso2=it&lat=40.6249&lon=15.1035&asl=138&tz=Europe%2FRome&apikey=jhMJTOUVRNvs25m4&lang=it&location_name=Quadrivio&windspeed_units=kmh&sig=019aad2a754640de4dcc7cef14e5a258 HTTP/1.1" 200 82323

Mar 20 10:25:54 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IHDR' 16 13

Mar 20 10:25:54 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'PLTE' 41 768

Mar 20 10:25:54 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'tRNS' 821 256

Mar 20 10:25:54 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'pHYs' 1089 9

Mar 20 10:25:54 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IDAT' 1110 65536

Mar 20 10:25:54 raspberrypi weewxd[11529]: INFO user.richiesta_token: Immagine salvata con successo in /var/www/html/weewx/previsione/previsione.png

Mar 20 10:25:54 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.3bmeteo.com:443

Mar 20 10:25:55 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.3bmeteo.com:443 "GET /meteo/quadrivio HTTP/1.1" 200 None

Mar 20 10:25:55 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): graph.facebook.com:443

Mar 20 10:25:55 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://graph.facebook.com:443 "GET /v19.0/3479353805541966/accounts?access_token=EAATInc3craQBO4TVblpp4l4j6ZB8l6XRLLoWILxwMZAZBGLvfpZARk84dzoFJeI9yuuD5SWu3sv84MeCLe35oXKet3aASFE9ZBwtIZBupstk0RdmQbjZCtvUZCW2F8RZBrfOgB9nTLDjz6MBtwbW6SCxUvZA1lR0z6qDxDri2k4aQA4O5EbcqGLhkUhUekDeTZB7PQZD HTTP/1.1" 200 510

Mar 20 10:25:55 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:55 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET / HTTP/1.1" 200 12219

Mar 20 10:25:56 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:25:56 CET (1710926756)

Mar 20 10:25:56 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:56 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET /san-giovanni-nepomuceno/ HTTP/1.1" 200 17870

Mar 20 10:25:56 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): my.meteoblue.com:443

Mar 20 10:25:56 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://my.meteoblue.com:443 "GET /images/meteogram?temperature_units=C&wind_units=kmh&precipitation_units=mm&iso2=it&lat=40.6249&lon=15.1035&asl=138&tz=Europe%2FRome&apikey=jhMJTOUVRNvs25m4&lang=it&location_name=Quadrivio&windspeed_units=kmh&sig=019aad2a754640de4dcc7cef14e5a258 HTTP/1.1" 200 82323

Mar 20 10:25:56 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IHDR' 16 13

Mar 20 10:25:56 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'PLTE' 41 768

Mar 20 10:25:56 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'tRNS' 821 256

Mar 20 10:25:56 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'pHYs' 1089 9

Mar 20 10:25:56 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IDAT' 1110 65536

Mar 20 10:25:57 raspberrypi weewxd[11529]: INFO user.richiesta_token: Immagine salvata con successo in /var/www/html/weewx/previsione/previsione.png

Mar 20 10:25:57 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.3bmeteo.com:443

Mar 20 10:25:57 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.3bmeteo.com:443 "GET /meteo/quadrivio HTTP/1.1" 200 None

Mar 20 10:25:57 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): graph.facebook.com:443

Mar 20 10:25:57 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:25:58 CET (1710926758)

Mar 20 10:25:58 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://graph.facebook.com:443 "GET /v19.0/3479353805541966/accounts?access_token=EAATInc3craQBO4TVblpp4l4j6ZB8l6XRLLoWILxwMZAZBGLvfpZARk84dzoFJeI9yuuD5SWu3sv84MeCLe35oXKet3aASFE9ZBwtIZBupstk0RdmQbjZCtvUZCW2F8RZBrfOgB9nTLDjz6MBtwbW6SCxUvZA1lR0z6qDxDri2k4aQA4O5EbcqGLhkUhUekDeTZB7PQZD HTTP/1.1" 200 509

Mar 20 10:25:58 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:58 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET / HTTP/1.1" 200 12219

Mar 20 10:25:58 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:25:58 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET /san-giovanni-nepomuceno/ HTTP/1.1" 200 17870

Mar 20 10:25:58 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): my.meteoblue.com:443

Mar 20 10:25:59 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://my.meteoblue.com:443 "GET /images/meteogram?temperature_units=C&wind_units=kmh&precipitation_units=mm&iso2=it&lat=40.6249&lon=15.1035&asl=138&tz=Europe%2FRome&apikey=jhMJTOUVRNvs25m4&lang=it&location_name=Quadrivio&windspeed_units=kmh&sig=019aad2a754640de4dcc7cef14e5a258 HTTP/1.1" 200 82323

Mar 20 10:25:59 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IHDR' 16 13

Mar 20 10:25:59 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'PLTE' 41 768

Mar 20 10:25:59 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'tRNS' 821 256

Mar 20 10:25:59 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'pHYs' 1089 9

Mar 20 10:25:59 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IDAT' 1110 65536

Mar 20 10:25:59 raspberrypi weewxd[11529]: INFO user.richiesta_token: Immagine salvata con successo in /var/www/html/weewx/previsione/previsione.png

Mar 20 10:25:59 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.3bmeteo.com:443

Mar 20 10:25:59 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.3bmeteo.com:443 "GET /meteo/quadrivio HTTP/1.1" 200 None

Mar 20 10:26:00 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:26:00 CET (1710926760)

Mar 20 10:26:00 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): graph.facebook.com:443

Mar 20 10:26:00 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://graph.facebook.com:443 "GET /v19.0/3479353805541966/accounts?access_token=EAATInc3craQBO4TVblpp4l4j6ZB8l6XRLLoWILxwMZAZBGLvfpZARk84dzoFJeI9yuuD5SWu3sv84MeCLe35oXKet3aASFE9ZBwtIZBupstk0RdmQbjZCtvUZCW2F8RZBrfOgB9nTLDjz6MBtwbW6SCxUvZA1lR0z6qDxDri2k4aQA4O5EbcqGLhkUhUekDeTZB7PQZD HTTP/1.1" 200 510

Mar 20 10:26:00 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:26:00 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET / HTTP/1.1" 200 12219

Mar 20 10:26:01 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.santodelgiorno.it:443

Mar 20 10:26:01 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.santodelgiorno.it:443 "GET /san-giovanni-nepomuceno/ HTTP/1.1" 200 17870

Mar 20 10:26:01 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): my.meteoblue.com:443

Mar 20 10:26:02 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:26:02 CET (1710926762)

Mar 20 10:26:02 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://my.meteoblue.com:443 "GET /images/meteogram?temperature_units=C&wind_units=kmh&precipitation_units=mm&iso2=it&lat=40.6249&lon=15.1035&asl=138&tz=Europe%2FRome&apikey=jhMJTOUVRNvs25m4&lang=it&location_name=Quadrivio&windspeed_units=kmh&sig=019aad2a754640de4dcc7cef14e5a258 HTTP/1.1" 200 82323

Mar 20 10:26:02 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IHDR' 16 13

Mar 20 10:26:02 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'PLTE' 41 768

Mar 20 10:26:02 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'tRNS' 821 256

Mar 20 10:26:02 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'pHYs' 1089 9

Mar 20 10:26:02 raspberrypi weewxd[11529]: DEBUG PIL.PngImagePlugin: STREAM b'IDAT' 1110 65536

Mar 20 10:26:02 raspberrypi weewxd[11529]: INFO user.richiesta_token: Immagine salvata con successo in /var/www/html/weewx/previsione/previsione.png

Mar 20 10:26:02 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: Starting new HTTPS connection (1): www.3bmeteo.com:443

Mar 20 10:26:03 raspberrypi weewxd[11529]: DEBUG urllib3.connectionpool: https://www.3bmeteo.com:443 "GET /meteo/quadrivio HTTP/1.1" 200 None

Mar 20 10:26:03 raspberrypi weewxd[11529]: INFO weewx.cheetahgenerator: Generated 18 files for report Belchertown in 46.83 seconds

Mar 20 10:26:03 raspberrypi weewxd[11529]: INFO weewx.reportengine: Copied 5 files to /var/www/html/weewx

Mar 20 10:26:03 raspberrypi weewxd[11529]: DEBUG weewx.manager: Daily summary version is 4.0

Mar 20 10:26:04 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:26:04 CET (1710926764)

Mar 20 10:26:06 raspberrypi weewxd[11529]: INFO weewx.restx: MQTT: Published record 2024-03-20 10:26:06 CET (1710926766)

Mar 20 10:26:06 raspberrypi weewxd[11529]: DEBUG weewx.reportengine: Running report 'FTP'

Mar 20 10:26:06 raspberrypi weewxd[11529]: DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Ftp/skin.conf for report 'FTP'

Mar 20 10:26:06 raspberrypi weewxd[11529]: DEBUG weewx.reportengine: Cannot read localization file /etc/weewx/skins/Ftp/lang/it.conf for report 'FTP': Config file not found: "/etc/weewx/skins/Ftp/lang/it.conf".

Mar 20 10:26:06 raspberrypi weewxd[11529]: DEBUG weewx.reportengine: **** Using defaults instead.

Mar 20 10:26:06 raspberrypi weewxd[11529]: DEBUG weewx.reportengine: Running generators for report 'FTP' in directory '/etc/weewx/skins/Ftp'

Mar 20 10:26:06 raspberrypi weewxd[11529]: DEBUG weeutil.ftpupload: Attempting connection to ftp.meteoquadrivio.altervista.org

Mar 20 10:26:06 raspberrypi weewxd[11529]: DEBUG weeutil.ftpupload: FTP encoding not supported, ignoring.

Mar 20 10:26:06 raspberrypi weewxd[11529]: DEBUG weeutil.ftpupload: Connected to ftp.meteoquadrivio.altervista.org



Tom Keffer

unread,
Mar 20, 2024, 8:37:23 AMMar 20
to Gianluca Contessa, weewx-development
I don't know what I'm looking at. Which messages are from your extension? The HTTP GET? 

If so, we would have to see how it is used to offer an opinion. How is it referenced in your templates? Which templates is it used in?



--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/2c88b9f7-14f8-4721-90e2-d072f8bca9ban%40googlegroups.com.

Gianluca Contessa

unread,
Mar 20, 2024, 9:46:15 AMMar 20
to weewx-development
I created this file with the name request_token.py and put it in etc/weewx/bin/user, as new search_list_extension and everything works fine... but it repeats it several times. this is the file:
import os
import requests
from io import BytesIO
from PIL import Image
import time
import weewx
from bs4 import BeautifulSoup
from weewx.cheetahgenerator import SearchList
from weewx.tags import TimespanBinder
import weeutil.weeutil
import weewx.units
import re
from datetime import datetime
import json
# weewx 4.0+
import weeutil.logger
import logging

log = logging.getLogger(__name__)


class TokenPage(SearchList):
def __init__(self, generator):
SearchList.__init__(self, generator)

def get_extension_list(self, timespan, db_lookup):
ID_utente = self.generator.skin_dict["Extras"]["ID_utente"]
Token_utente = self.generator.skin_dict["Extras"]["Token_utente"]

url = ('https://graph.facebook.com/v19.0/%s/accounts?access_token=%s'
% (ID_utente, Token_utente)
)
response = requests.get(url)
url_immagine = "https://my.meteoblue.com/images/meteogram?temperature_units=C&wind_units=kmh&precipitation_units=mm&iso2=it&lat=40.6249&lon=15.1035&asl=138&tz=Europe%2FRome&apikey=jhMJTOUVRNvs25m4&lang=it&location_name=Quadrivio&windspeed_units=kmh&sig=019aad2a754640de4dcc7cef14e5a258"
cartella_destinazione = "/var/www/html/weewx/previsione"
nome_file = "previsione.png"
# Ottieni il tempo Unix corrente
tempo_unix = int(time.time())
# Converti il tempo Unix in una stringa
stringa_tag = "?=" + str(tempo_unix)

def pulisci_stringa(stringa):
stringa = re.sub(r'\r', '', re.sub(r'\n', '', stringa))
stringa = stringa.replace("'", "'\\''")
return stringa

## Effettua la chiamata HTTP a santo del giorno
url_sito_santo = 'https://www.santodelgiorno.it'
risposta_da_santo = requests.get(url_sito_santo)

if risposta_da_santo.status_code == 200:
soupsanto = BeautifulSoup(risposta_da_santo.text, 'html.parser')

# Specifica la classe del div contenente il paragrafo desiderato
classe_div_sdg = 'SantoDiOggi'
# Trova il div con la classe specificata
div_sdg = soupsanto.find('div', class_=classe_div_sdg)

if div_sdg:
# Trova il link della pagina del santo all'interno del div
href_content = div_sdg.find('a').get('href')
url_santo = url_sito_santo + href_content
# Effettua una richiesta GET alla pagina del santo
risposta_santo = requests.get(url_santo)
soup_santo = BeautifulSoup(risposta_santo.text, 'html.parser')
# Ricava l'URL dell'immagine del santo all'interno del div
url_foto = url_sito_santo + soup_santo.find('img', class_='lazy').get('data-src')
# Trova tutti i div con classe 'SantoDiOggi', salta sino al primo con prima parola "Nome"
i = 0
while True:
div_santos = soup_santo.find_all('div', class_='SantoDiOggi')[i]
prima_parola = div_santos.text.split()[0]
if prima_parola == "Nome:":
break
i += 1
titolo = div_santos.find('b').text.upper()
div_santos = soup_santo.find_all('div', class_='SantoDiOggi')[i+1:i+4]
sottotitolo = ""
for ind, x in enumerate(div_santos):
sottotitolo += x.find('b').text
if ind != len(div_santos) - 1:
sottotitolo += " - "
paragrafo_santo = soup_santo.find('div', id="TestoSanto").text

titolo = pulisci_stringa(titolo)
sottotitolo = pulisci_stringa(sottotitolo)
paragrafo_santo = pulisci_stringa(paragrafo_santo).strip()
paragrafo_santo = paragrafo_santo.replace(" ", " ")
else:
log.error(f"Div con classe '{classe_div_sdg}' non trovato.")
else:
log.error(f"Errore nella richiesta HTTP: {risposta_da_santo.status_code}")

## Effettua la chiamata HTTP a meteoblue
risposta = requests.get(url_immagine)
# Verifica se la chiamata ha avuto successo (status code 200)
if risposta.status_code == 200:
# Crea la cartella se non esiste già
if not os.path.exists(cartella_destinazione):
os.makedirs(cartella_destinazione)

# Leggi l'immagine dal contenuto della risposta
immagine = Image.open(BytesIO(risposta.content))
immagine = immagine.convert('RGBA')
# Salva l'immagine nella cartella specificata con il nome desiderato
percorso_completo = os.path.join(cartella_destinazione, nome_file)
immagine.save(percorso_completo)

log.info(f"Immagine salvata con successo in {percorso_completo}")
else:
log.error(f"Errore nella richiesta HTTP. Status code: {risposta.status_code}")
# Verifica se la richiesta a Facebook è andata a buon fine (status code 200)
if response.status_code == 200:
# Carica il JSON dalla risposta
json_data = response.json()
# Recupera il valore desiderato dal JSON (sostituisci 'chiave' con la chiave effettiva)
token_pagina = json_data['data'][0]['access_token']
ID_pagina = json_data['data'][0]['id']

# Recupera testo dal sito di 3B Meteo
risposta_da_sito = requests.get(url_to_find)

if risposta_da_sito.status_code == 200:
soup = BeautifulSoup(risposta_da_sito.text, 'html.parser')

# Specifica la classe del div contenente il paragrafo desiderato
classe_div_desiderato = 'section-title pad-box'
# Trova il div con la classe specificata
div_desiderato = soup.find('div', class_=classe_div_desiderato)

if div_desiderato:
# Trova il paragrafo all'interno del div
paragrafo = div_desiderato.find('p')

if paragrafo:
testo_paragrafo = paragrafo.get_text()
testo_paragrafo_pulito = pulisci_stringa(testo_paragrafo)
else:
log.debug("Paragrafo non trovato all'interno del div.")
else:
log.debug(f"Div con classe '{classe_div_desiderato}' non trovato.")
else:
log.error(f"Errore nella richiesta HTTP: {risposta_da_sito.status_code}")

## Testo di allerta meteo
# Leggere il file JSON forecast
with open("/var/www/html/weewx/json/forecast.json", "r") as f:
# Carica il contenuto del file JSON
json_file = json.load(f)
# Recupera il valore desiderato dal JSON (alerts)
json_alert = json_file['alerts'][0]['response']
alert_text = ""
ora = datetime.now()
data_odierna = ora.strftime("%Y-%m-%d")
for alert in json_alert:
dt = datetime.fromtimestamp(alert['timestamps']['expires'])
dt_day = dt.strftime("%Y-%m-%d")
if dt_day == data_odierna:
alert_text += alert['details']['name'] + " sino alle " + dt.strftime("%H:%M") + " di oggi" + ". "
else:
alert_text += alert['details']['name'] + " sino al " + dt.strftime("%d/%m/%Y %H:%M") + ". "
## Almanacco
with open("/var/www/html/weewx/json/weewx_data.json", "r") as f:
# Carica il contenuto del file JSON
json_file_weewx = json.load(f)
# Recupera i valori desiderati dal JSON
json_almanac = json_file_weewx['almanac']
text_almanac = "Il Sole sorge alle ore " + json_almanac['sunrise_hour'] + ":" + json_almanac['sunrise_minute'] + " e tramonta alle " + json_almanac['sunset_hour'] + ":" + json_almanac['sunset_minute']

# Emoji Luna
if json_almanac['moon']['moon_index'] == "0":
emoji_luna = "🌑"
elif json_almanac['moon']['moon_index'] == "1":
emoji_luna = "🌒"
elif json_almanac['moon']['moon_index'] == "2":
emoji_luna = "🌓"
elif json_almanac['moon']['moon_index'] == "3":
emoji_luna = "🌔"
elif json_almanac['moon']['moon_index'] == "4":
emoji_luna = "🌕"
elif json_almanac['moon']['moon_index'] == "5":
emoji_luna = "🌖"
elif json_almanac['moon']['moon_index'] == "6":
emoji_luna = "🌗"
elif json_almanac['moon']['moon_index'] == "7":
emoji_luna = "🌘"

# Crea i nuovi tags
search_list_extension = {
'page_token' : token_pagina,
'page_id' : ID_pagina,
'ver_tag' : stringa_tag,
'textp' : testo_paragrafo_pulito,
'allerta' : alert_text,
'testo_almanacco' : text_almanac,
'emoji_luna' : emoji_luna,
'foto_santo' : url_foto,
'testo_santo' : paragrafo_santo,
'titolo_santo' : titolo,
'sottotitolo_santo' : sottotitolo
}
# Finally, return our extension as a list:
return [search_list_extension]
else:
log.error(f"Errore nella richiesta: {response.status_code}")

class RinominaVento(SearchList):
def nomevento(self, vento):
if vento == "N":
return "Nord"
elif vento == "NNE":
return "Nord-NordEst"
elif vento == "NE":
return "NordEst"
elif vento == "E":
return "Est"
elif vento == "ENE":
return "Est-NordEst"
elif vento == "ESE":
return "Est-SudEst"
elif vento == "SE":
return "SudEst"
elif vento == "S":
return "Sud"
elif vento == "SSE":
return "Sud-SudEst"
elif vento == "SSO":
return "Sud-SudOvest"
elif vento == "SO":
return "SudOvest"
elif vento == "OSO":
return "Ovest-SudOvest"
elif vento == "O":
return "Ovest"
elif vento == "ONO":
return "Ovest-NordOvest"
elif vento == "NO":
return "NordOvest"
elif vento == "NNO":
return "Nord-NordOvest"
else:
return "Nessuna"

Gianluca Contessa

unread,
Mar 20, 2024, 9:51:22 AMMar 20
to weewx-development
This is templates: text and photo that I take from an Italian weather site and text and photo that I get from a "saint of the day" site and I publish both in a post on Facebook on my page. To post content you need to request a token page from Facebook, with your personal token.


Il giorno mercoledì 20 marzo 2024 alle 13:37:23 UTC+1 Tom Keffer ha scritto:
pubblica_sdg.sh.tmpl
pubblica.sh.tmpl

Gianluca Contessa

unread,
Mar 20, 2024, 9:56:31 AMMar 20
to weewx-development
the sh files that I get, I run them via crontab every few hours

Il giorno mercoledì 20 marzo 2024 alle 13:37:23 UTC+1 Tom Keffer ha scritto:

Tom Keffer

unread,
Mar 21, 2024, 8:46:11 AMMar 21
to Gianluca Contessa, weewx-development
I'm sorry, but that is way too much custom code for me to debug.

If you don't have a good debugger (I can recommend PyCharm), just put in print statements that print out the stack each time your extension is invoked. It will give you some ideas about what is activating it.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages