#M5Stack: LoRaWAN and MicroPython on the 'Fire'
LoRa/LoRaWAN, M5Stack, MicroPython | 2 min | 3330
I've just updated the LoRa/LoRaWAN repository for MicroPython and added a configuration that works on the M5Stack Fire using the LoRa868 Module. Therefore, this will help you connect the M5Stack Fire to the "The Things Network (TTN)"!
If you're new to MicroPython read this tutorial: Tutorial: Getting Started with MicroPython on ESP32, M5Stack, and ESP8266If you want to know more about the LoRaWAN and MicroPython, read this article: Tutorial: ESP32 running MicroPython sends data over LoRaWAN
Hardware and Software
The following hardware and software will be used in this article.
You can combine the M5Stack Fire with a LoRa868 module and M5GO/FIRE base to make a portable LoRaWAN node (see Fig. 1). Fig. 2 shows that the LoRa868 module has a Ra-01 chip (sx127x), and it can be used using the lemariva/uPyLoRaWAN repository. As I mentioned before, I've just updated the repository. The application, board, and LoRa/LoRaWAN settings are now in a single config file. Therefore, follow these steps to deploy the app on your M5Stack Fire:
- Clone the
git clone https://github.com/lemariva/uPyLoRaWAN.git -b LoRaWAN
- Rename the file
- Configure the SPI pins to connect to the SX127x module. I've included the following example connections:
- ES32 TTGO v1.0
- M5Stack ATOM connected to LoRa v2.0 board.
- M5Stack Fire connected to the LoRa868 Module.
- Configure the LoRaWAN settings (
country) as described here
- Upload the code to the M5Stack using VSCode as explained in this tutorial
Fig. 1: M5Stack Fire with a LoRa868 module and a M5GO base.
Fig. 2: RA-01 LoRa chip (sx127x)The downlink (from TTN to the device) is not working for me right now, but I don't know if it is my gateway forwarder or the M5Stack. If you can test the code on an M5Stack connected to a different gateway and it works, please write a comment! The decryption on the ESP32 of the "downlinked" packages is still in my ToDo list.
- Clone the