Recently I started using an Espressif ESP32 (DevKitC) and the Dragino Lora Shield to make a node that can be connected to TTN. At the moment I would really like the IBM LMIC library to work on the ESP32 while still using the esp-idf (so not the Arduino Core).
I tried porting the LMIC library to the ESP32 environment. Some successes have been made (SPI connection works) but I’m afraid there are some timing issues. Since I’m on a fairly tight schedule I have to make decisions pretty fast. Is there anyone out there that tried to do the same as I did? Or am I bound to use the Arduino Core if I want to use the ESP32?
Trying the same, esp idf is much reliabler than arduino.
Currently have the following issue. It seems to send something but I can’t get something on my gateway. Can you share your code?
run
Fired IRQ0
run
run
run
Fired IRQ1
run
run
Fired IRQ1
run
run
8321714: EV_TXCOMPLETE (includes waiting for RX windows)
run
8352972: Unknown event: 17
Packet queued
It seems like you are further with your implementation than I currently am. Unfortunately I haven’t been able to get the EV_TXCOMPLETE event yet. At the moment my code is in a bit of a mess because of all the prototyping and trying to make it work. I’ll refactor it and post a link to the github page soon.
Few questions for you though. How are you handling the timing? Did you implement a timer? Are you currently running it with FreeRTOS as well?
I tried to implement the LMIC library as a component in the esp-idf environment. That way it keeps my main nice and clean. In the lmic folder you will find a config file that defines the necessary pins for SPI and GPIO. After the os_init() and LMIC_reset() call I create a task called os_loop_task which is defined in oslmic.h/c.
The timer functionality is currently not implemented since I’m fairly sure the previous solution was not the way to go. Not really sure how to go forward from here and if the LMIC library can run with esp-idf without making big changes to the library.
I’m pleased to announce ttn-esp32, a new TTN device library for ESP32 and SX127x LoRa chips, implemented as an ESP-IDF component. The library builds on IBM’s LMIC code and provides a much simpler API taking full advantage of FreeRTOS’ task scheduling.
Please check it out. It’s free and open source. Your feedback is very welcome.