This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF9160 Udp with psm sample

Hy,

I have a question to the udp_with_psm sample. To my situation: first it looks like as it works correct (find LTE-NB connection, open socket and send data), but the sent data never arrives at our UDP-Server and the Nordic board is in idle speed to wait for a receive. Does someone know what I am doing wrong (before building I ofcourse set the correct host and port)?

I am glad about any help, thanks.

KR, Sebastian

Parents Reply Children
  • The unmodified sample does not seem to work (I assume the network type NB is not selected).

    The only difference between the unmodified and mine is the added line in the prj.conf: CONFIG_LTE_NETWORK_MODE_NBIOT=y and a different host and port in the main.c.

    The file below shows the output where I only changed the prj.conf:

    ***** Booting Zephyr OS v1.14.99-ncs2 *****
    UDP test with PSM
    Exception occurred in Secure State
    ***** HARD FAULT *****
      Fault escalation (see below)
    ***** BUS FAULT *****
      Precise data bus error
      BFAR Address: 0x50008120
    ***** Hardware exception *****
    Current thread ID = 0x20021dec
    Faulting instruction address = 0x1084a
    Fatal fault in ISR! Spinning...

    This file is with the modified prj.conf, host and port:

    ***** Booting Zephyr OS v1.14.99-ncs2 *****
    UDP test with PSM
    sendto ret: 48

    KR, Sebastian

  • Hi,

     

    Does any other sample get a connection on your kit?

    Have you tried using the at_client to see if that works (post a log if you have issues)? Note that you have to change the systemmode (AT%XSYSTEMMODE=0,1,0,0) before enabling the modem to enable NB1.

     

    Kind regards,

    Håkon

  • Hi,

    Yes, other samples get a connection on my kit (for example at_client). I checked the systemmode too and it returned the same value as you suggested it (%XSYSTEMMODE: 0,1,0,0).

    Is there something else I can try?

    EDIT:

    > I may found the reason why I can send a package but the server does not receive it. The kit chooses a private apn of my provider.

    > I do have a public apn but how and when should I set it in the udp_with_psm sample?

    EDIT:

    > Now I am sure that the wrong apn caused the issue. Why I know that: If my public apn is set manually (+CGDCONT=...) via the LTE Link Monitor right after the start of zephyr booting, the kit registers with the correct apn and I can receive the sent data in our server. *happy* ;)

    > Which possibilities do I have to set the apn, except manually?

    KR, Sebastian

  • Hi Sebastian,

     

    Glad to hear that it started working!

    SebastianF said:
    > Which possibilities do I have to set the apn, except manually?

    You can either hard-code it in the application (runtime set at every boot), or store it once using at_client (before modem is active) by issuing new APN, then "AT+CFUN=0" to store it. 

     

    Kind regards,

    Håkon

Related