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

Bluetooth Mesh example: Interactive PyACI timeout

Hi,

I'm having problems to run the Loopback example in the Bluetooth Mesh SDK:

infocenter.nordicsemi.com/index.jsp

I'm receiving a timeout.

My setup is as follows:

  • Ubuntu Bionic (18.04 LTS) 64-bit
  • My user is added to the dialout group (for permissions to /dev/ttyACM0 etc)
  • Python 3.6.5 (changed default /usr/bin/python symlink to not point to python 2) due to ninja's call to /usr/bin/python
  • Using virtualenv with python 3 when calling interactive_pyaci
  • nrf52832 dev kits
  • Mesh SDK 2.0.1
  • nRF5 SDK 15.0.0
  • SEGGER JLink_V632c

It has worked on some occasions (after resetting/reprogramming), but often not.

However, nrfjprog seems to always recognize my dev board(s) (including indirectly, when programming using ninja), please see below:

(mesh) ...:~/projects/nrf5_sdk_for_mesh/build$ ninja flash_serial_nrf52832_xxAA_s132_6.0.0
[0/1] cd /home/daniel/projects/nrf5_sdk_for_mesh/build/examples/serial && /usr..._sdk_for_mesh/build/examples/serial/serial_nrf52832_xxAA_s132_6.0.0_merged.hex
Connected devices:
0: 682833172

Select one ('0'), several ('0, 1, 2') or all ('a') devices.
To quit, enter 'q': 0
# 682833172: Erasing device...
# 682833172: Programming /home/daniel/projects/nrf5_sdk_for_mesh/build/examples/serial/serial_nrf52832_xxAA_s132_6.0.0_merged.hex
# 682833172: Resetting...
(mesh) ...:~/projects/nrf5_sdk_for_mesh/build$ cd ../scripts/interactive_pyaci/
(mesh) ...:~/projects/nrf5_sdk_for_mesh/scripts/interactive_pyaci$ nrfjprog -i
682833172
(mesh) ...:~/projects/nrf5_sdk_for_mesh/scripts/interactive_pyaci$ nrfjprog -f NRF52 --reset
Applying system reset.
Run.
(mesh) ...:~/projects/nrf5_sdk_for_mesh/scripts/interactive_pyaci$ python interactive_pyaci.py -d /dev/ttyACM0 --no-logfile

    To control your device, use d[x], where x is the device index.
    Devices are indexed based on the order of the COM ports specified by the -d option.
    The first device, d[0], can also be accessed using device.

    Type d[x]. and hit tab to see the available methods.

Python 3.6.5 (default, Apr  1 2018, 05:46:30) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: d[0].send(cmd.Echo("hello world"))

In [2]: 2018-05-15 16:17:07,547 - INFO - ttyACM0: cmd Echo, timeout waiting for event


Thank you!

Parents
  • I've also been running into this issue since version 1.0 of the mesh SDK. I'm pretty sure this isn't a problem with my computer,  the OS or any software on it. My setup is pretty similar to TYRI's except for Arch Linux.

    The serial example seems to work once out of every ten tries. When it works, it continues to work until the board is turned off.

    I've tried the following and nothing seems to have an effect:

    • Resetting with nrfjprog -r or -p
    • Using the switch to turn the board off and on
    • Unplugging the board from the USB port
    • Reflashing the serial example
    • Doing --eraseall then reflashing
    • Rebooting my computer
    • Switching between my desktop to my laptop
    • Running in debugging mode in Embedded studio
    • Leaving the board unplugged without a battery for several minutes
    • Switching between different devkit boards

    Despite any of this, sending even a trivial Echo command to the board fails most of the time. 

    Sometimes when the example works I see the following error when starting interactive_pyaci.py: 

    2018-06-07 16:15:48,254 - ERROR - ttyACM0: Exception in pkt handler <bound method Interactive.__event_handler of <__main__.Interactive object at 0x7f4d97d5eef0>>
    2018-06-07 16:15:48,261 - ERROR - ttyACM0: traceback: Traceback (most recent call last):
      File "/home/patonw/code/nordic/nrf5_sdk_for_mesh/scripts/interactive_pyaci/aci/aci_uart.py", line 88, in process_packet
        fun(packet)
      File "interactive_pyaci.py", line 164, in __event_handler
        if self._event_filter_enabled and event._opcode in self._event_filter:
    AttributeError: 'Interactive' object has no attribute '_event_filter_enabled'
    

    I need to spend more time with the debugger but my hunch is that something is not getting initialized in the mesh SDK. When the serial example behaves normally, it will trigger a breakpoint in serial_bearer_rx_get with the following call stack (doing this from memory since I can't get the example to work again):

    • bearer_event.c: EVENT_IRQHandler
    • bearer_event.c: bearer_event_handler
    • bearer_event.c: call_callback
    • serial.c: serial_process
    • serial.c: serial_process_cmd
    • serial_bearer.c: serial_bearer_rx_get

    However, when the example fails to run none of these functions are invoked, aside from EVENT_IRQHandler which is getting called constantly, regardless. 

Reply
  • I've also been running into this issue since version 1.0 of the mesh SDK. I'm pretty sure this isn't a problem with my computer,  the OS or any software on it. My setup is pretty similar to TYRI's except for Arch Linux.

    The serial example seems to work once out of every ten tries. When it works, it continues to work until the board is turned off.

    I've tried the following and nothing seems to have an effect:

    • Resetting with nrfjprog -r or -p
    • Using the switch to turn the board off and on
    • Unplugging the board from the USB port
    • Reflashing the serial example
    • Doing --eraseall then reflashing
    • Rebooting my computer
    • Switching between my desktop to my laptop
    • Running in debugging mode in Embedded studio
    • Leaving the board unplugged without a battery for several minutes
    • Switching between different devkit boards

    Despite any of this, sending even a trivial Echo command to the board fails most of the time. 

    Sometimes when the example works I see the following error when starting interactive_pyaci.py: 

    2018-06-07 16:15:48,254 - ERROR - ttyACM0: Exception in pkt handler <bound method Interactive.__event_handler of <__main__.Interactive object at 0x7f4d97d5eef0>>
    2018-06-07 16:15:48,261 - ERROR - ttyACM0: traceback: Traceback (most recent call last):
      File "/home/patonw/code/nordic/nrf5_sdk_for_mesh/scripts/interactive_pyaci/aci/aci_uart.py", line 88, in process_packet
        fun(packet)
      File "interactive_pyaci.py", line 164, in __event_handler
        if self._event_filter_enabled and event._opcode in self._event_filter:
    AttributeError: 'Interactive' object has no attribute '_event_filter_enabled'
    

    I need to spend more time with the debugger but my hunch is that something is not getting initialized in the mesh SDK. When the serial example behaves normally, it will trigger a breakpoint in serial_bearer_rx_get with the following call stack (doing this from memory since I can't get the example to work again):

    • bearer_event.c: EVENT_IRQHandler
    • bearer_event.c: bearer_event_handler
    • bearer_event.c: call_callback
    • serial.c: serial_process
    • serial.c: serial_process_cmd
    • serial_bearer.c: serial_bearer_rx_get

    However, when the example fails to run none of these functions are invoked, aside from EVENT_IRQHandler which is getting called constantly, regardless. 

Children
No Data
Related