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

Committer:
abci5961:cmatgr59a@os.mbed.com
Date:
Tue Feb 05 19:20:30 2019 +0100
Revision:
4:43647366c69e
Parent:
0:ae6c6727b545
fix BG96 shield library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
abci5961 0:ae6c6727b545 1 /*
abci5961 0:ae6c6727b545 2 * mbed SDK
abci5961 0:ae6c6727b545 3 * Copyright (c) 2017 ARM Limited
abci5961 0:ae6c6727b545 4 *
abci5961 0:ae6c6727b545 5 * Licensed under the Apache License, Version 2.0 (the "License");
abci5961 0:ae6c6727b545 6 * you may not use this file except in compliance with the License.
abci5961 0:ae6c6727b545 7 * You may obtain a copy of the License at
abci5961 0:ae6c6727b545 8 *
abci5961 0:ae6c6727b545 9 * http://www.apache.org/licenses/LICENSE-2.0
abci5961 0:ae6c6727b545 10 *
abci5961 0:ae6c6727b545 11 * Unless required by applicable law or agreed to in writing, software
abci5961 0:ae6c6727b545 12 * distributed under the License is distributed on an "AS IS" BASIS,
abci5961 0:ae6c6727b545 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
abci5961 0:ae6c6727b545 14 * See the License for the specific language governing permissions and
abci5961 0:ae6c6727b545 15 * limitations under the License.
abci5961 0:ae6c6727b545 16 */
abci5961 0:ae6c6727b545 17
abci5961 0:ae6c6727b545 18 // Automatically generated configuration file.
abci5961 0:ae6c6727b545 19 // DO NOT EDIT, content will be overwritten.
abci5961 0:ae6c6727b545 20
abci5961 0:ae6c6727b545 21 #ifndef __MBED_CONFIG_DATA__
abci5961 0:ae6c6727b545 22 #define __MBED_CONFIG_DATA__
abci5961 0:ae6c6727b545 23
abci5961 0:ae6c6727b545 24
abci5961 0:ae6c6727b545 25 #endif