dernasherbrezon / sx127x

Library to work with Semtech chips SX1276/SX1277/SX1278/SX1279.
Apache License 2.0
34 stars 4 forks source link

lora transmit example issue #4

Closed 13koma closed 1 year ago

13koma commented 1 year ago

Doing everything according to instructions for platformio, after flashing the code i go to monitor and see my esp32 board reboots continuously with this error - ESP_ERROR_CHECK failed: esp_err_t 0x10a (ESP_ERR_INVALID_VERSION) at 0x400d112d file: "src/main.c" line 85 func: app_main expression: sx127x_create(spi_device, &device)

dernasherbrezon commented 1 year ago

Hey,

Can you double check if you have sx127x chip and not sx126x? They are different and have different chip version. Hence the error.

13koma commented 1 year ago

I have rfm95w module which has sx1276 chip

13koma commented 1 year ago

wow i'm sorry, my breakoutboard for esp was soldered badly, that was the problem

gustavrsh commented 11 months ago

Sorry for commenting on this issue. I am migrating to your library from esp32-lora-library and I'm having exactly the same issue.

The linked library initializes correctly. I'll try to debug the issue later today. There are some differences between the libraries in regards to spi transfers.

My module is a sx1276 and is confirmed to be working.

dernasherbrezon commented 11 months ago

Yes, this is the first call via SPI bus, so if you incorrectly initialised it, it will fail.

gustavrsh commented 11 months ago

Yes, this is the first call via SPI bus, so if you incorrectly initialised it, it will fail.

Thank you for your response.

I identified the problem. Reset pin was not initialized and was not set to high. TX works without error, I'll later get another board and test RX. Another change I had to make is to use DMA channel 2 for spi_bus_initialize , as 1 was being used in my case. You may change to SPI_DMA_CH_AUTO.

Thank you again as your code handles the device better with the presence of interrupts.