Estou tentando conectar a um gateway mas quando roda o código, dá o erro AT_JOIN_ERROR.
/* Includes */
#include <LoRaWAN.h>
#include <SoftwareSerial.h>
#include <stdint.h>
/* SoftwareSerial handles */
SoftwareSerial* hSerialCommands = NULL;
/* Variables */
char str_counter[128];
int counter = 0;
void setup()
{
Serial.begin(9600);
Serial1.begin(9600);
delay(1000);
Serial.println(“Initializing…”);
/* Initialize SoftwareSerial */
hSerialCommands = SerialCommandsInit(13, 15, 9600);
Serial.println(“Reset…”);
SendRaw(“ATZ\r\n”);
delay(5000);
Serial.println(“Configurando OTAA…”);
SendRaw(“AT+NJM=1\r\n”);
delay(1000);
//Serial.println(“Configurando DADDR…”);
//SendRaw(“AT+DADDR=26:01:1B:72\r\n”);
//delay(1000);
/* Configurando EndDevice como ABP */
Serial.println(“Sending App Key…”);
SendRaw(“AT+APPSKEY=minhaKey”);
delay(1000);
Serial.println(“Sending Application EUI…”);
SendRaw(“AT+APPEUI=meuEUI”);
delay(1000);
Serial.println(“Sending Channel Mask…”);
SendRaw(“AT+CHMASK=FF00:0000:0000:0000:0001:0000”); // TTN
delay(1000);
Serial.println(“Enviando Delay de Janela JN1…”);
SendRaw(“AT+JN1DL=5000”);
delay(1000);
Serial.println(“Enviando Delay de Janela JN1…”);
SendRaw(“AT+JN2DL=6000”);
delay(1000);
Serial.println(“Sending JOIN…”);
SendRaw(“AT+JOIN”);
delay(1000);
Serial.println(“Aguardando 30 segundos apos JOIN…”);
delay(30000);
}
/* Loop ---------------------- */
void loop()
{
sprintf(str_counter, “AT+TXCFM=83:1:3:{“Contador”:“contador”,“value”:2} \r\n\0”, counter++);
SendRaw(str_counter);
Serial.println(str_counter);
Serial.println(“Aguardando 5 segundos apara proximo envio…”);
delay(5000);
sprintf(str_counter, “AT+SEND=5:{“Contador”:“contador”,“value”:%d} \r\n\0”, counter++);
SendRaw(str_counter);
Serial.println(str_counter);
Serial.println(“Aguardando 5 segundos apara proximo envio…”);
delay(5000);
}