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.
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.
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...
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...
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.
/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.
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.
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...
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.
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 •...
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...
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.
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”;...
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...
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...
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...
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...
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...
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.
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...
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...
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...
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.
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)
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...
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...
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/...
Need help?
Do you have a question about the NB-IoT and is the answer not in the manual?
Questions and answers