Closed pvtex closed 5 months ago
the pin that you enter in the user mask is active and can be used. but if you reload the user list all users are showing the same pincode of one random user.
with debugoutputs i can see that the right pins are read in void ICACHE_FLASH_ATTR sendUserList
but on the way through serializeJson and ws to the browser it get lost
the json opject item hold the right pincode. the jsonarray users has wrong pincodes.
think i found the solution the variable pincode was declared as const char. const chars are used as pointers in nestedobject. cast pincode to a string should help
had to change the file wsResponses.esp
line 28-32
String pincode = "";
if(json.containsKey("pincode"))
{
pincode = String((const char*)json["pincode"]);
}
Thank you very much @pvtex for reporting this bug. I can confirm it.
The problem I think it's earlier than the lines highlighted in your last comment, unfortunately. I was able to reproduce the pincode corruption even by just updating manually a few of the pincodes. I'm going to fix this surely before v2 is done.
Sorry for this and thank you very much for reporting.
You were right @pvtex !
I've applied your fix and that's fine :) I'm going to close this as the fix is in dev
.
Thank you :+1:
the pincode of a user is not read succesfully. sometimes a pincode form an other user is shown. looking in the user files in the SPIFFS filesystem the pincodes are right.
in the filesystem: