-
Notifications
You must be signed in to change notification settings - Fork 191
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
Credentials not saved or loaded correctly #388
Comments
After some more debugging I found that AutoConnectCredential::del() doesn't delete the flag for DHCP or Static IP. When using DHCP the byte is set to 0x00. After the first entry is deleted, the SSID of the second entry is preluded with 0x00. Because the del() function looks for the first 0x00 when deleting the SSID or password, the second entry SSID does not get deleted as it immediately encounters 0x00. This means that the while loop for deleting the password actually deletes the SSID. This bug results in the entry not being fully deleted. I solved the issue by replacing // Erase ip configuration extention
if (_eeprom->read(_dp) == STA_STATIC) {
for (uint8_t i = 0; i < sizeof(station_config_t::_config); i++)
_eeprom->write(_dp++, 0xff);
} with if (_eeprom->read(_dp) == STA_STATIC) {
for (uint8_t i = 0; i < sizeof(station_config_t::_config); i++)
_eeprom->write(_dp++, 0xff);
}
_eeprom->write(_dp++, 0xff); In AutoConnectCredential.cpp |
It is incorrect instantiation of AutoConnectCredentail. I'm sure, I have mentioned this note somewhere in the past, but I forgot where I wrote it. This topic is a known limitation and will be closed. |
Sorry to insist but the issue is still present when declaring the AutoConnectCredential object locally in each function. I have reperformed the test and the results are the same as before. Although declaring the object globally can certainly cause issues, I still think the issue in this case is in AutoConnectCredential::del(). Could you have a closer look at it? Thanks! |
@bramhut I was able to reproduce the issue. |
Thank you for the solution, it is working as expected now. |
Hello,
There seem to be issues with saving, deleting or loading the credentials. It appears that the data is loaded or saved at the wrong location in the EEPROM or the data is corrupted. I've expanded your code in issue #307 to also save and delete credentials via serial.
When saving, or deleting a credential with partly random SSID and BSSID, sometimes the data is corrupted (as seen in the pictures).
Another example, which also shows a shift in some data (SSID).
![image](https://user-images.githubusercontent.com/13022463/128331833-7cad5bd1-8780-4c2c-9553-00b245d33578.png)
I'm using an ESP8266 with ESP8266 Arduino framework 3.1.0 using PlatformIO. I've tried using multiple ESP8266's and different versions of AutoConnect (v1.2.2, v1.2.0, v130) but the issue persists.
When using EEPROM.put() and EEPROM.get() in my own sketch, no issues were found.
Thanks in advance.
The text was updated successfully, but these errors were encountered: