Hi all,
I have a things uno and loaded the receiving example script form thingsnetwork.h.
it lets me do this:
#include <TheThingsNetwork.h>
// Set your AppEUI and AppKey
const char *appEui = "secret";
const char *appKey = "secret";
#define loraSerial Serial1
#define debugSerial Serial
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
#define freqPlan TTN_FP_EU868
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
void setup()
{
loraSerial.begin(57600);
debugSerial.begin(9600);
// Wait a maximum of 10s for Serial Monitor
while (!debugSerial && millis() < 10000)
;
// Set callback for incoming messages
ttn.onMessage(message);
debugSerial.println("-- STATUS");
ttn.showStatus();
debugSerial.println("-- JOIN");
ttn.join(appEui, appKey);
}
void loop()
{
debugSerial.println("-- LOOP");
// Send single byte to poll for incoming messages
ttn.poll();
delay(10000);
}
void message(const uint8_t *payload, size_t size, port_t port)
{
debugSerial.println("-- MESSAGE");
debugSerial.print("Received " + String(size) + " bytes on port " + String(port) + ":");
for (int i = 0; i < size; i++)
{
debugSerial.print(" " + String(payload[i]));
}
debugSerial.println();
}
Now If I send a downlink it shows up in my application livedata tab but I dont see it in my serial monitor. as if the device doesnt see it.
How can I make the payload show up in my serial monitor ? If I send uplinks it works perfectly so the device is connected