Hi everyone.
We have a problem uploading sketches to our OPTA devices. Through the USB interface everything works but if we try to load the firmware via "Over-the-Air" we always get the same error which is:
"unable to verify ota: the board didn't answer after reboot"
#include "thingProperties.h"
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
//delay(1500);
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
/*
The following function allows you to obtain more information
related to the state of network and IoT Cloud connection and errors
the higher number the more granular information you’ll get.
The default is 0 (only errors).
Maximum is 4
*/
setDebugMessageLevel(4);
ArduinoCloud.printDebugInfo();
pinMode(LED_D0, OUTPUT);
}
void loop() {
ArduinoCloud.update();
// Your code here
digitalWrite(LED_D0, HIGH);
delay(2000);
digitalWrite(LED_D0, LOW);
delay(2000);
}
/*
Since Variabile is READ_WRITE variable, onVariabileChange() is
executed every time a new value is received from IoT Cloud.
*/
void onVariabileChange() {
// Add your code here to act upon Variabile change
}
1 Like
pennam
June 7, 2023, 10:20am
2
@albertoenvolve are you using ethernet or wifi? Can you share the output of the board serial monitor during the OTA process?
Hi @pennam !!
We are using ethernet for upload and our OPTA is model PLUS with modbus rs485.
I'll send you the output of serial console during OTA process:
Start verifying
/usr/local/bin/arduino-cli compile --fqbn arduino:mbed_opta:opta --libraries /home/builder/opt/libraries/latest --build-cache-path /tmp --output-dir /tmp/127284999/build --build-path /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD -v --library /mnt/create-efs/webide/3d/41/3d41ce93ac353a96bb81c6b48694f9e2:albertoenvolve/libraries_v2/HttpClientEnvolve /tmp/127284999/Prova_Ufficio_may22a
Using board 'opta' from platform in folder: /home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2
Using core 'arduino' from platform in folder: /home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2
Detecting libraries used...
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/defines.txt @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_OPTA -DARDUINO_ARCH_MBED_OPTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated-avr-comp -iprefix/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/includes.txt /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/sketch/Prova_Ufficio_may22a.ino.cpp -o /dev/null
Alternatives for ArduinoIoTCloud.h: [arduinoiotcloud_1_11_1@1.11.1]
ResolveLibrary(ArduinoIoTCloud.h)
-> candidates: [arduinoiotcloud_1_11_1@1.11.1]
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/defines.txt @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_OPTA -DARDUINO_ARCH_MBED_OPTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA -I/home/builder/opt/libraries/latest/arduinoiotcloud_1_11_1/src -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated-avr-comp -iprefix/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/includes.txt /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/sketch/Prova_Ufficio_may22a.ino.cpp -o /dev/null
Alternatives for Arduino_ConnectionHandler.h: [arduino_connectionhandler_0_7_4@0.7.4]
ResolveLibrary(Arduino_ConnectionHandler.h)
-> candidates: [arduino_connectionhandler_0_7_4@0.7.4]
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/defines.txt @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_OPTA -DARDUINO_ARCH_MBED_OPTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA -I/home/builder/opt/libraries/latest/arduinoiotcloud_1_11_1/src -I/home/builder/opt/libraries/latest/arduino_connectionhandler_0_7_4/src -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated-avr-comp -iprefix/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/includes.txt /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/sketch/Prova_Ufficio_may22a.ino.cpp -o /dev/null
Alternatives for WiFi.h: [indhilib_3_0_5@3.0.5 wifinina_1_8_14@1.8.14 wifiespat_1_4_2@1.4.2 wifi_1_2_7@1.2.7 vega_wifinina_1_0_0@1.0.0 da16200_wi_fi_library_for_arduino_1_0_1@1.0.1 WiFi@1.0 seeed_arduino_rpcwifi_1_0_6@1.0.6]
ResolveLibrary(WiFi.h)
-> candidates: [indhilib_3_0_5@3.0.5 wifinina_1_8_14@1.8.14 wifiespat_1_4_2@1.4.2 wifi_1_2_7@1.2.7 vega_wifinina_1_0_0@1.0.0 da16200_wi_fi_library_for_arduino_1_0_1@1.0.1 WiFi@1.0 seeed_arduino_rpcwifi_1_0_6@1.0.6]
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/defines.txt @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_OPTA -DARDUINO_ARCH_MBED_OPTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA -I/home/builder/opt/libraries/latest/arduinoiotcloud_1_11_1/src -I/home/builder/opt/libraries/latest/arduino_connectionhandler_0_7_4/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/WiFi/src -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated-avr-comp -iprefix/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/includes.txt /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/sketch/Prova_Ufficio_may22a.ino.cpp -o /dev/null
Alternatives for SocketHelpers.h: [SocketWrapper@1.0]
ResolveLibrary(SocketHelpers.h)
-> candidates: [SocketWrapper@1.0]
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/defines.txt @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_OPTA -DARDUINO_ARCH_MBED_OPTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA -I/home/builder/opt/libraries/latest/arduinoiotcloud_1_11_1/src -I/home/builder/opt/libraries/latest/arduino_connectionhandler_0_7_4/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/WiFi/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/SocketWrapper/src -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated-avr-comp -iprefix/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/includes.txt /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/sketch/Prova_Ufficio_may22a.ino.cpp -o /dev/null
Alternatives for Ethernet.h: [uipethernet_2_0_12@2.0.12 ethernetenc_2_0_3@2.0.3 ethernet_2_0_2@2.0.2 Ethernet@1.0.0 eventethernet_1_0_0@1.0.0]
ResolveLibrary(Ethernet.h)
-> candidates: [uipethernet_2_0_12@2.0.12 ethernetenc_2_0_3@2.0.3 ethernet_2_0_2@2.0.2 Ethernet@1.0.0 eventethernet_1_0_0@1.0.0]
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/defines.txt @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_OPTA -DARDUINO_ARCH_MBED_OPTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA -I/home/builder/opt/libraries/latest/arduinoiotcloud_1_11_1/src -I/home/builder/opt/libraries/latest/arduino_connectionhandler_0_7_4/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/WiFi/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/SocketWrapper/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/Ethernet/src -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated-avr-comp -iprefix/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/includes.txt /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/sketch/Prova_Ufficio_may22a.ino.cpp -o /dev/null
Alternatives for Arduino_DebugUtils.h: [arduino_debugutils_1_4_0@1.4.0]
ResolveLibrary(Arduino_DebugUtils.h)
-> candidates: [arduino_debugutils_1_4_0@1.4.0]
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/defines.txt @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_OPTA -DARDUINO_ARCH_MBED_OPTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA -I/home/builder/opt/libraries/latest/arduinoiotcloud_1_11_1/src -I/home/builder/opt/libraries/latest/arduino_connectionhandler_0_7_4/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/WiFi/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/SocketWrapper/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/Ethernet/src -I/home/builder/opt/libraries/latest/arduino_debugutils_1_4_0/src -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated-avr-comp -iprefix/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/includes.txt /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/sketch/Prova_Ufficio_may22a.ino.cpp -o /dev/null
Alternatives for ArduinoECCX08.h: [rak5814_atecc608a_1_0_0@1.0.0 arduinoeccx08_1_3_7@1.3.7]
ResolveLibrary(ArduinoECCX08.h)
-> candidates: [rak5814_atecc608a_1_0_0@1.0.0 arduinoeccx08_1_3_7@1.3.7]
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/defines.txt @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_OPTA -DARDUINO_ARCH_MBED_OPTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA -I/home/builder/opt/libraries/latest/arduinoiotcloud_1_11_1/src -I/home/builder/opt/libraries/latest/arduino_connectionhandler_0_7_4/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/WiFi/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/SocketWrapper/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/Ethernet/src -I/home/builder/opt/libraries/latest/arduino_debugutils_1_4_0/src -I/home/builder/opt/libraries/latest/rak5814_atecc608a_1_0_0/src -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated-avr-comp -iprefix/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/includes.txt /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/sketch/Prova_Ufficio_may22a.ino.cpp -o /dev/null
Alternatives for Wire.h: [Wire]
ResolveLibrary(Wire.h)
-> candidates: [Wire]
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/defines.txt @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_OPTA -DARDUINO_ARCH_MBED_OPTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA -I/home/builder/opt/libraries/latest/arduinoiotcloud_1_11_1/src -I/home/builder/opt/libraries/latest/arduino_connectionhandler_0_7_4/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/WiFi/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/SocketWrapper/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/Ethernet/src -I/home/builder/opt/libraries/latest/arduino_debugutils_1_4_0/src -I/home/builder/opt/libraries/latest/rak5814_atecc608a_1_0_0/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/Wire -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated-avr-comp -iprefix/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/includes.txt /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/sketch/Prova_Ufficio_may22a.ino.cpp -o /dev/null
Alternatives for ArduinoMqttClient.h: [arduinomqttclient_0_1_7@0.1.7]
ResolveLibrary(ArduinoMqttClient.h)
-> candidates: [arduinomqttclient_0_1_7@0.1.7]
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/defines.txt @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/cxxflags.txt -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_OPTA -DARDUINO_ARCH_MBED_OPTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA -I/home/builder/opt/libraries/latest/arduinoiotcloud_1_11_1/src -I/home/builder/opt/libraries/latest/arduino_connectionhandler_0_7_4/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/WiFi/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/SocketWrapper/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/Ethernet/src -I/home/builder/opt/libraries/latest/arduino_debugutils_1_4_0/src -I/home/builder/opt/libraries/latest/rak5814_atecc608a_1_0_0/src -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/Wire -I/home/builder/opt/libraries/latest/arduinomqttclient_0_1_7/src -DCM4_BINARY_START=0x60000000 -DCM4_BINARY_END=0x60040000 -DCM4_RAM_END=0x60080000 -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated -I/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino/api/deprecated-avr-comp -iprefix/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/cores/arduino @/home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/variants/OPTA/includes.txt /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/sketch/Prova_Ufficio_may22a.ino.cpp -o /dev/null
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-objcopy -O ihex -R .eeprom /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/Prova_Ufficio_may22a.ino.elf /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/Prova_Ufficio_may22a.ino.hex
Multiple libraries were found for "WiFi.h"
Used: /home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/WiFi
Not used: /home/builder/opt/libraries/indhilib_3_0_5
Not used: /home/builder/opt/libraries/wifinina_1_8_14
Not used: /home/builder/opt/libraries/wifiespat_1_4_2
Not used: /home/builder/opt/libraries/wifi_1_2_7
Not used: /home/builder/opt/libraries/vega_wifinina_1_0_0
Not used: /home/builder/opt/libraries/da16200_wi_fi_library_for_arduino_1_0_1
Not used: /home/builder/opt/libraries/seeed_arduino_rpcwifi_1_0_6
Multiple libraries were found for "ArduinoECCX08.h"
Used: /home/builder/opt/libraries/rak5814_atecc608a_1_0_0
Not used: /home/builder/opt/libraries/arduinoeccx08_1_3_7
Multiple libraries were found for "Ethernet.h"
Used: /home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/Ethernet
Not used: /home/builder/opt/libraries/uipethernet_2_0_12
Not used: /home/builder/opt/libraries/ethernetenc_2_0_3
Not used: /home/builder/opt/libraries/ethernet_2_0_2
Not used: /home/builder/opt/libraries/eventethernet_1_0_0
Using library arduinoiotcloud_1_11_1 at version 1.11.1 in folder: /home/builder/opt/libraries/arduinoiotcloud_1_11_1
Using library arduino_connectionhandler_0_7_4 at version 0.7.4 in folder: /home/builder/opt/libraries/arduino_connectionhandler_0_7_4
Using library WiFi at version 1.0 in folder: /home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/WiFi
Using library SocketWrapper at version 1.0 in folder: /home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/SocketWrapper
Using library Ethernet at version 1.0.0 in folder: /home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/Ethernet
Using library arduino_debugutils_1_4_0 at version 1.4.0 in folder: /home/builder/opt/libraries/arduino_debugutils_1_4_0
Using library rak5814_atecc608a_1_0_0 at version 1.0.0 in folder: /home/builder/opt/libraries/rak5814_atecc608a_1_0_0
Using library Wire in folder: /home/builder/.arduino15/packages/arduino/hardware/mbed_opta/4.0.2/libraries/Wire (legacy)
Using library arduinomqttclient_0_1_7 at version 0.1.7 in folder: /home/builder/opt/libraries/arduinomqttclient_0_1_7
Using library arduino_portenta_ota_1_1_3 at version 1.1.3 in folder: /home/builder/opt/libraries/arduino_portenta_ota_1_1_3
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-size -A /tmp/arduino-build-B7DD1CAC2CF1616CE28467AC0B90B4FD/Prova_Ufficio_may22a.ino.elf
Sketch uses 546180 bytes (69%) of program storage space. Maximum is 786432 bytes.
Global variables use 92952 bytes (17%) of dynamic memory, leaving 430672 bytes for local variables. Maximum is 523624 bytes.
Start Uploading sketch Prova_Ufficio_may22a Over-the-Air
Unable to verify OTA: the board didn't answer after reboot
tnhks in advance!!
pennam
June 7, 2023, 10:38am
4
@albertoenvolve the log you have posted is the build log. The serial monitor log is accessible with this button
can you also try to run this example?
Arduino_Portenta_OTA/OTA_Qspi_Flash_Ethernet.ino at main · arduino-libraries/Arduino_Portenta_OTA · GitHub
It performs an ota and should make your opta LEDs blink red blue and green
pennam
June 7, 2023, 11:26am
5
@albertoenvolve I also recommend you to remove the blocking delay in your loop and use something like this:
pennam:
mething like this:
hi i got this on serial console using your code :
Attempting to connect to the network ...
Connected
Initializing OTA storage
Error while opening the certificate file.
Arduino_Portenta_OTA::begin() failed with error code -9
pennam
June 7, 2023, 12:13pm
7
you need to run this sketch to upload network certificates inside the board:
#include "QSPIFBlockDevice.h"
#include "MBRBlockDevice.h"
#include "FATFileSystem.h"
#include "wiced_resource.h"
#include "certificates.h"
#ifndef CORE_CM7
#error Update the WiFi firmware by uploading the sketch to the M7 core instead of the M4 core.
#endif
QSPIFBlockDevice root(QSPI_SO0, QSPI_SO1, QSPI_SO2, QSPI_SO3, QSPI_SCK, QSPI_CS, QSPIF_POLARITY_MODE_1, 40000000);
mbed::MBRBlockDevice wifi_data(&root, 1);
mbed::FATFileSystem wifi_data_fs("wlan");
long getFileSize(FILE *fp) {
fseek(fp, 0, SEEK_END);
int size = ftell(fp);
fseek(fp, 0, SEEK_SET);
return size;
This file has been truncated. show original
The sketch will load also the WiFi firmware but you don't have to worry about it
2 Likes
Hi @pennam , we've run the sketch that you mentioned and the log was the following:
Attempting to connect to the network ...
Connected
Initializing OTA storage
Starting download to QSPI ...
97861 bytes stored.
Decompressing LZSS compressed file ...
125376 bytes decompressed.
Storing parameters for firmware update in bootloader accessible non-volatile memory ...
Performing a reset after which the bootloader will update the firmware.
Hint: Board LED will blink Red-Blue-Green.
What we have to do now?
Thanks
pennam
June 7, 2023, 12:50pm
9
@albertoenvolve Great! Are the LEDs blinking red blue and green? If yes the OTA process has been successful.
You can now retry an OTA using the IoT Cloud platform
d55m14
July 12, 2023, 9:41am
11
Hi I'm receiving the error :
Binary not received by the board: board not found,
while upload sketch via OTA with no USB connection to PC. The OPTA is connected to internet in Wi-Fi but I've tried with ethernet connection too.
With USB connection to PC all is working correctly.
Any suggestion ? tnks
pennam
July 26, 2023, 3:14pm
12
@d55m14 i've made a test and OTA works without issues also if the board is not connected to a PC. Make sure your update sketch do not have something like this in your setup() function:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
d55m14
July 27, 2023, 1:30pm
13
I don't have "while (!Serial).
I'm receiving now the following error :
Error received during OTA: Error code -5
I noticed that under the IDE the compiler is using hw-platform mbed_opta 4.0.4 while the online compiler uses the 4.0.2. May be the problem is this ?
tnks
pennam
July 27, 2023, 1:57pm
14
No this is not an issue
This means that the board is failing to download the OTA update file, specifically there is something wrong in the OTA file header.
Can you please retry?
d55m14
July 27, 2023, 2:26pm
15
I've retried ... same problem but error code -8
I've hw reset the opta too.
these are the first lines of sketch code :
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/ac7e0428-d65d-4e88-ace2-xxxxxxxxxx
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
String lastupdate;
float batcharge;
float batdischarge;
float loadgym;
float pvgen;
int gymonfv;
CloudSchedule scheduleon;
bool sourcefv;
bool sourcerete;
Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
which are called when their values are changed from the Dashboard.
These functions are generated with the Thing and added at the end of this sketch.
*/
#include "thingProperties.h"
// Sketch to manage fv energy for the gym
#include <ArduinoModbus.h>
#include <ArduinoRS485.h> // ArduinoModbus depends on the ArduinoRS485 library
#include <NTPClient.h>
Is it possible to activate any detailed debugging log ?
I've used the memory partition sketch at this link :
tnks
1 Like
pennam
July 28, 2023, 2:44pm
16
@d55m14 looks like your QSPI flash is not formatted correctly; can you please try to reformat it using this sketch selecting partition scheme 1.
#include "QSPIFBlockDevice.h"
#include "MBRBlockDevice.h"
#include "LittleFileSystem.h"
#include "FATFileSystem.h"
#ifndef CORE_CM7
#error Format QSPI flash by uploading the sketch to the M7 core instead of the M4 core.
#endif
QSPIFBlockDevice root(QSPI_SO0, QSPI_SO1, QSPI_SO2, QSPI_SO3, QSPI_SCK, QSPI_CS, QSPIF_POLARITY_MODE_1, 40000000);
mbed::MBRBlockDevice wifi_data(&root, 1);
mbed::MBRBlockDevice ota_data(&root, 2);
mbed::MBRBlockDevice user_data(&root, 3);
mbed::FATFileSystem wifi_data_fs("wlan");
mbed::FATFileSystem ota_data_fs("fs");
mbed::FileSystem * user_data_fs;
bool waitResponse() {
bool confirmation = false;
This file has been truncated. show original
then you need to reupload the network certificates using this sketch:
#include "QSPIFBlockDevice.h"
#include "MBRBlockDevice.h"
#include "FATFileSystem.h"
#include "wiced_resource.h"
#include "certificates.h"
#ifndef CORE_CM7
#error Update the WiFi firmware by uploading the sketch to the M7 core instead of the M4 core.
#endif
QSPIFBlockDevice root(QSPI_SO0, QSPI_SO1, QSPI_SO2, QSPI_SO3, QSPI_SCK, QSPI_CS, QSPIF_POLARITY_MODE_1, 40000000);
mbed::MBRBlockDevice wifi_data(&root, 1);
mbed::FATFileSystem wifi_data_fs("wlan");
long getFileSize(FILE *fp) {
fseek(fp, 0, SEEK_END);
int size = ftell(fp);
fseek(fp, 0, SEEK_SET);
return size;
This file has been truncated. show original
If you want, before running an OTA from IoTCloud you could test it just using this sketch:
/*
* This example demonstrates how to use to update the firmware of the Arduino Portenta H7 using
* a firmware image stored on the QSPI.
*
* Steps:
* 1) Create a sketch for the Portenta H7 and verify
* that it both compiles and works on a board.
* 2) In the IDE select: Sketch -> Export compiled Binary.
* 3) Create an OTA update file utilising the tools 'lzss.py' and 'bin2ota.py' stored in
* https://github.com/arduino-libraries/ArduinoIoTCloud/tree/master/extras/tools .
* A) ./lzss.py --encode SKETCH.bin SKETCH.lzss
* B) ./bin2ota.py PORTENTA_H7_M7 SKETCH.lzss SKETCH.ota
* 4) Upload the OTA file to a network reachable location, e.g. OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota
* has been uploaded to: http://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota
* 5) Perform an OTA update via steps outlined below.
*/
/******************************************************************************
* INCLUDE
******************************************************************************/
This file has been truncated. show original
and finally if everything works, LED blinks red green and blue, you can retry an OTA from ArduinoIoTCloud.
d55m14
July 28, 2023, 9:06pm
17
Hi pennam,
I executed the step you suggested : I changed the last step with the sketch "OTA_Qspi_Flash_Ethernet" as I'm using the OPTA ethernet connection to internet and LED blinks red green and blue.
But I receive the same error when I try to OTA my sketch.
For your info : I'm using a OPTA device with RS485 and Ethernet port , no wi-fi. Is it a problem ?
Is it possible to trace the upload process from cloud to Opta ?
tnks
pennam
July 31, 2023, 1:08pm
18
should not be a problem if during device creation you have selected the Ethernet interface. Once selected a network interface, othernet or wifi, if you want to change it you have to delete the old device and create a new one.
I've made an OTA test also using ethernet and is working fine, so i think that maybe the issue is in your sketch... can you please try to do a simple ota with a basic sketch like this?
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/a9efdf97-90b6-435c-9788-d9613e9e278f
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
int counter;
Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
which are called when their values are changed from the Dashboard.
These functions are generated with the Thing and added at the end of this sketch.
*/
#include "thingProperties.h"
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
delay(1500);
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
/*
The following function allows you to obtain more information
related to the state of network and IoT Cloud connection and errors
the higher number the more granular information you’ll get.
The default is 0 (only errors).
Maximum is 4
*/
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
}
void loop() {
ArduinoCloud.update();
// Your code here
Serial.println("OTA works");
delay(1000);
}
/*
Since Counter is READ_WRITE variable, onCounterChange() is
executed every time a new value is received from IoT Cloud.
*/
void onCounterChange() {
// Add your code here to act upon Counter change
}
d55m14
August 2, 2023, 1:20pm
19
Hi pennam,
i did some tests. With simple sketch the OTA seems OK but as I add some new instructions I get the following messages :
08:52:37.689 -> ArduinoIoTCloudTCP::onRequest _ota_url = https://api2.arduino.cc/iot/ota/6420b65c-320a-4b58-b5e2-e9cec503afb5
08:52:38.001 -> Arduino_Portenta_OTA_QSPI::decompress() failed with -5
As I get this messages I can't OTA any more also if I use the previous sketch : only again re-partitioning the device i can OTA correctly.
Have you any suggestion ?
tnks
pennam
August 23, 2023, 6:54am
20
@d55m14 looks like your new instructions are corrupting the QSPI flash. What exactly have you added yo your sketch?