Open itemir opened 8 years ago
I've seen this a few times on Linux 4.8.8 today; I'm guessing it's a hardware problem related to my USB hub.
Still seeing this with macOS 10.12.3 (16D32). ble-sniffer-osx works, but not sniffer.py. Fails with same error as above.
I think I had the same problem on Linux, and I have finally fixed it. I'm still working on it, and will publish a fix on my fork soon: https://github.com/vshymanskyy/BLESniffer_Python
Ok, seems to be fixed on my fork: https://github.com/vshymanskyy/BLESniffer_Python
Thanks for the fix. Unfortunately I cannot test it as I sent the unit back.
I was running into the same issue on macOS today and came across this bug.
Tried @vshymanskyy 's latest fork and crash no longer happens. However, it appears it is not detecting any devices in the scan and sits in a Scanning for BLE devices (5s) ...
loop forever. I know there are devices advertising and my HW is functional since the same setup is receiving packets on the PC version+wireshark.
It also appears my log file is filling up with "SLIP skipped" exceptions, which appears to be a new addition.
@dsweetkulshantechnology "SLIP skipped" was added to diagnose Serial stream errors.
I cannot test on OSX currently. What is syour version of OSX and hardware? Thx.
Could you also check my for on a PC? it also supports live capturing with --pipe
flag
Also, my version should show FW version: 1111. if it shows version 0, it means it just can't get in sync with serial stream. You can try this:
@dsweetkulshantechnology please try my latest master branch - it works with my OSX
@vshymanskyy OSX Version 10.11.6 (El Capitan) on MBP, using the AdaFruit BlueFruit sniffer.
With latest version I can't seem to get anything except Firmware Version: 0 - tried replugging multiple times with varying delays.
Same result on Win7 PC (Firmware Version: 0).
On the PC with the Nordic SW (same HW dongle) I get the following (Version 12?!):
I am running Ubuntu 16.04, using the Adafruit Bluefruit LE sniffer.
I have the same issues, unable to connect to the board:
Capturing data to logs/capture.pcap Connecting to sniffer on /dev/ttyUSB0 Software Version: 1111 Firmware Version: 0 Sniffer board is not responding. Please re-plug the board.
@jmartin-usna , @dsweetkulshantechnology - I think it would be best if I can perform some live debugging session with one of you guys.
I am having the same exact issue. I've tried on all three platforms: Mac OS, Windows, and Linux.
Hi,
I get the same problem unfortunately.
On my Arch Linux box and Adafruit BLE Sniffer (the CP210x one), this error reported above: "Sniffer board is not responding. Please re-plug the board." happens only for @vshymanskyy fork, not in this repo. With this repo, sniffer produces the pcap file fine.
I solved this by editing line 246 in SnifferAPI/Packet.py
--- a/SnifferAPI/Packet.py
+++ b/SnifferAPI/Packet.py
@@ -243,7 +243,7 @@ class PacketReader(Notifications.Notifier):
try:
self.uart.ser.port = iPort
- self.uart.ser.open()
+ self.uart.ser.isOpen()
self.sendPingReq()
startTime = time.time()
continueLoop = True
Thanks @gnyman, that solved the issue on my mac.
The problem is now that it does not find any devices:
Capturing data to logs/capture.pcap
Connecting to sniffer on /dev/tty.SLAB_USBtoUART
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
Scanning for BLE devices (5s) ...
It finds a lot on the windows machine...
uninstall the macos driver and re-install v4 - silabs released a broken driver
you will need to uninstall the old driver using the script included ^ some people had to uninstall twice before re-installing
Uninstalled the driver, restarted my mac and installed the sw from the link above. Still the same issue...
This is clearly a problem with the Python code.
If I run the sniffer like this:
python sniffer.py /dev/blabla
the result is:
Capturing data to logs/capture.pcap
Connecting to sniffer on /dev/blabla
Scanning for BLE devices (5s) ...
Traceback (most recent call last):
File "sniffer.py", line 184, in <module>
devlist = scanForDevices()
File "sniffer.py", line 51, in scanForDevices
mySniffer.scan()
File "/Users/alexandrusonea/Documents/ROBOTS/Adafruit_BLESniffer_Python-master/SnifferAPI/Sniffer.py", line 62, in scan
self._startScanning()
File "/Users/alexandrusonea/Documents/ROBOTS/Adafruit_BLESniffer_Python-master/SnifferAPI/SnifferCollector.py", line 206, in _startScanning
self._packetReader.sendScan()
File "/Users/alexandrusonea/Documents/ROBOTS/Adafruit_BLESniffer_Python-master/SnifferAPI/Packet.py", line 186, in sendScan
self.sendPacket(REQ_SCAN_CONT, [], timeout)
File "/Users/alexandrusonea/Documents/ROBOTS/Adafruit_BLESniffer_Python-master/SnifferAPI/Packet.py", line 183, in sendPacket
self.uart.writeList(packetString, timeout)
File "/Users/alexandrusonea/Documents/ROBOTS/Adafruit_BLESniffer_Python-master/SnifferAPI/UART.py", line 73, in writeList
nBytes = self.ser.write(array)
File "/Users/alexandrusonea/anaconda/lib/python2.7/site-packages/serial/serialposix.py", line 531, in write
raise portNotOpenError
serial.serialutil.SerialException: Attempting to use a port that is not open
there is no message that the port does not exist and was not able to open.
Reinstalling the driver had no effect. I'm on High Sierra 10.13.1, i've updated pyserial to 3.4, and running python 2.7.13 under Anaconda.
Is anyone really looking at this issue? Practically I got a £30 blue blinking led powered by my USB port...
I'm experiencing the same issue on OSX and Ubuntu. The device worked some time ago when I've tested it on Windows which I no longer have it at hand. Is there a chance for a fix for this?
My execution stack with logging some information looks like this:
python sniffer.py /dev/tty.usbserial-DN00FV4O
Capturing data to logs/capture.pcap
Connecting to sniffer on /dev/tty.usbserial-DN00FV4O
UART open on port /dev/tty.usbserial-DN00FV4O
(<SnifferAPI.UART.Uart instance at 0x103c52248>, '\xab\x06\x00\x01\x00\x00\r\xbc')
(<SnifferAPI.UART.Uart instance at 0x103c52248>, '\xab\x06\x00\x01\x01\x00\r\xbc')
(<SnifferAPI.UART.Uart instance at 0x103c52248>, '\xab\x06\x00\x01\x02\x00\r\xbc')
(<SnifferAPI.UART.Uart instance at 0x103c52248>, '\xab\x06\x00\x01\x03\x00\r\xbc')
(<SnifferAPI.UART.Uart instance at 0x103c52248>, '\xab\x06\x00\x01\x04\x00\r\xbc')
(<SnifferAPI.UART.Uart instance at 0x103c52248>, '\xab\x06\x00\x01\x05\x00\r\xbc')
(<SnifferAPI.UART.Uart instance at 0x103c52248>, '\xab\x06\x00\x01\x06\x00\r\xbc')
(<SnifferAPI.UART.Uart instance at 0x103c52248>, '\xab\x06\x00\x01\x07\x00\r\xbc')
(<SnifferAPI.UART.Uart instance at 0x103c52248>, '\xab\x06\x00\x01\x08\x00\r\xbc')
Scanning for BLE devices (5s) ...
(<SnifferAPI.UART.Uart instance at 0x103c52248>, '\xab\x06\x00\x01\t\x00\x07\xbc')
Traceback (most recent call last):
File "sniffer.py", line 184, in <module>
devlist = scanForDevices()
File "sniffer.py", line 51, in scanForDevices
mySniffer.scan()
File "/Volumes/HD2/Users/pb/Documents/dev/hardware/ble/tools/Adafruit_BLESniffer_Python/SnifferAPI/Sniffer.py", line 62, in scan
self._startScanning()
File "/Volumes/HD2/Users/pb/Documents/dev/hardware/ble/tools/Adafruit_BLESniffer_Python/SnifferAPI/SnifferCollector.py", line 206, in _startScanning
self._packetReader.sendScan()
File "/Volumes/HD2/Users/pb/Documents/dev/hardware/ble/tools/Adafruit_BLESniffer_Python/SnifferAPI/Packet.py", line 187, in sendScan
self.sendPacket(REQ_SCAN_CONT, [], timeout)
File "/Volumes/HD2/Users/pb/Documents/dev/hardware/ble/tools/Adafruit_BLESniffer_Python/SnifferAPI/Packet.py", line 184, in sendPacket
self.uart.writeList(packetString, timeout)
File "/Volumes/HD2/Users/pb/Documents/dev/hardware/ble/tools/Adafruit_BLESniffer_Python/SnifferAPI/UART.py", line 74, in writeList
nBytes = self.ser.write(array)
File "/Library/Python/2.7/site-packages/serial/serialposix.py", line 517, in write
raise portNotOpenError
serial.serialutil.SerialException: Attempting to use a port that is not open
I've added a print(self.uart, packetString)
in line after line 183 in https://github.com/adafruit/Adafruit_BLESniffer_Python/blob/master/SnifferAPI/Packet.py#L182
Anyone have any luck on this? I am still getting the same error on OSX
I tried uninstalling the newer driver (twice, as suggested) and then reinstalling. Checking by hand I can see that only the older version of the Silabs kext exists on my system and still I get the same sort of issues that most people are seeing. Until there is a fix, my workaround is to use ble-sniffer-osx by Roland King which will capture into Wireshark 2.0.x (I had to remove my newer version). It's cludgy but it works.
I was getting USB issues (same SerialException error)... if I run this little bash script it resets the USB and things work again:
#!/bin/bash
if [[ $EUID != 0 ]] ; then
echo This must be run as root!
exit 1
fi
for xhci in /sys/bus/pci/drivers/?hci_hcd ; do
if ! cd $xhci ; then
echo Weird error. Failed to change directory to $xhci
exit 1
fi
echo Resetting devices from $xhci...
for i in ????:??:??.? ; do
echo -n "$i" > unbind
echo -n "$i" > bind
done
done
I was experiencing this same issue. Doing the following fixed it for me:
kextstat | grep silabs
to make sure that the 4.x driver was installed instead of 5.x.
Trying to use sniffer.py on macOS Sierra (10.12.1) is giving errors:
ble-sniffer-osx from Roland King works, so it is not an OS issue nor a hardware issue.
It also looks like there have been others who ran into this issue. See the following thread: https://forums.adafruit.com/viewtopic.php?f=22&t=82839&sid=643613138ca6829f5444dd61c1cabc7d&start=15 (Workaround mentioned there, to install 2.3 FTDI driver, does also not work).