• 1
    Clone the repository:
    git clone -b LoRaWAN https://github.com/lemariva/uPyLoRaWAN.git
  • 2
    Rename the file ttn_config.sample.py to ttn_config.py. Inside this file, you need to define the following variables:
    DEVADDR: Device Address
    NWKEY: Network Session Key
    APP: App Session Key

    You get these values, from the TTN console, when you register a new device under an application, as explained in the next section. Inside the main.py change also the device_pins dictionary to the corresponding of your board. Finally, the variable payload is the data that will be sent. 

  • 3
    ​​Upload the code using VSCode and the PyMark extension to the ESP32 running MicroPython.

    You can follow this tutorial to install these tools: MicroPython: Visual Studio Code as IDE.