TTN CayenneLPP: failed to send webhook, request

Hi guys, I am using CayenneLPP webhook in my application, but it fails to send the webhook to myDevices.

Example of decoded payload:

"decoded_payload": {
        "analog_in_0": 4.966,
        "barometric_pressure_10": 1373.2,
        "barometric_pressure_2": 1018,
        "barometric_pressure_9": 5376,
        "luminosity_5": 5,
        "luminosity_6": 0,
        "luminosity_7": 0,
        "luminosity_8": 27465,
        "relative_humidity_3": 37.5,
        "relative_humidity_4": 36.5,
        "temperature_1": 49.65

(the names are programmed by hand since I do not use the true Cayenne format in my uplinks to reduce frame size - I may have made a mistake maybe?).

In my live data however, I get the following error (even when using true CayenneLPP formatted uplinks):


Opening the Fail to send webhook shows this as main error (I think):

"data": {
    "@type": "",
    "namespace": "pkg/applicationserver/io/web",
    "name": "request",
    "message_format": "request",
    "correlation_id": "641ceba5f3814a39b0934699a8ef751f",
    "code": 14,
    "details": [
        "@type": "",
        "value": {
          "body": "{\"statusCode\":500,\"error\":\"Internal Server Error\",\"message\":\"An internal server error occurred\"}",
          "status_code": 500,
          "url": "",
          "webhook_id": "cayenne-mydevices"

Any ideas how to solve this? And is there a temporary dirty way to save (only) the decoded payload for the next couple of days? Thanks in advance!

Yes, Data Storage, but it only keeps ~24 hours so you will need to extract it regularly. These (mostly) work: GitHub - descartes/TheThingsStack-Integration-Starters: Starter / Template code for various The Things Stack (v3) integrations

The web hook one is drag & drop if you have some external webspace.

That won’t work. TTN sends the raw data to mydevices, not what is available after running the uplink decoder.

Really? :frowning:
So I will be completely unable to use mydevices in this case?
Do you know of an alternative that will accept what I am trying to do? Eventually I’ll sure be able to make my own automatic figure generator but I’m well over paid time by now… plus I don’t even have the time :sweat_smile:

Why so? Correctly encoded LPP payloads will simply be decoded on the Cayenne/MyDevices site and presented in the dashboard. Just enable the webhook (at Application level) with correct settings and then register device (with Dev-EUI) on the cayenne dashboard page…add device, select Lora → the things network → select device type (if off the shelf) or simply Cayenne LPP if self-build with LPP payload, as data arrives the dashboard will start to populate sensor types and then values as data arrives if set correctly :slight_smile: If you declare as LPP payload in TTN console then again correctly encoded data will be decoded and presented in each line in the device console page…

It is acknowledged that LPP isnt the most efficient encoding mechanism but it does work so would suggest look at option of std encode/payload…unless you can prove to your self that the custom encoding is really worth the pain and fact that std webhook a problem…

IIRC you are looking at student use for term by term or semester by semester, perhaps even a couple of yers at a time max vs pushing battery envelope to hit 5/7/15 yr type timescales so payload likely not a big limiter for you?

Thanks for your reply, and I have been using that for the past year. Last week, I moved my devices to a new application on TTN, did just as you said and the webhook failed as mentioned.

But I decided to put some extra effort in being nice to LoRa and built my own encoder and decoder, which means I removed all channel and sensor IDs that Cayenne uses, and I thought to decode it to the JSON format that is presented by the CayenneLPP decoder on TTN, thinking that that JSON would be all that’s passed over to mydevices. So now I am presented with a double problem: the webhook didn’t even work at first and now my formatting is incomplete for Cayenne…

So that’s why I am looking for a solution or alternative! And I’m handing out the first nodes to students tomorrow… so I’m a bit stressed and cannot revert to CayenneLPP formatting at once :sweat_smile:

Understood, good idea but not sure of the mechanisms for passing what you are trying to generate - not sure it can be done in TTN as such ‘integration’ webhooks set up at system level by TTI team again IIRC…others may know better (Jac, Nick?) and advise…likely to do what you want you would have to pull out to your own external application server and do the massaging and forwarding to cayenne/mydevices from there…

Much as I love interesting pickles, this one is a doozy!

We can definitely capture the data using a vanilla web hook (as above) and, famous last words, reprocess it to relay on to Cayenne as expected in a few lines of code.

In the meanwhile, turn on Data Storage and I’ll PM you a web hook link on my data dump server so we are getting it both ways. I can sniff around the Cayenne integration code for TTS but it should be fairly straight forward if you could furnish me with your decoder.

1 Like

@Jeff-UK, I’ve had a good ferret around the Cayenne docs and they don’t appear to have a public incoming URL to push data to - MQTT I can see for RPi and Arduino - a URL to post data to would be soooo much simpler if you are aware of one. I may be able to piggy back off the TTN one but I’d rather use a public documented one if there is one available.

If there is one it would be a recent development (or really well hidden for all those years).

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

MOD:> Re-opened topic at OP request to allow OP to update on solution

Originally, the webhook failed even while I was uplinking official Cayenne-formatted data including channel and IPSO ID.
What was the case? I added my nodes as ABP without DevEUI (this is optional but not required). Thus, there was no DevEUI to forward to Cayenne and it could not resolve the uplink.
So, when using Cayenne and ABP devices, make sure to include your DevEUI during registration!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.