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

question on serial_lte_modem sample

Hi 

I am evaluating the serial_lte_modem sample with pc as client but failed, could you share the cmd format for gps start function?

here is the log after I issued the xgpsrun cmd as: 

AT#XGPSRUN=1

*** Booting Zephyr OS build v2.0.99-ncs1-rc1-1162-g9a0a85cf6760  ***
[00:00:01.548,095] <inf> app: Serial LTE Modem
[00:00:06.143,280] <err> gps: Failed to set fix retry value (err: -14)
[00:00:06.143,280] <err> gps: GPS start failed: -1

  • Hi!

    You're getting errno = -14  which corresponds to EFAULT: Bad addressHowever, I'm not sure why, so I have contacted the person who made the sample. 

    Best regards,

    Heidi

  • Add further info:

    Enabled debug log and refered to GPS sample, I manually sent enable GPS AT command("AT\%XSYSTEMMODE=0,0,1,0",
     "AT+CFUN=1") to modem but also failed:

    *** Booting Zephyr OS build v2.0.99-ncs1-rc1-1162-g9a0a85cf6760  ***
    [00:00:01.541,778] <dbg> at_cmd.at_cmd_set_notification_handler: Setting notification handler to 0x00011f09
    [00:00:01.548,187] <dbg> at_cmd.at_cmd_driver_init: Common AT socket created
    [00:00:01.548,187] <dbg> at_cmd.at_cmd_driver_init: Common AT socket processing thread created
    [00:00:01.548,217] <inf> app: Serial LTE Modem
    [00:00:01.548,278] <dbg> at_host: TX
    52 65 61 64 79 0d 0a                             |Ready..
    [00:00:01.548,889] <dbg> at_host.slm_at_host_init: at_host init done
    [00:00:01.548,919] <dbg> at_cmd.socket_thread_fn: AT socket thread started
    [00:00:35.484,222] <dbg> at_host: RX
    41 54 5c 25 58 53 59 53  54 45 4d 4d 4f 44 45 3d |AT\%XSYS TEMMODE=
    30 2c 30 2c 31 2c 30 0d  0a                      |0,0,1,0. .
    [00:00:35.484,283] <dbg> at_cmd.at_write: Sending command AT\%XSYSTEMMODE=0,0,1,0
    
    [00:00:35.493,103] <dbg> at_cmd.socket_thread_fn: at_cmd_rx: ERROR
    
    [00:00:35.493,133] <dbg> at_cmd.at_write: Bytes sent: 25
    [00:00:35.493,164] <err> at_host: Could not send AT command to modem: -8
    [00:00:35.493,164] <dbg> at_host: TX
    45 52 52 4f 52 0d 0a 00                          |ERROR...

  • Hi, can you just try sending the following commands

    AT%XSYSTEMMODE=0,0,1,0
    AT%XMAGPIO=1,0,0,1,1,1574,1577
    AT%XCOEX0=1,1,1570,1580
    AT+CFUN=1
    at#xgpsrun=1
    at#xgpsrun?
    

    and provide me with the output, thanks!

    Best regards,

    Heidi

  • Hi Heid,

    here is the output of your cmd sequences:

    2020-01-14T08:11:08.783Z INFO Modem port is opened
    2020-01-14T08:11:35.690Z DEBUG modem << Ready\x0D\x0A
    2020-01-14T08:11:52.197Z DEBUG modem >> AT%XSYSTEMMODE=0,0,1,0\x0D\x0A
    2020-01-14T08:11:52.214Z DEBUG modem << OK\x0D\x0A\x00
    2020-01-14T08:12:10.261Z DEBUG modem >> AT%XMAGPIO=1,0,0,1,1,1574,1577\x0D\x0A
    2020-01-14T08:12:10.277Z DEBUG modem << OK\x0D\x0A\x00
    2020-01-14T08:12:23.630Z DEBUG modem >> AT%XCOEX0=1,1,1570,1580\x0D\x0A
    2020-01-14T08:12:23.644Z DEBUG modem << OK\x0D\x0A\x00
    2020-01-14T08:12:35.391Z DEBUG modem >> AT+CFUN=1\x0D\x0A
    2020-01-14T08:12:35.408Z DEBUG modem << OK\x0D\x0A\x00
    2020-01-14T08:12:49.798Z DEBUG modem >> at#xgpsrun=1\x0D\x0A
    2020-01-14T08:12:49.818Z DEBUG modem << #XGPSRUN: 1,31\x0D\x0A
    2020-01-14T08:12:49.821Z DEBUG modem << OK\x0D\x0A\x00
    2020-01-14T08:13:03.903Z DEBUG modem >> at#xgpsrun?\x0D\x0A
    2020-01-14T08:13:03.908Z DEBUG modem << #XGPSRUN: 1,31\x0D\x0A
    2020-01-14T08:13:03.910Z DEBUG modem << OK\x0D\x0A\x00
    2020-01-14T08:13:19.845Z DEBUG modem << #XGPSS: tracking 1 using 1 unhealthy 0\x0D\x0A
    2020-01-14T08:13:23.844Z DEBUG modem << #XGPSS: tracking 0 using 0 unhealthy 0\x0D\x0A

    and seems the GPS could work after these cmds.

    Besides, after adding the enable_gps() to the beginning of do_gps_start() by refer to gps sample, the gps also could work correctly

    So in practice, should we add these AT cmds in the beginning of do_gps_start() to fix my issue? if not, what's your advice?

  • Yes, you have to run the AT commands I sent you before enabling the GPS. I'm glad it works now!

Related