-
Notifications
You must be signed in to change notification settings - Fork 39
Settings validation #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Settings validation #157
Conversation
b79a655 to
8d5517f
Compare
|
Memory usage change @ 8d5517f
Click for full report table
Click for full report CSV |
The objective of those flags is to verify that connection handlers that require settings to be provided before starting them properly configured.
By providing stub empty definition of DEBUG_* macro utility for AVR platform we aim to remove all the ifdefs in WiFiConnectionHandler::update_handleInit() function thus improving itse readability
the objective of the check state is to validate the configuration of the connection handler before going into the init state. For the time being the only valid check is to wait for settings to be provided if required. WiFiConnectionHandler splits the init state into check and init
8d5517f to
671669f
Compare
|
Memory usage change @ 671669f
Click for full report table
Click for full report CSV |
|
@tidjidi can you try this PR? This should address the issue |
|
Hi @andreagilardoni |
|
That is quite odd to me, I don't see any "Provided empty ssid, please provide a valid one", the issue could be somewhere else... Can you try a simple sketch, like the following one? Please provide your ssid and password. #include "WiFiS3.h"
#include "IPAddress.h"
char ssid[] = "SSID";
char pass[] = "PASSWORD";
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
int status;
// check for the WiFi module:
if ((status = WiFi.status()) == WL_NO_MODULE) {
Serial.println("Communication with WiFi module failed!");
// don't continue
while (true);
}
String fv = WiFi.firmwareVersion();
if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
Serial.println("Please upgrade the firmware");
}
// attempt to connect to WiFi network:
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network.
status = WiFi.begin(ssid, pass);
Serial.println(status);
}
printWifiStatus();
}
void loop() { }
void printWifiStatus() {
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your board's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("signal strength (RSSI):");
Serial.print(rssi);
Serial.println(" dBm");
} |
|
Hi @andreagilardoni . Sorry I didn't see your message before now... |
|
Well ! I tried the sketch you provide, but despite it answers that the UNO is connected, it's not! My router does not mention any connection of the UNO... With my sketch (based on the Arduino cloud connection), the UNO is identified in the router Addendum: I slightly modified the sketch, adding in void loop() {
if (millis() - start >= 5000) {
Serial.print("local IP : ");
IPAddress ip = WiFi.localIP();
Serial.println(ip);
while(1);
}
}This times, I got an IP@... |
|
Hello @andreagilardoni , where the important part is : |
|
Hi @tidjidi, did you apply the changes from this PR in the last comment? In the case of empty SSID this should print "Provided empty ssid, please provide a valid one" The RSSI value (-70dBm) is in between a okay value and a not good value, this could explain why you have some connection trials before achieving a proper connection. This value may be good for a PC with bigger antennas, but the esp32 antenna is quite smaller. |
|
Hi @andreagilardoni . No, this last message (and log) was with the "official" Arduino_ConnectionHandler library release (1.2.0). About the bad RSSI (-70dB), that's also odd! I am with the UNO just besides of my router box (of course with an excellent RSSI); but the borad chose to connect to my repeater which is on the other part of my house. Sure! It's the same SSID, but I'm surprised in prefered the further AP... Cheers |
|
Thank you, that is odd, I would also expect the esp to connect to the BSSID with the best RSSI in range... I will look into the wifi driver and verify that this properly configured. |
The objective of this PR is to improve settings validation inside of connection handlers.
CHECKis added, which waits for settings provisioning (if required by the handler) before going into theINITstateCHECKstate can also be overridden and add checks for hw validity, like done in wifi connection handler