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

Problem with MQTT_Simple

I am having a problem running MQTT_Simple on my nRF9160 DK.

The COM Port shows the following:

***** BUS FAULT *****
  Precise data bus error
  BFAR Address: 0x4002a514
***** Hardware exception *****
Current thread ID = 0x20000324
Faulting instruction address = 0x6704
Fatal fault in essential thread! Spinning...

I have recently updated SES, but the code still produces the bus fault.

Case ID: 226428 seems to be similar, but the discussion involves several "experiments" only some of which were productive.

So, could someone explicitly lists the steps needed to get this example working.  I wish to use it as the basis for a new product that sends data to the cloud.

Thank you,

-Craig Goldman

Parents
  • Have you tried updating to the latest firmware for the nrf9160 DK? Did you try "west update" to get the latest release?

    Also when, using the latest versions, you have to use build solution, connect target and then program the merged.hex file like mentioned here:

    https://devzone.nordicsemi.com/f/nordic-q-a/47032/mqtt_simple-programmed-to-wrong-address-range-00008000----00020abb

  • Thank you for your response (and sorry for the delay in responding).  I was not aware that I had to do something special to program the merged file.

    I am preparing to do a complete new download of the NCS directory and will try all these suggestions in the next few days.  I will report my results.

  • NRF_Connect asked me to download an update and I did.

    The LTE_Monitor is reporting an error  -- JLINK_ARM_DLL_TOO_OLD.

    First of all, if you have update nRF Connect to v2.7, there are known bugs with this version. Please ensure latest version of LTE Link Monitor (update in nRC Connect) and please download latest JLink drivers from Segger.com. If this does not help, we strongly advise downgrading to v2.6.2. 

    craig.goldman said:
    AT+CFUN? returns.... 
    +CFUN: 4

     Ok, this means that your modem is set to Offline or Flight Mode Please see AT Command CFUN documentation. You need to issue the command "AT+CFUN=1"

     

    craig.goldman said:
    I built this example with board nrf9160_pca10090.  Should it be built with nrf9160_pca10090ns?

    Yes, it still needs to be nrf9160_pca10090ns. This is due to the complexity of the nRF9160, more information here.

    craig.goldman said:
    Do I need to manually download a merged hex file?

    Yes, in Segger Embedded Studio (SES) v4.16 you need to manually program the device.  See this post on how the process is. We are working with a fix for newer version SES.

    Let me know how this works for you!

    Kind regards,
    Øyvind

  • I have upgraded my JLINK DLL drivers.  "at_client" has been built with nrf9160_pca10090ns. The merged.hex was manually downloaded.

    nRF Connect is v2.7.0.  LTE Link Monitor is v0.9.2

    When I open the device it reports....
    Opening COM6: File not found

    LTE commands time-out.

    UART, Modem, etc. all marked as gray boxes.

    The code says it is running, but I'm not sure that it is working.

    How do I downgrade nRF Connect to v.2.6.2?

    Do you have any other suggestions?

  • craig.goldman said:
    When I open the device it reports....
    Opening COM6: File not found

     Can you please provide a screenshot of the LTE Link Monitor?

    craig.goldman said:
    How do I downgrade nRF Connect to v.2.6.2?

     The issues that were first seen in version 2.7 should be fixed now, so there should be no need to downgrade after all. 

  • The monitor is acting different this morning.

    Also, I'm not sure this is a good location for cellular connection.  I'll try everything again at a better location this weekend.

    Here is Monitor snap shot

  • More interesting (promising?) information regarding mqtt_simple.

    I decided to re-build and re-download mqtt_simple on the board in a very strong cellular area.

    I also decided to activate the LTE_Monitor instead of the terminal emulator.

    When I reset the board, I got the same boot-up and the same error messages....
    ***** Booting Zephyr OS v1.14.99-ncs1-587-g5c5ba77d0170 *****
    The MQTT simple sample started
    LTE Link Connecting ...
    LTE Link Connected!
    ERROR: getaddrinfo failed 22
    ERROR: mqtt_connect -47

    Per earlier instructions, I send the command AT+CFUN?.  On the third try, the board sprung to life - the modem activated and the terminal every 10 seconds or so would send "AT+CESQ" and the device would respond with +CESQ: 99,99,255,255,255,76

    Eventually the "LTE" indicated it was searching.  It did this for awhile until I sent another AT+CFUN? command (using the push button this time).

    Everything now seems to be connected.

    Here are a couple of screen shots.

    I'm not sure how to attach the log file, if you are interested.

    This looks very good to me.  (Please tell me if I am being overly optimistic.)

    Still have issues with asset_tracker, but I'll play with it some more now that I know that you have to poke the application to get it to run.

    Is there anything more I can do with mqtt_simple?  Otherwise, I'll look into modifying this code to communicate with the 64Seconds mqtt_server.

    I appreciate all the help in getting me this far.

    If you can point me to any documents which discuss modifying mqtt_simple to be used in other applications or have any suggestions to get me started, I welcome all help.

    Thank you again.
    -Craig Goldman

Reply
  • More interesting (promising?) information regarding mqtt_simple.

    I decided to re-build and re-download mqtt_simple on the board in a very strong cellular area.

    I also decided to activate the LTE_Monitor instead of the terminal emulator.

    When I reset the board, I got the same boot-up and the same error messages....
    ***** Booting Zephyr OS v1.14.99-ncs1-587-g5c5ba77d0170 *****
    The MQTT simple sample started
    LTE Link Connecting ...
    LTE Link Connected!
    ERROR: getaddrinfo failed 22
    ERROR: mqtt_connect -47

    Per earlier instructions, I send the command AT+CFUN?.  On the third try, the board sprung to life - the modem activated and the terminal every 10 seconds or so would send "AT+CESQ" and the device would respond with +CESQ: 99,99,255,255,255,76

    Eventually the "LTE" indicated it was searching.  It did this for awhile until I sent another AT+CFUN? command (using the push button this time).

    Everything now seems to be connected.

    Here are a couple of screen shots.

    I'm not sure how to attach the log file, if you are interested.

    This looks very good to me.  (Please tell me if I am being overly optimistic.)

    Still have issues with asset_tracker, but I'll play with it some more now that I know that you have to poke the application to get it to run.

    Is there anything more I can do with mqtt_simple?  Otherwise, I'll look into modifying this code to communicate with the 64Seconds mqtt_server.

    I appreciate all the help in getting me this far.

    If you can point me to any documents which discuss modifying mqtt_simple to be used in other applications or have any suggestions to get me started, I welcome all help.

    Thank you again.
    -Craig Goldman

Children
  • Hi Craig,

     

    From the logs that you posted, it seems that your modem firmware is quite old.

    Could you please download the latest one from here:

    https://www.nordicsemi.com/Products/Low-power-cellular-IoT/nRF9160/Download#infotabs

    And try the mqtt_simple example again?

     

    Kind regards,

    Håkon

  • Sorry if this is a duplicate post, my previous reply a few minutes ago seems to have disappeared.

    Followed instructions and encountered problems.

    First, instructions call for command of "pip install nrf9160_mdm_dfu-0.10.1+dev-py3-none-any.whl", but the fie included in the download is "nrf9160_mdm_dfu-0.10.0+dev-py3-none-any.whl"

    Second, after I install, I run the following and get errors....

    c:\SwTools\Nordic Semi\2019-06-25 nRF9160 Modem Update>nrf9160_mdm_dfu --update
    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\nrf9160_mdm_dfu.exe\__main__.py", line 9, in <module>
      File "c:\python37\lib\site-packages\nrf9160_mdm_dfu\bin\nrf9160_mdm_dfu.py", line 24, in main
        nrf_dfu = nrf_dfu_API.nrf_dfu_API(quiet=args.quiet)
      File "c:\python37\lib\site-packages\nrf9160_mdm_dfu\api\nrf_dfu_API.py", line 37, in __init__
        self.api = API.API("NRF91")
      File "c:\python37\lib\site-packages\pynrfjprog\API.py", line 375, in __init__
        jlink_arm_dll_path = JLink.find_latest_dll()
      File "c:\python37\lib\site-packages\pynrfjprog\JLink.py", line 31, in find_latest_dll
        for root, dirs, files in os.walk(os.path.join(_DEFAULT_SEGGER_ROOT_PATH, jlink_sw_dirs[-1])):
    IndexError: list index out of range

    Any thoughts about what went wrong?
    Could it be that the download included "nrf9160_mdm_dfu-0.10.0+dev-py3-none-any.whl" but should have included "nrf9160_mdm_dfu-0.10.1+dev-py3-none-any.whl"?

    -Craig Goldman

  • Hi Craig,

     

    It looks like it cannot find your segger installation.

    Could you try downloading the latest driver from here, and see if that works?

    https://www.segger.com/downloads/jlink/

     

    Regarding the readme.txt, I'll report this internally. This should not have an impact on the modem upgrade procedure.

     

    Kind regards,

    Håkon

  • I thought I had just upgraded the driver, but maybe something went wrong with that.  I'll download it again and try this later.

    I'm in a bad cellular area today.  So the device may not connect successfully.  I'll try to find a good place to test the device tonight or tomorrow morning.

    -Craig Goldman

  • I upgraded the Jlink driver and re-ran "nrf9160_mdm_dfu --update".

    I got the same error message.

    When I upgraded the driver, the upgrade software informed me of the applications where the driver is used.  All that if found was my Keil compiler.  It did not mention any of the Nordic software.

    Is that typical?

Related