[SOLVED] NVS error=4354 on LoRa() constructor

  • Hello,

    I am using a simple program to transmit DS18B20 (one wire) temperature with Lorawan.
    My program is issuing these two lines:
    NVS error=4354
    NVS error=4354

    Right after calling the LoRa constructor:
    lora = LoRa(mode=LoRa.LORAWAN)

    I haven't found details on this error, what does it mean ?
    Does it need to be fixed and how ?

    My Lopy:
    (sysname='LoPy', nodename='LoPy', release='1.7.6.b1', version='v1.8.6-703-g5e80328a on 2017-07-05', machine='LoPy with ESP32', lorawan='1.0.0')

    Thank you.

  • Could someone explain what consequences it brings in the operation of the device when these errors come out?

  • @jmarcelino

    So sorry. I think it must be the sunny weather. You are 100% right -- looking at the payload on the gateway is not particularly useful, but if I look at the application, I can see the correct stuff !!

    Success. Yay. Very impressed with my little LoPy which only arrived a few hours ago :)

    Incidentally, I got OTAA working too, and since then the NVS error messages have gone away.

    Thanks so much for the quick reply, I was not expecting it :)


  • @patmolloy
    The packet received at the gateway (and TTN) is not your actual data but will be a full LoRaWAN frame and your data will be encrypted inside it too.

    You can decode the frame to see the metadata (but not decrypt the data contents) using this online tool:


  • Hi, I am having the same issue. Have followed the procedure above and it worked. Sort of.

    However, I am using the ABP example to connect to a TTN Gateway (at home). When I run the script the first time, I get no

    NVS error=4354
    NVS error=4354

    messages and I can see a payload arrive at the gateway. However, it's not the payload that the example ABP script sent which is via this line

    s.send(bytes([0x01, 0x02, 0x03]))

    Instead, I see 16 bytes arriving which are "4007160126000100020B334869FED334" ..

    This is entirely repeatable, except that the next time I run the script (and until re-flashed again, I think) I get the two mysterious errors

    NVS error=4354
    NVS error=4354

    BUT the same (wrong?) payload arrives at the gateway. In fact, no matter what is in that s.send command, I always get the same 16 bytes at the gateway. (I tried a simple ASCII -> Text conversion but it does not result in any readable text).

    So, at some basic level LoRa is working, ABP is working, but what are these NVS errors and why is the gateway seeing something different from what the script thinks it's sending ?!

    Any help most gratefully received.



  • That fixed the problem, thank you @jmarcelino !

    Just for reference for others that may need to run the command as well, esptool command should read:
    esptool.py --port YourLoPyCOMPort -b 115200 --chip esp32 erase_flash

  • Sounds like your Flash has some bad values.

    Can you install esptool


    put the LoPy into upgrade mode (connect GND-P2 pins) and then do:

    esptool.py --port YourLoPyCOMPort -b 115200 --chip esp32 erase_flash

    After that do the normal upgrade using the Pycom upgrade tool again.

Log in to reply

Pycom on Twitter