The MQTT simple sample code for the NRF9160DK cannot publish to Soracom Beam.

件名の通り、NRF9160DK のシンプルな MQTT サンプルコードを元に、Soracom Beam 経由で別のクラウド環境に MQTT データを送信しようとしていますが、苦戦しています。

さまざまな調整と調査を試みましたが、次の問題が発生しています。

*** Booting Zephyr OS build v3.3.99-ncs1 ***
[00:00:00.253,051] <inf> mqtt_simple: The MQTT simple sample started
[00:00:00.253,082] <inf> mqtt_simple: Disabling PSM and eDRX
[00:00:00.253,082] <err> lte_lc: nrf_modem_at_printf failed, reported error: -1
[00:00:00.253,112] <err> lte_lc: Failed to disable eDRX, reported error: -1
[00:00:00.253,112] <inf> mqtt_simple: LTE Link Connecting...
[00:00:00.253,143] <err> lte_lc: Failed to get system mode, error: -1
[00:00:00.253,143] <err> lte_lc: Could not get current system mode, error: -14
[00:00:00.253,173] <inf> mqtt_simple: Failed to establish LTE connection: -14
[00:00:00.253,173] <inf> mqtt_simple: Retrying in 120 seconds

SORACOM SIMがATモードで接続できることを確認しました。シンプルなMQTTサンプルコードのどの部分を修正すればよいか、また、役立つ関連情報があれば教えていただけますか?

  • Hi,

    So you are using this sample? What NCS version are you using? The NCS version corresponding to v3.3.99-ncs1 doesn't seem to support this sample, which made me a bit confused.

    Are you able to get it functioning without issues when running the completely default sample?

    It looks like there might be issues communicating to the modem, maybe due to nrf_modem_lib_init() not being called, issues regarding connections, or maybe the modem firmware not being updated.

    Regards,

    Elfving

  • Thank you for your reply.

    I had my doubts about that as well, so I replaced the NCS version with 2.0.0 yesterday and got it running. As a result, the modem error has been resolved, but I still cannot connect to LTE.

    *** Booting Zephyr OS build v3.0.99-ncs1  ***
    [00:00:00.617,645] <inf> mqtt_simple: The MQTT simple sample started
    [00:00:00.617,675] <inf> mqtt_simple: Disabling PSM and eDRX
    [00:00:00.624,481] <inf> mqtt_simple: LTE Link Connecting...
    [00:10:00.676,025] <inf> lte_lc: Network connection attempt timed out
    [00:10:00.768,310] <inf> lte_lc: Using fallback network mode
    [00:20:00.796,936] <inf> lte_lc: Network connection attempt timed out
    [00:20:00.796,966] <inf> mqtt_simple: Failed to establish LTE connection: -116
    [00:20:00.796,966] <inf> mqtt_simple: Retrying in 120 seconds
    *** Booting Zephyr OS build v3.0.99-ncs1  ***
    *** Booting Zephyr OS build v3.0.99-ncs1  ***
    [00:00:00.541,442] <inf> mqtt_simple: The MQTT simple sample started
    [00:00:00.541,473] <inf> mqtt_simple: Disabling PSM and eDRX
    [00:00:00.548,278] <inf> mqtt_simple: LTE Link Connecting...

    I suspected the problem was with the Soracom SIM's APN settings.

    I tried this APN configuration guide, but it didn't resolve the issue.

    https://devzone.nordicsemi.com/f/nordic-qa/86471/how-to-set-apn-in-sdk-v1-9-1-https_client-sample-project-on-nrf9160

    Do you have any suggestions for a proper method?

    Incidentally, when using the iBasis SIM card included with the nrf9160DK, it appeared to be working fine.

    Please let me know if there are any mistakes in my actions or if you have any advice.

  • sasasa said:

    Incidentally, when using the iBasis SIM card included with the nrf9160DK, it appeared to be working fine.

    I see. This gives me the impression that you would need to contact the provider of this sim card. It sounds like it doesn't support what you are trying to do. 

    Regards,

    Elfving

  • Thank you for your reply.

    I updated the modem firmware to 1.3.2, but it didn't solve the issue.

    I don't believe that Soracom SIM is unsupported.

    I have confirmed that when I input the AT commands as shown below to the nrf9160DK with the Serial LTE modem, it connects successfully.

    I’m not sure if I’m correct,

    but I believe that adding the same AT command processing to the simple MQTT sample could resolve the issue.

    The board is different, but what I want to do is the same as this.

    https://www.hackster.io/virgilvox/nrf9160-feather-soracom-beam-3b420f

    I apologize for the poor explanation.

    Please continue your support.

  • Could you get me the full application log and a modem trace as well?

    sasasa said:

    I don't believe that Soracom SIM is unsupported.

    It might be supported in a way, but if it works when you change to another SIM card, I think there is some feature that Soracom doesn't support here, that is causing this to happen. 

    Regards,

    Elfving

Related