Hey,
I'm currently working on the CaptivePortalAdvanced example provided by DNSServer. This provides a sketch named 'Credentials' where the credentials are saved in the EEPROM. But I want to save the details in a text file, so I decided to use FS.h for this. I developed a code for this, but it doesn't printout the necessary details, like it does in the original code. Any pointers to what I'm doing wrong or any advice on what I should do would be really appreciated!
This is the original code provided, where the details are saved in the EEPROM:
When saving to eeprom you dump the whole ssid or password buffer - all the 32 bytes including the trailing 0 and whatever padding is left in the buffer
/* Don't set this wifi credentials. They are configurated at runtime and stored on EEPROM */
char ssid[32] = "";
char password[32] = "";
so in eeprom you have
YOURSSID0******YOURPWD0*******OK0 (Stars representing padding up to 32 bytes)
When printing to the file neither the trailing null nor the padding is added and so you end up with
YOURSSIDYOURPWD
In the file and it’s impossible to read back as you have no separator (not to mention that your way to read back the content is not doing anything useful)
Dump everything in the file as binary in the same way so you’ll get known size to read back or add an end of field market like a new line
I want to print the data saved in the text file, on the serial monitor. I'm quite new to this, will you be able to tell me what I am to try instead of it?