5 years ago.

how to port the mbed-to-azure-iot-hub demo from ethernet to cellular

Hello, I'm planning to port the mbed-to-azure-iot-hub demo( https://os.mbed.com/users/coisme/code/Mbed-to-Azure-IoT-Hub/ ) to NRF52840 and cellular as the network module. What I did is: changed the network-interface and add the cellular parameter configuration in the mbed_app.json, see the following:

"config": { "network-interface":{ "help": "options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, WIFI_RTW, MESH_LOWPAN_ND, MESH_THREAD, CELLULAR_ONBOARD", "value": "CELLULAR_ONBOARD" },

"cellular-apn": { "help": "Please provide the APN string for your SIM if it is not already included in APN_db.h.", "value": "\"my_sims_apn\"" }, "cellular-username": { "help": "May or may not be required for your APN, please consult your SIM provider.", "value": "\"my_sim_apns_username\"" }, "cellular-password": { "help": "May or may not be required for your APN, please consult your SIM provider.", "value": "\"my_sim_apns_password\"" }, "cellular-sim-pin": { "help": "Please provide the PIN for your SIM (as a four digit string) if your SIM is normally locked", "value": "\"1234\"" } }

however, I can't compile passed, the output error is:

Building project Mbed-to-Azure-IoT-Hub (NRF52840_DK, GCC_ARM) Scan: Mbed-to-Azure-IoT-Hub Scan: env Scan: FEATURE_BLE Using ROM regions bootloader, application in this build. Region bootloader: size 0x22000, offset 0x0 Region application: size 0xde000, offset 0x22000 Compile [ 0.1%]: MQTTConnectServer.c Compile [ 0.3%]: MQTTDeserializePublish.c Compile [ 0.4%]: MQTTConnectClient.c Compile [ 0.5%]: MQTTFormat.c [Warning] MQTTFormat.c@123,9: variable 'strindex' set but not used [-Wunused-but-set-variable] [Warning] MQTTFormat.c@193,9: variable 'strindex' set but not used [-Wunused-but-set-variable] Compile [ 0.7%]: MQTTSerializePublish.c Compile [ 0.8%]: MQTTSubscribeClient.c Compile [ 1.0%]: MQTTSubscribeServer.c Compile [ 1.1%]: MQTTPacket.c Compile [ 1.2%]: MQTTUnsubscribeClient.c Compile [ 1.4%]: MQTTUnsubscribeServer.c Compile [ 1.5%]: TLSSocket.cpp Compile [ 1.6%]: TLSSocketWrapper.cpp Compile [ 1.8%]: at24mac.cpp Compile [ 1.9%]: NanostackRfPhyAtmel.cpp [Warning] NanostackRfPhyAtmel.cpp@1100,18: variable 'last_is' set but not used [-Wunused-but-set-variable] [Warning] NanostackRfPhyAtmel.cpp@1100,27: variable 'last_ts' set but not used [-Wunused-but-set-variable] [Warning] NanostackRfPhyAtmel.cpp@1102,11: unused variable 'orig_xah_ctrl_1' [-Wunused-variable] [Warning] NanostackRfPhyAtmel.cpp@1106,11: unused variable 'orig_flags' [-Wunused-variable] [Warning] NanostackRfPhyAtmel.cpp@1377,13: 'void rf_ack_wait_timer_stop()' defined but not used [-Wunused-function] Compile [ 2.1%]: ESP8266Interface.cpp Compile [ 2.2%]: MCR20Drv.c Compile [ 2.3%]: easy-connect.cpp [Error] easy-connect.cpp@84,1: 'OnboardCellularInterface' does not name a type; did you mean 'OnboardNetworkStack'? [Error] easy-connect.cpp@251,23: 'cellular' was not declared in this scope [Error] easy-connect.cpp@373,14: 'cellular' was not declared in this scope [ERROR] .\easy-connect\easy-connect.cpp:84:1: error: 'OnboardCellularInterface' does not name a type; did you mean 'OnboardNetworkStack'? OnboardCellularInterface cellular; ^~~~~~~~~~~~~~~~~~~~~~ OnboardNetworkStack .\easy-connect\easy-connect.cpp: In function 'NetworkInterface* easy_connect(bool)': .\easy-connect\easy-connect.cpp:251:23: error: 'cellular' was not declared in this scope connect_success = cellular.connect(); ^~~~~~ .\easy-connect\easy-connect.cpp:251:23: note: suggested alternative: 'ceill' connect_success = cellular.connect(); ^~~~~~ ceill .\easy-connect\easy-connect.cpp: In function 'NetworkInterface* easy_get_netif(bool)': .\easy-connect\easy-connect.cpp:373:14: error: 'cellular' was not declared in this scope return &cellular; ^~~~~~ .\easy-connect\easy-connect.cpp:373:14: note: suggested alternative: 'ceill' return &cellular; ^~~~~~ ceill

[mbed] ERROR: "c:\python27\python.exe" returned error. Code: 1 Path: "D:\mbed_os_workplace\Mbed-to-Azure-IoT-Hub" Command: "c:\python27\python.exe -u D:\mbed_os_workplace\Mbed-to-Azure-IoT-Hub\mbed-os\tools\make.py -t GCC_ARM -m NRF52840_DK source . build .\BUILD\NRF52840_DK\GCC_ARM"

Tip: You could retry the last command with "-v" flag for verbose output -

Is there anyone can point out the problems, or am I missed any configuration in json files? Thank you so much.

Be the first to answer this question.