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

setup nRF52DK sniffer on Wireshark has some error, Apple M1

I am following the step to install my nRF52DK, but when I check it with "python3 nrf_sniffer_ble.py --extcap-interfaces", it has some error:

extcap {version=3.1.0}{display=nRF Sniffer for Bluetooth LE}{help=https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE}
Traceback (most recent call last):
  File "/Users/ann/Downloads/nrf_sniffer_for_bluetooth_le_3.1.0_7cc811f /extcap/nrf_sniffer_ble.py", line 619, in <module>
    extcap_interfaces()
  File "/Users/ann/Downloads/nrf_sniffer_for_bluetooth_le_3.1.0_7cc811f /extcap/nrf_sniffer_ble.py", line 134, in extcap_interfaces
    for interface_port in get_interfaces():
  File "/Users/ann/Downloads/nrf_sniffer_for_bluetooth_le_3.1.0_7cc811f /extcap/nrf_sniffer_ble.py", line 125, in get_interfaces
    devices = UART.find_sniffer(write_data=False)  # Try non-intrusive search, set argument to True for intrusive search
  File "/Users/ann/Downloads/nrf_sniffer_for_bluetooth_le_3.1.0_7cc811f /extcap/SnifferAPI/UART.py", line 59, in find_sniffer
    reader = Packet.PacketReader(portnum=port, baudrate=rate)
  File "/Users/ann/Downloads/nrf_sniffer_for_bluetooth_le_3.1.0_7cc811f /extcap/SnifferAPI/Packet.py", line 72, in __init__
    self.uart = UART.Uart(portnum, baudrate)
  File "/Users/ann/Downloads/nrf_sniffer_for_bluetooth_le_3.1.0_7cc811f /extcap/SnifferAPI/UART.py", line 106, in __init__
    self.ser = serial.Serial(
  File "/opt/homebrew/lib/python3.9/site-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/opt/homebrew/lib/python3.9/site-packages/serial/serialposix.py", line 332, in open
    self._reconfigure_port(force_update=True)
  File "/opt/homebrew/lib/python3.9/site-packages/serial/serialposix.py", line 517, in _reconfigure_port
    termios.tcsetattr(
termios.error: (22, 'Invalid argument')

Could anyone help?

  • Hello, 

    Yes, we should be able to help you. Note that the Apple M1 is fairly new and that support may be limited as this time. I will need to discuss with our SW developers and get back to you next week. 

    Kind regards,
    Øyvind

  • Hi, 

    can you please try running the sniffer using SUDO? The issue might be caused by admin rights on the computer. Also, Python 3.9 has not been tested. Can you please try using e.g. Python 3.7 or 3.8?

    Thanks!

    Kind regards,
    Øyvind

  • hi,

    I used SUDO to run it.
    I tried to use Python3.8, but it seem some dependencies error in Apple M1.

    I can run it with Python3.9 on Windows. I think it is Apple M1's problem, right?

  • The SW team have run without issues on the an Apple M1. Will need to discuss further with them.

    Kind regards,
    Øyvind

  • hi,

    That's great news, please keep me posted with any progress.

    by the way, I also try it using Python2.7. It looks has same problem.

    extcap {version=2.0.0}{display=nRF Sniffer}{help=http://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF-Sniffer#Downloads}
    Traceback (most recent call last):
      File "nrf_sniffer.py", line 592, in <module>
        extcap_interfaces()
      File "nrf_sniffer.py", line 144, in extcap_interfaces
        for interface_port in get_interfaces():
      File "nrf_sniffer.py", line 135, in get_interfaces
        devices = UART.find_sniffer(write_data=False)  # Try non-intrusive search, set argument to True for intrusive search
      File "/Users/ann/Downloads/nrf_sniffer_for_bluetooth_le_2.0.0_c87e17d/extcap/SnifferAPI/UART.py", line 59, in find_sniffer
        reader = Packet.PacketReader(portnum=port, baudrate=rate)
      File "/Users/ann/Downloads/nrf_sniffer_for_bluetooth_le_2.0.0_c87e17d/extcap/SnifferAPI/Packet.py", line 114, in __init__
        self.uart = UART.Uart(portnum, baudrate)
      File "/Users/ann/Downloads/nrf_sniffer_for_bluetooth_le_2.0.0_c87e17d/extcap/SnifferAPI/UART.py", line 108, in __init__
        rtscts=True
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/serial/serialutil.py", line 244, in __init__
        self.open()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/serial/serialposix.py", line 332, in open
        self._reconfigure_port(force_update=True)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/serial/serialposix.py", line 520, in _reconfigure_port
        [iflag, oflag, cflag, lflag, ispeed, ospeed, cc])
    termios.error: (22, 'Invalid argument')

    Did I miss something?

Related