TTN Node with Cayenne

On the learning curve about IoT, I have a TTN Node which I ave programmed up with the “Basic” sketch to transmit its data to my TTN Application.

So far so good. I receive the data on the TTN data monitor on the website.

Next I created a “Lora” | “The Things Network” | “Cayenne LPP” Device in the MyDevices.Cayenne portal. I have entered the DevEUI of my Node.

Then I added a “MyDevices” Integration to the TTN Application that handles my Node.
In that Integration,

Basically, I have followed the instructions:
(Cayenne | The Things Network)

But, while the TTN Console shows the data coming in, the Cayenne dashboard steadfastly says:
" Your dashboard appears when Cayenne receives data from this device. Set up your device to transmit more frequently to speed up the process."

What am I missing?

Should I have programmed the Node with a special Sketch?
I don’t expect to see correctly formatted/parsed data yet (I know it does not send LPP-formatted data) but I would at least see the RSSI and SNR information, showing that the communication is occurring.

Related question - instead of “Cayenne LPP”, there is also a “The Things Node” as a choice in the Cayenne Device selection. What would I use that for (as opposed to the “Cayenne LPP” object?

Grateful for any assistance.

try this code arduino-device-lib/CayenneLPP.ino at master · TheThingsNetwork/arduino-device-lib · GitHub and the device as cayenneLPP in the dashboard.

Yes - that did the trick.
So the node needs to have the “CayenneLPP” Sketch running in order for Cayenne to respond at all.

Thank you.

Do you know what theCayenne “LoRa” | “The Things Network” | “TTN Node” object is for or how it works?

you can select the TTN node also while adding device. The cayenneLPP is there for any other lora node that is sending data in cayenneLPP format.

That is great - I have done that and it all works. Thanks again.

I have one more question if I may (to anyone who may know):
In the sketch for my TTN Node, how do I handle incoming downlink transmissions?

I can find plenty of examples for Arduino boards, etc. but not for the TTN Node.
All I want is “proof of concept”, i.e. to flash the LED when I send a digital or an analogue packet back down to the TTN Node.

I have tried adapting the “LPPDecode” and LMIC examples but nothing seems to come in, despite the TTN console showing “scheduled”, “confirmed” and “confirmed ack”.

you can add this code in the cayenne LPP code

void loop()
  debugSerial.println("-- LOOP");

  // Send single byte to poll for incoming messages


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]));


Thank you again for your help.

I have added the function message() at the end of my Sketch .ino file and I call ttn.poll(); at the end of the SendData() function which is called from the TheThingsNode::loop() function (via various callbacks) which is called from my main loop() function.

So I think I have fully and accurately complied with your instructions.

However, the message() function is never called, whether I send a downlink byte from the TTN device panel or punch a change in the Analog Output widget in Cayenne - both of which are reported in the data stream view on the TTN console…

Indeed, looking at the data stream, all that calling ttn.poll() does is to send a second, single byte transmission with a payload of 0x00 right after each main payload message.

Again, I am probably doing something wrong but clearly I am not setting up for the message() function to be called when a downlink message occurs.

I will upload my whole Sketch.
CayenneJan.txt (3.4 KB)

sorry, i missed one thing. Add ttn.onMessage(message); in your void setup()

1 Like

That’s it!
It works.
Thanks again.


Just out of interest, what hardware did you write this sketch for?


So no specific board, Arduino, TTGO etc?

That’s some good looking hardware Shramik :slightly_smiling_face: