Hi,
I figured out what was wrong: I accidentally copied a space at the end of the secret key
This is the solved issue.
I have just gotten a FireBeetle 2 ESP-32E.
I have tried to connect it to Arduino IoT Cloud. But I keep getting these errors:
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to mqtts-up.iot.arduino.cc:8884
ArduinoIoTCloudTCP::handle_ConnectMqttBroker 1 connection attempt at tick time 14357
I can confirm that the wifi on the FireBeetle is working: I uploaded the example “SimpleTime” with my timezone and WiFi Credentials. And I got the current time.
I uploaded this with the Arduino IDE 2.1.0(Mac OSX Monterey 12.6.2). DFrobot’s board package did not work so I used this one.
[Espressif’s Official Arduino Core.](https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json 17)
I have selected Firebeetle ESP -32 as the board because using the FireBeetle 2 ESP-32E doesn’t work.
This is the sketch I uploaded when I got the errors. Note that I did not include the arduino_secrets.h and thingProperties.h in this post.
Thanks in advance.
#include "arduino_secrets.h" // contains wifi credentials and secret key
/*
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
int fanSpeedLevel;
int VOCIndex;
CloudRelativeHumidity relativeHumidity;
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.
*/
#include "thingProperties.h" // include Library for connecting Arduino Cloud
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); //Begin Connection to Arduino Cloud.
/*
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();// Send debug info to Arduino cloud.
}
void loop() {
ArduinoCloud.update();// Update arduino cloud variables.
// Your code here
VOCIndex = 250; // this is just to test if I can send a value to the cloud.
}
/*
Since FanSpeedLevel is READ_WRITE variable, onFanSpeedLevelChange() is
executed every time a new value is received from IoT Cloud.
*/
//You don’t really need to pay attention to this part it’s not really relevant.
//
void onFanSpeedLevelChange() {
// Add your code here to act upon FanSpeedLevel change
if (fanSpeedLevel <= 4) {
if (fanSpeedLevel == 0) {
// Turn of air purifier
} else {
//send turbo
// need for loop
}
}else if(fanSpeedLevel==5){
// do auto mode
}
}