E32-TTL-100 takes a whole second to transmit a sentence!

Hi, I am trying to make a reliable RC control for my rover using ESP32 and E32-TTL-100, I need to send about 50 character long sentence around 10-20 times a second, BUT there is an interval of around 1s between two messages (on both default speed and highest 19.2k). Is there a setting that limits a packet size or something, so it doesn't send an empty packet with just a little bit of data when it only needs to send 50 characters?

No.

It is likely that on the receive side you are using a read command that doesn’t specify the length of the message you are expecting, but just reads a whole line. In order for it to know when it has finished there is a delay of about a second where it waits to see if any more characters are being sent.

For more specific help post you code correctly using code tags. Yes the copy for forum option in the IDE and paste it into your reply.

1 Like

Is that not a UART front ended module ?

For reliable, and predicatable communications, an SPI based LoRa module is a good alternative.

void setup() {
  Serial2.begin(9600);
  Serial.begin(9600);

}

void loop() {
  //tx
  /*
  String msg = "hello world\n\0";
  Serial2.print(msg);

  delay(300);
  */
  //rx

  String input = Serial2.readString();
  Serial.print(input);
  

}

Commented code is uncommented when uploading to transmitter.

When I was making the first version of controls with WiFi I was getting similar problem because waiting timeout was set long by default, then I changed it to 10ms and it worked like a charm.

Yes, it is UART module, I chose it because I wanted to make it simple, I wanted it to be as simple to use as wire serial.

I mean this would be the most predictable communication for me so far, before I used RPi with SSH controlled Python code (would leave motors on when freezing from overheating), then ESP32 WiFi
which only reached to half of my field.

UHF modules are mostly a poor choice for RC control as you often limited to a 10% duty cycle limit. So to keep it legal you need to know, accuratly, how long each packet takes to transmit. This is easy with SPI based modules. And 10% duty cylce is not good for RC control anyway.

Not heard of anyone attempting to use those UART modules for RC control, it might be possible I guess, but most all of the LoRa RC applications I have seen (including my own) use the SPI modules.

A much much much better choice for RC control is the 2.4Ghz LoRa modules, no real issues with duty cycle, and plenty of range for RC applications.

Good luck.

1 Like

Yes, you dont have complete control over packet size like you do with SPI based modules.

You need to study the datasheet of the E32 for the details ................

Please give me an example of read command that has specified length, so I can try it.

So I fixed it!

I added Serial2.setTimeout(10); to the code and now it too works like a charm! Now I can send 100 messages a second! I had lost hope in this module, I thought it was only designed for sending packets from sensors and stuff, with no urgency in mind, luckily I was wrong.

Sender code:

void setup() {
  Serial2.begin(9600);
  Serial2.setTimeout(10);// not sure if it needs to be here too
  
  Serial.begin(9600); 
}


void loop() {
  //tx
  
  String msg = "hello world\n\0";
  Serial2.print(msg);

  delay(10);
}

Receiver code:

void setup() {
  Serial2.begin(9600);
  Serial2.setTimeout(10);//<<<------VERY IMPORTANT FOR SPEED!!!
  
  Serial.begin(9600); 
}

void loop() {
  //rx
  
  String input = Serial2.readString();
  Serial.print(input);
  

}

Now I can make a new remote with this module, and make a simple code for it.

Thank you for suggestions!