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

BLE sniffer on dongle, error in Python

Hi. So, pretty sure I've got the firmware installed right and plugging the dongle in creates a "/dev/tty.usbmodem1101" entry. Problem is I have a crash in Python:

extcap % ./nrf_sniffer_ble.sh --extcap-interfaces
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/davep/.config/wireshark/extcap/./nrf_sniffer_ble.py", line 619, in <module>
    extcap_interfaces()
  File "/Users/davep/.config/wireshark/extcap/./nrf_sniffer_ble.py", line 134, in extcap_interfaces
    for interface_port in get_interfaces():
  File "/Users/davep/.config/wireshark/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/davep/.config/wireshark/extcap/SnifferAPI/UART.py", line 59, in find_sniffer
    reader = Packet.PacketReader(portnum=port, baudrate=rate)
  File "/Users/davep/.config/wireshark/extcap/SnifferAPI/Packet.py", line 72, in __init__
    self.uart = UART.Uart(portnum, baudrate)
  File "/Users/davep/.config/wireshark/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')

This is an M1 Mac so I might be being my own worst enemy here. Any ideas?

Thanks,

Dave

Parents Reply Children
  • It could somehow be related to Rosetta and potentially an executable that is built for Intel won't run on ARM (maybe some incompatibility with pyserial), however based on the stack-trace you shared, it may look like it's originating in serialposix somewhere. It almost looks like there is no com port available or present in the system. Maybe check that not anything else is using the com port, and the com port is available.

Related