Sunday, March 18, 2018

Using BC-95 for NB-IoT

March 18, 2018 Posted by Akalanka , No comments
The BC-95 modem by Quectel is a low cost NB-IoT modem designed to be used in low power applications. This has a chipset by Neul whose parent company is now Huawei. Main highlights of this modem are:

  • Supports NB-IoT in Band 5/8/20
  • Inbuilt stack for UDP, COAP*
  • Support for Non-IP data delivery
  • Downlink max speed: 24kbps
  • Uplink max speed: 15.625kbps
  • AT Command interface via UART
The offered AT commands are quite comprehensive yet simple. You can refer the official page http://www.quectel.com/product/bc95.htm for more details. Important commands to remember are:

Basic AT commands:
  • AT+CFUN - turn modem ON or OFF by setting the functionality
  • AT+NRB - reboot modem
Network registration
  • AT+COPS - set network registration. 
  • AT+CEREG - check network registration status and parameters
Data (PDP) activation & testing
  • AT+CGATT - Attach packet data
  • AT+CGDCONT - set APN
  • AT+NPING - Ping a remote IP address
UDP Datagram 
  • AT+NSOCR - Open UDP socket
  • AT+NSOST - Send UDP message
  • AT+NSORF - Receive UDP Packet
  • AT+NSOCL - Close UDP Socket
CDP (COAP) 
  • AT+NCDP - Set CDP platform settings
  • AT+NMGS - Send CoAP message via platform
  • AT+NNMI - Received message indicator
  • AT+NMGR - Get received messages

A sample command sequence would be 
  • AT+NRB - Start with a reboot 
  • AT+COPS? - Check if connected to network
  • AT+COPS=1,2,"41301",7 - Make the modem attache to network manually. "41301" are the MCC & MNC for Mobitel Sri Lanka
  • AT+CGATT=1 - Start data session
Once this is complete you can either send UDP messages or CoAP messages using appropriate commands. 

Important: If the modem you have at hand is not registering on a network check the following - 
  • Enter AT+NCONFIG?
  • Check if the 'scrambling' parameter is set to false. If not enter
    • AT+NCONFIG="CR_0354_0338_SCRAMBLING","FALSE" 
  • Enter AT+NUESTATS to check the current modem status in the radio layer.
  • You can set the 'auto connect' parameter in NCONFIG to true so that once the modem is powered up it will auto attach to the network.
This is caused by the different ways the operators configure their network. Prior to 3GPP release 13 (R13) scrambling could be turned on on the network as an option. But R13 mandated turning on scrambling which meant the scrambling status should be configured depending on your NB-IoT service provider. However even this minor ambiguity is expected to be ironed out when complete R13 compliance is reached.

Connecting your BC-95 to Arduino

If you are using Arduino and want to connect to your BC-95, you are in luck. We have a simple Arduino library for you to give the head start at https://gitlab.com/akalankadesilva/BC95-Arduino 

Refer the bc95test.ino in the GIT for sample codes to send UDP messages and CoAP messages to remote servers. In the next post we will see how to communicate with a BC-95 based device using Inzpire NB-IoT device API.



0 comments:

Post a Comment