USB Device Constantly Disconnecting!?

I get this message to when connecting to the dock, but ONLY if I do this with the lid open, not in clamshell mode.

I've tried looking at the logs of BTT (which unfortunately does not say WHICH device connects/disconnects) but I have 26 connect events which are absolutely correct to the number of devices connecting and that's just normal when hooking up to a tb4 dock. What puzzles me is the fact the notification says "constantly disconnects" but the thing happening is a lot of devices CONNECTING, not disconnecting.

I also have this issue, but I'm not even connected to a dock and I have no peripherals. This notification pops up occasionally just using my laptop with nothing plugged in. It seems to be pretty intermittent and I largely only get it when I've left my computer alone for hours, I'll come back sometimes to see the notification. Only BTT gives this notification and it's pretty confusing.

I'm using BTT 3.779 on MacOS Mojave on a MBP 9,1 with no other aberrant behavior that I've noticed.

could be some internal USB device with a breaking contact. Definitely not normal for this to happen if nothing is connected :-/
But as long as you don't see any negative effects probably ok to ignore.

(defaults write com.hegenberg.BetterTouchTool BTTDontShowConnectWarning YES)

It's good that there's an ignore feature, but something is definitely up with this in terms of not actually indicating a problem for some users.

So far there has always been a problem (as far as I know). Usually it's if devices don't get enough power or have a broken cable. I think the only situation where this warning can safely be ingored is the "dock" disconnection usecase where it is expected that many devices disconnect all at once.

In your and @ColdBrewCoffee's case I'd be extra careful because you are probably still under warranty. A internal device disconnecting is usually not something that should happen.

I'm definitely not under warranty as it's a MBP 9,1 / mid-2012 15". I actually have seen this issue cropping up for 3 years, which I think is when I started using BTT on it, it's just so intermittent and infrequent I hadn't put much effort into seeking a root cause. I have never noticed a performance issue with the computer or the USB port. Hopefully it doesn't turn into a bigger problem!

I've tried searching the logs / console but I'm not very knowledgeable about that and haven't been able to pin down what exactly what could be causing the disconnect.

Are the USB ports the only USB connections in this device, or are there be other internal USB devices that could be causing the disconnection message?

It could also be some internal devices. However if you haven't noticed issues, it's probably not happening often enough to cause any issues - in that case just ignore BTT's message. (Or disable it via the command I posted)

1 Like

I've tried to really investigate this to understand it, but from my analysis it seems to trigger simply because a lot of devices connect when hooking up the dock. Check these logs out. The first part is from Hammerspoon where I've scripted a USB connection monitor that logs when an USB device connects or disconnects. The second part is the BTT log. As you can see, the USB connects in Hammerspoon correlates perfectly to the connect count in BTT. Right after this, BTT warned about a USB device reconnecting often, but there is no USB device disconnecting at all. Other times there's a single USB device that connects, then disconnects and this seems to trigger the warning.

I've tried fiddling back and forth with understanding exactly what triggers the warning, but I can't find it. It only happens very occasionally and ONLY on Dock connection or disconnection.

2023-03-13 12:57:10: 12:57:10       init: USB Monitor: added Fresco Logic, Inc. USB2.0 Hub
2023-03-13 12:57:10: -- Loading extension: notify
2023-03-13 12:57:11: 12:57:11       init: USB Monitor: added  USB2.0 Hub
2023-03-13 12:57:11:                init: USB Monitor: added Satechi Satechi Hub
2023-03-13 12:57:11:                init: USB Monitor: added Intel Corporation. USB3.0 Hub
2023-03-13 12:57:11:                init: USB Monitor: added  USB2.0 Hub
2023-03-13 12:57:11:                init: USB Monitor: added Satechi Thunderbolt 4 Dock
2023-03-13 12:57:12: -- Loading extension: window
2023-03-13 12:57:12: 12:57:12                 Screen setup or dock change detected
2023-03-13 12:57:12:                          Checking if docked, primary screen is 'BenQ LCD' and dockedMode was false
2023-03-13 12:57:12:                          Switched to docked mode
2023-03-13 12:57:12:                          Starting dockTimer ...
2023-03-13 12:57:12:                          Skipped checking for change in screen list (only when docked with no change)
2023-03-13 12:57:12:                          Screen setup or dock change detected
2023-03-13 12:57:12:                          Checking if docked, primary screen is 'BenQ LCD' and dockedMode was true
2023-03-13 12:57:12:                          No change in dock mode
2023-03-13 12:57:12:                          No change in list of screens
2023-03-13 12:57:12:                          Screen setup or dock change detected
2023-03-13 12:57:12:                          Checking if docked, primary screen is 'BenQ LCD' and dockedMode was true
2023-03-13 12:57:12:                          No change in dock mode
2023-03-13 12:57:12:                          No change in list of screens
2023-03-13 12:57:12:                init: USB Monitor: added  USB2.0 Hub
2023-03-13 12:57:13: 12:57:13       init: USB Monitor: added Satechi Satechi Hub
2023-03-13 12:57:13:                init: USB Monitor: added KORG INC. nanoKEY2
2023-03-13 12:57:13:                init: USB Monitor: added Generic USB Audio
2023-03-13 12:57:13:                init: USB Monitor: added Realtek USB 10/100/1000 LAN
2023-03-13 12:57:13:                          Docktimer fired
2023-03-13 12:57:13:                          Docktimer: Bluetooth is off, turning it on
2023-03-13 12:57:13: -- Loading extension: task
2023-03-13 12:57:13:                          Docktimer: Run dock switches script (replacing dock.app)
2023-03-13 12:57:13:                          Running dock switches applescript (geeklet positions + toggle stagemanager + keylight state)
2023-03-13 12:57:13: -- Loading extension: osascript
2023-03-13 12:57:13:                init: USB Monitor: added GenesysLogic USB3.1 Hub
2023-03-13 12:57:14: 12:57:14       init: USB Monitor: added GenesysLogic USB2.1 Hub
2023-03-13 12:57:14:                          New default output device, but it was not headphones so no action.
2023-03-13 12:57:14:                init: USB Monitor: added GenesysLogic USB3.0 Hub
2023-03-13 12:57:14:                init: USB Monitor: added  USB2.0 HUB
2023-03-13 12:57:14:                init: USB Monitor: added GenesysLogic USB2.0 Hub
2023-03-13 12:57:14:                init: USB Monitor: added Realtek USB 10/100/1G/2.5G LAN
2023-03-13 12:57:14:                init: USB Monitor: added GenesysLogic USB3.0 Hub
2023-03-13 12:57:14:                init: USB Monitor: added GenesysLogic USB2.0 Hub
2023-03-13 12:57:14:                init: USB Monitor: added Action Star USB2.0 Hub
2023-03-13 12:57:14:                init: USB Monitor: added Apple, Inc. Keyboard Hub
2023-03-13 12:57:14:                init: USB Monitor: added Realtek USB3.0 Card Reader
2023-03-13 12:57:14:                init: USB Monitor: added Action Star USB HID
2023-03-13 12:57:14:                init: USB Monitor: added Keystation Mini 32 Keystation Mini 32
2023-03-13 12:57:14:                init: USB Monitor: added Microsoft 
2023-03-13 12:57:15: 12:57:15       init: USB Monitor: added Apple Inc. Apple Keyboard
2023-03-13 12:57:19: 12:57:19                 Network reachable
2023-03-13 12:58:44: 12:58:44       init: pingTimer - sending pdetevent 1%20P
2023-03-13 12:58:44:                          http reply OK

BTT Log, found some info but no device:
1678708630.987232|SYS|USB DEVICE CONNECTED|
1678708630.987310|SYS|USB Connect Count 1|
1678708631.509092|SYS|USB DEVICE CONNECTED|
1678708631.509199|SYS|USB Connect Count 2|
1678708631.563026|SYS|USB DEVICE CONNECTED|
1678708631.563175|SYS|USB Connect Count 3|
1678708631.607693|SYS|USB DEVICE CONNECTED|
1678708631.608113|SYS|USB Connect Count 4|
1678708631.769900|SYS|USB DEVICE CONNECTED|
1678708631.770038|SYS|USB Connect Count 5|
1678708631.870559|SYS|USB DEVICE CONNECTED|
1678708631.870679|SYS|USB Connect Count 6|
1678708632.386660|SNAPAREA|step1, 0 displays- match mode 0 - searching BenQ LCD|
1678708632.387762|SNAPAREA|return existing (updated)|
1678708632.387806|SNAPAREA|step1, 0 displays- match mode 0 - searching Built-in Retina Display|
1678708632.388515|SNAPAREA|return existing (updated)|
1678708632.388563|SNAP|Did recognize 32800 21573 dragpoints: 0 - 3|
1678708632.388568|SNAP|Did recognize 41040 4251086178 dragpoints: 0 - 2|
1678708632.388586|SNAP|Did reset snap areas 1 0|
1678708632.417873|SNAPAREA|step1, 0 displays- match mode 0 - searching BenQ LCD|
1678708632.418448|SNAPAREA|return existing (updated)|
1678708632.418485|SNAPAREA|step1, 0 displays- match mode 0 - searching Built-in Retina Display|
1678708632.418800|SNAPAREA|return existing (updated)|
1678708632.418818|SNAP|Did recognize 32800 21573 dragpoints: 0 - 3|
1678708632.418824|SNAP|Did recognize 41040 4251086178 dragpoints: 0 - 2|
1678708632.418841|SNAP|Did reset snap areas 1 0|
1678708632.643893|SNAPAREA|step1, 0 displays- match mode 0 - searching BenQ LCD|
1678708632.644503|SNAPAREA|return existing (updated)|
1678708632.644533|SNAPAREA|step1, 0 displays- match mode 0 - searching Built-in Retina Display|
1678708632.644835|SNAPAREA|return existing (updated)|
1678708632.644848|SNAP|Did recognize 32800 21573 dragpoints: 0 - 3|
1678708632.644853|SNAP|Did recognize 41040 4251086178 dragpoints: 0 - 2|
1678708632.644864|SNAP|Did reset snap areas 1 0|
1678708632.973188|SYS|USB DEVICE CONNECTED|
1678708632.973243|SYS|USB Connect Count 7|
1678708633.061563|SYS|USB DEVICE CONNECTED|
1678708633.061629|SYS|USB Connect Count 8|
1678708633.223964|SYS|USB DEVICE CONNECTED|
1678708633.224014|SYS|USB Connect Count 9|
1678708633.245747|SYS|USB DEVICE CONNECTED|
1678708633.245798|SYS|USB Connect Count 10|
1678708633.323247|SYS|USB DEVICE CONNECTED|
1678708633.323297|SYS|USB Connect Count 11|
1678708633.755343|script|init|
1678708633.755392|NAMED|togglestagemanager|
1678708633.813693|NAMED|keylight_down|
1678708633.821085|NAMED|keylight_down|
1678708633.824472|NAMED|keylight_down|
1678708633.827092|NAMED|keylight_down|
1678708633.830230|NAMED|keylight_down|
1678708633.840261|NAMED|keylight_down|
1678708633.846239|NAMED|keylight_down|
1678708633.855049|NAMED|keylight_down|
1678708633.859246|NAMED|keylight_down|
1678708633.863959|NAMED|keylight_down|
1678708633.871118|NAMED|keylight_down|
1678708633.879039|NAMED|keylight_down|
1678708633.885467|NAMED|keylight_down|
1678708633.888176|NAMED|keylight_down|
1678708633.900311|SYS|USB DEVICE CONNECTED|
1678708633.900332|SYS|USB Connect Count 12|
1678708633.901114|NAMED|keylight_down|
1678708633.904694|NAMED|keylight_down|
1678708634.039155|SYS|USB DEVICE CONNECTED|
1678708634.039406|SYS|USB Connect Count 13|
1678708634.116567|SYS|USB DEVICE CONNECTED|
1678708634.116630|SYS|USB Connect Count 14|
1678708634.227271|SYS|USB DEVICE CONNECTED|
1678708634.227463|SYS|USB Connect Count 15|
1678708634.296915|SYS|USB DEVICE CONNECTED|
1678708634.297035|SYS|USB Connect Count 16|
1678708634.346634|SYS|USB DEVICE CONNECTED|
1678708634.346733|SYS|USB Connect Count 17|
1678708634.348794|SYS|USB DEVICE CONNECTED|
1678708634.348835|SYS|USB Connect Count 18|
1678708634.562102|SYS|USB DEVICE CONNECTED|
1678708634.562146|SYS|USB Connect Count 19|
1678708634.624076|SYS|USB DEVICE CONNECTED|
1678708634.624481|SYS|USB Connect Count 20|
1678708634.662393|SYS|USB DEVICE CONNECTED|
1678708634.662433|SYS|USB Connect Count 21|
1678708634.769725|SYS|USB DEVICE CONNECTED|
1678708634.769794|SYS|USB Connect Count 22|
1678708634.878976|SYS|USB DEVICE CONNECTED|
1678708634.879387|SYS|USB Connect Count 23|
1678708634.940468|SYS|USB DEVICE CONNECTED|
1678708634.940540|SYS|USB Connect Count 24|
1678708634.980024|SYS|USB DEVICE CONNECTED|
1678708634.980079|SYS|USB Connect Count 25|
1678708635.273076|SYS|USB DEVICE CONNECTED|
1678708635.273157|SYS|USB Connect Count 26|

Would you mind sharing your script and instructions how to use it? I'd like to know if I can find out what component might be causing the error message to pop up for me, particularly as I don't even have a USB dock to plug in

It's not very hard, I use a code similar to this. This is Hammerspoon code:

usbConnectsTimer = hs.timer.new(3, function()
   usbConnectsTimer:stop()
   print("> usb connect for devices: " .. usbConnectsDevs)
   usbConnects = 0
   usbConnectsDevs = nil
 end)

 usbDisconnectsTimer = hs.timer.new(3, function()
   usbDisconnectsTimer:stop()
   print("> usb disconnect for devices: " .. usbDisconnectsDevs)
   usbDisconnects = 0
   usbDisconnectsDevs = nil
 end)

 usbConnects = 0
 usbDisconnects = 0
 usbDCWatcher = {}

 usbMonitor = hs.usb.watcher.new(function(info)
   -- iNotify(log,"USB Monitor: " .. info['eventType'] .. " " .. info['vendorName'] .. " " .. info['productName'])
   local event = info['eventType']
   local vendor = info['vendorName']
   local product = info['productName']
   print("USB Monitor: " .. event .. " " .. vendor .. " " .. product)
   if event == "added" then
     if usbDebugAllConns then
       usbConnectsTimer:setNextTrigger(3)
       usbConnects = usbConnects + 1
       if usbConnectsDevs ~= nil then usbConnectsDevs = usbConnectsDevs .. ", " .. vendor .. " " .. product else usbConnectsDevs = vendor .. " " .. product end
     end
     if usbDebugReconns then
       currTime = hs.timer.secondsSinceEpoch()
       for i, v in pairs(usbDCWatcher) do
         if currTime-v>30 then usbDCWatcher[i] = nil end
       end
       if usbDCWatcher[vendor .. " " .. product] ~= nil then
         print("USB Device reconnect occured: " .. vendor .. " " .. product)
       end
     end
   elseif event == "removed" then
     if usbDebugAllConns then
       usbDisconnectsTimer:setNextTrigger(3)
       usbDisconnects = usbDisconnects + 1
       if usbDisconnectsDevs ~= nil then usbDisconnectsDevs = usbDisconnectsDevs .. ", " .. vendor .. " " .. product else usbDisconnectsDevs = vendor .. " " .. product end
     end
     if usbDebugReconns then usbDCWatcher[vendor .. " " ..product]=hs.timer.secondsSinceEpoch() end
   else print("Unknown USB event in usb watcher") end
 end):start()

 function getUsbDevices()
   local devs = hs.usb.attachedDevices()
   local cnt = 0
   local res = {}
   local vendor
   for i,v in pairs(devs) do
     cnt = cnt + 1
     if v['vendorName'] ~= nil then vendor = v['vendorName'] else vendor = "(no vendor)" end
     if v['productName'] ~= nil then product = v['productName'] else product = "(no productname)" end
     table.insert(res,vendor .. " " .. product)
   end
   table.sort(res)
   print("\n" .. table.concat(res,"\n"))
   print(cnt .. " devices attached")
 end

Thank you, I haven't had a recurrence yet but I just added this code so now I can monitor for events.

1 Like

Culprit possibly found, though I don't know what it means.

I got a BTT USB constantly disconnecting report one morning after opening my laptop lid, which wakes it from hibernate. The Hammerspoon output was:

2023-07-22 12:53:39: USB Monitor: removed 2023-07-22 12:53:40: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:40: USB Monitor: removed Apple Inc. Bluetooth USB Host Controller 2023-07-22 12:53:40: USB Monitor: removed Apple Inc. Apple Internal Keyboard / Trackpad 2023-07-22 12:53:40: USB Monitor: removed Apple Computer, Inc. IR Receiver 2023-07-22 12:53:40: USB Monitor: removed Apple Inc. BRCM20702 Hub 2023-07-22 12:53:40: USB Monitor: removed 2023-07-22 12:53:40: USB Monitor: removed 2023-07-22 12:53:40: USB Monitor: added 2023-07-22 12:53:40: USB Monitor: added 2023-07-22 12:53:40: USB Monitor: added Apple Inc. Apple Internal Keyboard / Trackpad 2023-07-22 12:53:40: USB Monitor: added Apple Computer, Inc. IR Receiver 2023-07-22 12:53:40: USB Monitor: added Apple Inc. BRCM20702 Hub 2023-07-22 12:53:40: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:40: USB Monitor: added 2023-07-22 12:53:40: USB Monitor: added 2023-07-22 12:53:40: USB Monitor: added 2023-07-22 12:53:44: USB Monitor: added Apple Inc. Bluetooth USB Host Controller 2023-07-22 12:53:44: USB Monitor: removed 2023-07-22 12:53:44: USB Monitor: removed 2023-07-22 12:53:49: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:49: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:50: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:50: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:52: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:52: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:54: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:54: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:56: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:56: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:58: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:58: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:59: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:53:59: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:01: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:01: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:03: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:03: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:05: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:05: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:06: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:06: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:08: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:08: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:10: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:10: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:12: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:12: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:14: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:14: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:15: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:15: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:17: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:17: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:19: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:19: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:21: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:21: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:23: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:23: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:24: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:24: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:26: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:26: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:28: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:28: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:30: USB Monitor: removed Apple Inc. FaceTime HD Camera (Built-in) 2023-07-22 12:54:30: USB Monitor: added Apple Inc. FaceTime HD Camera (Built-in)

I closed my laptop last night and woke it up this morning. BTT did not report the disconnecting USB issue, but I checked my Hammerspoon console out of curiosity and saw much the same output (rapidly removing and adding the built in camera).

This only seems to happen when I open the lid. My guess would be microcracks somewhere in the cable for this device that cause its connection to fluctuate when the lid opens? I almost never use this camera, but I just started up PhotoBooth and confirmed the camera does work.

I suppose I could test whether this happens when putting the computer to sleep and waking it up without closing the lid, but I'll have to get to that later.

This really looks like an actual issue. It doesn't look like this in my log (posted above).

Yeah, I put my computer to hibernate without closing the lid and woke it up. The repeated camera connect/disconnect cycling didn't happen. I think it has to be a hardware issue at this point, likely micro breaks in the webcam cable. The repair for that is very invasive, requiring disassembly of the display, and I use the webcam once a year if that, so I'm just going to leave it as is.

Thank you for helping me diagnose the issue (or at least, one issue -- I can reproduce this log output, but the BTT display warning hasn't come back and I haven't suppressed it) and learn about Hammerspoon!

No problem. It's a very good tool to have at hand. I use it to extend the functionality around docking for which it is fantastic.

Updating to confirm it was definitely a failing camera or camera cable, not a software bug on BTT's end. The error went off again and now my webcam is not detectable by the computer at all.

1 Like

Glad it worked out for you. I've still got issues that sounds more like a software issue related to a dock.