Mesh Serial Example Problem (timeout waiting for event)

Hello

I have a problem with Interactive PYACI Script Example where i get ((((2022-12-19 21:50:24,339 - INFO - ttyACM0: cmd Echo, timeout waiting for event)))) this kind of error . I do saw many forum answers seems like they are old and no links in those forum replies works. Need solution for the latest updated versions answer.

I am using nRF52840_DK where i use Serial_Example in it and to communicate with that i use Interactive_PYACI_Script in RaspberryPI with no desktop version 32-bit OS Lite Debian Bulleye.

I use PuTTY as SSH Interface to communicate with RaspberryPi. No idea what was the problem and where is the problem to get an output like this ((((2020-03-24 12:45:18,063 - INFO - ttyACM0: {event: DeviceEchoRsp, data: {'data': 'hello world'}})))) as mentioned in the document.

I use python version (Python 3.9.2)
Eagerly waiting for the solution:)

Regards

Parents
  • Hello,

    Have you tried to scope the UART lines between the nRF and the DK? Are you using GPIOs (on the Raspberry pi) for UART, or are you using the USB cable? If so, where did you connect the USB cable on the DK? 

    And are you sure that you are using the correct COM port on the raspberry pi (i.e. ttyACM0)? Did you check whether this is actually where the DK connected to?

    I have never done this on a raspberry pi before. Although I can't think of any reason why it wouldn't work, did you find somewhere that it states that it does work? Did you try to do the same on a computer?

    And finally, did you try to debug the serial_example on the DK? Does it receive any UART interrupts at all? And do you see anything on the Raspberry pi side?

    Best regards,
    Edvin

  • Have you tried to scope the UART lines between the nRF and the DK? Are you using GPIOs (on the Raspberry pi) for UART, or are you using the USB cable? If so, where did you connect the USB cable on the DK? 

    I am using USB Cable and I connected to the normal USB port not the one with nRF USB at the bottom side also after your replied i checked with the nRF USB too and it doesn't work. Also i have no idea scoping with UART lines between NRF and DK thing so i did not use that method.

    And are you sure that you are using the correct COM port on the raspberry pi (i.e. ttyACM0)? Did you check whether this is actually where the DK connected to?

    Yes I am using the correct one for your idea here is the proof below attached, also i used ttyACM1 too because i see 2 ports when i see for connected ports.

    #Checking Ports....
    pi@pi:~/CMock/nrf5sdkformeshv500src/scripts/interactive_pyaci $ dmesg | tail
    [  800.094960] scsi host0: usb-storage 1-1.1.2:1.5
    [  801.112597] scsi 0:0:0:0: Direct-Access     SEGGER   MSD Volume       1.00 PQ: 0 ANSI: 4
    [  801.113651] sd 0:0:0:0: Attached scsi generic sg0 type 0
    [  801.117187] sd 0:0:0:0: [sda] 21829 512-byte logical blocks: (11.2 MB/10.7 MiB)
    [  801.119543] sd 0:0:0:0: [sda] Write Protect is off
    [  801.119567] sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
    [  801.122935] sd 0:0:0:0: [sda] No Caching mode page found
    [  801.122965] sd 0:0:0:0: [sda] Assuming drive cache: write through
    [  801.151813]  sda:
    [  801.161239] sd 0:0:0:0: [sda] Attached SCSI removable disk
    
    and  
    
    pi@pi:~/CMock/nrf5sdkformeshv500src/scripts/interactive_pyaci $ sudo dmesg | grep -C 3 SEGGER
    [  800.085004] usb 1-1.1.2: New USB device found, idVendor=1366, idProduct=1051, bcdDevice= 1.00
    [  800.085039] usb 1-1.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  800.085059] usb 1-1.1.2: Product: J-Link
    [  800.085076] usb 1-1.1.2: Manufacturer: SEGGER
    [  800.085093] usb 1-1.1.2: SerialNumber: 001050243137
    [  800.087877] cdc_acm 1-1.1.2:1.0: ttyACM0: USB ACM device
    [  800.090817] cdc_acm 1-1.1.2:1.2: ttyACM1: USB ACM device
    [  800.094138] usb-storage 1-1.1.2:1.5: USB Mass Storage device detected
    [  800.094960] scsi host0: usb-storage 1-1.1.2:1.5
    [  801.112597] scsi 0:0:0:0: Direct-Access     SEGGER   MSD Volume       1.00 PQ: 0 ANSI: 4
    [  801.113651] sd 0:0:0:0: Attached scsi generic sg0 type 0
    [  801.117187] sd 0:0:0:0: [sda] 21829 512-byte logical blocks: (11.2 MB/10.7 MiB)
    [  801.119543] sd 0:0:0:0: [sda] Write Protect is off
    
    ------------------------------------------------------------------------------------
    
    #Checking whether it works with the help of echo commands with 2 different ports
    
    pi@pi:~/CMock/nrf5sdkformeshv500src/scripts/interactive_pyaci $ sudo python3 interactive_pyaci.py -d /dev/ttyACM0
    
        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.9.2 (default, Mar 12 2021, 04:06:34)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 8.7.0 -- An enhanced Interactive Python. Type '?' for help.
    
    In [1]: import time
    
    In [2]: for i in range(0, 10): send(cmd.Echo("Hello: " + str(i))); time.sleep(1)
    2022-12-21 09:16:00,591 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    2022-12-21 09:16:02,594 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    2022-12-21 09:16:04,596 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    2022-12-21 09:16:06,602 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    
    2022-12-21 09:16:08,614 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    In [3]: y2022-12-21 09:16:10,638 - INFO - ttyACM0: cmd Echo, timeout waiting for event
     2022-12-21 09:16:12,641 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    In [3]:
    Do you really want to exit ([y]/n)? 2022-12-21 09:16:14,644 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    y
    
    2022-12-21 09:16:16,645 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    
    and 
    
    pi@pi:~/CMock/nrf5sdkformeshv500src/scripts/interactive_pyaci $ sudo python3 interactive_pyaci.py -d /dev/ttyACM1
    
        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.9.2 (default, Mar 12 2021, 04:06:34)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 8.7.0 -- An enhanced Interactive Python. Type '?' for help.
    
    In [1]: import time
    
    In [2]: for i in range(0, 10): send(cmd.Echo("Hello: " + str(i))); time.sleep(1)
    2022-12-21 09:17:02,669 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    2022-12-21 09:17:04,671 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    2022-12-21 09:17:06,674 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    2022-12-21 09:17:08,682 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    
    2022-12-21 09:17:10,693 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    In [3]: 2022-12-21 09:17:12,717 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    In [3]:
    Do you really want to exit ([y]/n)? y2022-12-21 09:17:14,721 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    
    
    2022-12-21 09:17:16,724 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    

    I have never done this on a raspberry pi before. Although I can't think of any reason why it wouldn't work, did you find somewhere that it states that it does work? Did you try to do the same on a computer?

    In the documentation they mentioned setup method for linux too right and also its python scripting so i am using in raspberry pi. I don't think so i saw anywhere mentioning Raspberry-Pi and in the Forum replies and questions of like 4-5 years ago, I think they mentioned Raspberry pi but i am not sure.

    And finally, did you try to debug the serial_example on the DK? Does it receive any UART interrupts at all? And do you see anything on the Raspberry pi side?

    Yes, i debug the serial_example on DK using segger embedded studio on windows and flashed it then connected the DK kit(Also with softdevice with number.140 which is same as my hexfile number , since i dont have any idea how to flash hex file and soft device using segger, I used programmer in nRF connect for desktop software and uploaded files FYI: I used the hex file which i got from segger studio where i did debug thing )  to Raspberry pi via USB cable. I don't know what is UART interrupts because i did not use anything related to UART.

    Best Regards

Reply
  • Have you tried to scope the UART lines between the nRF and the DK? Are you using GPIOs (on the Raspberry pi) for UART, or are you using the USB cable? If so, where did you connect the USB cable on the DK? 

    I am using USB Cable and I connected to the normal USB port not the one with nRF USB at the bottom side also after your replied i checked with the nRF USB too and it doesn't work. Also i have no idea scoping with UART lines between NRF and DK thing so i did not use that method.

    And are you sure that you are using the correct COM port on the raspberry pi (i.e. ttyACM0)? Did you check whether this is actually where the DK connected to?

    Yes I am using the correct one for your idea here is the proof below attached, also i used ttyACM1 too because i see 2 ports when i see for connected ports.

    #Checking Ports....
    pi@pi:~/CMock/nrf5sdkformeshv500src/scripts/interactive_pyaci $ dmesg | tail
    [  800.094960] scsi host0: usb-storage 1-1.1.2:1.5
    [  801.112597] scsi 0:0:0:0: Direct-Access     SEGGER   MSD Volume       1.00 PQ: 0 ANSI: 4
    [  801.113651] sd 0:0:0:0: Attached scsi generic sg0 type 0
    [  801.117187] sd 0:0:0:0: [sda] 21829 512-byte logical blocks: (11.2 MB/10.7 MiB)
    [  801.119543] sd 0:0:0:0: [sda] Write Protect is off
    [  801.119567] sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
    [  801.122935] sd 0:0:0:0: [sda] No Caching mode page found
    [  801.122965] sd 0:0:0:0: [sda] Assuming drive cache: write through
    [  801.151813]  sda:
    [  801.161239] sd 0:0:0:0: [sda] Attached SCSI removable disk
    
    and  
    
    pi@pi:~/CMock/nrf5sdkformeshv500src/scripts/interactive_pyaci $ sudo dmesg | grep -C 3 SEGGER
    [  800.085004] usb 1-1.1.2: New USB device found, idVendor=1366, idProduct=1051, bcdDevice= 1.00
    [  800.085039] usb 1-1.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  800.085059] usb 1-1.1.2: Product: J-Link
    [  800.085076] usb 1-1.1.2: Manufacturer: SEGGER
    [  800.085093] usb 1-1.1.2: SerialNumber: 001050243137
    [  800.087877] cdc_acm 1-1.1.2:1.0: ttyACM0: USB ACM device
    [  800.090817] cdc_acm 1-1.1.2:1.2: ttyACM1: USB ACM device
    [  800.094138] usb-storage 1-1.1.2:1.5: USB Mass Storage device detected
    [  800.094960] scsi host0: usb-storage 1-1.1.2:1.5
    [  801.112597] scsi 0:0:0:0: Direct-Access     SEGGER   MSD Volume       1.00 PQ: 0 ANSI: 4
    [  801.113651] sd 0:0:0:0: Attached scsi generic sg0 type 0
    [  801.117187] sd 0:0:0:0: [sda] 21829 512-byte logical blocks: (11.2 MB/10.7 MiB)
    [  801.119543] sd 0:0:0:0: [sda] Write Protect is off
    
    ------------------------------------------------------------------------------------
    
    #Checking whether it works with the help of echo commands with 2 different ports
    
    pi@pi:~/CMock/nrf5sdkformeshv500src/scripts/interactive_pyaci $ sudo python3 interactive_pyaci.py -d /dev/ttyACM0
    
        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.9.2 (default, Mar 12 2021, 04:06:34)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 8.7.0 -- An enhanced Interactive Python. Type '?' for help.
    
    In [1]: import time
    
    In [2]: for i in range(0, 10): send(cmd.Echo("Hello: " + str(i))); time.sleep(1)
    2022-12-21 09:16:00,591 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    2022-12-21 09:16:02,594 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    2022-12-21 09:16:04,596 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    2022-12-21 09:16:06,602 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    
    2022-12-21 09:16:08,614 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    In [3]: y2022-12-21 09:16:10,638 - INFO - ttyACM0: cmd Echo, timeout waiting for event
     2022-12-21 09:16:12,641 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    In [3]:
    Do you really want to exit ([y]/n)? 2022-12-21 09:16:14,644 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    y
    
    2022-12-21 09:16:16,645 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    
    and 
    
    pi@pi:~/CMock/nrf5sdkformeshv500src/scripts/interactive_pyaci $ sudo python3 interactive_pyaci.py -d /dev/ttyACM1
    
        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.9.2 (default, Mar 12 2021, 04:06:34)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 8.7.0 -- An enhanced Interactive Python. Type '?' for help.
    
    In [1]: import time
    
    In [2]: for i in range(0, 10): send(cmd.Echo("Hello: " + str(i))); time.sleep(1)
    2022-12-21 09:17:02,669 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    2022-12-21 09:17:04,671 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    2022-12-21 09:17:06,674 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    2022-12-21 09:17:08,682 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    
    2022-12-21 09:17:10,693 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    In [3]: 2022-12-21 09:17:12,717 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    In [3]:
    Do you really want to exit ([y]/n)? y2022-12-21 09:17:14,721 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    
    
    2022-12-21 09:17:16,724 - INFO - ttyACM1: cmd Echo, timeout waiting for event
    

    I have never done this on a raspberry pi before. Although I can't think of any reason why it wouldn't work, did you find somewhere that it states that it does work? Did you try to do the same on a computer?

    In the documentation they mentioned setup method for linux too right and also its python scripting so i am using in raspberry pi. I don't think so i saw anywhere mentioning Raspberry-Pi and in the Forum replies and questions of like 4-5 years ago, I think they mentioned Raspberry pi but i am not sure.

    And finally, did you try to debug the serial_example on the DK? Does it receive any UART interrupts at all? And do you see anything on the Raspberry pi side?

    Yes, i debug the serial_example on DK using segger embedded studio on windows and flashed it then connected the DK kit(Also with softdevice with number.140 which is same as my hexfile number , since i dont have any idea how to flash hex file and soft device using segger, I used programmer in nRF connect for desktop software and uploaded files FYI: I used the hex file which i got from segger studio where i did debug thing )  to Raspberry pi via USB cable. I don't know what is UART interrupts because i did not use anything related to UART.

    Best Regards

Children
  • Hello,

    Try plugging the board into a computer and open a UART terminal at baud rate 115200. Do you see any data? If not, try to set HWFC to false in pca10056.h in the serial example from the mesh sdk, or just set it to directly on line 87 in serial_uart.c (inside serial_uart_init()):

    NRF_UART0->CONFIG  = (UART_CONFIG_HWFC_Disabled) << UART_CONFIG_HWFC_Pos;

    Do you see any data on the UART line then?

    And by the way, this example is using UART, not USB, so you need to use the USB port on the short end of the DK. Not the one marked nRF USB.

    You can also monitor the UART pins on the nRF by tapping into pin 6 and 8 (the back of  the DK indicates which is which on the UART. P0.06 is the nRF's TX and P0.08 is the nRF's RX. If you are using HWFC, then you need to use pings P0.05 and P0.07 as well. 

  • Hello

    Thank You for the support, Problem is solved.

    I was downloaded nrf5_mesh package from nordic page to the windows and then trasnferred that folder to Raspberry Pi. But the correct package is we need to directly download from github(nRF5-SDK-for-Mesh-master) and followed the steps from PyInteractive from Infocenter. Then it worked:)

    Regards

Related