Testing a Opta WiFi for use in the field, but OTA is not usely possible in the cloud editor.
Since several Opta's needed OTA update is needed.
Power cycle helps sometimes to activat the OTA connection in the Editor.
Have already done what topic (Arduino Opta OTA error during upload - #25 by pennam)" proposed.
Connection for cloud variables works fine.
What am i doeing wrong?
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled 2"
https://create.arduino.cc/cloud/things/f1b9f045-302e-4cc5-b46f-db234dfb79f2
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
int CWaterSpuitGevrTijdCloud;
int CWaterSpuitRestTijdCloud;
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"
unsigned long CurentMillis;
int WaterSpuitGevrTijd;
int SyncWaterSpuitGevrTijd;
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();
//Cloud connection info
ArduinoCloud.addCallback(ArduinoIoTCloudEvent::CONNECT, doThisOnConnect);
ArduinoCloud.addCallback(ArduinoIoTCloudEvent::SYNC, doThisOnSync);
ArduinoCloud.addCallback(ArduinoIoTCloudEvent::DISCONNECT, doThisOnDisconnect);
}
void loop() {
ArduinoCloud.update();
// Your code here
CurentMillis = millis();
//CWaterSpuitGevrTijdCloud
//CWaterSpuitRestTijdCloud
}
void doThisOnConnect(){
Serial.println("Connected");
//Serial.println(testmillis);
Serial.println(CWaterSpuitGevrTijdCloud);
// wacht op deze melding
}
void doThisOnSync(){
Serial.println("synchronized");
//Serial.println(testmillis);
WaterSpuitGevrTijd = CWaterSpuitGevrTijdCloud;
Serial.println(WaterSpuitGevrTijd);
CWaterSpuitGevrTijdCloud = 0;
}
void doThisOnDisconnect(){
Serial.println("Disconnected");
}
/*
Since CWaterSpuitGevrTijdCloud is READ_WRITE variable, onCWaterSpuitGevrTijdCloudChange() is
executed every time a new value is received from IoT Cloud.
*/
void onCWaterSpuitGevrTijdCloudChange() {
// Add your code here to act upon CWaterSpuitGevrTijdCloud change
}
/*
Since CWaterSpuitRestTijdCloud is READ_WRITE variable, onCWaterSpuitRestTijdCloudChange() is
executed every time a new value is received from IoT Cloud.
*/
void onCWaterSpuitRestTijdCloudChange() {
// Add your code here to act upon CWaterSpuitRestTijdCloud change
}