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
GettingStarted.html@4:43647366c69e, 2019-02-05 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
abci5961 | 0:ae6c6727b545 | 1 | <!DOCTYPE HTML> |
abci5961 | 0:ae6c6727b545 | 2 | <html lang="en-US"> |
abci5961 | 0:ae6c6727b545 | 3 | <head> |
abci5961 | 0:ae6c6727b545 | 4 | <meta charset="UTF-8"> |
abci5961 | 0:ae6c6727b545 | 5 | <meta http-equiv="refresh" |
abci5961 | 0:ae6c6727b545 | 6 | content="1;url="https://developer.mbed.org/handbook/Getting-Started-mbed-Exporters> |
abci5961 | 0:ae6c6727b545 | 7 | <script type="text/javascript"> |
abci5961 | 0:ae6c6727b545 | 8 | window.location.href = "https://developer.mbed.org/handbook/Getting-Started-mbed-Exporters" |
abci5961 | 0:ae6c6727b545 | 9 | </script> |
abci5961 | 0:ae6c6727b545 | 10 | <title>Page Redirection</title> |
abci5961 | 0:ae6c6727b545 | 11 | </head> |
abci5961 | 0:ae6c6727b545 | 12 | <body> |
abci5961 | 0:ae6c6727b545 | 13 | If you are not redirected automatically, please follow the |
abci5961 | 0:ae6c6727b545 | 14 | <a href='https://developer.mbed.org/handbook/Getting-Started-mbed-Exporters'>link to the online exporter documentation</a> |
abci5961 | 0:ae6c6727b545 | 15 | </body> |
abci5961 | 0:ae6c6727b545 | 16 | </html> |