Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect BitBox02 on M2 Mac #43

Closed
linearray opened this issue Apr 14, 2023 · 24 comments · Fixed by #44
Closed

Cannot connect BitBox02 on M2 Mac #43

linearray opened this issue Apr 14, 2023 · 24 comments · Fixed by #44

Comments

@linearray
Copy link

I installed bitbox-bridge and tried to use it with Rabby in Brave and Chrome. I made sure no other wallet like the BitBox app is running. All I get when trying to connect the BitBox02 to Rabby is the following error:

Screenshot 2023-04-14 at 1 05 44 PM

When I look at http://127.0.0.1:8178/ I see the bridge running and http://127.0.0.1:8178/api/v1/devices shows the device (twice, in fact).

I wish I could provide more info, but I see no further error message (also nothing in Console), so I am not even sure if this is a bridge problem.

The same process works fine on my Intel MacBook (both MacBooks are running macOS 13.3).

@linearray linearray changed the title Cannot connect BitBox02 on M1 Mac Cannot connect BitBox02 on M2 Mac Apr 14, 2023
@pozylon
Copy link

pozylon commented May 6, 2023

I have the same issue but the intel Mac Mini doesn't work either so I doubt that this is an issue related to mac version.

@pozylon
Copy link

pozylon commented May 6, 2023

It's very frustrating, I really like the BitBox02 but if I can't make this work in the next few days, I need to buy a Trezor or a Ledger just in order to use dapps safely 😤

@benma
Copy link
Contributor

benma commented May 6, 2023

@pozylon

Is the BitBoxApp and all other wallet apps closed? Only one app can talk to the BitBox02 at once.

Are you using VPN?

@linearray

I see the bridge running and http://127.0.0.1:8178/api/v1/devices shows the device (twice, in fact).

Strange, I think it should show it once, not twice.

Could you try connecting to myetherwallet.com using Firefox and Chrome? On FireFox the bridge is used, on Chrome webHID is used without the bridge.

@benma
Copy link
Contributor

benma commented May 6, 2023

@pozylon what does http://127.0.0.1:8178/api/v1/devices show for you when trying to connect?

@pozylon
Copy link

pozylon commented May 7, 2023

@pozylon what does http://127.0.0.1:8178/api/v1/devices show for you when trying to connect?

It shows 2 devices as soon as i select the orientation on the bitbox02

@pozylon
Copy link

pozylon commented May 7, 2023

Is the BitBoxApp and all other wallet apps closed? Only one app can talk to the BitBox02 at once.

Are you using VPN?

Yes, everything closed, bridge running showing 2 devices, MEV works on chrome but does not on firefox:
Bildschirmfoto 2023-05-07 um 20 04 06

@pozylon
Copy link

pozylon commented May 7, 2023

There is only 1 difference in the devices shown:

...%2FIOUSBHostInterface%401%2FAppleUserUSBHostHIDDevice","product":"BitBox02"}]}
...%2FIOUSBHostInterface%400%2FAppleUserUSBHostHIDDevice","product":"BitBox02"}]}

@benma maybe that helps?

@pozylon
Copy link

pozylon commented May 7, 2023

@benma

Some more info:

listening on http://127.0.0.1:8178
[2023-05-07T18:56:14Z INFO  warp::server] listening on http://127.0.0.1:8178
[2023-05-07T18:56:14Z INFO  bitbox_bridge::usb] Notified!
[2023-05-07T18:56:14Z INFO  bitbox_bridge::usb] Found BitBox02 at IOService:/AppleARMPE/arm-io@10F00000/AppleT811xIO/usb-drd0@82280000/AppleT8112USBXHCI@00000000/usb-drd0-port-hs@00100000/BitBox02@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice!
[2023-05-07T18:56:14Z INFO  bitbox_bridge::usb] Found BitBox02 at IOService:/AppleARMPE/arm-io@10F00000/AppleT811xIO/usb-drd0@82280000/AppleT8112USBXHCI@00000000/usb-drd0-port-hs@00100000/BitBox02@00100000/IOUSBHostInterface@1/AppleUserUSBHostHIDDevice!
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] read 420 bytes
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] parsed 11 headers
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::conn] incoming body is empty
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] Some(127.0.0.1:52524)
[2023-05-07T18:56:22Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:52524
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] localhost:8178
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] Origin: Some(https://www.myetherwallet.com/)
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] flushed 718 bytes
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] read 420 bytes
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] parsed 11 headers
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::conn] incoming body is empty
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] Some(127.0.0.1:52524)
[2023-05-07T18:56:22Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:52524
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] localhost:8178
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] Origin: Some(https://www.myetherwallet.com/)
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] flushed 718 bytes
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] read 420 bytes
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] parsed 11 headers
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::conn] incoming body is empty
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] Some(127.0.0.1:52524)
[2023-05-07T18:56:22Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:52524
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] localhost:8178
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] Origin: Some(https://www.myetherwallet.com/)
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] flushed 718 bytes
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] read 420 bytes
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] parsed 11 headers
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::conn] incoming body is empty
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] Some(127.0.0.1:52524)
[2023-05-07T18:56:22Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:52524
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] localhost:8178
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] Origin: Some(https://www.myetherwallet.com/)
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] flushed 718 bytes
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] read 420 bytes
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] parsed 11 headers
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::conn] incoming body is empty
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] Some(127.0.0.1:52524)
[2023-05-07T18:56:22Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:52524
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] localhost:8178
[2023-05-07T18:56:22Z DEBUG bitbox_bridge::web] Origin: Some(https://www.myetherwallet.com/)
[2023-05-07T18:56:22Z DEBUG hyper::proto::h1::io] flushed 718 bytes
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] read 420 bytes
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] parsed 11 headers
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::conn] incoming body is empty
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] Some(127.0.0.1:52524)
[2023-05-07T18:56:23Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:52524
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] localhost:8178
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] Origin: Some(https://www.myetherwallet.com/)
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] flushed 718 bytes
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] read 420 bytes
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] parsed 11 headers
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::conn] incoming body is empty
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] Some(127.0.0.1:52524)
[2023-05-07T18:56:23Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:52524
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] localhost:8178
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] Origin: Some(https://www.myetherwallet.com/)
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] flushed 718 bytes
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] read 420 bytes
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] parsed 11 headers
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::conn] incoming body is empty
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] Some(127.0.0.1:52524)
[2023-05-07T18:56:23Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:52524
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] localhost:8178
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] Origin: Some(https://www.myetherwallet.com/)
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] flushed 718 bytes
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] read 420 bytes
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] parsed 11 headers
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::conn] incoming body is empty
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] Some(127.0.0.1:52524)
[2023-05-07T18:56:23Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:52524
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] localhost:8178
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] Origin: Some(https://www.myetherwallet.com/)
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] flushed 718 bytes
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] read 420 bytes
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] parsed 11 headers
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::conn] incoming body is empty
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] Some(127.0.0.1:52524)
[2023-05-07T18:56:23Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:52524
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] localhost:8178
[2023-05-07T18:56:23Z DEBUG bitbox_bridge::web] Origin: Some(https://www.myetherwallet.com/)
[2023-05-07T18:56:23Z DEBUG hyper::proto::h1::io] flushed 718 bytes

Firefox just calls the devices api 10 times again and again without every trying to connect to the websocket, then gives up:

Bildschirmfoto 2023-05-07 um 20 58 49

@pozylon
Copy link

pozylon commented May 7, 2023

Looks like it's a problem of the client js lib not accepting more than 1 device in the list.

@benma
Copy link
Contributor

benma commented May 8, 2023

Thanks for debugging @pozylon. Now we need to figure out why the bridge lists two devices instead of one. I can't reproduce the issue. Any chance you know some Rust? https://github.com/digitalbitbox/bitbox-bridge/. If not, I'll try to figure out what could be going wrong by studying the code.

Potentially it registers the U2F interface as well, though I thought that was being filtered.

@benma
Copy link
Contributor

benma commented May 8, 2023

bitbox-bridge.zip

@pozylon could you test with this build of the bridge? I built it from this commit: benma@d7116f3

@pozylon
Copy link

pozylon commented May 8, 2023

Yeah it looks like it has something to do with that but i'm not very skilled at rust or hardware.

Nevertheless it seems to relate to the hidapi:

ruabmbua/hidapi-rs#89

The devices are only different by path and the bridge doesn't parse the path / filter interface id's

@benma
Copy link
Contributor

benma commented May 8, 2023

@pozylon you can run the above with ./bitbox-bridge -p 2342 or some other random port and then checking http://127.0.0.1:2342/api/v1/devices

@pozylon
Copy link

pozylon commented May 8, 2023

bitbox-bridge.zip

@pozylon could you test with this build of the bridge? I built it from this commit: benma@d7116f3

[2023-05-08T04:55:36Z INFO  bitbox_bridge::usb] Notified!
[2023-05-08T04:55:36Z INFO  bitbox_bridge::usb] Found BitBox02 at IOService:/AppleARMPE/arm-io@10F00000/AppleT811xIO/usb-drd1@2280000/AppleT8112USBXHCI@01000000/usb-drd1-port-hs@01100000/BitBox02@01100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice!
[2023-05-08T04:55:36Z INFO  bitbox_bridge::usb] Found BitBox02 at IOService:/AppleARMPE/arm-io@10F00000/AppleT811xIO/usb-drd1@2280000/AppleT8112USBXHCI@01000000/usb-drd1-port-hs@01100000/BitBox02@01100000/IOUSBHostInterface@1/AppleUserUSBHostHIDDevice!
[2023-05-08T04:55:36Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:53083
[2023-05-08T04:55:36Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:53083
[2023-05-08T04:55:36Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:53083
[2023-05-08T04:55:37Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:53083
[2023-05-08T04:55:37Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:53083
[2023-05-08T04:55:37Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:53083
[2023-05-08T04:55:37Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:53083
[2023-05-08T04:55:37Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:53083
[2023-05-08T04:55:37Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:53083

same issue still with that binary

@pozylon
Copy link

pozylon commented May 8, 2023

ioreg -p IOUSB:

+-o Root  <class IORegistryEntry, id 0x100000100, retain 31>
  +-o AppleT8112USBXHCI@00000000  <class AppleT8112USBXHCI, id 0x100000494, registered, matched, active, busy 0 (4633 ms), retain 291>
  +-o AppleT8112USBXHCI@01000000  <class AppleT8112USBXHCI, id 0x10000047b, registered, matched, active, busy 0 (69 ms), retain 60>
    +-o BitBox02@01100000  <class IOUSBHostDevice, id 0x10000557c, registered, matched, active, busy 0 (53 ms), retain 33>
➜  ~ 

@benma
Copy link
Contributor

benma commented May 8, 2023

@pozylon could you do:

pip3 install hidapi

then post the output of python3 -c 'import hid; print(hid.enumerate())'?

@pozylon
Copy link

pozylon commented May 8, 2023

Here you go @benma


[{'path': b'DevSrvsID:4294983388', 'vendor_id': 1452, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': '', 'product_string': 'Keyboard Backlight', 'usage_page': 65280, 'usage': 15, 'interface_number': -1}, {'path': b'DevSrvsID:4294989616', 'vendor_id': 1003, 'product_id': 9219, 'serial_number': 'v9.14.0', 'release_number': 256, 'manufacturer_string': 'shiftcrypto.ch', 'product_string': 'BitBox02', 'usage_page': 65535, 'usage': 1, 'interface_number': 0}, {'path': b'DevSrvsID:4294989618', 'vendor_id': 1003, 'product_id': 9219, 'serial_number': 'v9.14.0', 'release_number': 256, 'manufacturer_string': 'shiftcrypto.ch', 'product_string': 'BitBox02', 'usage_page': 61904, 'usage': 1, 'interface_number': 0}, {'path': b'DevSrvsID:4294968805', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'APPL', 'product_string': 'BTM', 'usage_page': 65280, 'usage': 72, 'interface_number': -1}, {'path': b'DevSrvsID:4294968406', 'vendor_id': 1452, 'product_id': 33028, 'serial_number': '638275c34e9e752407094320', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': '', 'usage_page': 65280, 'usage': 9, 'interface_number': -1}, {'path': b'DevSrvsID:4294983032', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': 'Apple Internal Keyboard / Trackpad', 'usage_page': 65280, 'usage': 3, 'interface_number': -1}, {'path': b'DevSrvsID:4294968351', 'vendor_id': 1452, 'product_id': 33028, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': '', 'usage_page': 65280, 'usage': 5, 'interface_number': -1}, {'path': b'DevSrvsID:4294968341', 'vendor_id': 1452, 'product_id': 33028, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': '', 'usage_page': 32, 'usage': 138, 'interface_number': -1}, {'path': b'DevSrvsID:4294968324', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': '', 'usage_page': 65280, 'usage': 255, 'interface_number': -1}, {'path': b'DevSrvsID:4294968392', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': '', 'usage_page': 65292, 'usage': 5, 'interface_number': -1}, {'path': b'DevSrvsID:4294983026', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': 'Apple Internal Keyboard / Trackpad', 'usage_page': 1, 'usage': 6, 'interface_number': -1}, {'path': b'DevSrvsID:4294983026', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': 'Apple Internal Keyboard / Trackpad', 'usage_page': 12, 'usage': 1, 'interface_number': -1}, {'path': b'DevSrvsID:4294983026', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': 'Apple Internal Keyboard / Trackpad', 'usage_page': 65280, 'usage': 6, 'interface_number': -1}, {'path': b'DevSrvsID:4294983046', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': 'Apple Internal Keyboard / Trackpad', 'usage_page': 65280, 'usage': 11, 'interface_number': -1}, {'path': b'DevSrvsID:4294968348', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': '', 'usage_page': 65280, 'usage': 4, 'interface_number': -1}, {'path': b'DevSrvsID:4294968300', 'vendor_id': 1452, 'product_id': 33028, 'serial_number': '638275c34e9e752407094320', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': '', 'usage_page': 65280, 'usage': 3, 'interface_number': -1}, {'path': b'DevSrvsID:4294968857', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': 'Headset', 'usage_page': 12, 'usage': 1, 'interface_number': -1}, {'path': b'DevSrvsID:4294968430', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': '', 'usage_page': 65292, 'usage': 1, 'interface_number': -1}, {'path': b'DevSrvsID:4294983035', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': 'Apple Internal Keyboard / Trackpad', 'usage_page': 65280, 'usage': 13, 'interface_number': -1}, {'path': b'DevSrvsID:4294983125', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': 'Apple Internal Keyboard / Trackpad', 'usage_page': 1, 'usage': 2, 'interface_number': -1}, {'path': b'DevSrvsID:4294983125', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': 'Apple Internal Keyboard / Trackpad', 'usage_page': 1, 'usage': 1, 'interface_number': -1}, {'path': b'DevSrvsID:4294983125', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': 'Apple Internal Keyboard / Trackpad', 'usage_page': 13, 'usage': 5, 'interface_number': -1}, {'path': b'DevSrvsID:4294983125', 'vendor_id': 0, 'product_id': 0, 'serial_number': '', 'release_number': 0, 'manufacturer_string': 'Apple', 'product_string': 'Apple Internal Keyboard / Trackpad', 'usage_page': 65280, 'usage': 12, 'interface_number': -1}]

@pozylon
Copy link

pozylon commented May 8, 2023

@benma I've logged the usage_page with hidapi-rs which differs by device, but the interface_number always returns 0, so neither 1 or -1

[2023-05-08T06:19:32Z INFO bitbox_bridge::usb] 61904
[2023-05-08T06:19:32Z INFO bitbox_bridge::usb] Found BitBox02 at IOService:/AppleARMPE/arm-io@10F00000/AppleT811xIO/usb-drd0@82280000/AppleT8112USBXHCI@00000000/usb-drd0-port-hs@00100000/BitBox02@00100000/IOUSBHostInterface@1/AppleUserUSBHostHIDDevice!
[2023-05-08T06:19:32Z INFO bitbox_bridge::usb] 65535
[2023-05-08T06:19:32Z INFO bitbox_bridge::usb] Found BitBox02 at IOService:/AppleARMPE/arm-io@10F00000/AppleT811xIO/usb-drd0@82280000/AppleT8112USBXHCI@00000000/usb-drd0-port-hs@00100000/BitBox02@00100000/IOUSBHostInterface@0/AppleUserUSBHostHIDDevice!

@pozylon
Copy link

pozylon commented May 8, 2023

This!

libusb/hidapi#531

Fixed already: libusb/hidapi#534

@benma
Copy link
Contributor

benma commented May 8, 2023

Thanks that is helpful. It seems that your HID driver is listing the two interfaces of the BitBox02 as two separate devices, but with different usage_page numbers.

Here is a bridge version that filters for the usage page, so you can try to run this instead of the official release with Rabby to quick-fix your problem.

bitbox-bridge.zip

Thanks for the link above - I'll check if/how I can pull in this fix and if ask you to try it if you don't mind.

@pozylon
Copy link

pozylon commented May 8, 2023

I can confirm that it works with both Rabby for Chrome and MyEtherWallet for Firefox.

benma added a commit to benma/bitbox-bridge that referenced this issue May 9, 2023
This fixes BitBoxSwiss#43 -
a regression where libusb/hidapi would report the interface number of
both (HWW and U2F) as 0 instead of 0 and 1 on macOS 13.3.

The fix is to pull the upstream fix:
libusb/hidapi#534.

hidapi-rs was forked to benma/hidapi-rs to pull in the latest
libusb/hidapi that contains the fix.
benma added a commit to benma/bitbox-bridge that referenced this issue May 9, 2023
This fixes BitBoxSwiss#43 -
a regression where libusb/hidapi would report the interface number of
both (HWW and U2F) as 0 instead of 0 and 1 on macOS 13.3.

The fix is to pull the upstream fix:
libusb/hidapi#534.

hidapi-rs was forked to benma/hidapi-rs to pull in the latest
libusb/hidapi that contains the fix.

This also led me down a rabbit-hole of updating the Docker base image
and all sorts of dependencies.
@benma
Copy link
Contributor

benma commented May 9, 2023

@pozylon I updated the libusb/hidapi dependency in the bridge. Could you test also this version?

bitbox-bridge.zip

If it works I'll make a new release. Thank you.

@pozylon
Copy link

pozylon commented May 9, 2023

@benma amazing, it works, but weirdly the path is now much shorter:

listening on http://127.0.0.1:8178
[2023-05-09T11:14:51Z INFO  warp::server] Server::run; addr=127.0.0.1:8178
[2023-05-09T11:14:51Z INFO  warp::server] listening on http://127.0.0.1:8178
[2023-05-09T11:14:51Z INFO  bitbox_bridge::usb] Notified!
[2023-05-09T11:16:07Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:07Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:11Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:11Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:12Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:12Z INFO  bitbox_bridge::usb] Notified!
[2023-05-09T11:16:12Z INFO  bitbox_bridge::usb] Found BitBox02 at DevSrvsID:4295009074!
[2023-05-09T11:16:15Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:16Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:17Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:29Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:30Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:31Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:31Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:32Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58328
[2023-05-09T11:16:57Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58405
[2023-05-09T11:16:57Z INFO  bitbox_bridge::web] Client connected: 127.0.0.1:58406
[2023-05-09T11:16:57Z INFO  bitbox_bridge::usb] Successfully acquired device: DevSrvsID:4295009074

benma added a commit to benma/bitbox-bridge that referenced this issue May 11, 2023
This fixes BitBoxSwiss#43 -
a regression where libusb/hidapi would report the interface number of
both (HWW and U2F) as 0 instead of 0 and 1 on macOS 13.3.

The fix is to pull the upstream fix:
libusb/hidapi#534.

hidapi-rs was forked to benma/hidapi-rs to pull in the latest
libusb/hidapi that contains the fix.

This also led me down a rabbit-hole of updating the Docker base image
and all sorts of dependencies.

Code changes are clippy fixes.
benma added a commit to benma/bitbox-bridge that referenced this issue May 11, 2023
This fixes BitBoxSwiss#43 -
a regression where libusb/hidapi would report the interface number of
both (HWW and U2F) as 0 instead of 0 and 1 on macOS 13.3.

The fix is to pull the upstream fix:
libusb/hidapi#534.

hidapi-rs was forked to benma/hidapi-rs to pull in the latest
libusb/hidapi that contains the fix.

This also led me down a rabbit-hole of updating the Docker base image
and all sorts of dependencies.

Code changes are clippy fixes.

libusb dep was changed to libudev, as hidapi-rs switched to the hidraw
hidapi backend by default (was libusb backend before) in
ruabmbua/hidapi-rs@bbb7f3e.
@benma benma closed this as completed in b60e027 May 11, 2023
@benma
Copy link
Contributor

benma commented May 11, 2023

BitBoxBridge 1.5.1 is now released for macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants