Hi everyone, I am new to the forum.
I am developing a prototype device that uses a couple sensors to gather data and then fire the data off using LoRa. To minimize the size of my device for its application, I had to get a custom PCB made from SparkFun A La Carte. In the Design, I used a ESP32-WROOM-32E microcontroller and a couple sensors, and then a RFM95w LoRa Module.
I, for the absolute life of me, cannot get the LoRa module to initialize successfully. Each code I have used I have simplified to just enough code to attempt to initialize the module and then Serial print a success or failed initialization. I have tried a few different libraries, I dug up the schematic files and verified the connections are to the right numbered GPIO/pins. All the standard pins are used when compared to other existing hardware.
I am using USB-C Power supply at the moment but I do have 2-wire 3.7 volt battery power port. I have ordered batteries online and will plug one in while I install and run the code to phase-out the issue of power supply messing things up.
I am using the Espressif esp32 board manager ESP32 - Dev Module(have also tried the esp32-wroom-DA module.
I have successfully built a code to use one of the sensors (Accelerometer) and i can upload it whenever and things work fine, but no dice with the LoRa…
If anyone has experience with this and/or someone maybe having a little giggle at their desk for something super basic I am overlooking? I am a 25 y/o mechanical engineer and would consider myself tech savvy. I have been writing Arduino codes for projects for around 7 years now and this I believe is the first hurtle I cannot jump… Ouch, My Ego…
-Hayddsss
liaifat85:
Did you test the RFM95 LoRa separately before connecting that to the PCB? Was it working fine earlier?
The RFM95 LoRa module is built into the custom PCB. I don’t think there is a way to test it separately as it is “hardwired” to the ESP32 in the PCB. So in short, no i have not tested the individual RFM95 apart from the rest of the PCB.
Not sure if its related, but i do have a APA102 pixel on the PCB too. I briefly tried to use the FASTLED library to initiate that LED and get some colors to shine, although I am failing to do that as well. Perhaps this is actually a power issue from the USB-C I am using through a regular USB-2 Port on my computer? There is onboard voltage regulator/converter to 3.7v from 5v but maybe I’m not getting adequate amperage? I highly doubt this because the same cord and port can charge my Bluetooth speaker relatively quickly and the PCB should only require milli-amps…
Perhaps i should upload some code(s) I have tried for attempting to initiate the LoRa module and see if anyone can pick out obvious mistakes?
here is a code i have tried. I get a period printed on serial monitor every 0.5 seconds that the LoRa Module does not initiate.
#include <SPI.h>
#include <LoRa.h>
// define the pins used by the transceiver module
#define ss 15
#define rst 18
#define dio0 34
void setup() {
// initialize Serial Monitor
Serial.begin(115200);
while (!Serial);
Serial.println("LoRa Sender");
// setup LoRa transceiver module
LoRa.setPins(ss, rst, dio0);
// replace the LoRa.begin(---E-) argument with your location's frequency
// 433E6 for Asia
// 866E6 for Europe
// 915E6 for North America
while (!LoRa.begin(915E6)) {
Serial.println(".");
delay(500);
}
// Change sync word (0xF3) to match the receiver
// The sync word assures you don't get LoRa messages from other LoRa transceivers
// ranges from 0-0xFF
LoRa.setSyncWord(0xF3);
Serial.println("LoRa Initializing OK!");
}
void loop() {
static int counter = 0;
Serial.print("Sending packet: ");
Serial.println(counter);
// Send LoRa packet to receiver
LoRa.beginPacket();
LoRa.print("hello ");
LoRa.print(counter);
LoRa.endPacket();
counter++;
delay(10000);
}
I connected a battery and had the USB-C plugged it. It charged the battery to full voltage. A small led came on during that.
Once I had full battery AND USB-C plugged in, I reset the board, jammed the code down its throat, then looked at my serial monitor and unfortunately, still no luck.
I haven’t been able to contact sparkfun for this; Does anyone know the best method to get in touch with some coding gurus at sparkfun?