blynkkk / blynk-library

Blynk library for IoT boards. Works with Arduino, ESP32, ESP8266, Raspberry Pi, Particle, ARM Mbed, etc.
https://blynk.io
MIT License
3.84k stars 1.39k forks source link

Add OTA support on hardware side #356

Closed doom369 closed 7 years ago

doom369 commented 7 years ago

I just made the basic version of OTA on server-side. There is how it is working right now:

Next request initiates firmware update for specific hardware (in case it is online only): GET http://host/{token}/ota/start

you can also add query param fileName.

As result of above request you'll get BLYNK_INTERNAL command with next body on hardware: ota http://host/static/ota/firmware_ota.bin

where space is nil separator.

Now you can perform regular GET request to get the firmware file. I need a bin file from you to make test.

doom369 commented 7 years ago

@vshymanskyy added upload handler. You can upload file with:

curl \
  -F "file=@/home/user/test.txt" \
  host/upload

instead of host please use QA server host. Request will return path to file, like:

/static/ota/FUp_1014398055299680179_upload.txt

You need to put this file name during ota start:

GET http://host/{token}/ota/start?fileName=FUp_1014398055299680179_upload.txt

vshymanskyy commented 7 years ago

Fixed in https://github.com/blynkkk/blynk-library/commit/4818f3f22c5c7a2e89ed4f6036b4acb0bb3d1e02