The current version of nina-fw does not allow to retrieve the credentials of a working connection. This can be done by storing a backup of the credentials of the last working network into the flash.
2 new options are available:
NO network selection (SSID field empty): the fw immediately tries to connect to the last working network by restoring its credentials saved in a backup;
wrong SSID: while the first time the fw tries to connect to this network and fails, the second time it restores the credentials of the last working network and connects to it. In order to allow this, the WiFi.begin() function must not be called just once, otherwise the connection will fail anyway. It is suggested to use a loop such as
while (status != WL_CONNECTED) {
status = WiFi.begin(ssid, pass);
}
This patch allows to save the credentials of only one network: whenever the WiFi module connects to a new working network, the backup of this "safe" credentials are overwritten. Then, obviously, if the WiFi to which we are trying to connect is different from the one saved in the backup, the only way to connect to the new WiFi is to provide the right SSID and password.
The second proposed feature introduces a counter for the number of times a reboot is performed. This counter is saved in the flash in a file called "bootcounter.bin". This information can be used to trigger a reset or enable a way to step out from a blocking condition.
The file is created (if it does not already exist) by the ESP. It just contains a number which is read, incremented and written back whenever a reboot is triggered.
The current version of nina-fw does not allow to retrieve the credentials of a working connection. This can be done by storing a backup of the credentials of the last working network into the flash. 2 new options are available:
This patch allows to save the credentials of only one network: whenever the WiFi module connects to a new working network, the backup of this "safe" credentials are overwritten. Then, obviously, if the WiFi to which we are trying to connect is different from the one saved in the backup, the only way to connect to the new WiFi is to provide the right SSID and password.
The second proposed feature introduces a counter for the number of times a reboot is performed. This counter is saved in the flash in a file called "bootcounter.bin". This information can be used to trigger a reset or enable a way to step out from a blocking condition. The file is created (if it does not already exist) by the ESP. It just contains a number which is read, incremented and written back whenever a reboot is triggered.