Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My fix #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

My fix #6

wants to merge 2 commits into from

Conversation

NgDKhanh
Copy link
Contributor

I added OTA function to AirSENSE-IDF system. OTA task reads JSON from server and checks version. If it's a new version, it creates a http client with key is md5_checksome read from JSON.
URL will looks like : http://................/api/get/dataFile?api_key=md5_checksome

Also I add esp_wifi_set_ps(WIFI_PS_NONE); to ensure to disable any WiFi power save mode, this allows best throughput and hence timings for overall OTA operation.

But this version has some small problems:

  • I want to create checkOTA Task when esp32 connect to Wifi for the first time since reboot. And then suspend that task whenever esp32 disconnect to Wifi. But the problem is when OTA downloaded image and write to flash, esp_restart() function doesn't work correctly! It just disconnect esp32 from wifi and stuck there, other tasks (get data from sensor, push data to queue and save data from queue to SD card) still operate !
  • I have a solution that: create a restart task waiting for a semaphore. This semaphore is gived when OTA download and write image to flash done. This task have only 1 function that is esp_restart() and create in main().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant