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

MQTT blocks restarting GPS?

Hi,

I'm writing a program that swaps between LTE and GPS to send the device's location to AWS over MQTT. I am able to connect to LTE and AWS, then swap to GPS and get a fix, and swap back to LTE. However, when I then try to go back to GPS, I get a bsd recoverable error 3, and it appears I cannot communicate over the GPS socket.

If I have everything EXCEPT connecting to MQTT, I am able to freely swap between LTE and GPS.

I've attached my code below:

called by main():

GPS code:

AT command swapping code:

Output:

Using the debugger, I was able to find that the error occurred after the call to  retval = nrf_setsockopt(gps_socket, NRF_SOL_GNSS, NRF_SO_GNSS_START, NULL, 0);

What's going wrong?

Thanks.

Parents
  • Hi Johnny,

    Good news.
    A stripped-down and a more user-friendly sample has been made with GPS + LTE.
    Please find the sample here:  https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/udp_gps 
    You could either add that sample in your NCS environment or copy the whole repository of "rallare".

    (remember to do a 'west update' in the nrf folder so you get the other repositories in the correct state)


    If you are only going to copy that sample to your NCS, you need to use the master branch.

    Best regards,
    Martin L.

  • Hi, Martin. I followed your instruction, but I got this error. Could you give me any advice?

    What I did

    1. Download the Rallare nrf folder and place it under ncs folder.
    2. Run "git checkout master", "git pull", and "west update" under the nrf_rallare folder
    3. Try to open the folder => got error

    modem: v1.0.0
    nrf tag: v1.0.0
    SES: v4.16

  • Hi Yusuke,

    If you are using the Rallare fork, and want to use the nrf9160 samples you need to checkout the correct branch.

    Then you should be able to open and run the samples.

  • Hey! - I'm trying to pull this project and put the Rallare fork into my current tree in place of the existing nrf directory as described above.

    However, when I do the west update I get the following. What is wrong?

    $ west update
    validation.invalid
     --- All found errors ---
    ["Key 'repo-path' was not defined. Path: '/projects/0'", "Key 'repo-path' was not defined. Path: '/projects/3'", "Key 'repo-path' was not defined. Path: '/projects/4'", "Key 'repo-path' was not defined. Path: '/projects/5'", "Key 'repo-path' was not defined. Path: '/projects/6'", "Key 'repo-path' was not defined. Path: '/projects/10'"]
    Traceback (most recent call last):
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\manifest.py", line 153, in __init__
        schema_files=[_SCHEMA_PATH[key]]
      File "c:\python37\lib\site-packages\pykwalify\core.py", line 167, in validate
        error_msg=u'.\n - '.join(self.validation_errors)))
    pykwalify.errors.SchemaError: <SchemaError: error code 2: Schema validation failed:
     - Key 'repo-path' was not defined. Path: '/projects/0'.
     - Key 'repo-path' was not defined. Path: '/projects/3'.
     - Key 'repo-path' was not defined. Path: '/projects/4'.
     - Key 'repo-path' was not defined. Path: '/projects/5'.
     - Key 'repo-path' was not defined. Path: '/projects/6'.
     - Key 'repo-path' was not defined. Path: '/projects/10'.: Path: '/'>

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "c:\python37\lib\runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "C:\Python37\Scripts\west.exe\__main__.py", line 9, in <module>
      File "c:\python37\lib\site-packages\west\_bootstrap\main.py", line 499, in main
        wrap(wrap_argv)
      File "c:\python37\lib\site-packages\west\_bootstrap\main.py", line 485, in wrap
        west.main.main(argv)
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\main.py", line 569, in main
        extensions = get_extension_commands()
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\main.py", line 531, in get_extension_commands
        extensions = extension_commands()
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\commands\command.py", line 181, in extension_commands
        manifest = Manifest.from_file()
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\manifest.py", line 91, in from_file
        return Manifest(source_file=source_file, sections=sections)
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\manifest.py", line 156, in __init__
        self._malformed(e, key)
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\manifest.py", line 226, in _malformed
        complaint))
    west.manifest.MalformedManifest: Malformed manifest file C:\wrk\SmartTrackTech\boohoo_nrf\nrf\west.yml (schema: C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\manifest-schema.yml):
    <SchemaError: error code 2: Schema validation failed:
     - Key 'repo-path' was not defined. Path: '/projects/0'.
     - Key 'repo-path' was not defined. Path: '/projects/3'.
     - Key 'repo-path' was not defined. Path: '/projects/4'.
     - Key 'repo-path' was not defined. Path: '/projects/5'.
     - Key 'repo-path' was not defined. Path: '/projects/6'.
     - Key 'repo-path' was not defined. Path: '/projects/10'.: Path: '/'>

Reply
  • Hey! - I'm trying to pull this project and put the Rallare fork into my current tree in place of the existing nrf directory as described above.

    However, when I do the west update I get the following. What is wrong?

    $ west update
    validation.invalid
     --- All found errors ---
    ["Key 'repo-path' was not defined. Path: '/projects/0'", "Key 'repo-path' was not defined. Path: '/projects/3'", "Key 'repo-path' was not defined. Path: '/projects/4'", "Key 'repo-path' was not defined. Path: '/projects/5'", "Key 'repo-path' was not defined. Path: '/projects/6'", "Key 'repo-path' was not defined. Path: '/projects/10'"]
    Traceback (most recent call last):
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\manifest.py", line 153, in __init__
        schema_files=[_SCHEMA_PATH[key]]
      File "c:\python37\lib\site-packages\pykwalify\core.py", line 167, in validate
        error_msg=u'.\n - '.join(self.validation_errors)))
    pykwalify.errors.SchemaError: <SchemaError: error code 2: Schema validation failed:
     - Key 'repo-path' was not defined. Path: '/projects/0'.
     - Key 'repo-path' was not defined. Path: '/projects/3'.
     - Key 'repo-path' was not defined. Path: '/projects/4'.
     - Key 'repo-path' was not defined. Path: '/projects/5'.
     - Key 'repo-path' was not defined. Path: '/projects/6'.
     - Key 'repo-path' was not defined. Path: '/projects/10'.: Path: '/'>

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "c:\python37\lib\runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "C:\Python37\Scripts\west.exe\__main__.py", line 9, in <module>
      File "c:\python37\lib\site-packages\west\_bootstrap\main.py", line 499, in main
        wrap(wrap_argv)
      File "c:\python37\lib\site-packages\west\_bootstrap\main.py", line 485, in wrap
        west.main.main(argv)
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\main.py", line 569, in main
        extensions = get_extension_commands()
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\main.py", line 531, in get_extension_commands
        extensions = extension_commands()
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\commands\command.py", line 181, in extension_commands
        manifest = Manifest.from_file()
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\manifest.py", line 91, in from_file
        return Manifest(source_file=source_file, sections=sections)
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\manifest.py", line 156, in __init__
        self._malformed(e, key)
      File "C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\manifest.py", line 226, in _malformed
        complaint))
    west.manifest.MalformedManifest: Malformed manifest file C:\wrk\SmartTrackTech\boohoo_nrf\nrf\west.yml (schema: C:\wrk\SmartTrackTech\boohoo_nrf\.west\west\src\west\manifest-schema.yml):
    <SchemaError: error code 2: Schema validation failed:
     - Key 'repo-path' was not defined. Path: '/projects/0'.
     - Key 'repo-path' was not defined. Path: '/projects/3'.
     - Key 'repo-path' was not defined. Path: '/projects/4'.
     - Key 'repo-path' was not defined. Path: '/projects/5'.
     - Key 'repo-path' was not defined. Path: '/projects/6'.
     - Key 'repo-path' was not defined. Path: '/projects/10'.: Path: '/'>

Children