NuMaker-IoT-M487 (4) Use NB-IoT or 4G LTE on Mbed OS

Selected option
NuMaker-IoT-M487 (4) Use NB-IoT or 4G LTE on Mbed OS
Training,Tool
English
Introduction

Hello everyone, I am Morgan, the principal engineer of Nuvoton Technology. Today, I will show you how to use 4G LTE or NB-IoT with Mbed OS on NuMaker-IoT-M487 development board. This tutorial needs a cellular expansion board to work with NuMaker-IoT-M487 development board. You can purchase the 4G LTE expansion board, RF-EC21A, on Nuvoton Direct (https://direct.nuvoton.com/communication-module/). Please install your 4G LTE SIM card in the mini SIM card slot on the back, and install the antenna at the MAIN connector on the front of the board. Although there is an NB-IoT expansion board, it requires an NB-IoT SIM card. Using LTE is more convenient. Just use your own LTE SIM card which has data plan. Then install the expansion board to the Arduino UNO connector of the NuMaker-IoT-M487 development board. Because the power consumption of the 4G LTE module is higher, it is not enough to supply power from USB only. You need to plug in the 5V/2A power supply. If you use NB-IoT module, no additional power supply is needed. We used “New” to select a template to create a new project. This time, we use the example on GitHub to create a new project. The URL of template used for this tutorial is https://github.com/OpenNuvoton/NuMaker-mbed-Cellular-example In chrome browser, enter the URL https://ide.mbed.com to use Mbed Online Compiler environment. After you log in, make sure that NuMaker-IoT-M487 board already selected in the upper right corner. If not, please refer Nuvoton IoT Tutorial series “Get Started with Mbed OS” which has a detailed description of how to add a board. Click the second option “Import” on the upper left. In the Import Wizard, click “Click here” On the “Source URL:”, enter the tempalte URL https://github.com/OpenNuvoton/NuMaker-mbed-Cellular-example . Then move mouse cursor to “Import Name:” and click it, the Project name will be automatically fill in. Then click “Import” button. Now you can see that the sample code has loaded. Depending on the cellular module used, the configuration may need to be modified. Click on “Readme.md” to open it. It lists configurations for supported cellular modules. Because the tutorial uses RF-EC21A expansion board which includes a Quectel EC21 LTE module, let’s check and modify the configuration in mbed_app.json file. Click the “mbed_app.json” file to open it. It is a JSON file to customize compile time configuration parameters in Mbed OS. The “*” (asterisk) in “target_overrides” session indicates all development boards are applicable. You can set in the designated board session, so the settings are only applicable to the specified board. The default mbed_app.json file in the example has configured for RF-EC21A. Such as, "target.network-default-interface-type" has set to "CELLULAR" for cellular connection. Both "lwip.ppp-enabled” and "lwip.tcp-enabled" set to true. Use generic AT3GPP driver for RF-EC21A ("GENERIC_AT3GPP.provide-default": true) And the RF-EC21A UART connects on Arduino D0/D1 ("GENERIC_AT3GPP.tx": "D1" and "GENERIC_AT3GPP.rx": "D0") When your SIM card installed in your mobile phone, you can find the APN, username and password settings in your mobile phone. Or contact your telecom operator to get this information. In the example, APN has set to “internet”, no username, and no password. (Move mouse cursor around these settings) The final setting to check is PIN code. In the example, the setting is no PIN code. If your SIM card has PIN code, for example 1234, please set it like this “\”1234\”” (Move mouse cursor around the setting) Save it then build it. It is in compiling, please wait a moment. Then you can see the last message is “Success!”. The browser will download the binary firmware file directly after a successful compiling. It will be saved in a default download folder or the folder based on your browser setting. In Chrome, you can click download file and select “Show in folder”. Then we connect the NuMaker-IoT-M487 USB port to your computer and don’t forget to plug in external 5V power supply. Please find the virtual COM port assigned for NuMaker-IoT-M487 in Device Manager. In the demonstration, the “Nu-Link Virtual Com Port” is COMx. Then use your favorite terminal tool. Here we use Putty. Open the COMx port with 115200 baud rate, 8 bits, 1 stop bit, none parity, and no flow control settings. Then “Open” it. Let’s back to the download folder where you can see the binary firmware file (NuMaker-mbed-Cellular-example.NUMAER_IOT_M487.bin). Drag and drop the file to NuMicro MCU drive. You will see the copying progress dialog box. You can see the connection messages printed on terminal. It shows that the board creates a TCP connection to server “echo.mbedcloudtesting.com”, send 4 bytes data and get the data back from server. That’s all for this tutorial. Thank you. For more information, please visit Nuvoton Technology: https://bit.ly/3hVdcmC Buy now: https://direct.nuvoton.com/tw/numaker-iot-m487 #tool #training #learning #intermediate #en

File
This website uses cookies to ensure you get the best experience on our website. Learn more
OK