Configuring Datacake to send downlinks

In the last tutorial, we looked at sending downlinks to your device from your TTN account. We shall now configure Datacake to send downlinks from your Datacake account.

Select device

Login to your Datacake account at https://app.datacake.de and select your device.

Then select the ‘Configuration’ tab.

On newer versions of Datacake, you will also have to click the 'Product and Hardware' link in the left-hand menu.



Select config

Scroll down until you get to the ‘LoRaWAN’ section. To the right of 'The Things Stack V3', you will see a ‘Change’ button. Click on this.


Network server pop-up

You will then see this pop-up window.

In this Dialog you need to select your network server and fill in the four textboxes with Information that you find on the TheThingsStack Console.

Firstly, select the network server: ‘The Things Stack V3’.

Now for the four textboxes:

1) TTS Device ID

This is the ID of your Device in your TTN Application. Login to your TTN account https://eu1.cloud.thethings.network/console/applications and select your device. If you open this in a separate tab, you can paste from one application to the other.

Select device ID

The TTS Device ID is the same as the ‘End device ID’, in this case ‘eui-a8610a3230228616’. Click on the icon to the right to copy it into your Datacake account.

2) TTI Server URL

This is the web address of your Things account that you have just opened. If you are with The Things Network in Europe, then your URL is:
eu1.cloud.thethings.network

If you are outside Europe, look at the web address of your Things account and change the ‘eu1’ part of the address to what it says in your address.

If you have a paid for account with The Things Industries, then your URL will be:
datacake.eu1.cloud.thethings.industries

Again, change the ‘eu1’ part of the address if you are not in Europe. 

Add API

3) TTI App ID

This is the ID of your application in your Things account. It is the lower case, no spaces version of whatever you have called your application. Click on ‘Application overview’, the ‘Application ID’ appears under the name of your application.

In this case, ‘board-6’. Copy this into your Datacake application.

Click API keys

4) TTI API Key

Click ‘API keys’ in the left-hand menu. 

Add API key

Allocate a name for the new key. I called mine 'board-6-downlink-api-key' You will not be able to select rights until this is done. Click ‘Grant individual rights’. Then select the last three rights options. These rights allow queueing of downlinks.



Add API link

Then click ‘Create API key’.

Copy API key

You should then see this pop-up.

The new API key is at the foot of the pop-up. If you can’t see it, scroll down. Then click the ‘copy’ icon and paste the key into your Datacake application. When done, go back to the TTN tab and click the blue ‘I have copied the key’ button.

If you need to use the API key again, you will have to delete this key and create a new one.


Try decoder

You should now see your newly created API key.

New server settings

Your Network Server settings on Datacake should now look something like this.


Downlinks configured

Now click the blue ‘Update’ button on the Datacake tab to complete the configuration. You should then see something like this:

If you do, then your downlinks have been successfully configured.
Your downlink settings should automatically be saved. Click ‘Save’ if you are not sure.

Next, try and send a downlink.

Sending a downlink

As before, we are going to send two downlinks, one to turn the Arduino’s onboard LED on, and one to turn it off again.

Send downlink

In Datacake, return to your device dashboard and click ‘Downlinks’.



If you see a message ‘Downlinks have not been configured’, it is because the settings were not saved from the configuration page. If so, go back, add the settings again, then click ‘Update’, and then ‘Save’ on the configuration page.

Configure downlinks

Click ‘Add Downlink’. You should see this pop-up window.

For our purposes, we are only interested in the fields named ‘Name’ and ‘Payload Encoder’. In the name field, type a descriptive name for your downlink. I would suggest keeping this to one word, or at least, use no spaces. This could save confusion later on.

‘Payload Encoder’ is a JavaScript snippet. Content placed in the square brackets [] will be sent to your device in the downlink. It is expecting some hexadecimal code. In our example, we want to send the number 1 to turn the onboard LED on, and the number 0 to turn the system off.

In order to turn on the LED, I gave the downlink the name ‘LED-ON’, and the downloaded hexadecimal value of ‘0x01’, which is the number 1 in decimal. 

LED on

The completed form will look like this. When done, click ‘Save Downlink’ at the foot of the pop-up.

You will see that I have added a couple of words into the ‘Description’ field. If you click on the ‘Test’ button towards the foot of the pop-up, you will see that the number 1 has been returned.


Testing downlink ON

Your downlink will now appear on the downlinks page.

Click on the blue ‘Send Downlink’ button to test. 

Test debug

Now click on the ‘Debug’ tab to see that the downlink has been sent.

The onboard LED on your Arduino should now light up. It may take a minute for your board to pick up the downlink.

Now repeat the process to send a 0 to turn the LED off again.

LED off

Still in Datacake, go back to your device page and click ‘Add Downlink’ again. Now add the details to send a downlink to turn the LED off. 

This time, use the hexadecimal code for 0, which is ‘0x00’.

Two downlinks

You now have two downlinks set up.



Click the blue ‘Send downlink’ button that you have just created to turn the LED off. You can check the ‘Debug’ tab to see that the link has been sent. This time you should see ‘Sent payload: 00’.

And the onboard LED should be turned off.

Setting your Arduino free – untether your device:

Next: Battery power - connecting and charging the Li Po battery Click here for the next steps.

© Copyright 2025 Dr Dulcamara - All Rights Reserved