Problem with Lora-E5 module when sending messages

Hello everyone,

I have two Seeed LoRa E5 Grove modules that I am programming with a STM32. The thing is that all the AT commands work fine, I am able to change all the settings, join via OTAA and send a message. The problem is that when I try to send the second message, using any of the commands for it (like AT+ MSG= “Data to send”) the second messages only send the first two letters (in this case AT).

This code alway fail after the second message (The module has already joined the network)
(I always wait to receive the command completion message form the Lora module)

while(true){
		  char cmd[20];
 		  sprintf(cmd, "AT+MSG=\"123456\"\r\n");
		  HAL_UART_Transmit(&huart4,(uint8_t*)cmd,strlen(cmd), 0xFFFF );
		  HAL_Delay(10000);
}

In the logic analyzer I see:
first message send [AT+MSG=“123456”\r\n]
Second message only send [AT]
Thir message send [AT+MSG=“123456”\r\n] but it will fail because for the Lora-E5 is like ATAT+MSG=“123456”\r\n
Four merssage only send [AT]
And so on

Hi there,
sounds like a local echo or the terminal your using has it turned on?
or you need to flush the serial port before the next transmission?
my .02
HTH
GL :slight_smile: PJ
also you sure about the CR & LF , maybe just the \n"

It was the communication problem with the UART because it did not finish reading the whole message before sending another command, and part of the data was lost, resulting in an error. Thanks

Nice Job… :wink: :+1:

GL :slight_smile: PJ