Lpp.cayenne & downlink

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:
( myDevices | Simplify Sensor Deployments is not clear enough for me )

Really thanks for your help :slight_smile:

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?

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

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.

2 Likes

Ok, thanks for your return, shramik_salgaonkar :slight_smile:

Thanks jburhenn,
I’m using arduino_lmic (I put the -little- sketch in my answer to adam )
( GitHub - matthijskooijman/arduino-lmic: This library is deprecated, see the README for alternatives. )

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

https://ncloud.zaclys.com/index.php/s/d8qPjtR4YTYp4gE

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.

Hello, to decode Cyanne message, you can use this librairie : GitHub - Alarevoyure/LPP-DECODE: This program is used to decode Cayenne messages using addAnalogOutput and addDigitalOutput

1 Like

Hi,
Thanks for this return Loegaux :slight_smile:

Sorry jburhenn : I had not seen your answer before that day … and to be honest I was busy in the kitchen garden in recent weeks !
I’ll go back to LPP Cayenne as soon as possible :wink:

1 Like