🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    UIFlow2.0 NVS how-to check pre-existence (ESP_ERR_NVS_NOT_FOUND)

    UiFlow 2.0
    2
    2
    1.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      txinto
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @txinto

        you can wrap the get key block in a try / except block. See example M5Dial_NVS_UIFlow2.0.1 in the UIFlow2 Project Zone.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • First post
          Last post