NB-IoT. Non-IP Data Delivery or just NIDD. Testing with MTS commercial service

Good afternoon and good mood!

This is a small tutorial on setting up NIDD (Non-IP Data Delivery) in the MTS cloud service with the self-explanatory name "M2M Manager". The essence of NIDD is the energy-efficient exchange of small data packets over the NB-IoT network between devices and the server. If earlier GSM devices communicated with the server by exchanging TCP / UDP packets, then an additional communication method became available for NB-IoT devices - NIDD. In this case, the server interacts with the operator's network using unified POST/GET requests. I am writing for myself (so as not to forget) and for everyone who finds it useful.

You can read about NB-IoT:

NB-IoT, Narrow Band Internet of Things. General information, technology features
NB-IoT, Narrow Band Internet of Things. Power saving modes and control commands

NIDD theory from MTS

Documentation for the NB-IoT module that was used in the testing process:
Neoway N21.

MTS service for managing M2M devices.

To feel NIDD, we need:

  • SIM card NB-IoT MTS
  • NIDD-enabled NB-IoT device
  • password and login from M2M-manager MTS

As a device, I used a board N21 DEMO, and the password and login for access to the M2M manager were kindly provided to me by MTS employees. For this, as well as for the various help and numerous consultations, many thanks to them.

So, go to the M2M manager and check that:

  • in the menu item "SIM Manager" there is "NB-IoT Control Center";
  • our NB-IoT card appeared in the NB-IoT Control Center, as well as sections:
    NIDDAPN
    NIDD Accounts
    NIDD Security
  • at the very bottom there is a menu item "API M2M" with the "NIDD Developer's Guide"

The whole economy should look something like this:

NB-IoT. Non-IP Data Delivery or just NIDD. Testing with MTS commercial service

If something is missing in the M2M manager, feel free to send a request to your manager at MTS with a detailed description of your wishes.

If the necessary items of the NB-IoT Control Center are in place, you can start filling them out. Moreover, the β€œNIDD Accounts” item is the last thing: it will need data from neighboring sections.

  1. NIDDAPN: we come up with and fill in the name of our APN and the β€œApplication ID”.
  2. NIDD Safety: here we specify the IP address of our application server, which will communicate with NB-IoT devices through the MTS service (server).
  3. NIDD Accounts: Just fill in all the fields and click "Save".

As soon as all the points are filled in, you can begin to deal with the requests that our server should form. We go to "API M2M" and read the "NIDD Developer's Guide". In order for the device to be able to register in the NB-IoT network, you need to create an SCS AS configuration:

NB-IoT. Non-IP Data Delivery or just NIDD. Testing with MTS commercial service

The manual has a description of the individual query parameters, I will only give a couple of small comments:

  1. link for sending requests: m2m-manager.mts.ru/scef/v1/3gpp-nidd/v1/{scsAsId}/configurations, where scsAsId is the β€œApplication ID” from the β€œNIDD APN” menu item;
  2. basic authorization method with a login and password - use the login and password that you created when filling out the "NIDD Accounts" menu item;
  3. notificationDestination is the address of your server. From it you will send non-ip messages to devices, and the MTS server will send notifications about sending and receiving non-ip messages to it.

When the SCS AS configuration is created and the device has successfully registered in NIDD mode in the operator's NB-IoT network, you can try to exchange the first non-ip messages between the server and the device.

To send a message from the server to the device, study the section "2.2 Sending a message" of the manual:

NB-IoT. Non-IP Data Delivery or just NIDD. Testing with MTS commercial service

{configurationId} in the request link, a value of the "hex-abracadabra" type obtained at the configuration creation stage. Looks like: b00e2485ed27c0011f0a0200.

date β€” message content in Base64 encoding.

Configuring an NB-IoT device to work in NIDD

Of course, in order to exchange data with the server, our device must not only be able to work in the NB-IoT network, but also support the NIDD (non-ip) mode. In the case of the N21 DEMO development board or other device based on NB-IoT-module N21 the sequence of actions for sending non-ip messages is described below.

We activate the configuration with the APN, which we came up with when filling out the "NIDD APN" item of the M2M manager (here - EFOnidd):

AT+CFGDFTPDN=5,"EFOnidd"

and ask the device to re-register on the network:

AT+CFUN=0

AT+CFUN=1

then issue the command

AT+CGACT=1,1

and send the message "test":

AT+NIPDATA=1, "test"

Upon receipt of a non-ip message on the UART of the N21 module, an unsolicited message of the form is issued:

+NIPDATA:1,10,3132333435 // received non-ip message '12345'
where
1 - CID, pdp context
10 - number of data bytes after the decimal point

The message arrives at the server in Base64 encoding (in a POST request).

PS To simulate the transfer of data from the server, it is convenient to use the program Postman. You can use any script that imitates an HTTP server to receive messages.

I hope it's useful to someone.
Thank you.

Source: habr.com

Add a comment