So, now it doesn't seem to work even in Firefox. There is no OTA connection at all. The last time it was unsuccessful at reaching the the cloud from the project, I rebooted the laptop, connected through Arduino Create, and was able to get it to connect. Now that isn't working either.
The device is connected to the cloud as it's sending updates, to the dashboard, we just can't connect through the browser. Seems the cloud IDE functionality has been struggling over the last month and is progressively getting worse ?
Seeing a few others with similar issues ?
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/7ce5686a-0aba-49c7-9f46-9d831495eb75
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
float packVoltage;
int humidity;
int moisture;
int 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_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
int moistPin = A5;
// calibrate moisture sensor
const int AIR_ANALOG = 4095; // calibrate moisture sensor dry state
const int WATER_ANALOG = 3000; // calibrate moisture sensor wet state
#define Sensor A6 // defining the voltage sensor for the 12v battery pack
float vOUT = 0.0; // setting vOUT to zero at start
float vIN = 0.0; // setting vIN to zero at start
float R1=30000.0;//30kohms resistor
float R2=7500.0;//7.5kohms resistor
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
delay(1500);
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
//Get Cloud Info/errors , 0 (only errors) up to 4
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
//Wait to get cloud connection to init the carrier
while (ArduinoCloud.connected() != 1) {
ArduinoCloud.update();
}
delay(1500);
CARRIER_CASE = true;
carrier.begin();
carrier.display.setRotation(0);
delay(1500);
carrier.Relay1.close(); // starting it at low or closed
carrier.Relay2.close(); // starting it at low or closed
pinMode(LED_BUILTIN, OUTPUT); // Set the built-in LED as an output
pinMode(3, OUTPUT); // Set pin 3 the screen backlight as an output
digitalWrite(3, LOW); // setting it to low or off
}
void loop() {
ArduinoCloud.update();
carrier.Buttons.update();
while(!carrier.Light.colorAvailable()) {
delay(5);
}
int none;
temperature = carrier.Env.readTemperature(FAHRENHEIT)-10;
if (temperature > 90) {
carrier.Relay1.open(); //set the fan relay open on at above 90f
}
else if (temperature <= 85) {
carrier.Relay1.close(); // turn the relay - fan off at 85f moisture
}
humidity = carrier.Env.readHumidity();
int raw_moisture = analogRead(moistPin); // read raw moisture value
// map raw moisture value to a scale of 0 to 100 from set constants
moisture = map(raw_moisture, AIR_ANALOG, WATER_ANALOG, 0, 100);
// the moisture relay settings
// open the relay - hose valve when it goes below 40%
if (moisture < 40) {
// Turn on the relay
carrier.Relay2.open(); //set the relay open
}
// turn the relay - valve off at 70% moisture
else if (moisture >= 70) {
// Turn off the relay
carrier.Relay2.close();
}
analogReadResolution(12); // set the sensors analog read resolution to 12 bit - 4095
delay(100);
int value=analogRead (Sensor); // set the analog read of the 12v battery to int value
vOUT = (value *3.3) / 4095.0; // set voltage out to value multiplied the board voltage of 3.3v
vIN = vOUT / (R2/(R1 + R2)); // convert the vOUT to the actual pack voltage
packVoltage = vIN; // set vIN to a cloud variable packVoltage
if (carrier.Buttons.onTouchDown(TOUCH1)) {
carrier.display.fillScreen(ST77XX_BLACK);
carrier.display.setTextColor(ST77XX_WHITE);
carrier.display.setTextSize(4);
carrier.display.setCursor(30, 110);
carrier.display.print("Tem: ");
carrier.display.print(temperature);
}
if (carrier.Buttons.onTouchDown(TOUCH2)) {
carrier.display.fillScreen(ST77XX_BLACK);
carrier.display.setTextColor(ST77XX_WHITE);
carrier.display.setTextSize(4);
carrier.display.setCursor(30, 110);
carrier.display.print("Hu: ");
carrier.display.print(humidity);
carrier.display.print(" %");
}
if (carrier.Buttons.onTouchDown(TOUCH3)) {
carrier.display.fillScreen(ST77XX_BLACK);
carrier.display.setTextColor(ST77XX_WHITE);
carrier.display.setTextSize(4);
carrier.display.setCursor(30, 110);
carrier.display.print("mois: ");
carrier.display.print(moisture);
carrier.display.print(" %");
}
}