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

Mesh Serial Example Problem (timeout waiting for event)

Hello I have problem with Mesh Serial Example and Interactive_pyaci, it works just in Debug-Mode. I use nRF52840, nRF5_SDK_15.0.0_a53641a, nrf5_SDK_for_Mesh_v2.0.1, Python3.5.2 64bit on linux mint 18 64bit. JLink_Linux_V633f_x86_64.

In aci_uart.py I set :  def __init__(self, port, baudrate=115200, device_name=None, rtscts=False):

In Debug-mode it works:

Activating auto-logging. Current session state plus future input saved.
Filename       : log/18-178-8-46_interactive_session.log
Mode           : backup
Output logging : False
Raw input log  : False
Timestamping   : False
State          : active
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: send(cmd.Echo("test"))

In [2]: 2018-06-27 08:46:48,476 - INFO - ttyACM0: {event: DeviceEchoRsp, data: {'data': bytearray(b'test')}}

But if I plug-out and  plug-in the device again, I get :

In [2]: 2018-06-27 08:49:12,153 - INFO - ttyACM0: cmd Echo, timeout waiting for event

in examples/serial/include/sdk_config.h  there are a lot of definitions with UART what exactly should i set to 1, if this is the problem ?

I'm new in this topic and my aim is to receive all the packets in the mesh and to send them to the host pc.

Are there any mesh monitors for observ the mesh traffic ?

Parents
  • I am not sure I fully understand. Are you using the sending mesh packets code from our Infocenter?  When you run the mesh serial example in debug mode, does it work to plug out & plug in the device & then you do not receive the timeout waiting for event?

    Does this timeout error only occur when you are using the Release version in SES?

    You could take a look at the nrf sniffer v2 to observe the mesh traffic. Another user on devzone points out in this case that:

    "The mesh is completely encrypted so you are likely to see messages, their types being transmitted and their RSSI but not much more. You may want to use the python API for the nRF Sniffer to get the messages and decrypt them with the netkey/appkey but that is additional work that is needed."

     

  • yes I'm using the sending mesh packets code from your Infocenter  (interactive_pyaci).

    I also conect the J-Link and erase all before Flashing new Build-Version.

    My previous description was not correct.  I get this error independent of the Build-Mode (Release/Debug) .

    It works only after Flashing. If I plug out & plug in the device I get this error.

  • 1) My guess is you may have a limitation based on the Bluetooth Mesh specifications itself. Let me double check this & get back to you.

    2) If you mean another way to use the serial example instead of via the Interactive PyACI on the host pc, then no, unfortunately not. You could try to modify the Interactive PyACI python script, as long as you follow the copyright notice on top of the file.

    3) From the documentation provided, it seems you do not have to implement ECDH offloading on the host pc. This link says that you should enable ECDH offloading if you are running multiple provisioners in parallel. The code to enable ECDH offloading is given in the link. I am unsure how the serial example tells the computer to do ECDH operations. I could ask internally about this if you want? Short answer: no, you don't have to do, but can be useful if you are running multiple concurrent provisioners.

  • ok I'm agin back to the interactive PyACI script because all the Datastructure  is already implemented there. But as I said bevore it still does not work proper.

    I found out that I can always read data from the device: I implemented a button which sends a number via serial port. It works after plugout & plugin but if i try to send a comand to the device i get a time out error. I dont understand why.
    And why i can send messages tho the device just after i flashed it but not after re-pluging.

    there is some output: first I try to send a command to the device but it does not work. After that i press button #1 on the board four times and send the number 1 to the Host-PC and it works.

    In [1]: send(cmd.Echo("test"))

    write data
    In [2]: 2018-07-09 10:29:23,823 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    2018-07-09 10:29:33,888 - INFO - ttyACM1: {event: Application, data: {'data': bytearray(b'1')}}
    2018-07-09 10:29:34,456 - INFO - ttyACM1: {event: Application, data: {'data': bytearray(b'1')}}
    2018-07-09 10:29:34,994 - INFO - ttyACM1: {event: Application, data: {'data': bytearray(b'1')}}
    2018-07-09 10:29:35,425 - INFO - ttyACM1: {event: Application, data: {'data': bytearray(b'1')}}

    Serial events are sent asynchronously, what about commands, how are they sent ?
    maybe this is the reason for the problem, because the synchronous stuff does not work properly ?

    concerning theECDH, ask please If you have the time , would be interessting.

  • Sorry for the delayed response. Like I mentioned previously, you will unfortunately need to close the current interactive pyaci terminal & start a new session to get the loopback test to work again.

    Interesting to see that once you press button 1 four times & send the number 1 to the host pc it works.

    Everything over Interactive PyACI gets sent via UART, which stands for Universal Asynchronous Receiver Transmitter. Therefore, all commands are sent asynchronously.

  • the problem ist the OS (Linux), it works fine in Windows

  • Thanks smart life, your comments helped me. I killed my time in linux but your comments took me in windows. It works fine in windows

Reply Children
No Data
Related