Advertisement

Quick Links

NB-IoT / Cat-M Module
Networking Guide

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the NB-IoT and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Libelium NB-IoT

  • Page 1 NB-IoT / Cat-M Module Networking Guide...
  • Page 2: Table Of Contents

    3.4.2. Getting module information ....................12 3.5. Setting operator parameters ......................14 3.6. Checking network connection status ................... 15 3.7. Basic network connection to NB-IoT .................... 16 3.8. Basic network connection to Cat-M ....................16 3.9. Basic network connection to EGPRS ..................... 16 3.10.
  • Page 3 Index 3.15. Scanning network operators ....................... 33 3.16. Sending AT commands......................... 33 4. Consumption ........................34 4.1. Consumption table ......................... 34 5. Code examples and extended information ..............35 6. API changelog ........................36 7. Certifications ........................37 v7.0...
  • Page 4: Introduction

    Note: It is important to remark that the NB-IoT or Cat-M connectivities require a dedicated SIM card (not included by default). With a standard SIM card, only the EGPRS connectivity can be tested. Besides, the network coverage is only present in certain zones and strongly depends on the selected mobile network operator.
  • Page 5: Nb-Iot Vs Cat-M

    On the other hand, NB-IoT is not compatible with the LTE network and it would require higher costs for operators to deploy a NB-IoT network. Despite of this fact, there are a lot of operators that are actively researching and making efforts to commercialize NB-IoT.
  • Page 6: Hardware

    Hardware 2. Hardware 2.1. Specifications The NB-IoT / Cat-M module is based on the Quectel’s BG96 chipset. The module is managed by UART and it must be connected to socket 1 (direct connection, without Waspmote Expansion Board). Model: BG96 (Quectel)
  • Page 7 Telefónica (Spain) • JATE/TELEC/KDDI/SoftBank/DOCOMO* (Japan) • KC/SKT/LGU+* (Korea) • IFETEL (Mexico) • IMDA (Singapore) • NCC (Taiwan) • CCC (China) • * Under Development **LTE B25 will be supported on BG96 with R1.2 hardware version. Figure: NB-IoT / Cat-M module v7.0...
  • Page 8: How To Connect The Module

    Expansion Radio Board. Figure: Module connected to Waspmote in SOCKET1 The SIM card size used in the NB-IoT / Cat-M module is nano-SIM. The next picture shows how the nano-SIM card must be plugged in the module. Figure: SIM card installation in OEM version...
  • Page 9: Antennas

    Hardware 2.3. Antennas The NB-IoT / Cat-M module comes with one cellular antenna for improving the signal reception. Besides, a GNSS antenna is also included for the GNSS receiver. Both antennas are the same model and can be used in any of the 2 antenna connectors. The module’s silkscreen identifies the connectors.
  • Page 10: Software

    /BG96/WaspBG96.h • /BG96/WaspBG96.cpp • It is mandatory to include the NB-IoT / Cat-M library when using this module. So the following line must be added at the beginning of the code: #include <WaspBG96.h> 3.1.2. Class constructor To start using the Waspmote NB-IoT / Cat-M library, an object from the class must be created.
  • Page 11: Switching On

    BG96.ON(); 3.3. Switching off function allows the user to switch off the NB-IoT / Cat-M module and close the UART. This function OFF() must be called in order to save battery when the module is not going to be used.
  • Page 12: Sim Card

    Example for setting a new PIN: BG96.enterPIN(“1234”, ”1111”); Example of entering the PIN number: www.libelium.com/development/waspmote/examples/nb-iot-01-enter-pin-code 3.4.2. Getting module information function can get more than one information field to the module. This function needs one input getInfo() to indicate the type of information requested.
  • Page 13 Software Related variables: → Buffer which stores the information requested BG96._buffer → Number of bytes in buffer BG96._length Example of getting module info: www.libelium.com/development/waspmote/examples/nb-iot-02-get-module-info -13- v7.0...
  • Page 14: Setting Operator Parameters

    Software 3.5. Setting operator parameters When the NB-IoT / Cat-M module uses data services like TCP/UDP connections, HTTP services, SMTP or FTP transfers, it is mandatory to configure the parameters provided by the user’s Mobile Network Operator (MNO): APN, login and password. The owner of a SIM should be notified with these parameters by the MNO.
  • Page 15: Checking Network Connection Status

    Software 3.6. Checking network connection status There are 2 functions to check the network connection status: checkConnection() checkDataConnection() function checks the module’s network connection status and returns whether the module: checkConnection() is connected to a network • is not connected to a network •...
  • Page 16: Basic Network Connection To Nb-Iot

    Example of basic NB-IoT connection: www.libelium.com/development/waspmote/examples/nb-iot-04a-basic-connection-nb-iot 3.8. Basic network connection to Cat-M In the same way as for NB-IoT connection, to demonstrate a basic connection through the Cat-M network, the 1st step is to configure the connection with function and then connect with...
  • Page 17: Http Client

    HTTP is a great protocol because it is a standard, simple and light way to send information to web servers. Libelium has created a little web service in order to allow 4G, 3G, GPRS, GPRS+GPS, NB-IoT / Cat-M or WiFi modules to test the HTTP mode.
  • Page 18 Remember this PHP code is really simple and is offered with the only purpose of testing, without any warranty. The source code is available here: downloads.libelium.com/waspmote-html-get-post-php-parser-tester.zip The user may find it interesting to copy this code and make it run on his own server (physical or virtual). If the user wants to go further, he can complete the code.
  • Page 19: Http Request Methods

    After choosing the method, the function needs the host URL, port and resource of the HTTP server requested. The data field is only necessary when POST or PUT methods are performed. Example of use (GET, HEAD and DELETE methods): char host[] = “test.libelium.com”; uint16_t port = 80; char resource[] = “/test-get-post.php?varA=1&varB=2&varC=3&varD=4”;...
  • Page 20: Sending Waspmote Frames To Meshlium Via Http

    Software 3.10.3. Sending Waspmote frames to Meshlium via HTTP Since Meshlium Manager System v4.0.9, HTTPS method is the default method for sending data. HTTPS is the recommended technology because it provides many cyber security services. Therefore, the HTTPS service is always enabled on Meshlium.
  • Page 21 Software Figure: Send frames to Meshlium via NB-IoT After calling the function, the response from Meshlium will be stored in . Besides, it will store the HTTP _buffer status code from server in . Please refer to the Data Frame Guide...
  • Page 22: Sending Waspmote Frames To Meshlium Via Https

    The downloaded certificate must be installed following the steps explained in the “SSL sockets” section and the proper library function. Also, the example linked at the end of this section shows how to perform the installation. Example of sending frames to Meshlium via HTTPS: www.libelium.com/development/waspmote/examples/nb-iot-08b-sending-frames-to-meshlium-via-https -22- v7.0...
  • Page 23: Making Tcp/Udp Connections

    3.11. Making TCP/UDP connections 3.11.1. Socket identifiers The NB-IoT / Cat-M module permits to have up to 6 simultaneous TCP/UDP connections. For that purpose, the library defines the following socket identifiers to be used when handling the multi-socket connections: WaspBG96::CONNECTION_1...
  • Page 24: Creating A Tcp/Udp Client Socket

    Software Example of use: uint8_t socketId = WaspBG96::CONNECTION_1; BG96.getSocketStatus(socketId); Related variables: → Socket identifier BG96.socketInfo[socketId].id → Socket status BG96.socketInfo[socketId].state → Local IP address BG96.socketInfo[socketId].localIp → Local port BG96.socketInfo[socketId].localPort → Remote IP address BG96.socketInfo[socketId].remoteIp → Remote port BG96.socketInfo[socketId].remotePort 3.11.3. Creating a TCP/UDP client socket function configures and opens a socket.
  • Page 25 Software Possible error codes for this function: 1: not registered, ME is not currently searching for a new operator to register to 2: not registered, but ME is currently searching for a new operator to register to 3: registration denied 4: unknown 6: not registered, ME is not currently searching for a new operator to register to 8: not registered, but ME is currently searching for a new operator to register to...
  • Page 26: Sending Data

    3: if error sending data 4: if error waiting confirmation from module 5: if error getting socket status 6: if timeout getting socket status All examples related to TCP/UDP sockets (both client and server) show how to send data: http://www.libelium.com/development/waspmote/examples/nb-iot-11-tcp-client http://www.libelium.com/development/waspmote/examples/nb-iot-13-udp-client -26- v7.0...
  • Page 27: Receiving Data

    Software 3.11.5. Receiving data function allows the user to receive TCP/UDP packets once the socket is active. The function needs receive() different inputs: Socket ID: the socket identifier used for opening the connection. • Timeout (optional input): • If no timeout input is specified, the receive function is a non-blocking function which answers if data has been received.
  • Page 28: Closing A Socket

    3.11.7. SSL sockets The NB-IoT / Cat-M module includes a stack for establishing SSL sockets. For this feature, the user must keep in mind that it is necessary to install the proper security data in the module. For handling the SSL socket new functions are defined for opening the socket, sending data, receiving data and closing the socket.
  • Page 29 Software Possible error codes for this function: 1: not registered, ME is not currently searching for a new operator to register to 2: not registered, but ME is currently searching for a new operator to register to 3: registration denied 4: unknown 6: not registered, ME is not currently searching for a new operator to register to 8: not registered, but ME is currently searching for a new operator to register to...
  • Page 30 5: if error parsing length of received data 6: if error getting received data 7: if error waiting module confirmation function allows the user to close a secure socket. The function needs an input parameter closeSocketSSL() for the socket identifier. Example for SSL socket: www.libelium.com/development/waspmote/examples/nb_iot-15-ssl-sockets -30- v7.0...
  • Page 31: Gnss - Getting Position

    GNSS engine of the module. It is possible to switch from a SUPL session gpsStop() to the autonomous GNSS mode. Firstly, the GNSS feature must be stopped, and then restart with the autonomous mode. Example of GPS modes: http://www.libelium.com/development/waspmote/examples/nb-iot-16-GNSS -31- v7.0...
  • Page 32: Sleep Mode

    By default, the module sleep mode can be enabled by the function. nbiotSleepMode() However, the NB-IoT / Cat-M module allows several configuration modes to minimize the power consumption. For example, the module can be configured in Power Saving Mode (PSM) using the function , and...
  • Page 33: Edrx Setup

    Example of how to use the eDRX feature: http://www.libelium.com/development/waspmote/examples/nb-iot-24-edrx 3.15. Scanning network operators In order to see the coverage of NB-IoT or Cat-M in a certain location, use the function scanOperator() The list of the detected operators is stored in , and is the number of bytes in the buffer.
  • Page 34: Consumption

    Consumption 4. Consumption 4.1. Consumption table The NB-IoT / Cat-M module is directly powered by the battery. The next table shows the Waspmote’s peak current consumption in different states of the NB-IoT / Cat-M module. State Mean power consumption Idle state (DRX = 1.28 s)
  • Page 35: Code Examples And Extended Information

    Code examples and extended information 5. Code examples and extended information In the Waspmote Development section you can find complete examples: www.libelium.com/development/waspmote/examples -35- v7.0...
  • Page 36: Api Changelog

    API changelog 6. API changelog Keep track of the software changes on this link: www.libelium.com/development/waspmote/documentation/changelog/#nb_iot -36- v7.0...
  • Page 37: Certifications

    Certifications 7. Certifications Libelium offers 2 types of sensor platforms, Waspmote OEM and Plug & Sense!: Waspmote OEM is intended to be used for research purposes or as part of a major product so it needs final • certification on the client side. More info at: http://www.libelium.com/products/waspmote/...

This manual is also suitable for:

Cat-m

Table of Contents