2024-08-04 03:36 AM
I got 2 STM32F446VET7 MCU board and I am trying to communicate each other with LoRa E220-400T30S.
I cannot found any usefull libraries so I am trying to write one.
I can communicate with modules from UART and setting configuration parameters.
Both E22 module has same configuration(address,channel, baudrate, etc.)
in the documents of datasheet it says : "in fixed mode..."
data[0] is 0x00 which is ADDR High
data[1] is 0x01 which is ADDR Low
data[2] is 0x32 which is Channel (410.125MHz + data[2]*1MHz = 460.125MHz)
so I am sending uint8_t data[5] = {0x00, 0x01, 0x32, 0x03, 0x03}; through to the E220 in tranciever board.
I try with 2 functions.
HAL_UART_Transmit(&huart1, data, sizeof(data), HAL_MAX_DELAY);
HAL_UART_Transmit_DMA(&huart1, data, sizeof(data));
on the other side I am trying to read with 3 ways:
HAL_UART_Receive(&huart1, data, sizeof(data), HAL_MAX_DELAY);
HAL_UART_Receive_IT(&huart1, data, sizeof(data));
HAL_UART_Receive_DMA(&huart1, data, sizeof(data));
But I cannot read any data. What should I do?
2024-08-04 07:46 AM
My shared projects with 2 Nucleo-L432KC boards that communicate in Lora point to point, which you can learn from.
https://github.com/rreicher/STM32-Lora-EBYTE-E22-900T22D
My EBYTE modules are E22-900T22D in 868MHz and UART. It is based on a SEMETCH SX1278 module, yours is an LLCC68 module. But the UART protocols are perfectly identical.
Have a look at the drivers e220_900t22d.h and e220_900t22d.c
Apart from the operating modes defined by M0 and M1, and the AUX pin, which appears to be identical, you should simply change the addresses relating to register reads/writes. You'll need to refer to the respective User Manuals.
From personal experience with these modules, I'd say you should also measure the AUX timing precisely. Do this with an oscilloscope and adjust the following constants:
#define E220_MODE_TIMEOUT_MS 40U // Timeout for E220 Mode switching
#define E220_TX_TIMEOUT_MS 2U // Timeout for E220 packet send
Best regard.
Romain
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-08-05 07:29 AM
I wrote myself a library for the E220-400T30S but I could only do the configurations.
I adapted the library you gave me according to myself, but again I could not go beyond making configurations.
I cannot send and receive data in any way
! I DONT HAVE AUX CONNECTION ON MY BOARD. AUX IS FLOAT"
Here is my test station. I got 2 boards with STM32F446VET7 and LoRa E220-400T30S & 2 410-480MHz antenna.
I tried fixed and tranmission modes seperatly but nothing changed. Still no data transcieve.
Here is my Transciever and receiever configuration for fixed mode:
and first three byte of data is ADDH(0x00) - ADDL(0x03) - CHANNEL(0x04) of receiever.
uint8_t E220_tx_Buffer[8] = {0x00, 0x03, 0x04, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};
and the transmit & receive functions that I used in while loop :
Transmit :
Receive :
2024-08-05 09:55 AM
Is it an hardware issue? You must investigate, normally these modules can transmit already out of the box without any configuration.
- Are your STM32 uart's working? Are they well configured? Can you send ascii characters to a serial terminal?
- Have you crossed the signals between the STM32 and the modules UART_RX to the E220_Tx and UART_Tx to the E220_Rx?
- Have you checked and visualized the Rx and Tx signals from one end to the other of your modules (with a logic analyzer or an oscilloscope)?
- Have you you visualized the AUX pins, do you see the waveform responses that you find in the user manual of the module (even if you do not use AUX)?
- Are your modules and STM32 correctly (sufficiently) powered, can you check your cards and your schematic?
Good luck
Romain
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-08-06 08:16 AM
Hello Romain thanks for answering.
My UART are working. I can configure my device with that.
Yes I crossed RX-TX signals.
This is the transciever logic analyzer image:
RED is module RX pin which microcontroller TX.
Orange is AUX pin and it always LOW.
This is the receiver logic analyzer image:
White is module TX pin which microcontroller RX always high.
Brown is AUX pin and it always LOW
2024-08-06 08:37 AM
According to the waveform you shared AUX pin is always Low, and according to sections 5.5 Reset and 5.6 AUX description from E220-400T30S_UserManual_EN_v1.1.pdf, your modules are not in a transmit or receive state.
After reseting module, no UART transfert, could you observe AUX pins go High?
Do you confirm that M0 and M1 are Low to put each module in normal mode (see table 6 operating mode) ?
Do you confirm both modules are properly powered?
Could you share the schematic of boards?
Best regards,
Romain
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-08-06 09:52 AM
Hi Romain, thank you for answer
I recheck my connection. Unfortunately I connect ANT to logic analyzer instead of AUX.
I fix that.
Now my true signals
I do the GPIO SET on M1 and M0 for configuration (deep sleep - configuration mode)
I do the GPIO RESET on M1 and M0 for transmission & receive (normal mode)
ON THE TRANSMITTER SIDE
TRANSMITTER CONFIGURATION SIGNAL :
(WHITE ONE IS TRANSMITTER RX WHICH MCU TX, OTHER ONE IS AUX)
DATASHEET :
TRANSMITTER TRANSMISSION SIGNAL :
(AUX ALWAYS HIGH)
ON THE RECIEVER SIDE
RECIEVER CONFIGURATION SIGNAL :
(WHITE ONE IS RECIEVER TX WHICH MCU RX, OTHER ONE IS AUX)
Datasheet :
RECIEVER RECIVE SIGNAL :
(AUX and RX always high)