You are not logged in.

#1 2016-03-03 15:27:59

awelkie
Member
Registered: 2016-03-03
Posts: 1

HackRF won't connect on first attempt, but will on subsequent attempts

When I try to communicate with the HackRF connected to my computer, the communication fails. For example, if I run `hackrf_info`, I get the following error:

Found HackRF board 0:
hackrf_open() failed: HACKRF_ERROR_LIBUSB (-1000)

However, if I try to communicate with the HackRF within about 3 seconds of that first attempt, it will work just fine:

Found HackRF board 0:
USB descriptor string: 0000000000000000453c64c8255e978f
Board ID Number: 2 (HackRF One)
Firmware Version: 2015.07.2
Part ID Number: 0xa000cb3c 0x0079475c
Serial Number: 0x00000000 0x00000000 0x453c64c8 0x255e978f

If I wait more than about 3 seconds since the last attempt (successful or not), then the communication will fail again.

Every time I attempt a `hackrf_info` that fails, this shows up in the systemd journal:

Mar 03 10:20:04 aw-archbookpro kernel: usb 1-1.1.4: reset high-speed USB device number 18 using xhci_hcd
Mar 03 10:20:04 aw-archbookpro kernel: usb 1-1.1.4: USB disconnect, device number 18
Mar 03 10:20:04 aw-archbookpro kernel: usb 1-1.1.4: new high-speed USB device number 19 using xhci_hcd
Mar 03 10:20:05 aw-archbookpro mtp-probe[10716]: checking bus 1, device 19: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.1/1-1.1.4"
Mar 03 10:20:05 aw-archbookpro mtp-probe[10716]: bus: 1, device: 19 was not an MTP device

The USB device number always increments (the next time I attempt it will enumerate with device number 20, for example). If I query the `hackrf_info` within the 3 seconds and it succeeds, nothing will be printed in the systemd journal.

This is on a macbook pro 11,1. I see this when using a USB 3 hub and when using the laptop's USB connectors (I haven't tried using a USB 2 hub). Does anyone know what's going on?

Offline

#2 2016-03-27 13:19:58

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: HackRF won't connect on first attempt, but will on subsequent attempts

I havent been able to find a solution but I have the exact same issue with my HackRF on Arch Linux as well.

Offline

#3 2016-03-29 16:57:51

Zygote
Member
Registered: 2013-01-15
Posts: 77

Re: HackRF won't connect on first attempt, but will on subsequent attempts

I actually just figured out the problem. Im assuming you're using the hackrf with a laptop as well. Turns out that the hackrf doesnt support usb auto suspend so if you have any power saving services running (laptop-mode, tlp, etc) then that's what's causing the problem. You can blacklist the hackrf from power saving to resolve the issue. Config examples and further details available here: https://github.com/mossmann/hackrf/issues/243

Offline

Board footer

Powered by FluxBB