Get Started

Datacake offers native Integration for Devices that use LoRaWAN Networks. Our mission is to make it easier to bring devices onto the Datacake Platform. For this Datacake features:

  • Payload De- / Encoders for common LoRaWAN Devices

  • Integration for LoRaWAN Networks (TTN, TTI, Loriot, Kerlink)

  • Ready-to-Use Templates for common LoRaWAN Devices

Add your first LoRaWAN Device to Datacake

To create your first LoRaWAN Device you have to navigate into your fleet overview and press the "Add Device" Button on top right of the device-list panel.

Now a dialog appears asking you for the type of device you want to create. Please select the type "LoRaWAN Device".

After selecting the device type "LoRaWAN Device", a wizard appears, which guides you through the individual steps. As a first step a list of available LoRaWAN device templates is displayed. This looks something like the following:

You now have two options.

  1. You already own a LoRaWAN device and want to add it to Datacake

  2. You create your own LoRaWAN device on Datacake

In the next steps we will now deal with the case that you already own one or more LoRaWAN devices and that this is also available in the list of templates.

What are the advantages of using Templates?

When you select a template, the following things are automatically configured and set up for you in the background.

  • The connection to the LoRaWAN network

  • Payload Decoder / Encoder

  • Creation of a dashboard

  • Set the necessary configuration

When would I want to create my own LoRaWAN Device?

If you have a LoRaWAN device that is not listed in the list of available device templates, you can still use it with Datacake. For this purpose we provide you with all necessary functions:

LoRaWAN Network Server Integration

  1. TheThingsNetwork

  2. TheThingsIndustries

  3. Kerlink Wanesy

  4. Loriot

  5. Chirpstack

Payload Decoder

Datacake features writing your own Payload Decoders directly on Datacake. There is no need to create an Application based Payload Decoder on your LoRaWAN Networks server.

Add your Device using a Template

Ok. So you already own a LoRaWAN device and want to add it to Datacake? Great. The following steps will guide you through the process.

What you will need

In order for you to be able to create your LoRaWAN device on Datacake, there are a few requirements you need to meet:

  1. You have a LoRaWAN Gateway

  2. The Gateway is linked to a LoRaWAN Network Server (like TTN or Loriot)

  3. You know the DevEUI, AppKEY and AppEUI of the device.

There are open TTN gateways and networks in my area. Can I use them?

Yes, even if you do not have access to these gateways or networks, you can still use them by either

  • Create an application on TTN (each Gateway routes the packets of your sensors to the correct application).

  • Select the Datacake TTN in the LNS selection (more on this in a moment).

You do not own a LoRaWAN Gateway yet?

We offer our own gateway, which connects to the Internet and the Datacake platform via cellular. The set up is very easy, because you do not need any programming or a LoRaWAN network server.

Do I need a LoRaWAN Network Server?

If you want to operate your own gateway, you need a LoRaWAN network server to which the gateway can connect. For example, use the open and free version of TheThingsNetwork LoRaWAN Network Server or Loriot.

Chose a Device Template

When adding a new LoRaWAN device the wizard will show you a list of available templates. Search for the device you want to add and select it by clicking on it.

You can also filter the list by manufacturer or use the search field and type in the name of the device you are looking for.

My device is not in the list of templates. Can I still use it?

Sure. In this case you will need to create an integration for your device yourself. Datacake features all the things that are necessary for this. In the chapter "Create your own Device" you will learn how to create individual LoRaWAN devices on Datacake.

Great. Simply contact us. All we need for this is a device name, description and logo. If you have already integrated your devices via "Generic LoRaWAN Device" adding your device to the global template section just takes a few minutes.

Select your LoRaWAN Network Server

Once you have selected your device from the list, the next step is to select your LoRaWAN network server your Gateway is connected to. To do this, you also use the list now displayed in the wizard.

This list shows you all available LoRaWAN Network Servers. There are a few special features which we will now discuss in detail:

Datacake TTN

We have created a separate application on the public TheThingsNetwork for each device in the list. This facilitates the onboarding of your LoRaWAN device and can be used for example in the following situations:

  • There is a public TTN Gateway near you.

  • You already have your own TTN Gateway in your area nearby.

TheThingsNetwork

If your gateway is connected to TheThingsNetwork, select this option. If there is a TTN Gateway near you, you can also use this option. The only important thing is that you have created a corresponding application on TTN. If not, select the "Datacake TTN" instead which features predefined Applications.

TheThingsIndustries

If you have your own instance of the TTI network, select this option.

Select this option if your gateway connects to the Kerlink Wanesy network. However, there is one important point to note:

  • The decryption of the payload must be done on Wanesy (Decryption - not payload encoding - which is done on Datacake).

The Wanesy can optionally decrypt the sensor data. This option has to be activated because we expect an unencrypted payload.

Loriot

We support the Loriot LoRaWAN network server. Select this option if you want to connect to a Loriot Server.

Chirpstack

We offer support for the open ChirpStack LoRaWAN network server. If you are running a gateway with ChirpStack, please select this option.

Can I change the Network later?

Currently, yes. Basically this list is just to show you which networks Datacake supports. Matching is done via the DevEUI of your device. So if you later move the device to another (supported) LoRaWAN Network Server, you only have to set the Webhook setting on that server. Changing it in Datacake is not necessary.

Enter Device Details

Once you have decided on a template, you must enter final details about your device:

  • Chose a Name

  • Set DevEUI

  • (Optionally enter AppEUI and AppKEY when selecting Datacake TTN)

Here's how this looks:

Name

Here you can assign any name for your device. You can change this name at any time from device configuration.

Device EUI (DevEUI)

The assignment of data from the LoRaWAN network server and the respective device in Datacake is happening based on the DevEUI. So please enter the correct DevEUI of your desired device here.

Enter AppEUI and AppKEY

When choosing Datacake TTN as the preferred LoRaWAN Network Server it is required that you in addition to DevEUI also enter AppEUI and AppKey.

This looks like the following:

Entering those additional details is required in order for the device being registered correctly on the corresponding Datacake TTN Application.

The benefits are that you are not required to configure the Device on a third-party LoRaWAN Network server.

Add Device

To create your device you have to confirm your entry by clicking the button "Add Device". This also takes you directly to the dashboard of your new device.

Configure Webhook

In order for your devices and your LoRaWAN Network Server to forward data to Datacake, you need to configure a Webhook Integration on your LNS.

If you've selected "Datacake TTN" as your desired LNS you can skip the step of setting up a Webhook as we've done this already. Another benefit you get from choosing Datacake TTN.

This applies to both "Generic LoRaWAN Device" and devices you've created from using a Template.

The Webhook URLs are:

  • TTN: https://api.datacake.co/integrations/lorawan/ttn/

  • TTI: https://api.datacake.co/integrations/lorawan/tti/

  • Wanesy: https://api.datacake.co/integrations/lorawan/wanesy/

  • Loriot: https://api.datacake.co/integrations/lorawan/loriot/

  • ChirpStack: https://api.datacake.co/integrations/lorawan/chirpstack/

On your LoRaWAN Network Server you will need to create a Webhook Integration and paste the above URL for the corresponding LNS.

Example: Webhook for TTN

As TTN is by far the most popular LoRaWAN Network Server and most people use this as a starting point we've covered the necessary steps for TTN as an example in this starting guide.

Access your TTN Application

To set your Webhook Integration on TTN you need to navigate into the corresponding Application on TTN. Here is a screenshot of how this might look:

Create an Integration

Next thing you do is navigating to the "Integrations" section. Here you click on the "+ add integration" button on right end of the Integrations Table like shown in the following screenshot:

This will bring up a new view that shows you all available integrations. Here you simply click on the "HTTP Integration" as shown in the following screenshot:

Next step is that you prepare the Integration and paste the following URL:

  • https://api.datacake.co/integrations/lorawan/ttn/

In addition to providing the Webhook URL you need to provide Details like a freely choosable "Process ID", the Access Key, and the Method of the Webhook HTTP request. Simply configure those options like shown in the screenshot above.

Testing your Webhook

If you have successfully set up the Webhook integration, your LNS will now forward the data from your devices to Datacake.

To ensure that the data is also forwarded to the respective device in Datacake, we perform a matching to the DevEUI, which is send to us with every webhook request.

If you are now sending data from your device, you can tell if the Webhook integration is working by using the "debug" section of your Datacake device. This section can be found in the tab bar of your device view.

If data is successfully forwarded to the device, this is indicated by a corresponding output - as shown in the following example:

And what about the other LNS?

We've created a detailed guide on how to set up those Integrations. You can find it here:

Troubleshooting

If you do not see any Data in Datacake, even though they are sent from your device and can also be seen in your LNS, this may be due to the following reasons:

DevEUI entered wrong

Please check your DevEUI. If it was entered wrong, in this case you need to delete the device and add it once more and make sure you type it correctly.

Webhook Integration not set on LNS

In order for Datacake to receive Data from your Devices a Webhook Integration needs to be set up on your LNS. This startup guide covers the necessary steps for setting up such an integration on TTN. The following guide covers webhook setup for additional LNS:

Webhook URL set wrong

Please make sure that you've set the correct Webhook URL:

  • TTN: https://api.datacake.co/integrations/lorawan/ttn/

  • TTI: https://api.datacake.co/integrations/lorawan/tti/

  • Wanesy: https://api.datacake.co/integrations/lorawan/wanesy/

  • Loriot: https://api.datacake.co/integrations/lorawan/loriot/

  • ChirpStack: https://api.datacake.co/integrations/lorawan/chirpstack/

Create your own Device

In many cases it makes sense that you do not create a device on the basis of a template, but start from scratch. In some cases it is also not possible to use a Datacake Template. The reasons for this could be, for example:

  • Your device does not yet have a Datacake Template

  • You develop your own devices (example: via ESP32 or Arduino)

  • You need special functionalities that are not covered by the default Template

Customizing Templates

If there is a template for your device and you still want to customize it, you do not need to create a new device. After creating a device using a Datacake template, you can adjust all functions of this device.

  • You can make modifications to the template decoder.

  • Add new, additional database fields.

  • Customize basic dashboards.

Use a Template Device as a starting point / example

A good way to start creating your own device using the "Generic LoRaWAN Device" functionality is to use a Template device as an example. You don't even need a physical device for this. You can just enter a fake device and then simply delete the device later.

Generic LoRaWAN Device

To create your own LoRaWAN device we have implemented a generic device type, the so-called "Generic LoRaWAN Device". When you add a new LoRaWAN device, you will find it as first item in the list:

To proceed with creating your custom device please select this device type.

Select LoRaWAN Network Server

After selecting the generic device type you will be asked for the LoRaWAN Network Server you want to use with that device. You have the following options:

  • TheThingsNetwork

  • TheThingsIndustries

  • Kerlink Wanesy

  • Loriot

  • ChirpStack

They all are basically working very similar and matching of Payload and Device is done based on the provided DevEUI for your device. Also it is possible to change the LNS during runtime.

We've written a detailed guide on how to set up your LoRaWAN Network Server in order to connect it to Datacake and forward payload Data from your Devices. You can find it here:

Enter Device Details

As the final step you need to enter the DevEUI of your custom device and give it a name. This looks very much like the following screenshot:

Name

Provide a Name for your custom device here. You can change that later at any time from within the device config panel.

Device EUI (DevEUI)

Use this field to provide the DevEUI of your custom Device.

Add Device

To finalize the creation of your custom device you need to press the "Add Device" Button. This will bring you directly to the device view.

Create Payload Decoder

Next step is that you add your custom payload decoder or write it directly on Datacake as the platform provides all the necessary tools for this:

  • JavaScript based Payload Decoder

  • Functions to test the decoder

  • Debug section with logging output

Can I use Payload Decoders that already run on TTN?

Yes, mostly. There are some minor differences so that some complicated Payload Decoders that use custom language feature might not work. In this case there are some workarounds. But mostly 99% of payload decoders do work.

However you need to adapt the output of the decoder so that this matches the way how Datacake requires Data to be forwarded.

There is a dedicated page in the Documentation that gives detail on writing payload decoders on Datacake:

Your first Decoder

We are now going to cover the basics of payload decoding on Datacake here. See the following example for a basic Datacake Payload Decoder:

function Decoder(payload, port) {
if(port === 1) {
return [
{
field: "TEMPERATURE",
value: payload[0] / 10
}
];
}
}

It's probably making no sense at all but it's showing you how you need to return the data from your code so that Datacake can read it and forward it into a corresponding field in the database of your device.

Most important is the structure that is returned. Datacake awaits a JSON-Array with Dictionaries inside. Each Object in that Array is a Dictionary with at least two values:

  1. The Field Identifier for the Database (field)

  2. The actual value to be stored in the field (value)

Create Database Fields

In order for Datacake to forward the returned data into Database Fields of your Device you first of all need to create corresponding fields. You do this by scrolling into the fields section in the device configuration.

Here you press on the "Add Field" button. A modal will open up which will ask you to provide settings and Details for the to be created field.

To be consistent with the above payload decoder example, we will create a Temperature field. This will look very much like the following example:

Identifier

The Identifier has to be a unique alphanumeric and upper-case string that identifies the field. This is also used by the payload decoder to forward data into the corresponding field - so matching from payload to database is happening based on this identifier.

return [
{
field: "TEMPERATURE",
value: payload[0] / 10
}
];

If you want to learn more about creating database fields, the different types and their settings, see the following chapter in the documentation:

Testing your Payload Decoder

Datacake provides tools that help you test your payload decoders. We will use these now to test the above example. Underneath the payload decoder section you find an area where you can enter demo payload data and execute the decoding of that payload.

Simply enter some random bytes (Payload) here and press on the "Test"-Button on the right end of that row.

If the payload decoder runs successfully, you should see a corresponding result in the output. If Datacake was able to assign the returned data to one or more fields, you will see this as a confirmation in the "Recognised Measurements" section (red arrow).

Your payload decoder has now been successfully created. For more information on this topic and troubleshooting, please see the following link:

Next Steps

With creating fields in the database and setting up a basic payload decoder on Datacake your Datacake device is now ready to receive data from your actual - physical - devices.

Forward Data from LNS to Datacake

As you have already entered the DevEUI of your device during creation you now have to set up the Webhook Integration on your LoRaWAN Network server. How you do this is covered in the next chapter "Configure Webhook" or covered in detail here:

Create Dashboard

As you have created a "Generic LoRaWAN Device", this of course does not include a dashboard. You must now create a separate dashboard for your device.

To do so, navigate to the "Dashboard" item in the Device Overview using the tab bar.

To create a dashboard, activate the edit mode with the button at the right end of the tab bar. Now the dashboard can be edited accordingly. To create a dashboard, simply drag and drop widgets onto the appropriate areas of the dashboard.

​