loop()
, connectToWiFi()
, and onOTAEvent()
functions, integrating Edge Impulse API interactions:
loop()
Functionloop()
function regularly checks for updates from the Edge Impulse API.connectToWiFi()
FunctionconnectToWiFi()
function includes a maximum number of attempts to connect to WiFi.onOTAEvent()
FunctiononOTAEvent()
function is triggered when a new update is available, downloading and applying the update.onOTAEvent
function is called, where you can implement the logic to download and update the firmware.