E32 LORA tranceiver module: quick start guide

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

E32 LORA tranceiver module: quick start guide

Post by MJU »

I have promised to share my experience with the E32 LORA tranceiver modules from the Chinese manufacturer EBYTE.
I've wrote a bit of text to help other people to play with these modules and I hope that someone makes a Flowcode component for these modules in the future.

A lot of thanks goes to chipfryer27, kersing and Medelec for their continuous support on this forum!
Chipfryers27 earns a tall statue for helping me out behind the scenes in this project! (and a lot of beers!)

**********************************************************************************
The E32 Lora module from Ebyte is a cheap LORA tranceiver that is controlled by a standard serial (UART) port.
It uses LORA spread spectrum modulation to accomplish RF connection between nodes. It can not connect to LORA-WAN network.

They are available in 433Mhz 868Mhz and 915Mhz version. Check out the proper frequency for your region.
They claim to have a Line Of Sight send/receive distance of 3Km for the 't20d' versions (100mW).

I bought the "E32-868T20D SX1276 868MHz 100mW DIP Wireless Module" from Aliexpress.
I've also bought these generic antennas described as "Omni 868MHz High Gain uhf Antenna CDSENET TX868-JK-20 SMA Male 868 MHz Omnidirection Wifi Antennas for Communication".
But keep in mind that these are only for 868Mhz modules. Other frequencies need other antennas.

My own rangetesting

I've tested them by sending a few bytes and looked at the receiver module if he had received something. I didn't look if the received data was corrupted, just if the RX received a signal on the modules address and the channel it was supposed to listen to.

I've used an (Chinese) Arduino Nano (clone) and a breadboard that was powered by a battery.

To check if there was data received, I looked at the AUX pin" and had a LED to indicate if there was a connection.
To my big surprise they did very well.

The sender (TX) was lying on my attic (some 10m above ground).
I walked around the area where I live. There are fields, but also a lot of houses that came in between the sender and the receiver.
The power was set to the default setting of 30dB, the baudrate was the default 2.4kbps.

I managed to walk a distance of 700m bird's eye view, with several rows of buildings between the RX and TX. Still I received "a" signal from the TX.

Sometimes the connection failed, but this was a very basic setup, in the manual there are tip of how to improve the distance (proper antenna, where and how to place the modules and so on).

The manual (not a real datasheet) for the 868 version can be found here:
https://www.google.com/url?sa=t&rct=j&q ... GuQyA_XLz_

The pin connections...

The module has 7 connections: GND and VCC (off course), RX and TX (off course) AUX-pin, M0 and M1.

The RX of the module needs to be connected to the TX of a microcontroller (or other serial device like a USB/serial adapter). The TX must be connected to the RX of the controller device.

Make sure you read the manual for proper voltage levels on the IO-pins of the device. They seem not to be very keen on 5V on the IO pins. But mine are working a quite long time now with only a resistor in the RX line. (read the remarks on this in the manual if you want to use a 5V microcontroller).

For the power supply there seem to be a lot topics on forums that indicate that this is critical for the operation of the modules. Mine keep working on the 5V that is fetched of the Arduino Nano 5V pins. The Arduino is powered via a USB port.

The AUX-pin is an output that indicates if the module is busy doing something.
The "IDLE" state of the pin is HIGH. This means that most actions can take place when this pin is logic 1. If the pin is low, it means that there is data being send, received, or that the module is initializing.
How to read and act upon this pin => manual.

The M0 and M1 pins are the mode select pins.
There are 4 modes.
Mode 0 is where M0 and M1 are 0, this means, the module can send or receive data. This is called "Normal mode".
Mode 3 (called "Sleep mode": M0 and M1 are logic 1) is where the initialization can be performed. Also the reading of the stored settings, reset and so can be accomplished in this mode.

Initialization

The module needs to be put into mode 3 (M0 and M1 logic 1).
By sending serial commands you can read the current configuration, reset the module or change the configuration.

By sending 0xC4 0xC4 0xC4 (three times 0xC4) you can reset the module. My advice is to reset the module after altering settings for the module.
To read the current settings, you need to send 0xC1 0xC1 0xC1 (three times 0xC1).
Reading the version number is done by sending three times 0xC3

Then, changing the setting..

In sleep mode (M0 and M1 are logic 1), this can be done by sending 0xC0 OR 0xC2, followed by 5 other bytes. (difference between 0xC0 and xC2 as header is that with C0, the settings are stored at power down, 0xC2 does not store the settings @power down)

These 5 other bytes are settings for the HIGH ADDRESS BYTE, then the LOW ADDRESS BYTE, then the SPED settings, then the CHAN setting and last, the OPTION settings.

The default settings for the UART are 9600 8N1. The UART settings can be changed by altering the SPED byte.

Important settings are the HIGH and LOW ADDRESS bytes. You can choose them freely.
Make sure you change the default settings for these addresses before starting the TX/RX action.
Both modules can't have the same addresses if they listen to the same channel..

Then you need to change the CHAN settings.
My opinion is that it's best to give the TX and RX different channels.

The CHAN settings change the frequency the module listens to when it's ready to receive data.

In the OPTION settings, it's best to choose between FIXED or TRANSPARANT transmission mode.
The difference between them are that in FIXED mode, the module only listens to the broadcast that is started with the proper HIGH and LOW address of the module (and the right channel).
In TRANSPARENT mode the RX module captures everything that is broadcasted in the chosen channel.

For instance.

TX and RX are in fixed mode.
RX is configured with HIGH address = 0x00 and LOW address 0x01 on channel 0x04.
To send data from the TX to RX, you need to send <0x00 0x01 0x04 data>

The data can be everything with a maximum of 512bytes before a buffer overrun takes place.
The modules have a maximum capacity of 54 bytes in a single package.
As soon as the RF part of the module starts sending data, the AUX pin goes low.

So in FIXED mode, first send the HIGH, LOW address byte, followed by the channel, and then the data.

In TRANSPARANT mode, no need to send the address of the module.

When this option is chosen in the OPTION settings, you start the broadcast with 0XFF 0XFF (or 0x00 0x00). Followed by the channel and the data.
Example: <0xFF 0XFF 0X04 data> will send the data to all modules that are in transparent mode listening to channel 4.

The AUX pin.

During transmitting the AUX pin goes low until all data is send by the RF part of the module.

It's adviced to wait a few more milliseconds before starting a new action after the AUX pin goes HIGH again (refer to the manual for timing).

During configuration of the module (for instance at wake up), the AUX pin goes low to indicate there is something going on, and please wait until the module is ready (again, after the AUX pin goes HIGH, wait a few ms).

During receiving data, the AUX pin goes low about 5ms before the received serial data is send to the microcontroller (or other device).
It's best to monitor this pin to see what's going on, and make the microprocessor wake up, or start listening to the data that is about to show up.

I've made a few Flowcode charts that simply setup a TX and RX module, send data on one module, and receive the data on a second module..
TX FC1.fcfx
(17.38 KiB) Downloaded 754 times
RX FC.fcfx
(17.39 KiB) Downloaded 420 times
As I'm testing this by looking at the data via my logic analyzer, there was no need to add displays or so on.
Please adapt them to your needs and please keep the forum up to date on what you are doing with these modules.

Maybe one day the E32-xxxT20D's become a standard Flowcode component :-)

petrsi
Posts: 1
Joined: Thu Dec 26, 2019 11:00 am
Contact:

Re: E32 LORA tranceiver module: quick start guide

Post by petrsi »

Hello,
I have problem with sleep mode. I use library by Kris Kasprzak.
After :
Transceiver.SetMode(MODE_PROGRAM); //M0 and M1 are HIGH
//Transceiver.Reset();
Serial.print("M0:");Serial.println(digitalRead(M0));
Serial.print("M1:");Serial.println(digitalRead(M1));

The comsumption is high - E32 doesn't go to sleep mode.

Then I use MOSFET P type according http://www.gammon.com.au/forum/?id=12106.

The behavior is strange. When I put the E32 directly into the PCB arduino it still reboots. When I use 10 cm wires to connect everything is OK and E32 goes to sleep mode.

Cam me give any advice?

Thanks
Attachments
Ebyte_sender_v6.zip
(3.12 KiB) Downloaded 429 times
LORA.png
(52.14 KiB) Downloaded 1234 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: E32 LORA tranceiver module: quick start guide

Post by kersing »

Why are you asking this question on a Flowcode forum while referring to and attaching Arduino code? Is there not a more appropriate forum available?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

chipfryer27
Valued Contributor
Valued Contributor
Posts: 618
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 195 times
Contact:

Re: E32 LORA tranceiver module: quick start guide

Post by chipfryer27 »

Hi

I agree with Kersing that this is probably not the best place for advice, perhaps the "Gammon" forum you document would be better as it his circuit.

However I am sightly confused in that you are using a FET to switch power to the E32 module but are still expecting to put it into "sleep". Surely you would either power off completely or use the sleep function (which requires the module to be powered) not both?

Regards

Post Reply