timmbogner / Farm-Data-Relay-System

A system that uses ESP-NOW, LoRa, and other protocols to transport sensor data in remote areas without relying on WiFi.
MIT License
507 stars 114 forks source link

Debug Error on Initializing LoRa before going into infinite while loop #36

Closed thefeiter closed 2 years ago

thefeiter commented 2 years ago

In my test setup I once connected the LoRa Board to the wrong pins. This resulted in LoRa.begin(FDRS_BAND) returning 0 which led the execution into the infinite while loop:

if (!LoRa.begin(FDRS_BAND)) { while (1); }

I don't know if this is intetnional, but the ESP8266 seems to not like that and it resets wit an error message. Upon debugging with the ESP Exception decoder it crashes on that while line.

So to prevent from users having to go down that rabbit hole wondering why the ESP keeps resetting I suggest Sending a debug message first.

(Also included in this PR updating the addition of the SPI fix to the files that havent been updated)