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

nrf52840 failure with connect desktop and wireshark

Hi all, I am trying to use the nrf52840 dongle with wireshark, I was having permission errors trying to open the device in the program section of the nrf desktop suite running on Ubuntu 20 and followed the suggestions found at https://devzone.nordicsemi.com/f/nordic-q-a/52546/nrf-connect-linux/211625#211625 , adding the user to the dialout group did not do anything, the method using https://github.com/NordicSemiconductor/nrf-udev and https://github.com/NordicSemiconductor/nrf-udev/releases made the dongle visible and readable.  In the program section of the desktop suite I selected to add the hex nrf802154_sniffer_dongle.hex and ran the 'write' option.  During or after it ran the write option i recieved the following log

2020-10-17T15:14:09.904Z INFO Parsing HEX file:  /home/david/nRF-Sniffer-for-802.15.4/nrf802154_sniffer/nrf802154_sniffer_dongle.hex
2020-10-17T15:14:10.036Z INFO File was last modified at  10/16/2020, 11:51:25 PM
2020-10-17T15:14:15.204Z INFO Using USB SDFU protocol to communicate with target
2020-10-17T15:14:15.271Z INFO Protocol Version:  1 found
2020-10-17T15:14:15.306Z INFO Hardware: 52840 found
2020-10-17T15:14:15.492Z INFO Firmware: Bootloader found
2020-10-17T15:14:15.494Z INFO Firmware: Application found
2020-10-17T15:14:51.577Z INFO Does not need to be reloaded:  /home/david/nRF-Sniffer-for-802.15.4/nrf802154_sniffer/nrf802154_sniffer_dongle.hex
2020-10-17T15:14:51.592Z INFO Hash is generated by SHA256
2020-10-17T15:14:51.605Z INFO Performing DFU. This may take a few seconds
2020-10-17T15:14:51.659Z INFO DFU procedure starts. This may take a few seconds.
2020-10-17T15:14:56.693Z INFO DFU for Application completed successfully!
2020-10-17T15:14:56.694Z INFO 0 dfu package(s) left.
2020-10-17T15:14:56.694Z INFO Waiting for device
2020-10-17T15:15:01.697Z ERROR Reopen device failed: Timeout while waiting for device  C621B478D146 to be attached and enumerated
2020-10-17T15:15:01.698Z INFO Nordic DFU Trigger Interface was not found.Please physically reset device.
2020-10-17T15:15:01.718Z ERROR Device not found due to failure during DFU
2020-10-17T15:15:25.178Z INFO Target device closed.

After this I had to press the reset button on the dongle for it to be recognized, but it did appear to show the hex in the dongles memory.  However, I cannot find any protocol in wireshark despite having added the appropriate python script to the wireshark extcap directory (I have wireshark working successfully with the nrf BLE protocol using  a dongle from Adafruit, so the pyserial and all that is in order) and wireshark does not see the dongle.

I'm very new to working with the wireless protocols and wireshark and the associated hardware so I'm not really sure where the real issue lies in this, if I've overlooked any imortant information please let me know.

Thanks,

David

Parents
  • Thanks for the response Vidar,  yes I have done both of those, changing the user permissions didn't make any difference that I could tell.  From setting up the Bluetooth LE dongle from Adafruit I did find out that running wireshark as sudo can make a difference but, it does not do anything to the protocols to choose from.

    The python file is in the excap folder, and has its permission set to allow executing as a program, I hit the 'refresh interfaces' button in the capture menu, but I'm still not getting the selection for 'nRF Sniffer for 802.15.4'.  I really don't know what I missed, I did the j-link and command line tools.  I'm just stuck right now.

    Thanks for any help,

    David

Reply
  • Thanks for the response Vidar,  yes I have done both of those, changing the user permissions didn't make any difference that I could tell.  From setting up the Bluetooth LE dongle from Adafruit I did find out that running wireshark as sudo can make a difference but, it does not do anything to the protocols to choose from.

    The python file is in the excap folder, and has its permission set to allow executing as a program, I hit the 'refresh interfaces' button in the capture menu, but I'm still not getting the selection for 'nRF Sniffer for 802.15.4'.  I really don't know what I missed, I did the j-link and command line tools.  I'm just stuck right now.

    Thanks for any help,

    David

Children
  • Hi David,

    Please try to program nrf802154_sniffer_dongle.hex from the latest release tagged with v0.7.2. It seems like there may be a problem with the one on Master. The green led should start to blink once you have programmed it. You should also see a new ttyACMx device popping up when the dongle is plugged in (ls /dev/ttyACM*)

  • Hi Vidar, I did that, and it does show up as /dev/ttyACM0 but there is still no protocol listed for it in wireshark, with only a mouse dongle and the nrf dongle plugged in when I open wireshark there are 3 that show activity, but the same 3 show the same activity without the nrf dongle plugged in.  The 2 that are closest in terms of name are 'nflog' (no activity) and 'nfqueue' (also no activity), although I don't think those are actually related since it is nf and not nrf.  From previously installing the Bluetooth LE protocol things it's not doing anything when I move the python scripts to the extcap folder and refresh the devices.  I tried moving the entire nRF-Sniffer-for-802.15.4 folder into the extcap folder then running 'sudo python3 setup.py install' and it seems sucessful but made no differences, I also tried only moving the nrf802154_sniffer.py file, and moving the nrf802154_sniffer.py and __init__.py files to the folder.  None of these got any new activity on the menu of protocols on the open page of wireshark.

  • Hi David,

    Can you try opening wireshark from the terminal and see if any errors are logged. I tested this now on my setup which is also running Ubuntu 20 (LTS)

  • Hi Vidar,

    When I  run it from terminal I get the following

    sudo wireshark
    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
    from: too many arguments
    /usr/bin/env: ‘python3\r’: No such file or directory
    /usr/bin/env: ‘python3\r’: No such file or directory
    from: too many arguments

    running it without sudo gets many more, but they seem to all be permissions issues as expected.  I looked through the GUI System Log Viewer but didn't see anything that seems related at all.  If there's a specific log to check let me now and I can have a look.

    I did have the idea that since Ubuntu 20 seems like it does not parse python as either python2 or python3, I checked the header of sudo '/usr/lib/x86_64-linux-gnu/wireshark/extcap/nrf802154_sniffer.py' and it was originally just python.  I changed it to python3 and it didn't seem to change anything, when I tried changing it to python2 I got this

    sudo wireshark
    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
    Traceback (most recent call last):
    File "/usr/lib/x86_64-linux-gnu/wireshark/extcap/nrf802154_sniffer.py", line 62, in <module>
    from serial import Serial, serialutil
    ImportError: No module named serial
    from: too many arguments
    /usr/bin/env: ‘python3\r’: No such file or directory
    from: too many arguments
    /usr/bin/env: ‘python3\r’: No such file or directory
    Traceback (most recent call last):
    File "/usr/lib/x86_64-linux-gnu/wireshark/extcap/nrf802154_sniffer.py", line 62, in <module>
    from serial import Serial, serialutil
    ImportError: No module named serial

    so it does seem like it is accessing the nrf802154_sniffer.py file. 

  • Hi David,

    david613 said:
    /usr/bin/env: ‘python3\r’: No such file or directory

     Looks like this is the problem. Can you try editing the py script again and remove the '\r' at the end. I forgot to mention earlier that I also had to change from 'python' to 'python3' in the script.

    And it looks like it's failing with python2 because it does not have the 'pyserial' dependency installed.

Related