ESP32 and LoRa
Re: ESP32 and LoRa
The tutorial has it linking to a Seeeduino Lotus. Tried it on an Arduino Uno, Hero and Seeeduino v4 but all the same issue. not sure about it working by itself. As you say everything else I've seen involves more than the Groves but the board doesn't have a DIO pin so hadn't tried any other way. I'll take a look at the other forum - hadn't spotted that. thanks for the help.
Re: ESP32 and LoRa
Unfortunately the seeed docs are crap. I think they just had some intern make up something.
You are absolutely correct that the Grove connector provides a UART. If you have a look at the schematics linked in the datasheet, though, the grove connector is connected to the ATMega processor not the actual Lora module (RFM98 on the schematic). The RFM module, in turn, is connected to the Atmega via SPI. The way I'm piecing things together is that the intended use of the Grove connector is to hook up some sensors that the Atmega can query and send send the sensor readings via the Lora radio.
I think the documentation they provided is pure bullshit: they suggest you can use the whole thing as a Lora Radio and use the Radiohead RFM driver code to connect to it. I can't see how that can possibly work, because the Radiohead library expects a RFM9x module connected via SPI and not a Grove module connected via UART. Maybe they're providing a custom very of the Lora library that can connect to firmware running on the ATMega!?
You are absolutely correct that the Grove connector provides a UART. If you have a look at the schematics linked in the datasheet, though, the grove connector is connected to the ATMega processor not the actual Lora module (RFM98 on the schematic). The RFM module, in turn, is connected to the Atmega via SPI. The way I'm piecing things together is that the intended use of the Grove connector is to hook up some sensors that the Atmega can query and send send the sensor readings via the Lora radio.
I think the documentation they provided is pure bullshit: they suggest you can use the whole thing as a Lora Radio and use the Radiohead RFM driver code to connect to it. I can't see how that can possibly work, because the Radiohead library expects a RFM9x module connected via SPI and not a Grove module connected via UART. Maybe they're providing a custom very of the Lora library that can connect to firmware running on the ATMega!?
Re: ESP32 and LoRa
So, I had a closer look at the Arduino code that seed provides and the situation is stupider than I expected.
While all the names (e.g. the header named Radiohead.h and the RH_ prefixes) suggest they are using the Radiohead library they are in fact using their own dumb, bastardized, undocumented, unsupported version. Which does connect via UART because they wrote some weird UART protocol that wraps the actual SPI calls to the module in serial messages passed via UART.
If you're wondering why: I assume the reason is that they want to cram their stupid grove connector down everyone's throat and because it's limited to 2 data pins it can't even do standard SPI, let alone handle Semtech's 5 interrupt lines (all but one of which are unnecessary).
Sorry I don't have better news, I had no idea it would be this dumb. Honestly a bit disappointed in seeed.
While all the names (e.g. the header named Radiohead.h and the RH_ prefixes) suggest they are using the Radiohead library they are in fact using their own dumb, bastardized, undocumented, unsupported version. Which does connect via UART because they wrote some weird UART protocol that wraps the actual SPI calls to the module in serial messages passed via UART.
If you're wondering why: I assume the reason is that they want to cram their stupid grove connector down everyone's throat and because it's limited to 2 data pins it can't even do standard SPI, let alone handle Semtech's 5 interrupt lines (all but one of which are unnecessary).
Sorry I don't have better news, I had no idea it would be this dumb. Honestly a bit disappointed in seeed.
Re: ESP32 and LoRa
I have a working ESP32/LoRa prototype using the hardware linked below. You mentioned problems with initialization. Please see my init function below. Not sure if this ports to your hardware. Hope this helps.
Regards, Mark
https://www.adafruit.com/product/3591
https://www.adafruit.com/product/3072
Regards, Mark
https://www.adafruit.com/product/3591
https://www.adafruit.com/product/3072
- /******************************************************************************
- * Includes
- *******************************************************************************/
- #include <RH_RF95.h>
- #include "hal/radio.hpp"
- /******************************************************************************
- * Macro defines
- *******************************************************************************/
- #define RFM95_CS 27
- #define RFM95_RST 13
- #define RFM95_INT 12
- #define RF95_FREQ 915.0
- RH_RF95 rf95(RFM95_CS, RFM95_INT);
- /******************************************************************************
- * Function Definitions
- *******************************************************************************/
- void initializeRadio(void)
- {
- pinMode(RFM95_RST, OUTPUT);
- digitalWrite(RFM95_RST, HIGH);
- delay(10);
- digitalWrite(RFM95_RST, LOW);
- delay(10);
- digitalWrite(RFM95_RST, HIGH);
- delay(10);
- while (!rf95.init())
- {
- Serial.println("LoRa radio init failed");
- while (1)
- ;
- }
- Serial.println("LoRa radio init OK!");
- if (!rf95.setFrequency(RF95_FREQ))
- {
- Serial.println("setFrequency failed");
- while (1)
- ;
- }
- Serial.print("Set Freq to: ");
- Serial.println(RF95_FREQ);
- // Defaults after init are 434.0MHz, 13dBm, Bw = 125 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on
- // The default transmitter power is 13dBm, using PA_BOOST.
- // If you are using RFM95/96/97/98 modules which uses the PA_BOOST transmitter pin, then
- // you can set transmitter powers from 5 to 23 dBm:
- rf95.setTxPower(23, false);
- }
Who is online
Users browsing this forum: Bing [Bot] and 112 guests