This is an example based on mbed-os cellular APIs that demonstrates a TCP or UDP echo transaction with a public echo server. Included TPB23 NB-IoT module which is can use LGU+ in Korea.

This example is showing how to use the NB-IoT(SECOM TPB23 module) of LGU plus network in Korea. The NB-IoT module' seller provided a document on how to start based on Mbed OS 5.11. (Created by CodeZoo) This guide has been supported to the latest os version which included 5.12 ~ 5.15.

  • if you need specific version of Mbed OS, please revision of TPB23_Driver and check it out.
  • Pelion ready example code is here!

Requirement

462 320 320

320

Tested with

1. Import the application into your desktop

mbed import http://os.mbed.com/users/Daniel_Lee/code/mbed-os-example-cellular-TPB23/

cd mbed-os-example-cellular-TPB23

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: Aug  7 2019, 06:10:47


[MAIN], plmn: NULL
Establishing connection
[00000001ms][INFO][CELL]: New CellularContext  (20000a08)
[00000002ms][INFO][CELL]: CellularContext plmn NULL
[00000003ms][INFO][CELL]: CellularContext connect
[00000036ms][INFO][CELL]: RSSI -69 dBm
[00000036ms][INFO][CELL]: Start connecting (timeout 1 s)
[00000087ms][INFO][CELL]: RSSI -69 dBm
[00000116ms][INFO][CELL]: Modem ready
[00000146ms][INFO][CELL]: RSSI -69 dBm
[00000146ms][INFO][CELL]: Setup SIM (timeout 1 s)
[00001233ms][INFO][CELL]: Looked up APN internet
[00001362ms][ERR ][CELL]: AT error code 50
[00001362ms][WARN][CELL]: Packet domain event reporting set failed!
[00001393ms][INFO][CELL]: RSSI -65 dBm
[00001393ms][INFO][CELL]: Network registration (timeout 180 s)
[00001443ms][INFO][CELL]: Registering network => Attaching network
[00001473ms][INFO][CELL]: RSSI -65 dBm
[00001473ms][INFO][CELL]: Attaching network (timeout 60 s)
[00001601ms][INFO][CELL]: Found PDP context 1
[00001649ms][INFO][CELL]: Activate PDP context 1


Connection Established.
[00001671ms][INFO][CELL]: Socket 0 open
[00001707ms][INFO][CELL]: Socket 1 open
[00001748ms][INFO][CELL]: Socket create id: 1
[00001883ms][INFO][CELL]: Socket 1 sent 43 bytes to 8.8.8.8 port 53
[00004311ms][INFO][CELL]: Socket 1 recv 59 bytes from 8.8.8.8 port 53
[00004331ms][INFO][CELL]: Close socket: 1 error: 0
[00004331ms][INFO][CELL]: Socket 1 closed
[00004373ms][INFO][CELL]: Socket create id: 1
TCP: connected with echo.mbedcloudtesting.com server
[00004448ms][INFO][CELL]: Socket 0 sent 4 bytes to 52.215.34.155 port 7
TCP: Sent 4 Bytes to echo.mbedcloudtesting.com
[00007560ms][INFO][CELL]: Socket 0 recv 4 bytes
[00007580ms][INFO][CELL]: Close socket: 1 error: 0
[00007580ms][INFO][CELL]: Socket 0 closed
Received from echo server 4 Bytes
[00007581ms][INFO][CELL]: CellularContext disconnect()
[00007630ms][INFO][CELL]: cb: CellularContext disconnected


Success. Exiting

History

Update latest OS version 5.15 default tip

2020-02-10, by Daniel_Lee [Mon, 10 Feb 2020 12:52:15 +0000] rev 47

Update latest OS version 5.15


Disable unsupported properties

2019-08-08, by Daniel_Lee [Thu, 08 Aug 2019 08:36:54 +0000] rev 46

Disable unsupported properties


Update for Mbed OS 5.12.x; This code was tested on Mbed OS 5.12.2, please check code revision!

2019-08-07, by Daniel_Lee [Wed, 07 Aug 2019 06:31:31 +0000] rev 45

Update for Mbed OS 5.12.x; This code was tested on Mbed OS 5.12.2, please check code revision!


Merge branch 'mbed-os-5.13'

2019-08-01, by mbed_official [Thu, 01 Aug 2019 11:02:02 +0100] rev 44

Merge branch 'mbed-os-5.13'

* mbed-os-5.13:
Updating mbed-os to mbed-os-5.13.2
Updating mbed-os to mbed-os-5.13.1
Updating mbed-os to mbed-os-5.13.0
Updating mbed-os to mbed-os-5.13.0-rc3
Updating mbed-os to mbed-os-5.13.0-rc2

.
Commit copied from https://github.com/ARMmbed/mbed-os-example-cellular


NRF52840 to Jenkinsfile (#148)

2019-07-23, by mbed_official [Tue, 23 Jul 2019 12:05:34 +0100] rev 43

NRF52840 to Jenkinsfile (#148)

* Added NRF52840_DK to Jenkinsfile

.
Commit copied from https://github.com/ARMmbed/mbed-os-example-cellular


Merge pull request #143 from statropy/statropy-patch-1

2019-05-29, by mbed_official [Wed, 29 May 2019 08:01:56 +0100] rev 42

Merge pull request #143 from statropy/statropy-patch-1

Use the actual length of the test string payload
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-cellular


Merge pull request #138 from ARMmbed/1570-smoke-test

2019-05-16, by mbed_official [Thu, 16 May 2019 09:02:09 +0100] rev 41

Merge pull request #138 from ARMmbed/1570-smoke-test

Replaced C027 with Wise 1570 in smoke
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-cellular


Merge pull request #135 from mirelachirica/nonip_socket_support

2019-05-06, by mbed_official [Mon, 06 May 2019 09:02:01 +0100] rev 40

Merge pull request #135 from mirelachirica/nonip_socket_support

Added NonIP socket example
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-cellular


Merge pull request #136 from ARMmbed/https_raas_connection

2019-04-30, by mbed_official [Tue, 30 Apr 2019 11:02:03 +0100] rev 39

Merge pull request #136 from ARMmbed/https_raas_connection

Updated RaaS connection to use https
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-cellular


Merge branch 'mbed-os-5.12'

2019-04-30, by mbed_official [Tue, 30 Apr 2019 08:01:58 +0100] rev 38

Merge branch 'mbed-os-5.12'

* mbed-os-5.12:
Updating mbed-os to mbed-os-5.12.2

.
Commit copied from https://github.com/ARMmbed/mbed-os-example-cellular