---
agentTools:
  projectIndex: https://docs.iotcreators.com/v2.1/llms.txt
---

# Thales Cinterion  ENS22-E

Learn how to setup and integrate the Cinterion ENS22-E DevKit from Thales with IoT Creators NB-IoT network and Data Provisioning Service (SCS)

## #Introduction

To help developers to start with the NB-IoT module "**Thales Cinterion  ENS22-E**" (NB-IoT module for Europe; Cat NB1; Band 8, 20 -other bands suitable for APAC region are supported as well-) you can use the LGA ENS22 DevKit (developer kit) from the Thales Group.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/962d616-ens22e.jpg",
        "ens22e.jpg",
        671,
        573,
        "#7c7d80"
      ],
      "caption": "Thales Cinterion  ENS22-E LGADevKit"
    }
  ]
}
[/block]

####

**Links**

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/7bca278-Iotcreators_banner_Kreslic_pltno_1.png",
        "Iotcreators_banner_Kreslicí plátno 1.png",
        728,
        90,
        "#bab9d8"
      ],
      "caption": "https://eshop.sectron.eu/en/nb-iot-development-kit/p-15210/"
    }
  ]
}
[/block]

[block:parameters]
{
  "data": {
    "h-0": "Titel",
    "h-1": "URL",
    "0-0": "Where can I get it from?",
    "0-1": "**NB-IoT Development Kit for IoT Creators including a free SIM card:**\n[https://eshop.sectron.eu/en/nb-iot-development-kit/p-15210/](https://eshop.sectron.eu/en/nb-iot-development-kit/p-15210/)",
    "2-0": "Cinterion LGA DevKit - User Guide",
    "2-1": "[https://www.thalesgroup.com/sites/default/files/database/document/2020-11/lga_devkit_ug.pdf](https://www.thalesgroup.com/sites/default/files/database/document/2020-11/lga_devkit_ug.pdf)",
    "3-0": "Cinterion® ENS22-E - AT Command Set",
    "3-1": "[https://m2m-communication.gemalto.com/Thales_ENS22eV02_ATC](https://m2m-communication.gemalto.com/Thales_ENS22eV02_ATC)",
    "1-1": "[https://www.thalesgroup.com/en/markets/digital-identity-and-security/iot/cinterion-lga-devkit](https://www.thalesgroup.com/en/markets/digital-identity-and-security/iot/cinterion-lga-devkit) ",
    "1-0": "Cinterion® LGA DevKit - Home"
  },
  "cols": 2,
  "rows": 4
}
[/block]

####

**Links to the AT command samples:**

* [Query device information](#at-commands-to-get-imei-imsi-and-other-product-information-from-your-devkit)
* [Setup network configuration and verification](#at-commands-only)
* [Send "Hallo World" via UDP](#at-commands-to-send-hello-world)
* [Receive "Hallo Device" via UDP](#at-commands-to-receive--hello-device)

####

####

## #Setup the Device

In the following I will describe you how to setup your devkit so that you are able to send AT commands directly from your computer to the Cinterion module from Thales. To do so you need to

1. connect your your devkit with your computer via USB
2. press the power button
3. execute AT commands on your devkit the first time.

####

####

\##Connect your devkit with your computer

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/364f03e-ensbeschr.jpg",
        "ensbeschr.jpg",
        1007,
        410,
        "#b5b8bc"
      ]
    }
  ]
}
[/block]

Your ENS22 DevKit will be connected with your compute by using micro USB and can be accessed with a terminal program such as "putty" on Windows or "screen" or "minicom" on Linux.

In case you are working with **Linux** you are lucky. The USB/Serial drivers should be already available on your system and you don't need to install anything else.
In case you are using a Windows compute the driver will be automatically installed. If you have any trouble please download a FTDI VCP driver.
After you connected your ENS22 DevKitvia USB with your computer you should find the device file
**/dev/ttyACM0** (or /dev/ttyUSB0). It is automatically created when you connect your ENS22 DevKitwith your computer and if you disconnects it your ENS22 DevKitdisappears again.

Unfortunately I can not tell you how to enable the serial terminal connection via USB on Windows or Mac because I am only working with Linux. Sorry :disappointed\_relieved:.

####

####

####

####

\##Execute AT commands on your ENS22 DevKitthe first time.

To execute AT commands on your ENS22 DevKityou need start on your computer a terminal program such as **putty** on Windows or **minicom** or **screen** on Linux and connect it with your ENS22 DevKitvia the serial USB line. After this you can send AT commands to the modem of your ENS22 DevKit.

In the following I will explain to you how to do this stuff on Linux by using the **minicom** and to send those AT commands to the modem to query device product and IMEI information.

####

####

#### Connect your ENS22 DevKitwith your Linux computer via terminal program minicom

In case minicom is not already installed on your computer you can install it with

> $ sudo apt-get install minicom

####

After that you can configure minicom by executing

> $ sudo minicom -s

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/6e974b6-Bildschirmfoto_vom_2020-08-12_09-51-11.png",
        "Bildschirmfoto vom 2020-08-12 09-51-11.png",
        478,
        375,
        "#3d1a32"
      ],
      "caption": "Main configuration menu of minicom."
    }
  ]
}
[/block]

[block:callout]
{
  "type": "warning",
  "body": "It is important that you run the configuration of minicom as **root** because the resulting configuration file will be stored in the directory /etc/minicom to which root has only write permissions."
}
[/block]

In the minicom configuration menu change the following settings:

* Enter *Serial port setup*
  * Set *Serial Device* to **/dev/ttyACM0**
* Enter *Screen and keyboard*
  * Set *Local echo* to **Yes**
* Enter *Save setup as*
  * Give **ens22e** as the name to save the configuration
* Enter *Exit from Minicom*

####

After configuring minicom for your Thales ENS22 DevKit you can start minicom with the configuration **ens22e*'* which just created before.

> $ minicom ens22e

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/0098693-Bildschirmfoto_vom_2020-08-12_10-11-46.png",
        "Bildschirmfoto vom 2020-08-12 10-11-46.png",
        583,
        227,
        "#351029"
      ]
    }
  ]
}
[/block]

[block:callout]
{
  "type": "info",
  "body": "In case you have any problems to access the device file /dev/ttyACM0 because you don't have enough access privilages for this file execute the following command\n> $ sudo usermod -a -G dialout YOUR-USER-NAME"
}
[/block]

As very  first AT command you should input the command **AT**. This command shall always return **OK**. If not, there is something wrong.

```
AATT

OK

Afterwards you can deactivate your device echo with **ATE0**.

AATTEE00

OK
```

[block:callout]
{
  "type": "success",
  "title": "Congratulations",
  "body": "If you reached this point you equipt your Thales Cinterion  ENS22-E with the capabiltiy to pass your AT commands from the serial USB terminal interface directly through to the modem. \n\n**Now the fun begins!** :smiley: :smiley:"
}
[/block]

####

####

#### AT Commands to get IMEI, IMSI and other product information from your ENS22 DevKit

In the following various AT commands are shown to query the IMEI and other product information from   your ENS22 DevKit.

[block:code]
{
  "codes": [
    {
      "code": "# Request IMEI\nAT+CGSN=1\n                                                                                \n+CGSN: 357518080495450\n\nOK\n\n# Request IMSI of the SIM card\nAT+CIMI\n\n901405700009293\n\nOK\n\n# Request SIM card identification number\nAT+CCID\n\n+CCID: 89882280000001294327\n                                                                                \nOK                                    \n# Request manufacturer identification\nAT+CGMI\n\nCinterion\n\nOK\n\n# Rquest model identification \nAT+CGMM\n\nENS22-E\n\nOK\n\n# Request firmware version identification  \nAT+CGMR\n\nREVISION 02.000\n\nOK\n\n# Request prodct type number\nATI\n\nCinterion\nENS22-E\nREVISION 02.000\n\nOK",
      "language": "shell",
      "name": "AT commands to query general device information"
    }
  ]
}
[/block]

####

####

## #Attach to the NB-IoT Network

This chapter explains how you can attach your Thales Cinterion  ENS22 DevKit to the NB-IoT network. I recommend to read the chapter "Setup Thales Cinterion  ENS22-E"  first.

[block:callout]
{
  "type": "warning",
  "body": "If you are only interested in the conclusion of the AT commands to configure the network setup go to chapter [\"'AT Commands Only\" ](#at-commands-only)"
}
[/block]

[block:callout]
{
  "type": "danger",
  "body": "**Before you send any UDP or COAP message to IoT Creators make sure you registered the device IMEI before.**\n\n**If you forget, you will have problems to register your device afterwards. In this case  please get in contact with IoT Creators support team.**"
}
[/block]

A few assumptions and notes before starting with this manual

* You should be able to send AT commands to your ENS22 DevKit with a terminal program such as putty, screen, minicom, etc.
* Your device is on the latest firmware
* Be gentle to your device and have some patience. After each AT command he/she/it needs a few seconds to execute the command and respond

####

In the following we will walk through together the AT commands with which you can perform the following actions:

* Setup network configuration of you ENS22 DevKit.
* Attach to the network and verify your network configuration.
* Ping an IP address.

####

####

\##Setup Network Configuration
After switching on your ENS22 DevKit deactivate the radio functionality with `+CFUN`. You should do this to make sure no miss-configured automatic dial-in action make your setup difficult.

[block:code]
{
  "codes": [
    {
      "code": "AT+CFUN=0",
      "language": "text",
      "name": "Switch off radio"
    }
  ]
}
[/block]

[block:callout]
{
  "type": "danger",
  "title": "Roaming via Vodafone in UK",
  "body": "In case of romaing via Vodafone in UK you probably need to use ````AT+NCONFIG=\"CR_0859_SI_AVOID\",\"FALSE\"````."
}
[/block]

####

Set the APN of IoT Creators with `+CGDCONT` to cdp.iot.t-mobile.nl (

[block:code]
{
  "codes": [
    {
      "code": "AT+CGDCONT=0,\"IP\",\"cdp.iot.t-mobile.nl\"",
      "language": "text",
      "name": "Set APN"
    }
  ]
}
[/block]

[block:callout]
{
  "type": "info",
  "body": "In case you have the IoTcreators NB-IoT Development Kit from Sectron, set the APN of IoT Creators with ```+CGDCONT``` to **scs.telekom.tma.iot**\n\n> AT+CGDCONT=0,\"IP\",\"scs.telekom.tma.iot\""
}
[/block]

Sometimes you get an ERROR response of the `+CGDCONT` command. Reason for this can be that the radio is not deactivated with `+CFUN=0` and the modem already attached to the network.  In this case just deactivat the radio and try it again.

####

Set the EPS network registration status with `+CEREG` command.

[block:code]
{
  "codes": [
    {
      "code": "AT+CEREG=5",
      "language": "text",
      "name": "Set the EPS network registration status"
    }
  ]
}
[/block]

####

Select the network operator of your choice with `+COPS` command manually (1) by given the numeric identification (2) of the operator ("26201", "20416", "26002", etc.) Check in [Roaming Network Info](https://docs.iotcreators.com/docs/telekom-iot-networks-in-europe) for your local roaming partner and use MCC/MNC combination to attach

[block:code]
{
  "codes": [
    {
      "code": "AT+COPS=1,2,\"26201\"",
      "language": "text",
      "name": "Select Telekom as network operator in Germany"
    }
  ]
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "AT+COPS=1,2,\"20416\"",
      "language": "text",
      "name": "Select T-Mobile Netherland as network operator"
    }
  ]
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "AT+COPS=1,2,\"26002\"",
      "language": "text",
      "name": "Select T-Mobile Poland as network operator"
    }
  ]
}
[/block]

[block:callout]
{
  "type": "success",
  "body": ":+1: Great! Your setup of network configuration is complete now. \n\nThe next step is it to test if it is correct and if your ENS22 DevKit is able to attach the network with it. \n\nGood Luck :smirk:"
}
[/block]

####

The setup of the network configuration is complete. Because we deactivated the radio in the
beginning with `+CFUN=0` nothing should happen so far.
To see your configuration in action you can trigger a reboot of your ENS22 DevKit with the `+NRB` command.

[block:code]
{
  "codes": [
    {
      "code": "AT+NRB",
      "language": "text",
      "name": "Reboot your ENS22 DevKit"
    }
  ]
}
[/block]

After you triggered the reboot with  \`\`\`+NRB you should see the following on your terminal and your ENS22 DevKit should attach to the network automatically.

```AT+NRB

^SYSSTART


+CIEV: suspendAvailable,1

+CIEV: suspendReady,1

```

####

As next we will verify if your ENS22 DevKitis actually attached to the network and verify the network configuration with some more AT commands.

####

####

\##Attach to the Network and verify your Network Configuration
After you have rebooted your ENS22 DevKit the most interesting question is if your ENS22 DevKit got an IP address assigned by the network.
You can query the assigned IP address from your ENS22 DevKit with the `+CGPADDR` command.

[block:code]
{
  "codes": [
    {
      "code": "AT+CGPADDR\n\n+CGPADDR: 0,\"10.128.1.157\"\nOK",
      "language": "text",
      "name": "Query assigned IP address"
    }
  ]
}
[/block]

As the result your ENS22 DevKit returns the current IP address. In this sample it is `10.128.1.157`

[block:callout]
{
  "type": "info",
  "body": "If you are not able to get established a network attachment double check the following \n * Did you configure the correct APN?\n * Did you configure the correct mobile network operator in your country?\n * Did you make sure your SIM card has active roaming in case you are not in the home country of your network operator?\n* Did you connect the antenna?",
  "title": ":angry: What to do if it doesn't work :imp:"
}
[/block]

#### AT Commands to query Network Information

In the following I show you some more AT commands with which you can query other information regarding mobile connection status.

[block:code]
{
  "codes": [
    {
      "code": "# Query if the ENS22 DevKit is attached to the network\nAT+CGATT?\n+CGATT: 1\nOK\n\n# Query the configured MNO (Mobile Network Operator)\nAT+COPS?\n+COPS: 0,2,\"26201\"\nOK\n\n# Query the configured APN\nAT+CGDCONT?\n+CGDCONT: 0,\"IP\",\"cdp.iot.t-mobile.nl\",,0,0,,,,,0\nOK\n\n# Query the configuration\nAT+NCONFIG?\n+NCONFIG:AUTOCONNECT,TRUE\n+NCONFIG:CR_0354_0338_SCRAMBLING,TRUE\n+NCONFIG:CR_0859_SI_AVOID,TRUE\n+NCONFIG:COMBINE_ATTACH,FALSE\n+NCONFIG:CELL_RESELECTION,TRUE\n+NCONFIG:ENABLE_BIP,FALSE\n+NCONFIG:MULTITONE,TRUE\n+NCONFIG:NAS_SIM_POWER_SAVING_ENABLE,TRUE\n+NCONFIG:BARRING_RELEASE_DELAY,64\n+NCONFIG:RELEASE_VERSION,13\n+NCONFIG:RPM,FALSE\n+NCONFIG:SYNC_TIME_PERIOD,0\n+NCONFIG:IPV6_GET_PREFIX_TIME,65535\n+NCONFIG:NB_CATEGORY,2\n+NCONFIG:RAI,FALSE\n+NCONFIG:HEAD_COMPRESS,FALSE\n+NCONFIG:RLF_UPDATE,TRUE\n+NCONFIG:CONNECTION_REESTABLISHMENT,FALSE\n+NCONFIG:TWO_HARQ,FALSE\n+NCONFIG:PCO_IE_TYPE,EPCO\n+NCONFIG:T3324_T3412_EXT_CHANGE_REPORT,FALSE\n+NCONFIG:NON_IP_NO_SMS_ENABLE,FALSE\n+NCONFIG:SUPPORT_SMS,TRUE\n\nOK\n\n# Query signal power and quality\n# Power should be between 0-31 and NOT 99. 99 means \"no network detactable\"\n# Quality should be between 0-9. 99 means not know or not detactable.\nAT+CESQ\n+CSQ: 9,99\nOK",
      "language": "text",
      "name": null
    }
  ]
}
[/block]

####

####

\##Ping the first IP address
With the `AT+CGPADDR` command you could query the current IP address of your ENS22 DevKit. But you still not know if your ENS22 DevKit is able communicate in the IP network correctly.
To test this you should ping the UDP server of IoT Creators platform with th  `+NPING` command.

[block:code]
{
  "codes": [
    {
      "code": "AT+NPING=\"172.27.131.100\"\n\nOK\n\n+NPING: \"172.27.131.100\",253,7478\n",
      "language": "text",
      "name": null
    }
  ]
}
[/block]

[block:callout]
{
  "type": "success",
  "title": ":+1: Congratulations :+1:",
  "body": "If you reached this point and if you were able to ping successfully the IoT Creators' UDP server you reached a very important milestone. \n\nExperience has shown that most of the problems arise during the ENS22 DevKitcommissioning and the first attachment with the network.\n\nThe rest journey the next steps of the tutorial will be easy :smirk:"
}
[/block]

####

####

\##AT Commands Only

[block:code]
{
  "codes": [
    {
      "code": "#######################################################################\n# Network attach\n#######################################################################\n# Switch off radio\nAT+CFUN=0\n\n# Switch autoconnect and scrambling on:\nAT+NCONFIG=\"AUTOCONNECT\",\"TRUE\"\nAT+NCONFIG=\"CR_0354_0338_SCRAMBLING\",\"TRUE\"\nAT+NCONFIG=\"CR_0859_SI_AVOID\",\"TRUE\"\n\n# Set the APN\nAT+CGDCONT=0,\"IP\",\"cdp.iot.t-mobile.nl\"\n\n# EPS network registration status\nAT+CEREG=5\n\n# select an operator DE:\"26201\", NL:\"20416\"\nAT+COPS=1,2,\"26201\"\n\n# Reboot the device\nAT+NRB\n\n#######################################################################\n# Network attach verification\n#######################################################################\n# Check IP address\nAT+CGPADDR\n\n# Check if attached to network\nAT+CGATT?\n\n# Check MNO\nAT+COPS?\n\n# Check APN\nAT+CGDCONT?\n\n# Check the configuration\nAT+NCONFIG?\n\n# Check signal strength and qualitay\nAT+CESQ\n\n# Extended error report\nAT+CEER\n\n#######################################################################\n# Ping UDP server of IoT Creators\n#######################################################################\nAT+NPING=\"172.27.131.100\"\n",
      "language": "text",
      "name": "AT Commands to attach to the network and verify it"
    }
  ]
}
[/block]

####

####

## #Send and Receive via UDP

In the following chapters I will explain to you how you can send a "Hello World" message from the device to the IoT Creators SCS and how you can receive a "Hello Device" message on your devkit  from IoT Creators SCS.

####

####

\##Send "Hello World"

[block:callout]
{
  "type": "danger",
  "body": "Make sure that you have registered your device with its IMEI at the IoT Creators portal **BEFORE ** you send your first message to the UDP or CoAP server of IoT Creators.\n\nIf you forget, you will have problems to register your device afterwards. In this case  please get in contact with IoT Creators support team.",
  "title": "Register your device first!"
}
[/block]

####

Welcome to this step of tutorial. You probably ended up here because you could successfully connect your ENS22 DevKit to the network.
Before you continue make sure your device has an IP address assigned and you can ping the UDP server of IoT Creators. You test both with the `+CGPADDR` and the `+NPING` command.

[block:code]
{
  "codes": [
    {
      "code": "AT+CGPADDR\n+CGPADDR: 0,\"10.128.4.109\"\nOK\n\nAT+NPING=\"172.27.131.100\"\nOK\n+NPING: \"172.27.131.100\",253,2396",
      "language": "text",
      "name": "Your device has an IP address and can ping UDP server?"
    }
  ]
}
[/block]

In the next steps you will

* Open local UDP socket to send UDP messages.
* Create a "Hello World" message.
* Send the hex coded "Hello World" message to the UDP server of IoT Creators.
* Verify if the messages has been arrived at the IoT Creators platform.

####

####

\###Open local UDP Socket to send message
To send UDP messages to a UDP server you need to confiure  a local UDP socket.

[block:code]
{
  "codes": [
    {
      "code": "AT^SICS=0,\"conType\",\"GPRS0\"\nOK\nAT^SICS=0,\"apn\",\"cdp.iot.t-mobile.nl\"\nOK\nAT^SISS=0,\"srvType\",\"Socket\"\nOK\nAT^SISS=0,\"conId\",\"0\"\nOK\nAT^SISS=0,\"address\",\"sockudp://172.27.131.100:15683\"\nOK",
      "language": "text",
      "name": "Configure the UDP socket"
    }
  ]
}
[/block]

You can save the settings and simply relaod them the next time with **^SIPS**

[block:code]
{
  "codes": [
    {
      "code": "AT^SIPS=all,save,0\nOK\n\nAT^SIPS=all,load,0\nOK",
      "language": "text",
      "name": "Save and load socket settings"
    }
  ]
}
[/block]

Now you can open the Socket an ask for an IP.

[block:code]
{
  "codes": [
    {
      "code": "AT^SISO=0\nOK\n\nAT^SISI?\n^SICI: 0,2,1,\"10.128.3.195\"\nOK",
      "language": "text",
      "name": "Open the UDP Socket"
    }
  ]
}
[/block]

If you could open the socket successfully, you can send String messages to the server with ^SISW=0,11 (11 bit).

[block:code]
{
  "codes": [
    {
      "code": "AT^SISW=0,11\nHello World",
      "language": "text",
      "name": "Send \"Hello World\""
    }
  ]
}
[/block]

####

Afterwards you can close the Socket with **^SISC=0**

[block:code]
{
  "codes": [
    {
      "code": "AT^SISC=0\n\nOK",
      "language": "text",
      "name": "Close local UDP socket"
    }
  ]
}
[/block]

####

####

###

[block:callout]
{
  "type": "success",
  "body": "If you see **OK** on the device console **CONGRATULATIONS**! you just send your first UDP message from your device to an UDP server of IoT Creators.",
  "title": "**CONGRATULATIONS** :clap:  :cake:"
}
[/block]

####

####

\###View the received Messages in IoT Creators Portal
For each device the IoT Creators Portal makes the laste received message available by showing it in the **Payload** column. In case of our Hello World message

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/b2927a5-da718d7-project-screen-3.png",
        "da718d7-project-screen-3.png",
        888,
        822,
        "#f3eff2"
      ],
      "caption": "Project view of IoT Creators portal with device and last sent data."
    }
  ]
}
[/block]

####

If you click on the payload the value of it is copied to the clipboard.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/cdd5982-5649214-click_to_copy.JPG",
        "5649214-click_to_copy.JPG",
        247,
        209,
        "#f4e0eb"
      ],
      "caption": "Click on payload to copy into clipboard."
    }
  ]
}
[/block]

####

We see in the IoT Creators Portal the string  **48656c6c6f20576f726c64**.

To decode the received message back from hex to a readable string we can use the online tool <http://string-functions.com/hex-string.aspx>.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/2fa781f-f5f05b9-hex2string.png",
        "f5f05b9-hex2string.png",
        757,
        805,
        "#eeedf2"
      ],
      "caption": "Online tool to convert hex to string."
    }
  ]
}
[/block]

[block:callout]
{
  "type": "success",
  "body": "If you can decode your received message to **Hello World ****CONGRATULATIONS**! You just sent your first UDP message from your device via NB-IoT to IoT Creators platform.",
  "title": ":clap: **CONGRATULATIONS** :clap:  :cake:"
}
[/block]

####

####

\###AT Commands to send Hello World

[block:code]
{
  "codes": [
    {
      "code": "# Configure UDP socket\nAT^SICS=0,\"conType\",\"GPRS0\"\nAT^SICS=0,\"apn\",\"cdp.iot.t-mobile.nl\"\n\nAT^SISS=0,\"srvType\",\"Socket\"\nAT^SISS=0,\"conId\",\"0\"\nAT^SISS=0,\"address\",\"sockudp://172.27.131.100:15683\"\n\n# Open local UDP socket\nAT^SISO=0\n\n# Send 11 bit UDP message to UDP server\nAT^SISW=0,11\nHello World\n\n# Close socket\nAT^SISO=0\nOK",
      "language": "text",
      "name": "AT Commands to send \"Hallo World\""
    }
  ]
}
[/block]

####

####

\##Receive "Hello Device"
Welcome back to the tutorial :+1:.
In this step I will explain  you how you can receive the "Hello Device" downlink message **48656c6c6f20446576696365** via UDP which you have posted before to the IoT Creators platform.

#####

The downlink message which you posted to IoT Creators API before is queued by the IoT Creators platform. The queued downlink message is sent to the device after IoT Creators platform received the uplink message from the device.

#####

In this tutorial you will perform the following steps:

* Open local UDP socket.
* Send a "i am alive" heartbeat message via UDP to the UDP server of IoT Creators.
* Receive the previous queued "Hello Device" message from the IoT Creators platform.

#####

### Open local UDP socket and send "i am alive" heartbeat

As already described in [chapter 4](https://docs.iotcreators.com/docs/gemalto-cinterion-ens22-c)  of this tutorial you can open the UDP socket and send a UDP message with ^SISO=0 and SISW=0

#####

Before you open the UDP socket you can verify your IP address and if you are able to heartbeat the UDP server of IoT Creators.

[block:code]
{
  "codes": [
    {
      "code": "AT+CGPADDR\n+CGPADDR: 0,\"10.128.5.88\"\nOK\n\nAT+NPING=\"172.27.131.100\"\nOK\n+NPING: \"172.27.131.100\",253,4141",
      "language": "text",
      "name": "Verify network attach"
    }
  ]
}
[/block]

####

### Send "i am alive" heartbeat message and receive downlink message

After you verified the network attach of your device you can open the UDP socket on your device and send a "i am alive" heartbeat message to the UDP server of IoT Creators. As already explained in [chapter 4](https://docs.iotcreators.com/docs/gemalto-cinterion-ens22-c)  the message should be in hex format.

[block:code]
{
  "codes": [
    {
      "code": "\nAT^SISO=0\n\nAT^SISW=0,10\ni am alive\n\nOK",
      "language": "text",
      "name": "Open UDP socket and send \"i am alive\" heartbeat"
    }
  ]
}
[/block]

The "i am alive" message causes the UDP server of the IoT Creator portal to send out the previous queued "Hallo Device" message to the device.
The device notifiers you with an URC (Unsolicited Result Code) code as soon data has been been received by the modem of the device.

[block:code]
{
  "codes": [
    {
      "code": "AT^SISR=0,12\n\n^SISR=0, 12, 0\nHello Device\nOK",
      "language": "text",
      "name": "Receive \"Hallo Device\" message "
    }
  ]
}
[/block]

#####

[block:callout]
{
  "type": "warning",
  "title": "Downlink only possible after uplink",
  "body": "If you try to send a downlink message to a device that has not send any uplink messages you will receive the error : Serial number not found.\nAfter sending an uplink message the device registration is completed and downlinking will work."
}
[/block]

####

####

\###AT Commands to receive  Hello Device

[block:code]
{
  "codes": [
    {
      "code": "#  Test if device has an IP address asigned\nAT+CGPADDR \n+CGPADDR: 0,\"10.0.5.112\"\nOK\n\n# Ping UDP server of IoT Creators\nAT+NPING=\"172.27.131.100\" \nOK\n+NPING: \"172.27.131.100\",253,4135\n\n# Open local UDP socket \nAT^SISO=0\nOK\n\n# Send \"i am alive\" message to UDP server\nAT^SISW=0,10 \ni am alive\nOK\n\n# Receive the data\nAT^SISR=0,12\n^SISR=0, 12, 0\nHello Device\nOK",
      "language": "text",
      "name": "AT Commands to receive  Hello Device"
    }
  ]
}
[/block]