Using Cayenne LPP
How to use Cayenne LPP on Datacake
Last updated
How to use Cayenne LPP on Datacake
Last updated
If you are working with Cayenne LPP on your LoRaWAN Devices, Datacake offers a ready-to-use template.
A Cayenne LPP LoRaWAN Device
A free Datacake Account
This tutorial expects that you have registered on the Datacake Platform. If you haven't already done so, please head over to https://app.dacake.de/signup and create a Free Account on Datacake.
Now navigate into the Device Overview of your Workspace and create a new device.
After you have clicked on Adding a new Device you will see a list of available LoRaWAN Templates.
Use the search field and search for "Cayenne" or select "Datacake" from the list of available Manufacturers
Select "Cayenne LPP Starting Templates" from the list of results
The next step in adding a device is choosing a device plan.
Datacake allows having 2 free devices in your Workspace. Additional Devices can be individually purchased by choosing one of the available plans. We have different plans for different use-cases available. Read more about Pricing on https://datacake.co/pricing
When this is the first device that you are going to create, you can select "Free"
After you have chosen the plan you are required to set the LoRaWAN Network Server.
We have public applications for the Cayenne LPP Template on the TheThingsNetwork LoRaWAN Server. If you already have a TTN enabled gateway or TTN Network coverage in your area, you can use the LoRaWAN Server Option to Datacake without the need of setting up an Application on the TTN Console.
Read more about that option here:
To finalize the creation of your new device, you need to enter its DevEUI and set a Name using the following dialog:
Name: Enter a Name for your Device - you can change this at any later time
Device EUI: This is the DevEUI from your Device. You can find that on your LoRaWAN Network Server or in the Code of your Device.
After you have entered this required information, you have to click on the "Add Device" button. The Device will now be created and you should see the Device-View:
If you have selected the Datacake TTN Option you need to provide not only the DevEUI but also AppEUI and AppKey in order to be able to add the Device on Datacake.
Datacake receives information from the LoRaWAN Network Server via Webhook.
In order to forward Data from your LNS to Datacake, you need to set up a Webhook in the Application of the Network Server. Read more about how you configure the Webhook forward on your LNS:
Configuring LNSBy setting up the LNS it's also possible to send Downlinks to your Cayenne LPP Device. Read the following Page to know more about how you set up Downlinks for your Device:
Downlinks (LoRaWAN)If you have set up a Webhook on your LoRaWAN Network Server and your Device is already sending Data, you should be able to see this on Datacake.
For better debugging purposes, every device on Datacake has a Debug-Console that you can access from the Device-View by using the top Tab-Bar:
In this view, you will see the last 100 Messages and also some basic error logs. If data was successfully received by your device, this will look like the following:
In the above screenshot you see two messages:
A successfully receive webhook data forward from TTN
The Payload Decoder inside our Cayenne LPP Template was able to decode the bytes and record a measurement value into a database-field of that device.
Congratulations! You have forwarded your first Data packages from your Cayenne LPP Device to Datacake.
If you don't see data being recorded into the database fields of your newly created device, that's OK as we most likely have to create fields for your particular application first.
This is covered in the next chapter.
As the Cayenne LPP format can be used dynamically we cannot create Database Fields because we simply do not know what you are going to use it for.
So we are now going to show you how you create Database fields for the measurement values you are going to send.
By using the Cayenne LPP Template on Datacake you will have a device with an embedded payload decoder that you can use as a starting point (and modify it at any time).
This decoder transforms messages into values that can be stored in the Database of your Datacake-Device. The decoding takes place according to the Cayenne LPP specification.
For each Channel and Type, you want to send from your Device, you have to create a field in the Database. This looks something like the following:
So and now:
When your Device sends a value or payload (of multiple values) in the Cayenne LPP format, the decoder will turn this into a format that matches the Datacake API Structure.
This is then mapped automatically to a corresponding Database field in the "Fields"-List inside the configuration tab:
If the Field is not available in the List of "Fields", you need to create a new field and set the Identifier of that field to the Output of the payload Decoder.
If the Payload Decoder Output is like:
You need to create a field with the Identifier set to ANALOG_OUTPUT_0
If you want to make changes to the Payload Decoder you can access that from within the configuration view of your Device.
This will show you the decoder:
Read more about the creation and editing of Payload Decoders on Datacake:
Payload DecodersHead over to the Dashboard View using the Tab Bar of your Device and create a Dashboard that shows the measurement values of your device: