UIFlow2.0 NVS how-to check pre-existence (ESP_ERR_NVS_NOT_FOUND)
-
Hi, I want to use NVS in UIFlow2.0 with blocks, but I think this is not possible.
Normally, you should read a nvs value and, if it does not exist, create it, but there is no block to check the existence of a variable, and reading a variable which does not exist causes the program to crash (ESP_ERR_NVS_NOT_FOUND).
How I can do that check? Can I catch the error so the program is not stopped? -
Hello @txinto
you can wrap the get key block in a
try / exceptblock. See example M5Dial_NVS_UIFlow2.0.1 in the UIFlow2 Project Zone.Thanks
Felix
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login