Heltec CubeCell - send AT commands programmatically

I want to send to the CubeCell AT-Commands by Code.
For example Serial.write(“AT+XXX\r”) doesnt work.
Any ideas how to solve that?

Thanks a lot in advance…

Try sending without the carriage return

No, that has no effect…

That about defining the commands as char ?

Something like:

char command1[] = “AT+XXX”;

and then

Serial.write((uint8_t *) command1);

Didn’t tested this one - only as a rough thought about your problem…
Perhaps you could create a string with the “base” ‘AT+’ plus the actual command ‘XXX’.
Don’t forget to include

#include “string.h”

at the beginning.

Example may be like that:

char start[]=“AT+”;
char command[]=“XXX”;
char end[] = “\r\n”;
Serial.write((uint8_t *) start);
Serial.write((uint8_t *) command);
Serial.write((uint8_t *) end);

Greetz,

Detlef

I found this on documentation. Maybe it will help, I’m planning to try also.
Serial Port Settings

* Baud rate: 115200
* Stop bit: 1
* Data bits: 8
* DTR, RTS requirement:  **None**
* Ending characters:  **None**

**Make sure there is NO ending characters or new line in you serial monitor config.**

https://heltec-automation-docs.readthedocs.io/en/latest/cubecell/lorawan/config_parameter.html#via-at-command

Serial.write() is to output serial data through the chip, not to write to the chip through the serial port.

Yeah it’s wrong. Do you have any idea how? I tried to use the WASN configurator but I couldn’t verify that it is receiving my AT commands.

What is it that you are trying to achieve? Many of the AT commands have direct variables that can be changed, so if you tell us what you want to actually do, we might be able to help.

I am also interested in this functionality and was going to post my own question but will just add to this since the author did not reply. I may also create my own post.

MY PROJECT GOAL: Use LoRa communication without LoRaWAN. Just broadcast sensor data to a receiver I also manage.

DEVICES: GPS-6502, WiFi Lora 32 (V2)
DEVELOPMENT ENVIRONMENT: Arduino IDE

What I want is a function to send an AT command directly. I know the AT commands I want using the documentation you published at

I am currently doing this with a REYAX RYLR896 device and here is an example of working code using the SoftwareSerial library and a Seeeduino xiao device.

#include <SoftwareSerial.h>

SoftwareSerial LORA(9, 8); // RX, TX

void setup() {
pinMode(8, OUTPUT);
pinMode(9, INPUT);
Serial.begin(9600); // Debug monitor
LORA.begin(1200); // REYAX was configured for this slower rate
LORA.listen();

// Wait till RYLR896 device responds back
while (1) {
Serial.println(“Send AT Command”);
LORA.print(“AT\r\n”);
delay(1000);
String LoRa_response = LORA.readString();
Serial.print(LoRa_response);
if (LoRa_response.compareTo("+OK\r\n") == 0) {
Serial.println(“Compare OK”);
break;
}
Serial.println(“No Response”);
}
Serial.println(“LoRa radio ready!”);

// Query configuration
Serial.println(“AT+VER?”);
LORA.print(“AT+VER?\r\n”);
delay(1000);
Serial.print(LORA.readString());
Serial.println(“AT+BAND?”);
LORA.print(“AT+BAND?\r\n”);
delay(1000);
Serial.print(LORA.readString());

// Configure for appropriate band for USA
LORA.print(“AT+BAND=915000000\r\n”);
Serial.print(LORA.readString());
// etc.
}