-
Notifications
You must be signed in to change notification settings - Fork 141
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
Unable to use setParingCode() successfully #786
Comments
I think you've identified a bug in the new release (likely a result of all the refactoring). I can see by the QR code it generates that something is incorrect. Thanks for finding this --- will check it out and fix in a patch release. |
Closer examination of the log reveals a second reference to Setup Code. Here is a full log following a command line E
|
I have identified the problem and will fix in the next release (was an inadvertent error introduced in 1.9.0). However, there is an easy workaround:
// place the following in setup() before homeSpan.begin()
homeSpan.setWifiCallback([](){homeSpan.setPairingCode("32154876");}); The root of the issue is that as part of changes to 1.9.0 I no longer store the hashed setup code in memory when it is changed, but only in NVS, where it is read when needed for pairing. However, the NVS space that stores this information does not get opened and initialized until after homeSpan polling is started. This means calling setPairingCode() in setup() fails to store the hash in NVS as needed. |
Thanks for your prompt investigation and workaround for this issue. I can confirm the use of WiFi Callback has the desired result. |
This has now been fixed --
Fix is available in "dev" branch and will be part of the next release. |
Problem: unable to pair device after invocation of setParingCode()
HomeSpan version 1.9.0
Steps to reproduce:
homeSpan.setLogLevel(2);
homeSpan.setPairingCode("32154876");
Attempts to pair are unsuccessful, however the same pairing code can be set successfully via the serial interface
Note:
log output from setPariringCode() shows:
Generating SRP verification data for new Setup Code: 321-54-876 ... New Code Saved!
Setup Payload for Optional QR Code: X-HM://0004YYOZG
serial interface change shows:
Generating SRP verification data for new Setup Code: 321-54-876 ... New Code Saved!
Setup Payload for Optional QR Code: X-HM://0052JQTX8HSPN
The text was updated successfully, but these errors were encountered: