LoRa E32 433 MHz Communication Problem

Hi, i have two LoRa E32 modules and 2 Arduino Unos.

Transmitter Output:

----------------------------------------
HEAD : 11000000 192 C0
 
AddH : 10
AddL : 1
Chan : 23 -> 433MHz
 
SpeedParityBit     : 0 -> 8N1 (Default)
SpeedUARTDatte  : 111 -> 115200bps
SpeedAirDataRate   : 11 -> 4.8kbps
OptionTrans        : 1 -> Fixed transmission (first three bytes can be used as high/low address and channel)
OptionPullup       : 1 -> TXD, RXD, AUX are push-pulls/pull-ups
OptionWakeup       : 100 -> 1250ms
OptionFEC          : 0 -> Turn off Forward Error Correction Switch
OptionPower        : 1 -> 17dBm
----------------------------------------

Receiver Output:

17:40:12.657 -> ----------------------------------------
17:40:12.690 -> HEAD : 11000000 192 C0
17:40:12.723 ->  
17:40:12.723 -> AddH : 0
17:40:12.723 -> AddL : 3
17:40:12.723 -> Chan : 23 -> 433MHz
17:40:12.755 ->  
17:40:12.755 -> SpeedParityBit     : 0 -> 8N1 (Default)
17:40:12.788 -> SpeedUARTDatte  : 111 -> 115200bps
17:40:12.854 -> SpeedAirDataRate   : 11 -> 4.8kbps
17:40:12.887 -> OptionTrans        : 1 -> Fixed transmission (first three bytes can be used as high/low address and channel)
17:40:12.985 -> OptionPullup       : 1 -> TXD, RXD, AUX are push-pulls/pull-ups
17:40:13.050 -> OptionWakeup       : 100 -> 1250ms
17:40:13.083 -> OptionFEC          : 0 -> Turn off Forward Error Correction Switch
17:40:13.181 -> OptionPower        : 1 -> 17dBm
17:40:13.214 -> ----------------------------------------
17:40:13.247 -> 
17:40:13.247 -> Start listening!```

Transmitter Code:

/*
 * LoRa E32-TTL-100
 * Send fixed transmission structured message to a specified point.
 * https://www.mischianti.org/2019/12/03/lora-e32-device-for-arduino-esp32-or-esp8266-power-saving-and-sending-structured-data-part-5/
 *
 * E32-TTL-100----- Arduino UNO or esp8266
 * M0         ----- 3.3v (To config) GND (To send) 7 (To dinamically manage)
 * M1         ----- 3.3v (To config) GND (To send) 6 (To dinamically manage)
 * TX         ----- RX PIN 2 (PullUP)
 * RX         ----- TX PIN 3 (PullUP & Voltage divider)
 * AUX        ----- Not connected (5 if you connect)
 * VCC        ----- 3.3v/5v
 * GND        ----- GND
 *
 */
#include "Arduino.h"
#include "LoRa_E32.h"

// ---------- esp8266 pins --------------
//LoRa_E32 e32ttl(D2, D3, D5, D7, D6);
//LoRa_E32 e32ttl(D2, D3, D5, D7, D6); // Config without connect AUX and M0 M1
#include <SoftwareSerial.h>
SoftwareSerial mySerial(6, 7); // Arduino RX <-- e32 TX, Arduino TX --> e32 RX
LoRa_E32 e32ttl(6, 7); 

//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e32 TX, Arduino TX --> e32 RX
//LoRa_E32 e32ttl(&mySerial, D5, D7, D6);
// -------------------------------------

// ---------- Arduino pins --------------
//LoRa_E32 e32ttl(2, 3, 5, 7, 6);
//LoRa_E32 e32ttl(2, 3); // Config without connect AUX and M0 M1

//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(2, 3); // Arduino RX <-- e32 TX, Arduino TX --> e32 RX
//LoRa_E32 e32ttl(&mySerial, 5, 7, 6);
// -------------------------------------

// ---------------- STM32 --------------------
// HardwareSerial Serial2(USART2);   // PA3  (RX)  PA2  (TX)
// LoRa_E32 e32ttl(&Serial2, PA0, PB0, PB10); //  RX AUX M0 M1
// -------------------------------------------------

// ---------- Raspberry PI Pico pins --------------
// LoRa_E32 e32ttl100(&Serial2, 2, 10, 11); //  RX AUX M0 M1
// -------------------------------------

void printParameters(struct Configuration configuration);
void printModuleInformation(struct ModuleInformation moduleInformation);
//The setup function is called once at startup of the sketch
void setup()
{
	Serial.begin(9600);
	while (!Serial) {
	    ; // wait for serial port to connect. Needed for native USB
    }
	delay(100);

	e32ttl.begin();
	// After set configuration comment set M0 and M1 to low
	// and reboot if you directly set HIGH M0 and M1 to program
	ResponseStructContainer c;
  
	c = e32ttl.getConfiguration();
	Configuration configuration = *(Configuration*) c.data;
	configuration.ADDL = 0x01;
	configuration.ADDH = 0x02;
	configuration.CHAN = 0x17;
	configuration.OPTION.fixedTransmission = FT_FIXED_TRANSMISSION;
	e32ttl.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE);
	printParameters(configuration);
	c.close();
	// ---------------------------
}
struct Message {
    char type[5];
    char message[8];
    int temperature;
} message;

int i = 0;
// The loop function is called in an endless loop
void loop()
{
	delay(2500);
	i++;
	struct Message {
	    char type[5] = "TEMP";
	    char message[8] = "Kitchen";
	    byte temperature[4];
	} message;

	*(float*)(message.temperature) = 19.2;

	ResponseStatus rs = e32ttl.sendFixedMessage(0,3,17,&message, sizeof(Message));
	Serial.println(rs.getResponseDescription());
}

void printParameters(struct Configuration configuration) {
	Serial.println("----------------------------------------");

	Serial.print(F("HEAD : "));  Serial.print(configuration.HEAD, BIN);Serial.print(" ");Serial.print(configuration.HEAD, DEC);Serial.print(" ");Serial.println(configuration.HEAD, HEX);
	Serial.println(F(" "));
	Serial.print(F("AddH : "));  Serial.println(configuration.ADDH, BIN);
	Serial.print(F("AddL : "));  Serial.println(configuration.ADDL, BIN);
	Serial.print(F("Chan : "));  Serial.print(configuration.CHAN, DEC); Serial.print(" -> "); Serial.println(configuration.getChannelDescription());
	Serial.println(F(" "));
	Serial.print(F("SpeedParityBit     : "));  Serial.print(configuration.SPED.uartParity, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTParityDescription());
	Serial.print(F("SpeedUARTDatte  : "));  Serial.print(configuration.SPED.uartBaudRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTBaudRate());
	Serial.print(F("SpeedAirDataRate   : "));  Serial.print(configuration.SPED.airDataRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getAirDataRate());

	Serial.print(F("OptionTrans        : "));  Serial.print(configuration.OPTION.fixedTransmission, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getFixedTransmissionDescription());
	Serial.print(F("OptionPullup       : "));  Serial.print(configuration.OPTION.ioDriveMode, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getIODroveModeDescription());
	Serial.print(F("OptionWakeup       : "));  Serial.print(configuration.OPTION.wirelessWakeupTime, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getWirelessWakeUPTimeDescription());
	Serial.print(F("OptionFEC          : "));  Serial.print(configuration.OPTION.fec, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getFECDescription());
	Serial.print(F("OptionPower        : "));  Serial.print(configuration.OPTION.transmissionPower, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getTransmissionPowerDescription());

	Serial.println("----------------------------------------");

}
void printModuleInformation(struct ModuleInformation moduleInformation) {
	Serial.println("----------------------------------------");
	Serial.print(F("HEAD BIN: "));  Serial.print(moduleInformation.HEAD, BIN);Serial.print(" ");Serial.print(moduleInformation.HEAD, DEC);Serial.print(" ");Serial.println(moduleInformation.HEAD, HEX);

	Serial.print(F("Freq.: "));  Serial.println(moduleInformation.frequency, HEX);
	Serial.print(F("Version  : "));  Serial.println(moduleInformation.version, HEX);
	Serial.print(F("Features : "));  Serial.println(moduleInformation.features, HEX);
	Serial.println("----------------------------------------");

}




Receiver Code:

/*
 * LoRa E32-TTL-100
 * Receive fixed transmission message on channel.
 * https://www.mischianti.org/2019/12/03/lora-e32-device-for-arduino-esp32-or-esp8266-power-saving-and-sending-structured-data-part-5/
 *
 * E32-TTL-100----- Arduino UNO or esp8266
 * M0         ----- 3.3v (To config) GND (To send) 7 (To dinamically manage)
 * M1         ----- 3.3v (To config) GND (To send) 6 (To dinamically manage)
 * TX         ----- RX PIN 2 (PullUP)
 * RX         ----- TX PIN 3 (PullUP & Voltage divider)
 * AUX        ----- Not connected (5 if you connect)
 * VCC        ----- 3.3v/5v
 * GND        ----- GND
 *
 */
#include "Arduino.h"
#include "LoRa_E32.h"

// ---------- esp8266 pins --------------
//LoRa_E32 e32ttl(D2, D3, D5, D7, D6);
//LoRa_E32 e32ttl(D2, D3); // Config without connect AUX and M0 M1

//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e32 TX, Arduino TX --> e32 RX
//LoRa_E32 e32ttl(&mySerial, D5, D7, D6);
// -------------------------------------

// ---------- Arduino pins --------------
//LoRa_E32 e32ttl(2, 3, 5, 7, 6);
SoftwareSerial mySerial(6, 7); // Arduino RX <-- e32 TX, Arduino TX --> e32 RX
LoRa_E32 e32ttl(6, 7); 

//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(2, 3); // Arduino RX <-- e32 TX, Arduino TX --> e32 RX
//LoRa_E32 e32ttl(&mySerial, 5, 7, 6);
// -------------------------------------

// ---------------- STM32 --------------------
// HardwareSerial Serial2(USART2);   // PA3  (RX)  PA2  (TX)
// LoRa_E32 e32ttl(&Serial2, PA0, PB0, PB10); //  RX AUX M0 M1
// -------------------------------------------------

// ---------- Raspberry PI Pico pins --------------
// LoRa_E32 e32ttl100(&Serial2, 2, 10, 11); //  RX AUX M0 M1
// -------------------------------------

void printParameters(struct Configuration configuration);
void printModuleInformation(struct ModuleInformation moduleInformation);
//The setup function is called once at startup of the sketch
void setup()
{
	Serial.begin(9600);
	while (!Serial) {
	    ; // wait for serial port to connect. Needed for native USB
    }
	delay(100);

	e32ttl.begin();

//	e32ttl.resetModule();
	// After set configuration comment set M0 and M1 to low
	// and reboot if you directly set HIGH M0 and M1 to program
	ResponseStructContainer c;
	c = e32ttl.getConfiguration();
	Configuration configuration = *(Configuration*) c.data;
	configuration.ADDL = 0x03;
	configuration.ADDH = 0x00;
	configuration.CHAN = 0x17;
	configuration.OPTION.fixedTransmission = FT_FIXED_TRANSMISSION;

	e32ttl.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE);
	printParameters(configuration);
	c.close();
	// ---------------------------
	Serial.println();
	Serial.println("Start listening!");
    e32ttl.setMode(MODE_0_NORMAL);
}
struct Message {
    char type[5];
    char message[8];
    byte temperature[4];
};

// The loop function is called in an endless loop
void loop()
{
	if (e32ttl.available()  > 0){

		ResponseStructContainer rsc = e32ttl.receiveMessage(sizeof(Message));
		struct Message message = *(Message*) rsc.data;
		Serial.println(message.type);

		Serial.println(*(float*)(message.temperature));
		Serial.println(message.message);
//		free(rsc.data);
		rsc.close();
	}
}

void printParameters(struct Configuration configuration) {
	Serial.println("----------------------------------------");

	Serial.print(F("HEAD : "));  Serial.print(configuration.HEAD, BIN);Serial.print(" ");Serial.print(configuration.HEAD, DEC);Serial.print(" ");Serial.println(configuration.HEAD, HEX);
	Serial.println(F(" "));
	Serial.print(F("AddH : "));  Serial.println(configuration.ADDH, DEC);
	Serial.print(F("AddL : "));  Serial.println(configuration.ADDL, DEC);
	Serial.print(F("Chan : "));  Serial.print(configuration.CHAN, DEC); Serial.print(" -> "); Serial.println(configuration.getChannelDescription());
	Serial.println(F(" "));
	Serial.print(F("SpeedParityBit     : "));  Serial.print(configuration.SPED.uartParity, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTParityDescription());
	Serial.print(F("SpeedUARTDatte  : "));  Serial.print(configuration.SPED.uartBaudRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTBaudRate());
	Serial.print(F("SpeedAirDataRate   : "));  Serial.print(configuration.SPED.airDataRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getAirDataRate());

	Serial.print(F("OptionTrans        : "));  Serial.print(configuration.OPTION.fixedTransmission, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getFixedTransmissionDescription());
	Serial.print(F("OptionPullup       : "));  Serial.print(configuration.OPTION.ioDriveMode, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getIODroveModeDescription());
	Serial.print(F("OptionWakeup       : "));  Serial.print(configuration.OPTION.wirelessWakeupTime, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getWirelessWakeUPTimeDescription());
	Serial.print(F("OptionFEC          : "));  Serial.print(configuration.OPTION.fec, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getFECDescription());
	Serial.print(F("OptionPower        : "));  Serial.print(configuration.OPTION.transmissionPower, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getTransmissionPowerDescription());

	Serial.println("----------------------------------------");

}
void printModuleInformation(struct ModuleInformation moduleInformation) {
	Serial.println("----------------------------------------");
	Serial.print(F("HEAD BIN: "));  Serial.print(moduleInformation.HEAD, BIN);Serial.print(" ");Serial.print(moduleInformation.HEAD, DEC);Serial.print(" ");Serial.println(moduleInformation.HEAD, HEX);

	Serial.print(F("Freq.: "));  Serial.println(moduleInformation.frequency, HEX);
	Serial.print(F("Version  : "));  Serial.println(moduleInformation.version, HEX);
	Serial.print(F("Features : "));  Serial.println(moduleInformation.features, HEX);
	Serial.println("----------------------------------------");

}

As you can see, receiver can't receive any data. Can anyone help me about it please? Thanks.

How are they connected? Show your schematics, plus some good, clear photos of your setup.

@awneil Both systems same connected, so i'm posting one photo for both of them.

E32 --- Arduino
VCC --- 3.3V
GND --- GND
RX --- 7
TX --- 6

Text is very poor way of describing electrical/electronic circuits - please post a schematic (aka "circuit diagram")

See: " Schematics or circuit diagrams" in the "How to get the best out of this forum" article

EDIT

and what's with the tape wrapped around the connectors?

If you suspect that the connections are unreliable, then you really need to address that properly.

It also means we can't actually see the connections from the photo.

And where does the 3.3V come from, show us on a schematic ?

1 Like

@awneil
@srnet
As you can see, I mentioned the connections between E32 and Arduino. So the 3.3v comes from Arduino's 3.3v pin.

Again, Text is very poor way of describing electrical/electronic circuits - please post a schematic (aka "circuit diagram").

A photo of a hand-drawn schematic is fine.

Well, is it okay?

Just checking.

Its normal practice to not power the LoRa module from the Arduinos 3.3V pin due to its limited current handling capability.

Did you check the E32 device datasheet to see what the ratings for the voltage on its VCC pin are ?

Is the E32 a 3.3V logic level device ?

1 Like

Yes, for LoRa E-32, the recommended supply voltage is 3.3v.

:point_up_2: This! :point_up_2:

Radio modules can take very large current peaks when they transmit - best to have a dedicated supply.

I tried with power supply, still can't establish communicate between modules.

Is that right?

You haven't said which library you're using - is this it?

That one says:

#include <SoftwareSerial.h>
#include "LoRa_E32.h"
SoftwareSerial mySerial(2, 3); // RX, TX
LoRa_E32 e32ttl100(mySerial);

@awneil
Yes, i'm using this library.

I also tried to pull M0 and M1 pins to ground and restart system. But still no communication.

And after pulling M0 M1 pins to ground, at serial monitor, head info changes to : "HEAD : 0 0 0".

any ideas?

Again, the library documentation has:

SoftwareSerial mySerial(2, 3); // RX, TX
LoRa_E32 e32ttl100(mySerial);

But you have:

SoftwareSerial mySerial(6, 7); // Arduino RX <-- e32 TX, Arduino TX --> e32 RX
LoRa_E32 e32ttl(6, 7); 

Are you sure that's correct?

you mean,

LoRa_E32 e32ttl(6, 7); 

this line?

or SoftwareSerial line?

The pair of lines!

ADDED:

The library example first creates a SoftwareSerial instance, and then passes that instance to the e3ttl

You code creates a SoftwareSerial instance, and then creates the e3ttl on the same pins.
That looks suspicious - like the two things will be "fighting" to both use those pins ...

Yes, that's illogical. But i tried with another code and modules still can't communicate. So only problem is not "fighting".

Show that code.