Hi,
I’m loading the demo Simple LoRa sketch to my one and after compiling and error appears:
LoRaWAN_ABP_OTAA_SAMPLE:45: error: ‘ENABLE_PIN_IO’ was not declared in this scope
pinMode(ENABLE_PIN_IO, OUTPUT); // ONE
exit status 1
Anybody knows why?
Many many thank’s
#include <Arduino.h>
#include <Wire.h>
#include "Sodaq_RN2483.h"
#define debugSerial SerialUSB
#define loraSerial Serial1
// ABP
const uint8_t devAddr[4] = { ****************** };
const uint8_t appSKey[16] = { ************************************} ;
const uint8_t nwkSKey[16] = { ***************************};
void setupLoRaABP(){
if (LoRaBee.initABP(loraSerial, devAddr, appSKey, nwkSKey, true))
{
debugSerial.println(“Communication to LoRaBEE successful.”);
}
else
{
debugSerial.println(“Communication to LoRaBEE failed!”);
}
}
void setup() {
//Power up the LoRaBEE
//pinMode(BEE_VCC, OUTPUT); // Autonomo
//digitalWrite(BEE_VCC, HIGH); // Autonomo
pinMode(ENABLE_PIN_IO, OUTPUT); // ONE
digitalWrite(ENABLE_PIN_IO, HIGH); // ONE
delay(3000);
while ((!SerialUSB) && (millis() < 10000)){
// Wait 10 seconds for the Serial Monitor
}
//Set baud rate
debugSerial.begin(57600);
loraSerial.begin(LoRaBee.getDefaultBaudRate());
// Debug output from LoRaBee
LoRaBee.setDiag(debugSerial); // optional
//connect to the LoRa Network
setupLoRa();
}
void setupLoRa(){
// ABP
setupLoRaABP();
// OTAA
// setupLoRaOTAA();
}
void sendPacket(String packet){
switch (LoRaBee.sendReqAck(1, (uint8_t*)packet.c_str(), packet.length(), 8))
{
case NoError:
debugSerial.println(“Successful transmission.”);
break;
case NoResponse:
debugSerial.println(“There was no response from the device.”);
setupLoRa();
break;
case Timeout:
debugSerial.println(“Connection timed-out. Check your serial connection to the device! Sleeping for 20sec.”);
delay(20000);
break;
case PayloadSizeError:
debugSerial.println(“The size of the payload is greater than allowed. Transmission failed!”);
break;
case InternalError:
debugSerial.println(“Oh No! This shouldn’t happen. Something is really wrong! Try restarting the device!\r\nThe network connection will reset.”);
setupLoRa();
break;
case Busy:
debugSerial.println(“The device is busy. Sleeping for 10 extra seconds.”);
delay(10000);
break;
case NetworkFatalError:
debugSerial.println(“There is a non-recoverable error with the network connection. You should re-connect.\r\nThe network connection will reset.”);
setupLoRa();
break;
case NotConnected:
debugSerial.println(“The device is not connected to the network. Please connect to the network before attempting to send data.\r\nThe network connection will reset.”);
setupLoRa();
break;
case NoAcknowledgment:
debugSerial.println(“There was no acknowledgment sent back!”);
// When you this message you are probaly out of range of the network.
break;
default:
break;
}
}
void loop() {
// put your main code here, to run repeatedly:
String packet = "SODAQ";
sendPacket(packet);
delay(5000);
}