Wiring of DIO-pins of LoRa SX127x chip to ESP32
-
I'm using LMIC software (raw c++, not python) on LoPy4.
LMIC needs pins DIO0 and DIO1 (and optional DIO2) of LoRa chip SX127x wired to GPIOs of ESP32 cpu, for signalling events.How are the DIO pins wired on LoPy4 to ESP32?
In the datasheet i only find "Lora IRQ" which is DIO0.
Is DIO1 not wired?
-
@malachib i know is a hold post but y reply for other
is a bug in lmic-esp-idf in hal.c changeio_conf.pin_bit_mask = (1<<lmic_pins.nss) | (1<<lmic_pins.rst);
by
io_conf.pin_bit_mask = (1<<lmic_pins.nss);
if(lmic_pins.rst!=LMIC_UNUSED_PIN)
io_conf.pin_bit_mask = (1<<lmic_pins.rst);
-
@KK @Verkehrsrot , when I utilize that LoPy4 configuration I'm getting a
GPIO_PIN mask error
on startup duringlmic: Starting IO initialization
- any thoughts?Using ESP-IDF 3.3 and https://github.com/TobleMiner/lmic-esp-idf
-
To everyone who has the same problem for LoPy4, I would like to post the working configuration identified based on the posting by @verkehrsrot .
const lmic_pinmap lmic_pins = {
.mosi = 27,
.miso = 19,
.sck = 5,
.nss = 18,
.rxtx = LMIC_UNUSED_PIN,
.rst = LMIC_UNUSED_PIN,
.dio = {23, 23, 23}, //workaround to use 1 pin for all 3 radio dio pins
};
-
Hi ,
Some one did do that before with lopy , check the below link:https://www.thethingsnetwork.org/labs/story/program-your-lopy-from-the-arduino-ide-using-lmic
LMIC configuration is :
const lmic_pinmap lmic_pins = {
.mosi = 27,
.miso = 19,
.sck = 5,
.nss = 17,
.rxtx = LMIC_UNUSED_PIN,
.rst = 18,
.dio = {23, 23, 23}, //workaround to use 1 pin for all 3 radio dio pins
};So like @Xykon say each DIO is wired trought a diode to DIO 23 of ESP32
Try first that with lopy4 too ... i think will work, but take care lopy is using SX1272 lora chip and lopy4 use SX1276 chip and u need to change in LMIC conf to use SX1276
I hope that will helping you!
-
@xykon aah, ok. That should work with Lmic. Thanks!
(is there a schematic of the LoPy anywhere?)
-
@verkehrsrot All DIO are wired through a diode bridge to a single pin on the esp32 . This way you get events from all pins without sacrificing additional IO on the esp32 but you'll have to check the registers to see which pin triggered the interrupt.