@beegee. Bernd, my Arduino code using AT commands with the 3272S was working (joining Chirpstack and sending data at intervals for hours) until I powered cycled (the processor which also powers the 3272s). Reloading the program doesn’t help.
Now the 3272s fails to join the gateway (LoRaWAN mode) and keeps giving the following response on the Arduino Serial Monitor:
RAKwireless RAK3172-E Example
This is a follow-up to the Forum Item:
https://forum.rakwireless.com/t/rak3272-at-param-error-with-at-send/9506
ARDUINO SERIAL MONITOR READOUT:
Setup started
AT+ATM
OK
AT+NWM=1
RAKwireless RAK3172-E Example
--------AOK
RAKwireless RAK3172-E Example
RAKwireless RAK3172-E Example
---------------------------------send JOIN command
RAKwireless RAK3172-E Example
RAKwireless RAK3172-E Example
RAKwireless RAK3172-E Example
RAKwireless RAK3172-E Example
AT+SEND=6:00AA
AT_NO_NETWORK_JOINED
Following is the bulk of the test code:
#include <Arduino.h>
//#include <Wire.h>
#include "STM32LowPower.h"
static char recv_buf[512];
volatile uint32_t startMillis = 0; // timer for LoRa upload response
const int timeout_ms = 10000; //timeout for LoRa upload response
const int join_timeout_ms = 20000; //timeout for JOIN
bool join = true;
bool stop = false;
bool SwanToSleep = false;
volatile int ctr = 0;
const uint32_t timeLoopCycle = 30 * 60 * 1000; //repeat series of data sends every 30 minutes
volatile uint32_t timeNextDataSend = millis();
const uint32_t timePerDataSend = 2 * 60 * 1000; // time between each data send
volatile uint32_t durSwanSleep = 20 * 1000; //duration for SWAN to SLEEP
volatile int wakeup_counter = 0;
const uint32_t numbDataSends = 10; // number of data sends per cycle
int ctrCycles = 0;
// RX TX Establish SWAN SERIAL2 port for the RAK3272 module
HardwareSerial Serial2(PA10, PA9); // This works to connect SWAN TX, RX pins to RAK3272S UART2 (which accepts AT commands)
//---------------------------------------------------------------------------------
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
delay(5000);
// Initiate low power capability for SWAN
//LowPower.enableWakeupFrom(NULL,swanWakeup);
Serial.begin(115200);
delay(1000);
Serial2.begin(115200); //Serial port for RAK3272
delay(1000);
Serial.println("Setup started");
delay(100);
Serial2.println("AT+ATM");
delay(100);
Serial2.println("AT+NWM=1");
delay(100);
Serial2.println("AT+SN=?");
delay(100);
Serial2.println("AT+VER=?");
delay(100);
Serial2.println("AT+BAND=5");
delay(100);
Serial2.println("AT+CLASS=A");
delay(100);
Serial2.println("AT+MASK=0002");
delay(100);
Serial2.println("AT+CHE=1:2");
delay(100);
Serial2.println("AT+CFM=1");
delay(100);
Serial2.println("AT+ADR=1");
int ch;
int index;
startMillis = millis();
do
{
while (Serial2.available() > 0)
{
ch = Serial2.read();
recv_buf[index++] = ch;
Serial.print((char)ch);
delay(20);
}
} while (millis() - startMillis < join_timeout_ms);
delay(5000);
digitalWrite(LED_BUILTIN, LOW); // turn off LED to indicate Setup completed
//LowPower.begin();
}
//--------------------------------------------------------------------------------
void loop()
{
int ch;
int index;
// Join Network if needed
if(join==true)
{
Serial.println("send JOIN command");
Serial2.println("AT+JOIN=1:1:8:3"); //Set for confirmed data download and 3 retries
delay(5000);
startMillis = millis();
do
{
while (Serial2.available() > 0)
{
ch = Serial2.read();
recv_buf[index++] = ch;
Serial.print((char)ch);
delay(20);
}
} while (millis() - startMillis < join_timeout_ms);
Serial.println(" ");
Serial2.println("AT+SEND=6:00AA");
//delay(5000);
startMillis = millis();
index = 0;
do
{
while (Serial2.available() > 0)
{
ch = Serial2.read();
recv_buf[index++] = ch;
Serial.print((char)ch);
delay(20);
}
} while (millis() - startMillis < join_timeout_ms);
Serial.println(" ");
join = false;
delay(2000);
}
I also tried using the RAKDAP1 to give AT commands to the RAK3272s, but still get the same result, after which the 3272s no longer seems to accept AT commands via PUTTY. Here is the PUTTY screen capture.
AT
OK
AT+SN=?
AT+SN=AC1F09FFFE0825BF
OK
AT+BAUD=?
AT+BAUD=115200
OK
AT+NJM=?
AT+NJM=1
OK
AT+NJS=?
AT+NJS=0
OK
AT+BAND=?
AT+BAND=5
OK
AT+JOIN=1:0:10:8
OK
RAKwireless RAK3172-E Example
Current Work Mode: LoRaWAN.