Serial Connection with RYLR896 radio using ESP32

The problem I am having is with the AT command it says it does not receive the right AT head format.

Command Info: https://reyax.com/products/rylr896/

ESP32 connecting via UART0 pins as UART2 is being used by another device. The radio only requires 2.8v to 3.6v and a max of 43mA. The 3.3v and 40mA should be enough power as the radio is responding with the error code. I can always use the vcc 5v and add a resistor to get the correct V if I need more power to increase transmitting range later on.

// Define the RX0 and TX0 GPIO pins for Serial0
#define RXD1 3
#define TXD1 1

// Define GPIO_PIN to supply the 3.3V needed for the radio
#define GPIO_PIN 23
#define RADIO_BAUD 115200

void setup() {
  // Set up the GPIO pin 23 to supply power
  pinMode(GPIO_PIN, OUTPUT);
  digitalWrite(GPIO_PIN, HIGH);
  delay(100);
  
  // Initialize Serial0 for communication with the RYLR998
  Serial.begin(RADIO_BAUD,SERIAL_8N1,RXD1,TXD1);  //Serial0,UART0
  delay(500);
  Serial.println("\nSerial Setup Complete");
  
  // Sending and Seciveing AT commands 
  Serial.println("Response: " + Serial.readStringUntil('\n'));        //Response: 
  Serial.print("AT\r\n");                                             //Sending to radio
  Serial.println("Response: " + Serial.readStringUntil('\n') + "\n"); //Response:
}

void loop() {
}
20:12:06.287 -> 
20:12:06.287 -> Serial Setup Complete
20:12:06.287 -> Response: +READY
20:12:06.287 -> AT
20:12:06.287 -> Response: +ERR=2
20:12:06.287 -> 

According to the datasheet, the RYLR890 doesn't have built-in support for AT commands.

Follow the example code.

Sorry that is only the chip I am using the RYLR896

https://reyax.com/products/rylr896/

Modify the title of your thread. I will look closer.

Hi korokid5869. Welcome to the forum.

It would help to know which board you are using?

// Define the RX and TX pins for Serial 1
#define RXD1 3
#define TXD1 1

On most Arduino boards pins 0 and 1 are reserved for RX0 and TX0. Given these pin numbers I can only guess that you might be using an ESP8266 or ESP32?

You are then referring to both the terminal and radio serial port by the same designation, namely 'Serial':

If the radio is connected to UART1 then you should define the correct pins and refer to it as Serial1:

 // Initialize Serial 1 for communication with the RYLR998
  Serial1.begin(115200);
  Serial1.begin(RADIO_BAUD,SERIAL_8N1,RXD1,TXD1); //UART1

On the ESP32 its called Serial2 and you have to add an extra line to initialise it. However, that would depend on what board it is and whether it actually has a second UART. Therefore please could you let us know which board it is?

You haven't shown the circuit layout which again would be helpful, but don't use GPIO pins to directly supply power to anything:

// Define GPIO_PIN to supply the 3.3V needed for the radio
#define GPIO_PIN 23

The radio chip almost certainly draws more than the GPIO pin is rated to deliver so the chip will not power up and the GPIO will be damaged. Can you elaborate on how you designed this part of the circuit?

Again, this next section does not seem to make sense. You are using the same serial port to talk to the radio and also to print the responses to the terminal?

You can't use the same serial port for both, so again, is the radio supposed to be on another port? How have you actually wired it?

ESP32 connecting via UART0 pins as UART2 is being used by another device. The radio only requires 2.8v to 3.6v and a max of 43mA. The 3.3v and 40mA should be enough power as the radio is responding with the error code. I can always use the vcc 5v and add a resistor to get the correct V if I need more power to increase transmitting range later on.

Thats an easy way of burning the radio module out.

I switched to using Uart1 instead of Uart0 and it works thanks for all your help!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.