I connected the two devices the standard way even tried swapping Tx and Rx but the Lorawan is not even powering up the red led is not working
the Lora card is perfectly fine tried switching wires and nothing worked
this is my code I can't upload the whole file because it's kinda big but here's the important part
If the red power LED isn't even on, forget about TX/RX and the code for now.
First check the power supply to the LoRa32u4 II: measure the voltage directly between VCC and GND on the board. What voltage do you get?
I mesured the output wires from esp32 ( between3.3 andGND ) and mesured between 3.3 and GND of lora and both give me 3.3V
I did invert the Tx and Rx just in case but no luck
So there is power but the lora could be crashing for some reason
this photo of the lora, the esp32 photo is too messy with wires from other sensors so it wouldn't be helpful
start with a simple back to back test ESP32 to Adafruit Feather 32u4
when that works add your complex protocol etc etc
ESP32 serial1 code
// ESP32 Serial1 test - for loopback test connect pins RXD1 and TXD1
#define RXD1 16 // can map Serial1 and Serial2 to many ESP32 GPIO pins
#define TXD1 17 // check pin usage https://randomnerdtutorials.com/esp32-pinout-reference-gpios/
// for RS232 shield connect
// ESP32 RXD1 to TTL/RS232 Rx
// ESP32 TXD1 to TTL/RS232 Tx
// connect GND pins together and VCC to 3.3V on ESP32 5V on UNO ect
// for loopback test connect 9-pin D_type connector pins 2 Tx to 3 Rx (pin 5 is GND)
void setup() {
// initialize both serial ports:
Serial.begin(115200);
Serial1.begin(56700, SERIAL_8N1, RXD1, TXD1);
Serial.printf("\n\nESP32 serial1 test RXD1 pin %d TXD1 pin %d\n", RXD1, TXD1);
Serial.printf(" loopback test connect pin %d to pin %d\n", RXD1, TXD1);
Serial.printf("RS232: ESP32 pin %d RXD1 to TTL/RS232 Rx and pin %d TXD1 to TTL/RS232 Tx\n", RXD1, TXD1);
Serial.printf("RS232 - loopback connect 9-pin D-type pin 2 Tx to pin 3 Rx\n");
}
void loop() {
// read from Serial1, send to Serial
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.write(inByte);
}
// read from Serial, send to Serial1
if (Serial.available()) {
int inByte = Serial.read();
//Serial.write(inByte); // local echo if required
Serial1.write(inByte);
}
}
Adafruit Feather 32u4 LoRa Serial1 code
// Adafruit Feather 32u4 Serial1 test
// Serial1 is on the pins labled Tx (D1) and Rx (D0)
// for loopback test connect Tx to Rx
unsigned long time;
void setup() {
Serial.begin(115200); // initialise serial monitor port
delay(2000);
Serial1.begin(56700, SERIAL_8N1); // initialise Serial1
Serial.write("\n\nAdafruit Feather 32u4 Serial1 test - for loopback test connect Tx to Rx\n");
}
void loop() {
if (Serial1.available()) { // read from Serial1 output to Serial
Serial.write(Serial1.read());
}
if (Serial.available()) { // read from Serial outut to Serial1
int inByte = Serial.read();
//Serial.write(inByte); // local echo if required
Serial1.write(inByte);
}
}
Esp32 Serial monitor output
ESP32 serial1 test RXD1 pin 16 TXD1 pin 17
loopback test connect pin 16 to pin 17
RS232: ESP32 pin 16 RXD1 to TTL/RS232 Rx and pin 17 TXD1 to TTL/RS232 Tx
RS232 - loopback connect 9-pin D-type pin 2 Tx to pin 3 Rx
test1 32u4 to esp32
test2 32u4 to esp32 1234567890
Adafruit feather Serial monitor output
Adafruit Feather 32u4 Serial1 test - for loopback test connect Tx to Rx
test1 esp32 to 32u4
test2 esp32 to 32u4 1234567890
In the photo the two devices have seperate power supply, I need the lora to be powered by the esp32 does this still work ?
explanation why do I need to power it throught the esp32 : When I connect Lora seperatly to my pc, windows doesn't reconize it, in device manager it showes up as unkown device which is why windows blocks the port. Although, I was able to upload code into it, the device loses connection after upload is done. I did try other cables as well as other Lora32u4 and even tried to download a driver for the ATmega32u4 microcontroller but no luck so far
strange - I have the ESP32 (COM21) and the Adafruit Feather 32u4 LoRa (COM11) plugged into USB sockets on my PC with no problems, e.g.
try connecting ESP32 VIN to Feather 32u4 VBUS (5V)
if I run the following code on the 32u4 which when bytes are received on Serial1 they are transmitted back out on Serial1
// Adafruit Feather 32u4 Serial1 test
// Serial1 is on the pins labled Tx (D1) and Rx (D0)
// for loopback test connect Tx to Rx
unsigned long time;
void setup() {
Serial.begin(115200); // initialise serial monitor port
delay(2000);
Serial1.begin(56700, SERIAL_8N1); // initialise Serial1
Serial.write("\n\nAdafruit Feather 32u4 Serial1 test - for loopback test connect Tx to Rx\n");
}
void loop() {
if (Serial1.available()) { // read from Serial1 output to Serial
int inByte = Serial1.read();
Serial.write(inByte);
Serial1.write(inByte);
}
if (Serial.available()) { // read from Serial outut to Serial1
int inByte = Serial.read();
//Serial.write(inByte); // local echo if required
Serial1.write(inByte);
}
}
there is no Serial output on the 32u4 now (USB not connected)
however, text transmitted from the ESP32 to the 32u4 is now transmitted back to the ESP32 OK
EDIT: the thick red wire is my LoRa antenna the thin red wire is a modification connecting the RFM95 DIO1 to D6 - required for the LMIC LoRaWAN library see adafruit-feather-32u4-lora-ota
the pin headers plugged into the breadboard don't appear to be soldered to the 32u4 PCB
does this look like a bad soldering job
because windows won't connect the device but the power is on (the led works but device not connected )
it is not a cable problem or a pc problem because the other lora and esp32 connected fine
so the only answer I have is that one has a short circuit
from the top it looks like that
but the picture i sent are from the bottom (I moved the little plastic piece to see )
they look a little connected to me but I'm not sure