pylorawan

Pylorawan is a Micropython wrapper for lorawan devices from RAK Wireless.

Tested on a Raspberry PI Pico with a RAK4200(H) Evaluation Board (868MHz) (bought direct from RAK Wireless: https://rakwireless.kckb.st/821e96d1 )

It uses the RAK devices AT commands to join the network and send the data

How do I use this?

  1. Create an account on The Things Network / The Things Stack Community Edition and register your device and create an application
  2. Use Thonny to edit the simple_example.py with the keys from your device and The Things Network (TTN)
  3. Ensure that you use the right region (I’m in Europe, so I use EU868, in the USA you would use: US915, in India: IN865 etc)
  4. Connect the Pico and the RAK 4200 device. Ensuring that:
    • The Pico UART0 Tx connects to the UART Rx on the RAK device
    • The Pico UART0 Rx connects to the UART Tx on the RAK device
  5. Upload the 2 files, pylorawan and simple_example.py to the Pico using Thonny
  6. Open simple_example.py in Thonny and hit play. If debug is set to True, you should get debug like this: Thonny Pylorawan Debug of OTAA Join

And when connected, hopefully a few seconds later, in the TTN console you should see this: TTN showing the message we sent

GitHub

View Github