ElectronicCats / Beelan-LoRaWAN

A LoRaWAN library for compatible arduino board
https://www.beelan.mx
MIT License
190 stars 78 forks source link

ESP8266 seems to need a delay while polling DIO0 #135

Closed epwaudby closed 2 years ago

epwaudby commented 2 years ago

Hi, Great library, nearly got it all working using a WEMOS D1 clone (basically an ESP12F + breakout) and a raw RFM95W (868).

Just found an issue which seems a little 'odd'. The example app testOTAA.ino kept crashing (reboot) and I found a delay of 100ms after it polls DIO0 in LORA_Cycle fixes it up

do{ if(digitalRead(RFM_pins.DIO0)) //Poll Rx done for getting message { LORA_Receive_Data(Data_Rx, Session_Data, OTAA_Data, Message_Rx, LoRa_Settings); } delay(100) ; // add delay to stop reboot }while(millis() - prevTime < Receive_Delay_1);

Might be possible to trim the 100ms a little but this is okay for my purposes.

It's fixed my problem but might be worth a look

IvanAmg commented 2 years ago

Hello @epwaudby Thank you so much for your contribution! We'll surely include this solution in our troubleshooting.