hello good day, i was using arduino iot cloud and esp8266 for a project and i needed the cloud's long range communication for long distance viewing of data, and it was working at first however the cloud suddenly doesn't detect the esp8266 anymore, however it still works for arduino ide
Hi @marquisshawn. This is caused by a bug recently introduced into Arduino Cloud that affects uploading IoT Thing, and dashboards sketches to serial ports of ESP32 and ESP8266 boards. The Arduino Cloud developers are aware of the bug and are already working on a fix. I will report back here if I have any news to share regarding a resolution.
For now, please use Arduino IDE when you need to upload Arduino Cloud IoT Thing sketches to ESP32 and ESP8266 boards via the serial port. You can install support for the ESP8266 boards in Arduino IDE by following these instructions.
You can use the Arduino Cloud sketchbook integration feature of Arduino IDE 2.x to get convenient access to all your Arduino Cloud sketches (including Thing sketches) for use in Arduino IDE:
https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-cloud-sketch-sync
You can continue to use Arduino Cloud to set up IoT Devices, Things, and dashboards, to write and compile sketches, and to interact with the Thing via dashboards. The only problem is the inability to upload to the board via the serial port. The bug does not occur when using a non-IoT sketch so you can work with non-IoT sketches in Arduino Cloud, including uploading them to ESP32 and ESP8266 boards, just as always.
hello @ptillisch thank you for the reply, as of now i am trying to upload my code using arduino IDE to the esp8266, however my code from the iiot cloud is causing an error in the ide may I ask for help how to get this done?
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled 2"
https://create.arduino.cc/cloud/things/ecfef63f-e730-4829-b7d8-53c41c5a8b1a
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
float dustDensity;
CloudLength altitude;
CloudLocation coordinates;
CloudTemperature 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.
*/
//dust
int measurePin = A0; // Analog pin for dust sensor (A5 equivalent on ESP32)
int ledPower = 16; // GPIO pin connected to LED power (D12 equivalent on ESP32)
unsigned int samplingTime = 280;
unsigned int deltaTime = 40;
unsigned int sleepTime = 9680;
float voMeasured = 0;
float calcVoltage = 0;
//gps
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = 13, TXPin = 15;// Here we make pin 4 as RX of arduino & pin 3 as TX of arduino
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps;
SoftwareSerial gpsSerial(RXPin, TXPin);
//bme
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#define SEALEVELPRESSURE_HPA (1013.25)
Adafruit_BME280 bme; // I2C BME280 object
//unsigned long delayTime;
// Variables for initial altitude calculation
float initialPressure; // Initial pressure at program start
float initialAltitude; // Initial altitude assumption (e.g., 0 meters)
#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
pinMode(ledPower, OUTPUT);//dust
gpsSerial.begin(GPSBaud); //gps
delay(1500);
//bme.begin
bool status;
// Initialize BME280 sensor
status = bme.begin(0x76);
if (!status) {
Serial.println("Could not find a valid BME280 sensor, check wiring!");
while (1);
}
// Capture initial pressure and calculate initial altitude
initialPressure = bme.readPressure(); // Read initial pressure
initialAltitude = bme.readAltitude(SEALEVELPRESSURE_HPA); // Calculate altitude assuming sea level pressure
Serial.println("-- Default Test --");
//delayTime = 1000; // Set delay time between sensor readings
Serial.println();
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
}
void loop() {
ArduinoCloud.update();
onDustDensityChange();
delay(100);
onGpsChange();
onAltitudeChange();
onTemperatureChange();
// Your code here
}
void onDustDensityChange() {
// Add your code here to act upon DustDensity change
digitalWrite(ledPower, LOW);
delayMicroseconds(samplingTime);
voMeasured = analogRead(measurePin);
delayMicroseconds(deltaTime);
digitalWrite(ledPower, HIGH);
delayMicroseconds(sleepTime);
calcVoltage = voMeasured * (5.0 / 1023); // ESP32 ADC is 12-bit (4096 levels)
dustDensity = 170 * calcVoltage - 0.1;
if (dustDensity < 0) {
dustDensity = 0.00;
}
Serial.print("");
Serial.print("Dust Density:");
Serial.print(dustDensity);
Serial.println("ug/m3");
Serial.print("");
}
void onGpsChange() {
while (gpsSerial.available() > 0)
if (gps.encode(gpsSerial.read()))
displayInfo();
if (millis() > 5000 && gps.charsProcessed() < 10)
{
Serial.println(F("No GPS detected: check wiring."));
while(true);
}
}
void displayInfo()
{
Serial.print(F("Location: "));
if (gps.location.isValid())
{
double lat ;
double lon ;
lat = gps.location.lat();
lon = gps.location.lng();
coordinates = {lat,lon};
// gpsLocation (lat,lon);
// gpsLocation = (gps.location.lat(),gps.location.lng());
Serial.print(gps.location.lat(), 6);
Serial.print(F(","));
Serial.print(gps.location.lng(), 6);
Serial.print("");
}
else
{
Serial.print(F("INVALID"));
}
Serial.print("");
}
/*
Since Temperature is READ_WRITE variable, onTemperatureChange() is
executed every time a new value is received from IoT Cloud.
*/
void onTemperatureChange() {
Serial.print("Temperature = ");
Serial.print(bme.readTemperature());
Serial.println(" *C");
temperature = bme.readTemperature();
}
/*
Since Altitude is READ_WRITE variable, onAltitudeChange() is
executed every time a new value is received from IoT Cloud.
*/
void onAltitudeChange() {
float currentAltitude = bme.readAltitude(SEALEVELPRESSURE_HPA) - initialAltitude;
Serial.print("Current Altitude = ");
Serial.print(currentAltitude);
Serial.println(" m");
altitude = currentAltitude;
}
this is the code I have currently that works on the arduino iot cloud in one of the esp8266, but this code doesn't work for the arduino ide
this is the error message
55 | #include "thingProperties.h"
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: thingProperties.h: No such file or directory
Did you use the Arduino Cloud sketchbook integration feature I mentioned in my previous reply to open the sketch in Arduino IDE, or did you copy it from Cloud Editor?
sorry for the late reply, yes I was able to figure out how to do that thank you very much, I was able to resolve this issue as of now, thank you very much for your help!
You are welcome. I'm glad it is working now.
Regards,
Per
Hello again @marquisshawn. The bug that caused Cloud Editor to not recognize the serial ports of ESP32 and ESP8266 boards has now been fixed. I apologize for any inconvenience this has caused you.
There is one remaining problem you should be aware of: if you have multiple Arduino boards (or other devices that produce serial ports) connected to your computer, Cloud Editor might pick the wrong port to use. I have submitted a report about this problem to the developers. For now, please disconnect any additional Arduino boards from your computer before opening an Arduino Cloud IoT Thing sketch in Cloud Editor when using a serial port to upload to the board.
Please give it a try and let us know if you still have any problems.
A post was split to a new topic: Upload to ESP8266 fails: {runtime.tools.esptool.path}/esptool: no such file or directory
A post was split to a new topic: Arduino Cloud doesn't see port of WEMOS D1 Mini
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.