This is an example based on mbed-os cellular APIs that demonstrates a TCP or UDP echo transaction with a public echo server. Especially, BG96 operation check based Mbed OS 5.11, tested via SK Telecom in Korea

This code could be access via Cat.M1(BG96 module) of SK telecom network in Korea. Need a WIZnet BG96 board and development board. Before using this code, must be checking your modem is authorized or not from SK telecom. This code is based on Mbed OS 5.11.5.

/media/uploads/Daniel_Lee/img_8560.jpg

Tested with

  • DISCOVERY_L485VG_IOT01A
  • K66F
  • K64F

1. Import the application into your desktop

 mbed import https://os.mbed.com/users/Daniel_Lee/code/mbed-os-example-cellular-BG96_os511/

 cd mbed-os-example-cellular-BG96_os511

2. Compile and program

mbed compile -t <toolchain> -m <TARGET_BOARD>

(supported toolchains : GCC_ARM / ARM / IAR)

3. Download binary to a target board

4. Result

mbed-os-example-cellular


Built: Jun  4 2019, 13:45:53


[MAIN], plmn: (null)
Modem power on
Establishing connection
..

Connection Established.
TCP: connected with echo.mbedcloudtesting.com server
TCP: Sent 4 Bytes to echo.mbedcloudtesting.com
...Received from echo server 4 Bytes
...

Success. Exiting

5. Patched code

If need more information such as how to test, please look at https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-cellular/.

Revision:
27:97054be1a741
Parent:
26:348eec457e58
Child:
28:232da3ce8a88
--- a/mbed_app.json	Tue Nov 20 09:45:32 2018 +0000
+++ b/mbed_app.json	Thu Nov 22 10:30:32 2018 +0000
@@ -1,22 +1,6 @@
 {
     "config": {
         "sock-type": "TCP",
-        "sim-pin-code": {
-            "help": "SIM PIN code, set to 0 if none",
-            "value": "\"1234\""
-        },
-        "apn": {
-            "help": "The APN string to use for this SIM/network, set to 0 if none",
-            "value": "\"internet\""
-        },
-        "username": {
-            "help": "The user name string to use for this APN, set to zero if none",
-            "value": 0
-        },
-        "password": {
-            "help": "The password string to use for this APN, set to 0 if none",
-            "value": 0
-        },
         "echo-server-hostname": {
             "help": "Echo server host name.",
             "value": "\"echo.mbedcloudtesting.com\""
@@ -42,7 +26,12 @@
             "platform.stdio-baud-rate": 115200,
             "platform.default-serial-baud-rate": 115200,
             "platform.stdio-buffered-serial": true,
-            "cellular.debug-at": false
+            "cellular.debug-at": false,
+            "nsapi.default-cellular-plmn": 0,
+            "nsapi.default-cellular-sim-pin": "\"1234\"",
+            "nsapi.default-cellular-apn": 0,
+            "nsapi.default-cellular-username": 0,
+            "nsapi.default-cellular-password": 0
         }
     }
 }