Closed Asdf1qaz closed 1 week ago
So got somewhere with the AQI reading. Its probably due to not using the NTP servers anymore and just relying on the time from the OWM's data?
For the request for the pollution data, it needs to know the 'from' and 'to', written in unix time.
What it is sending is: api.openweathermap.org/data/2.5/air_pollution/history?lat=xxxxxx&lon=xxxxxx&start=-86383&end=16&appid={API key}
So: start=-86383&end=16 It should be something like this: start=1606223802&end=1606482999
I think this is about the end of my brain power today. I will see if I can get anywhere tomorrow though
I didn't pay attention to aqi, but effectively it is sticked to 0 on my station also. I will try to fix this point as soon as possible, based on your analysis that make lots of sense.
I just made a quick fix if you want to have a try. Seems to work but no intensive testing has been done. Modifications are below :
main.cpp (around line 580) rxStatus = getOWMairpollution(client, owm_air_pollution, owm_onecall.current.dt); / AUTO_TZ /
client_utils.cpp (around line 1429)
int getOWMairpollution(WiFiClient &client, owm_resp_air_pollution_t &r, int64_t curdt) // AUTO_TZ
int getOWMairpollution(WiFiClientSecure &client, owm_resp_air_pollution_t &r, int64_t curdt) // AUTO_TZ
(around line 1429) //time_t now; int64_t end = curdt; // AUTO_TZ
client_utils.h (around 67)
int getOWMonecall(WiFiClient &client, owm_resp_onecall_t &r); int getOWMairpollution(WiFiClient &client, owm_resp_air_pollution_t &r, int64_t curdt);
int getOWMonecall(WiFiClientSecure &client, owm_resp_onecall_t &r); int getOWMairpollution(WiFiClientSecure &client, owm_resp_air_pollution_t &r, int64_t curdt);
Looks good from my end too!
If you want, can I make a pull request to make the changes? Never done a pull request, so would like to try. I have also updated the dependencies that muck up the POP (https://github.com/lmarzen/esp32-weather-epd/commit/2567265d69843ad01c24204927f7dc18bc09e22d).
It compiles and works fine, just need to wait for a rainy day to test that though. I will put those updates in a separate pull request if I could
Hay again. First off, the contract thing has been sorted Its just an update zinggjm/GxEPD2 version 1.5.6 ->1.5.8
https://github.com/lmarzen/esp32-weather-epd/issues/119
Second, the AQI for me has never worked. It just always reads 0. Cant understand why as it looks like your code is pretty much the same as Imarzens? When I reuploaded his code, it works fine and reads at 42 now.
I saw that there is a debug mode and enabled it, but cant see where the debug info gets saved to?