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
- USB - AT command line interface using PC terminal application (USB driver can be found at http://www.quectel.com/support/downloads/USBDrivers.htm)
- Arduino shield to use for embedded application
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:
- Connect the USB
- 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 )
- After short time the blue led start flashing
- After a short time the USB will be active and ( you need Quectel drivers )
- com port are now shown on the PC
- Open RealTerm and configure as follow:
- try to send "AT" command and see the "OK" answer from BG96
- try any other command from BG96 AT user's guide
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
BG96 Mqtt client example User's Guide here
Revision 4:43647366c69e, committed 2019-02-05
- Comitter:
- abci5961:cmatgr59a@os.mbed.com
- Date:
- Tue Feb 05 19:20:30 2019 +0100
- Parent:
- 3:37ebef02b334
- Commit message:
- fix BG96 shield library
Changed in this revision
NbIotBG96.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 37ebef02b334 -r 43647366c69e NbIotBG96.lib --- a/NbIotBG96.lib Fri Dec 21 19:19:19 2018 +0100 +++ b/NbIotBG96.lib Tue Feb 05 19:20:30 2019 +0100 @@ -1,1 +1,1 @@ -https://github.com/Avnet-Silica/NbIotBG96/#572dbfc6b980421fe4ae3c102d66a5ecb40c766e +https://github.com/Avnet-Silica/NbIotBG96/#e4944c6b40ccfccf6c84f743926ae578f58be634
diff -r 37ebef02b334 -r 43647366c69e main.cpp --- a/main.cpp Fri Dec 21 19:19:19 2018 +0100 +++ b/main.cpp Tue Feb 05 19:20:30 2019 +0100 @@ -292,12 +292,11 @@ if(slg_active == true) { - //sl_if.startup(); + //sl_if.startup(); //only for debug.. sl_if.hw_set(); //not needed if SLG46824 already programmed + } - //sl_if.test_task(); - myled=1; //wait(0.5); pc.printf("\r\n*************************************************");