I am experimenting with the Arduino Cloud after a long break from it. I have a Portenta H7 connected via USB to my computer (which is how I have uploaded sketches to it) and it is also connected via the ESLOV connector to the Nicla Sense ME. When I attempt to upload the sketch over the air it verifies/starts uploading like normal with the status: "Start Uploading sketch Portenta-NiclaSenseME_aug15a Over-the-Air" A little while later it gives the error Unable to verify OTA: the board didn't answer after reboot
Code:
// ArduinoIoTCloud - Version: 1.7.0
#include <ArduinoIoTCloud.h>
/*
Sketch generated by the Arduino IoT Cloud Thing "Portenta-NiclaSenseME"
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
String BSECData;
float airQuality;
float temperature;
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"
#include "Arduino_BHY2Host.h"
Sensor tempSensor(SENSOR_ID_TEMP);
SensorBSEC bsec(SENSOR_ID_BSEC);
void setup() {
Serial.begin(9600);
delay(1500);
Serial.print("Configuring the Arduino IoT Cloud");
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
Serial.println("Connecting to the Arduino IoT Cloud");
while (ArduinoCloud.connected() != 1) {
ArduinoCloud.update();
delay(500);
}
delay(1500);
Serial.println("Initializing the connection to the Nicla");
BHY2Host.begin(false, NICLA_VIA_ESLOV);
tempSensor.configure(1, 0);
bsec.configure(1, 0);
temperature = tempSensor.value();
airQuality = bsec.iaq();
ArduinoCloud.printDebugInfo();
}
void loop() {
// Your code here
BHY2Host.update();
temperature = tempSensor.value();
// Serial.print("Value: ");
// Serial.println(temperature);
airQuality = bsec.iaq_s();
// Serial.print("Air Quality: ");
// Serial.println(airQuality);
// added extra to test if the upload worked
BSECData = bsec.toString() + " UPLOAD WORKS";
ArduinoCloud.update();
}
/*
Since temperature is READ_WRITE variable, onTemperatureChange() is
executed every time a new value is received from IoT Cloud.
*/
void onTemperatureChange() {
// Add your code here to act upon temperature change
}
/*
Since AirQuality is READ_WRITE variable, onAirQualityChange() is
executed every time a new value is received from IoT Cloud.
*/
void onAirQualityChange() {
// Add your code here to act upon AirQuality change
}
/*
Since BSECData is READ_WRITE variable, onBSECDataChange() is
executed every time a new value is received from IoT Cloud.
*/
void onBSECDataChange() {
// Add your code here to act upon BSECData change
}
Browser: Chrome (Version 104.0.5112.82 (Official Build) (64-bit))
OS: WIndows 10 build 19044
Create Agent: Version 1.2.6
Edit: Previous error was error -1.0000
Edit 2: With a blank sketch it still does not upload. (Binary not received by the board: board not found)
HI @smallguy89,
Could you please check which bootloader version is installed on your portenta running this sketch ?
For portenta you need at least bootloader version 22
You need also to make sure the OTA partition of your QSPI flash is writable and correctly formatted since the update binary have to be stored there. To reformat your qspi flash you can use this sketch and select layout 1:
If you are still unable to perform an OTA it would be very useful to enable the debug output of ArduinoIoTCloud library uncommenting this line
setting debug level to 4 in your setup function, upload the new sketch with debug enabled through serial port and retry OTA.
The serial monitor will print some additional debug info that we can use to understand the issue.
Magic Number (validation): a0
Bootloader version: 21
Clock source: External oscillator
USB Speed: USB 2.0/Hi-Speed (480 Mbps)
Has Ethernet: Yes
Has WiFi module: Yes
RAM size: 8MB
QSPI size: 16 MB
Has Video output: Yes
Has Crypto chip: Yes
Arduino loader
Magic Number (validation): a0
Bootloader version: 23
Clock source: External oscillator
USB Speed: USB 2.0/Hi-Speed (480 Mbps)
Has Ethernet: Yes
Has WiFi module: Yes
RAM size: 8MB
QSPI size: 16 MB
Has Video output: Yes
Has Crypto chip: Yes
Running QSPI sketch
Available partition schemes:
Partition scheme 1
Partition 1: WiFi firmware and certificates 1MB
Partition 2: OTA and user data 13MB
Partition scheme 2
Partition 1: WiFi firmware and certificates 1MB
Partition 2: OTA 5MB
Partition 3: User data 8MB
Do you want to use partition scheme 1? Y/[n]
If No, partition scheme 2 will be used.
WARNING! Running the sketch all the content of the QSPI flash will be erased.
Do you want to proceed? Y/[n]
QSPI Flash formatted!
It's now safe to reboot or disconnect your board.
Testing with blank Cloud sketch...
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
- No variables have been created, add cloud variables on the Thing Setup page
to see them declared here
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(4);
ArduinoCloud.printDebugInfo();
}
void loop() {
ArduinoCloud.update();
// Your code here
}
Gave error about wifi firmware, ran the updater sketch. Firmware updated successfully, uploaded blank sketch again via USB
Arduino Cloud shows the board as online:
Uploading OTA... Binary not received by the board: board not found
EDIT: while attempting the full sketch with the Nicla it worked... IDK why but it did. I commented out the delay after Serial.begin(9600)