pivoine31 / esp32-weather-epd-pvmod

L.Marzen ESP32 Weather station software with additional features
GNU General Public License v3.0
0 stars 1 forks source link

AQI Issue and contrast fix #3

Closed Asdf1qaz closed 1 week ago

Asdf1qaz commented 2 weeks ago

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?

Asdf1qaz commented 2 weeks 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

pivoine31 commented 2 weeks ago

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.

pivoine31 commented 2 weeks ago

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 :

Asdf1qaz commented 2 weeks ago

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