airgradienthq / arduino

Firmware of open-source hardware air quality monitors AirGradient ONE (indoor) and AirGradient Open Air (outdoor).
https://www.airgradient.com/documentation/
Other
220 stars 114 forks source link

Feat/ag-client-timeout #232

Closed samuelbles07 closed 2 months ago

samuelbles07 commented 2 months ago

Updates

  1. Set default http request timeout to 10s on AgApiClient class
  2. New AgApiClient member to set http request timeout from the caller
  3. Fix AgApiClient::postToServer uri formatting not using apiRoot
nick-4711 commented 2 months ago

Can you also post a log where we can see that it works?

samuelbles07 commented 2 months ago

Sure @nick-4711 . On left terminal is serial monitor from airgradient monitor and on the right side is dummy webserver.

  1. Failed on purpose → Give delay for 5s on server side and on client timeout is set to 3s.

failed

  1. Success GET → Delay for 10s on client side and 8s delay on server site for GET request

GET

  1. Success POST → Delay for 10s on client side and 8s delay on server site for POST request

POST