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/.

Committer:
Daniel_Lee
Date:
Tue Jun 04 07:20:23 2019 +0000
Revision:
46:81a8fcab4a6a
Parent:
44:a66aecfd2e4e
BG96 operation check based Mbed OS 5.11, tested via SK Telecom in Korea

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 0:4611f6cf2413 1 {
mbed_official 0:4611f6cf2413 2 "config": {
mbed_official 0:4611f6cf2413 3 "sock-type": "TCP",
mbed_official 11:23ea0907186e 4 "echo-server-hostname": {
mbed_official 11:23ea0907186e 5 "help": "Echo server host name.",
mbed_official 11:23ea0907186e 6 "value": "\"echo.mbedcloudtesting.com\""
mbed_official 11:23ea0907186e 7 },
mbed_official 11:23ea0907186e 8 "echo-server-port": {
mbed_official 11:23ea0907186e 9 "help": "Echo server port number.",
mbed_official 11:23ea0907186e 10 "value": 7
mbed_official 11:23ea0907186e 11 },
mbed_official 6:5678c0b6f74e 12 "trace-level": {
mbed_official 6:5678c0b6f74e 13 "help": "Options are TRACE_LEVEL_ERROR,TRACE_LEVEL_WARN,TRACE_LEVEL_INFO,TRACE_LEVEL_DEBUG",
mbed_official 6:5678c0b6f74e 14 "macro_name": "MBED_TRACE_MAX_LEVEL",
mbed_official 6:5678c0b6f74e 15 "value": "TRACE_LEVEL_INFO"
mbed_official 0:4611f6cf2413 16 }
mbed_official 6:5678c0b6f74e 17 },
mbed_official 0:4611f6cf2413 18 "target_overrides": {
mbed_official 0:4611f6cf2413 19 "*": {
mbed_official 28:232da3ce8a88 20 "target.network-default-interface-type": "CELLULAR",
mbed_official 6:5678c0b6f74e 21 "mbed-trace.enable": false,
Daniel_Lee 43:ac5e3248feae 22 "lwip.ipv4-enabled": false,
Daniel_Lee 43:ac5e3248feae 23 "lwip.ipv6-enabled": true,
mbed_official 0:4611f6cf2413 24 "lwip.ethernet-enabled": false,
mbed_official 0:4611f6cf2413 25 "lwip.ppp-enabled": true,
mbed_official 0:4611f6cf2413 26 "lwip.tcp-enabled": true,
mbed_official 0:4611f6cf2413 27 "platform.stdio-convert-newlines": true,
mbed_official 0:4611f6cf2413 28 "platform.stdio-baud-rate": 115200,
mbed_official 6:5678c0b6f74e 29 "platform.default-serial-baud-rate": 115200,
mbed_official 11:23ea0907186e 30 "platform.stdio-buffered-serial": true,
mbed_official 27:97054be1a741 31 "cellular.debug-at": false,
mbed_official 27:97054be1a741 32 "nsapi.default-cellular-plmn": 0,
mbed_official 27:97054be1a741 33 "nsapi.default-cellular-sim-pin": "\"1234\"",
Daniel_Lee 43:ac5e3248feae 34 "nsapi.default-cellular-apn": "\"lte-internet.sktelecom.com\"",
mbed_official 27:97054be1a741 35 "nsapi.default-cellular-username": 0,
mbed_official 27:97054be1a741 36 "nsapi.default-cellular-password": 0
mbed_official 0:4611f6cf2413 37 }
Daniel_Lee 44:a66aecfd2e4e 38 },
Daniel_Lee 43:ac5e3248feae 39 "macros":[
Daniel_Lee 43:ac5e3248feae 40 "CELLULAR_DEVICE=QUECTEL_BG96",
Daniel_Lee 43:ac5e3248feae 41 "MDMRXD=D0",
Daniel_Lee 43:ac5e3248feae 42 "MDMTXD=D1",
Daniel_Lee 43:ac5e3248feae 43 "MDMRTS=NC",
Daniel_Lee 43:ac5e3248feae 44 "MDMCTS=NC"
Daniel_Lee 43:ac5e3248feae 45 ]
mbed_official 0:4611f6cf2413 46 }