libretiny-eu / libretiny

PlatformIO development platform for IoT modules
http://docs.libretiny.eu/
MIT License
410 stars 61 forks source link

Configure OTA on wblc5 (BK7231T) #289

Open raulzanardo opened 3 months ago

raulzanardo commented 3 months ago

How do configure the platformio.ini file to use the OTA upload protocol?

Cossid commented 3 months ago

You can use the generic-bk7231t-qfn32-tuya board for the WBLC5 board, https://docs.libretiny.eu/boards/generic-bk7231t-qfn32-tuya/

raulzanardo commented 3 months ago

Ok, but how do configure the upload protocol for it to be OTA?

I cant find any documentation about the upload_protocol of the platformio.ini file

Cossid commented 3 months ago

I don't know that OTA in particular is a part of platformio, as it is more an implementation detail, not low-level.

platformio is expecting UART; https://docs.libretiny.eu/docs/flashing/platformio/#using-ltchiptool-wired-via-uart

I'll defer to @kuba2k2 to expand further.

kuba2k2 commented 3 months ago

If by "OTA" you're referring to the wireless update over Wi-Fi, then no, PlatformIO doesn't have that built-in. In fact, to best of my knowledge, PlatformIO doesn't have that feature on any supported platform.

If you want to upload your firmware via Wi-Fi, you will need to use the Update Arduino library. The library is very similar to ESP32's equivalent, it's meant to be a drop-in replacement. See docs:

The upload_protocol is not used and shouldn't be changed - it defaults to uart, no other protocol is currently supported.