Lpp.cayenne & downlink


#1

Hi all,
I try downlink order from Cayenne dashboard to lorawan node (arduino nano + rfm95 ) but I don’t really anderstand the steps to follow.
(yes I’ve read Cayenne docs :wink:

(uplink is ok: by exemple i receive temperature in Cayenne dasboard)

1- With lpp.addDigitalOutput in my sketch I can see a “digital output” widget in Cayenne dashboard.

lpp.addDigitalOutput(4, 1); // channel 4, set digital output high

2- When i click on this widget I can observe a payload in my TTN console (04 00 64 FF or 04 00 00 FF ) with th information : port 99 scheduled confirmed.
(and after “downlink scheduled” I can see “downlink sent” by the gateway )
So it’s ok : 04 <=> channel 4 and 64 <=> my digital output is “ON” but …

3- Question : how to retrieve and use this information in my sketch.ino to flash a led or operate a relay by example ?
the beginner I am failing to find tutorial :frowning:
( https://mydevices.com/cayenne/docs/lora/#lora-cayenne-low-power-payload-examples-downlink-message is not clear enough for me )

Really thanks for your help :slight_smile:


#2

I would assume that using lpp.addDigitalOutput(4, 1); will automatically set pin 4 to whatever the dashboard is, but unfortunately I broke the USB port on my gateway so I can’t test it (mine had the same fate as @rsiegel’s) :frowning: There maybe be a function that you have to call periodically similar to cayenne.loop() with the MQTT connection method.

@jburhenn I looked on the github page for some examples and wasn’t able to find any or wasn’t looking in the right place, do you have any that you can share?


#3

actually, there is no direct library to decode the cayenneLPP payload.


#4

Yeah, we don’t currently have an example for receiving the LPP payload. Probably because it depends on the LoRa library used. @Fufu, what LoRa library are you using to send data?

Depending on what library it is you may need to add some code in loop() to receive data from the server, or you may need to register a callback to handle data.


#6

Ok, thanks for your return, shramik_salgaonkar :slight_smile:


#7

Thanks jburhenn,
I’m using arduino_lmic (I put the -little- sketch in my answer to adam )
( https://github.com/matthijskooijman/arduino-lmic )


#8

Hi adam,
not a very original code: I discover (and copy / paste for the moment! ! )


#9

It looks like you are already getting the LMIC.frame data for the downlink message inside the EV_TXCOMPLETE case statement. Is that not working? If not it might be an issue with the arduino-lmic library.