BG96 Module MQTT client example using X-NUCLEO-IKS01A2

Dependencies:   mbed X_NUCLEO_IKS01A2 NetworkSocketAPI MQTT

Getting started mbed NbIot with BG96 module

NbIot BG96 board Main features:

  • LTE/EDGE modem for IOT connection
  • 4A type Pmod interface (expanded uart) except for signals on pin 1 (MODEM RING) and pin 4 (MODEM POWER KEY) here below schematics of pmod connector /media/uploads/abci5961/pmod_sch.jpg

/media/uploads/abci5961/hw_details.jpg

Using USB - AT command port and RealTerm for AT command line

  • Connect the BG96 board to the PC using USB port,

Warning

How to power up BG96 in USB-AT standalone

If you like to use the board STAND-ALONE ( USB - AT port), you must manually power up th BG96 modem. To make this:

  1. Connect the USB
  2. Make a short connection between pin 5 of ARDUINO POWER and pin 4 of PMOD to enable BG96_PWRKEY_ACTIVE_HIGH ( on the rev.C of the board we will add a pushbutton to make this easy )
  3. After short time the blue led start flashing
  4. After a short time the USB will be active and ( you need Quectel drivers )
  5. com port are now shown on the PC

/media/uploads/abci5961/bg96_start_from_usb_a.jpg

  • Open RealTerm and configure as follow: /media/uploads/abci5961/real_term.jpg
  • try to send "AT" command and see the "OK" answer from BG96
  • try any other command from BG96 AT user's guide /media/uploads/abci5961/at_command.jpg

NbIot BG96 MQTT Client example

for mbed OS online Compiler or user's IDE toolchain

It demonstrates how register and send data of some sensor to IBM BlueMix MQTT Quickstart server. It also can connect with MyBlueMix Avnet server (to make this user must have credential to log into Avnet server)

Please note that this example was derived from original IDW01M1_Cloud_IBM for WiFi connections. The WIFI original project can be found here

The application, by default:

  • Connects to LTE network via BG96
  • opens a UDP socket to Google DNS to obtain ip address of Quickstart server
  • opens a TCP socket to Quickstart server to register and send data
  • Send, every 30 seconds, local sensors data (temperature, humidity, pressure)

Hardware requirement

  • X_NUCLEO_L476RG mcu board
  • X_NUCLEO_IKS01A2 sensors expansion board
  • AVNET RSR1157 NbIOT BG96 expansion board

/media/uploads/abci5961/hw_req_1.jpg

BG96 Mqtt client example User's Guide here