@PeterB said in how to check if a non-existing key in nvs ?: @johand said in how to check if a non-existing key in nvs ?: You have to check if it is None or not, change to: if pycom.nvs_get("count") != None: Are you sure that will work? An exception is an exception and "pycom.nvs_get("count")" would not return anything to compare with. The exception would be generated before the compare can be executed. Depends on the version. This must have changed over time. You can simply use a variable and wrap the call, so that it shall run on all versions: try: _wake = pycom.nvs_get('wake'); except Exception as e: _wake = None if _wake==None: _wake = 103