how to integrate Modem Shell functionality with a custom application without conflicts.

Dear Nordic Team,

I would like to consult you about that, is there any way to flash modem shell to the custom PCB which already has nRF Cloud connection for location application without breaking its device credentials between nRF Cloud? We are using nRF9160 as a main chip.

Thank you so much.

Best regards,
Semih

  • Hi Semih,

    is there any way to flash modem shell to the custom PCB which already has nRF Cloud connection for location application without breaking its device credentials between nRF Cloud?

    Can you provide more information about your concern of breaking credentials?

    Which application is currently running on your board?

    Can you elaborate on your use case?

    Best regards,
    Dejan

  • Hi Dejans,

    In our main firmware, we are using Nordic's location services for WiFi, GNSS, and Cellular location. All these features are working without any issues, and we are successfully receiving all types of location data from nRF Cloud.

    To test the device’s features, I wrote a Python script that sends commands to it. For this, I realized that I needed to flash Modem Shell (Mosh) onto our custom PCB to send Mosh commands. I built and flashed the firmware using nRF Connect for Desktop’s Programmer feature.

    After flashing, I was able to send commands to the custom PCB, such as "at at+cereg?" and "wifi scan", and received clear responses. However, when I tried running location-related commands like "location get", I encountered the following error:

    00> Started to get current location...
    00> mosh:~$ Neighbor cell measurement results:
    00> Current cell:
    00> ID 6973709, phy ID 361, MCC 204 MNC 8, RSRP 65 : -76dBm, RSRQ 29, TAC 31502, earfcn 6400, meas time 181665
    00> TA 0, TA meas time 12802
    00> Neighbor cell 1
    00> phy ID 353, RSRP 54 : -87dBm, RSRQ 8, earfcn 6400, timediff 0
    00> RRC mode: Connected
    00> [00:03:02.784,362] <inf> location: Wi-Fi and cellular methods combined
    00> mosh:~$ [00:03:02.871,063] <inf> nrf_cloud_info: Device ID: nrf-359746162076546
    00> mosh:~$ [00:03:02.875,030] <inf> nrf_cloud_info: IMEI: 359746162076546
    00> mosh:~$ [00:03:02.961,181] <inf> nrf_cloud_info: UUID: 50565932-3033-4b88-8014-1a284ee05fcb
    00> mosh:~$ [00:03:02.966,766] <inf> nrf_cloud_info: Modem FW: mfw_nrf9160_1.3.7
    00> mosh:~$ [00:03:02.966,796] <inf> nrf_cloud_info: Protocol: REST
    00> mosh:~$ [00:03:02.966,827] <inf> nrf_cloud_info: Download protocol: HTTPS
    00> mosh:~$ [00:03:02.966,857] <inf> nrf_cloud_info: Sec tag: 16842753
    00> mosh:~$ [00:03:02.966,888] <inf> nrf_cloud_info: Host name: api.nrfcloud.com
    00> mosh:~$ mosh:~$ [00:03:05.969,207] <err> nrf_cloud_codec_internal: REST error msg: Auth token is malformed.
    00> mosh:~$ [00:03:05.969,329] <err> nrf_cloud_rest: nRF Cloud REST error code: 40100
    00> mosh:~$ [00:03:05.970,428] <err> location: nRF Cloud A-GNSS request failed, error: -77
    00> mosh:~$ mosh:~$ RRC mode: Idle

    Do you have any insights into why we are loosing nRF Cloud connection on the custom PCB, even though other commands function correctly?

    Thanks in advance for your help!

    Best regards,
    Semih

  • Hi Semih, 

    Error 40100 means access denied. You need to verify that your authorization is correct. You can read more about this error in the Error Codes documentation. With regard to authentication, you can refer to these pages - REST API authentication and managing tokens and keys.

    Best regards,
    Dejan

Related