nopnop2002 / esp-idf-sx127x

SX1276/77/78/79 Low Power Long Range Transceiver driver for esp-idf
MIT License
73 stars 14 forks source link

Any plans to support dio0 and dio1? #2

Open specternecter opened 2 years ago

specternecter commented 2 years ago

I'm trying to move over to the idf from Arduino because the esp32c3 usb support is absolutely terrible there. I was using the radiolib arduino library for the sx1276 and it works great. But it doesn't work in the idf obviously. It does have support for dio0 dio1 (and rxen txen pins that a lot of modules have). Are these pins going to be added in the future?

nopnop2002 commented 2 years ago

Is there a sample somewhere that uses DIO0, DIO1, rxen, txen pins?

Unfortunately I don't know how to use these.

EDIT I added: lora_set_dio_mapping lora_get_dio_mapping

I can't find any mention of the rxen txen pin in the datasheet.

specternecter commented 2 years ago

Yeah the txen and rxen thing is really annoying. I only ever found it in the radiolib library. It's for modules like the e32-900m30s (very high powered sx1276). I guess the only way to understand it would be to look at the radiolib library because the datasheets for these ebyte modules don't make a lot of sense when it comes to these pins. The dio0 and dio1 pins are the important ones but I can look into exactly whats going on with the rxen txen pins in radiolib

specternecter commented 2 years ago

It turns out rxen and txen aren't mentioned in most libraries because it's a switch that turns on the circuit that allows the modified sx127x modules to transmit at 1W and it's not hard do do this manually. This is not an option created by semtech so it's not in the datasheets. It's an aftermarket upgrade essentially and it's in their datasheets (those ebyte modules) but as is typical of datasheets from China it's full of conflicting information that ends up making no sense. My understanding is to transmit txen must be low and rxen high, and the opposite for receive. The radiolib library just allows you to hand over control and not have to worry about it

nopnop2002 commented 2 years ago

To understand these features, I need to get the e32-900m30s.

ghost commented 2 years ago

I will try to help @nopnop2002. This library supports the DIO0 pin as IRQ / RX signaling.

https://github.com/bkgoodman/esp-idf-lora

I'm having issues with it only because TTGO boards share the SPI bus with the sd card.

nopnop2002 commented 2 years ago

It will take some time to understand your content.

This library supports the DIO0 pin as IRQ / RX signaling.

about this, Please tell me a little more detail.

nopnop2002 commented 2 years ago

I want to know how to use DIO0 and DIO1.

If these are for interrupts, then ESP-IDF does not require interrupts.

Unlike the Arduino environment, you can loop for each task.

And LoRa tasks can communicate with other tasks in various ways.


By using FreeRTOS Queue, you can perform asynchronous communication.