Sending AT Commands to Telemetry Radio

Hello all,

I am trying to send AT commands to a telemetry radio (Sparkfun Link).

I wrote a quick script to send serial commands, and I am not receiving anything back. I send a "+++" to place it into AT mode, and I am supposed to get "OK" in return. Any idea what I am doing wrong? Any help is greatly appreciated!

#include <SoftwareSerial.h>
const byte rxPin = 0;
const byte txPin = 1;
String TXdata;
SoftwareSerial mySerial(rxPin, txPin);

void setup() {
  mySerial.begin(57600);
  Serial.begin(115200);
}

void loop() {
    if(Serial.available() > 0){   //check if any data was received
    // Get Data from Serial Monitor Input
    TXdata = Serial.readStringUntil('\n');
    Serial.println("Input = " + TXdata);
    Serial.println("Waiting...");
    delay(3000);
    // Send to Device
    Serial.println("Sending: " + TXdata);
    mySerial.print(TXdata);
    // Get response
    Serial.print("RECEIVED DATA: ");
    Serial.println(mySerial.readString());
    //Serial.println(TXdata);
    }
}

What Arduino are you using? Many use pins 0 and 1 for hardware serial (Serial). Serial ports cannot share pins.

The fastest that I have had software serial work, reliably, is 38400 baud.

Thanks for the reply! I should have said, but I’m using a SEEED XIAO, where pins 6 & 7 are rx and tx.

Default baud is 57600 for the radios.

Update to this:

I’ve eliminated the SoftwareSerial, and used Serial1 for the device and Serial for the console. When I send the “+++” command, I get “ok”.

When I send “ATI”, I get “ATI” in return. I’m going to see if I have a device with 2 UART interfaces to try and see if this works.

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