LORA with leonardo transmit/receive not working

i'm using 2 of LLCC68 LoRa E220-400T22D modules connected with 2 seperate arduino leonardos:
E220-400T22D_LLCC68_Lora_Module_Chengdu Ebyte Electronic Technology Co., Ltd
both circuits are identical as shown in attached fritzing sketch. the power comes from leonardo's USB.
the sketches' code for transmitter/receiver are simple enough:

Receiver:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);
void setup()
{
	Serial.begin(115200);
	delay(500);
	mySerial.begin(9600);
}
void loop()
{
	if (mySerial.available()) {
		Serial.println(mySerial.read());
	}
}

Transmitter:

#include <TimerEvent.h>
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);
TimerEvent printInfoTimer;

void setup()
{
    Serial.begin(115200);
  	delay(500);
  	printInfoTimer.set(1000, printInfo);
  	mySerial.begin(9600);
}
void loop()
{
	printInfoTimer.update();
}
void printInfo()
{
	mySerial.write("hello");
}

the problem is that i'm not getting any messages in the receiver side. i measured the receiving LORA tx pin with an oscilloscope, and it seems like messages ARE being transmitted every 1 second to the leonardo module (i can see a graph of voltage change every second, and if i turn off the transmitter module - the graph stops from appearing - so something is indeed received from the transmitter) but "mySerial.available()" never got into.

any idea why or what is wrong? i also tried the same with the "LoRa_E220.h" library as shown in:
https://www.mischianti.org/2022/03/11/ebyte-lora-e220-llcc68-device-for-arduino-esp32-or-esp8266-specs-and-basic-use-1/
but i get the exact same behavior...

if you are using Arduino Leonardo the Arduino SoftwareSerial documentation states
Not all pins on the Leonardo and Micro boards support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
the diagram shows an Arduino Nano ???

Not solving the problem but why do you use SoftwareSerial for this on a Leonardo; use the RX/TX pins and Serial1.

what voltage levels can you see? should be 0 to 3.3v minimum
can you upload a screen dump of trace?

@horace i didn't know that - thanks a lot - it is working :slight_smile:

it is arduino pro micro -> leonardo.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.