I am trying to use https://github.com/SodaqMoja/Sodaq_RN2483 in a simple sketch with a SODAQ ONE 2903 (re-flashed by Microchip) - when I kick the lib into debug mode, the following sketch
#include <Arduino.h>
#include <Sodaq_RN2483.h>
#define log(...) { SerialUSB.print(__VA_ARGS__); }
#define logln(...) { SerialUSB.println(__VA_ARGS__); }
#define write(...) { SerialUSB.write(__VA_ARGS__); }
#define loraSerial Serial1
// LoRa
const uint8_t devAddr[4] = { ... };
const uint8_t nwkSKey[16] = { ... };
const uint8_t appSKey[16] = { ... };
const uint8_t testPayload[] =
{
0x30, 0x31, 0xFF, 0xDE, 0xAD
};
void setup(void) {
pinMode(ENABLE_PIN_IO, OUTPUT);
digitalWrite(ENABLE_PIN_IO, HIGH);
SerialUSB.begin(115200);
LoRaBee.setDiag(SerialUSB);
loraSerial.begin(LoRaBee.getDefaultBaudRate());
if (!LoRaBee.initABP(loraSerial, devAddr, appSKey, nwkSKey, true))
{
log(F("Connection to the network failed!"));
return;
}
if (LoRaBee.sendReqAck(1, testPayload, 5, 3) != NoError)
{
log(F("Failed to send the packet!"));
}
}
void loop() {
}
alwas spits out:
[initABP]
[init]
[sleep]
[wakeUp]
[resetDevice]
[expectString] expecting RN.(ok)
it seems as if RN2903
is expected, but ok
gets sent - any hints on what I might be doing wrong?
Cheers!