Hello. I recently purchased a second router for networking my arduinos and I can get two ESP32s to appear as WiFi clients but none of the units will login or appear on the Cloud. they all have logged in previously with scant problems
Hi @mkebucknorris,
welcome to the arudino-forum.
If you want really help you will have to provide much more detail-information.
what exact type of router ?
configured how to expand your existing network?
running what code?
what exact cloud?
i appreciate the help. the router is a Puli GL-XE300 on tmobile 4g. I'm using it for a 2nd location, no direct link to hom[quote="StefanL38, post:2, topic:1279455, full:true"]
Hi @mkebucknorris,
welcome to the arudino-forum.
If you want really help you will have to provide much more detail-information.
what exact type of router ?
configured how to expand your existing network?
running what code?
what exact cloud?
[/quote]
`type or paste code here`
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled 2"
https://create.arduino.cc/cloud/things/5adfaadd-c740-4422-9b54-0e089bfeefb1
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
bool testLED;
bool testLED2;
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);
pinMode(4, OUTPUT);
pinMode(6,OUTPUT);
/*
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();
}
void loop() {
ArduinoCloud.update();
// Your code here
}
/*
Since TestLED is READ_WRITE variable, onTestLEDChange() is
executed every time a new value is received from IoT Cloud.
*/
void onTestLEDChange() {
if (testLED)
digitalWrite(4, HIGH);
else
digitalWrite(4, LOW);
// Add your code here to act upon TestLED change
}
/*
Since TestLED2 is READ_WRITE variable, onTestLED2Change() is
executed every time a new value is received from IoT Cloud.
*/
void onTestLED2Change() {
if (testLED2)
digitalWrite(6, HIGH);
else
digitalWrite(6, LOW);
// Add your code here to act upon TestLED2 change
}
I think that cut off. Im using the 2nd router for another location, no direct link to my home router. I'm attempting to login to the Arduino IoT Cloud. Thanks
I have zero experience with Arduino IoT-cloud.
What does the documentation say about the function
setDebugMessageLevel(2);
Is parameter 2 the most verbose debug-level that tells all the details?
If not set it to the maximum number.
Have you ever looked into the serial monitor what debug-messages you get?
here your code with a non-blocking timed printing the ArduinoCloud.printDebugInfo();
`type or paste code here`
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled 2"
https://create.arduino.cc/cloud/things/5adfaadd-c740-4422-9b54-0e089bfeefb1
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
bool testLED;
bool testLED2;
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 myDebugTimer;
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);
pinMode(4, OUTPUT);
pinMode(6, OUTPUT);
/*
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();
}
void loop() {
ArduinoCloud.update();
// Your code here
// print debuginfo only once per 1000 milliseconds
if ( TimePeriodIsOver(myDebugTimer, 1000) ) {
ArduinoCloud.printDebugInfo();
}
}
/*
Since TestLED is READ_WRITE variable, onTestLEDChange() is
executed every time a new value is received from IoT Cloud.
*/
void onTestLEDChange() {
if (testLED)
digitalWrite(4, HIGH);
else
digitalWrite(4, LOW);
// Add your code here to act upon TestLED change
}
/*
Since TestLED2 is READ_WRITE variable, onTestLED2Change() is
executed every time a new value is received from IoT Cloud.
*/
void onTestLED2Change() {
if (testLED2)
digitalWrite(6, HIGH);
else
digitalWrite(6, LOW);
// Add your code here to act upon TestLED2 change
}
// easy to use helper-function for non-blocking timing
// explanation see here
// https://forum.arduino.cc/t/example-code-for-timing-based-on-millis-easier-to-understand-through-the-use-of-example-numbers-avoiding-delay/974017
boolean TimePeriodIsOver (unsigned long &startOfPeriod, unsigned long TimePeriod) {
unsigned long currentMillis = millis();
if ( currentMillis - startOfPeriod >= TimePeriod ) {
// more time than TimePeriod has elapsed since last time if-condition was true
startOfPeriod = currentMillis; // a new period starts right here so set new starttime
return true;
}
else return false; // actual TimePeriod is NOT yet over
}
I upped debug to 4 and got this in the serial monitor:
ArduinoIoTCloudTCP::handle_ConnectMqttBroker could not connect to iot.arduino.cc:8884 Error: 5
I solved my problem, the device key was not copying correctly for some reason but I fixed it, odd. I had never used the debug before, thank you!