Open TaiSHiNet opened 5 years ago
Thanks for the details. I think the issue is the platform macros in hiddevice.cpp. Maybe a refactor went wrong somewhere. I made and pushed the changes, but I don't have access to my Mac right now to test. Can you pull master and try it now? Let me know if it works.
Excellent, compiled without issues. I do have a couple comments:
No device found, check connection and permissions
Tried without -t
, without sudo
and also with list
.
Furthermore, I moved the USB adapter from my monitor to my USB-C hub to no avail
Right the list
command does not work on OSX (pok3rtool should say that?). You just have to know the type of device you are looking for, so pok3rtool -t pok3r version
. You may have to run it with sudo
depending on your system.
Ran it with sudo
and still nothing. I wonder, how is the lookup made on the system? By a certain HW pattern? Name?
Hmm, odd. On OSX, you specify the USB VID and PID of the device you want, and the OS gives you a handle for it. Can you attach the pok3tool log file corresponding to sudo pok3rtool -t pok3r version
? It should dump verbose logs to a logs
folder.
[00:00:00:001] 0 D [|:] Command Line: ./pok3rtool -t pok3r version
[00:00:00:016] 0 D [|:] Found 0 devices
[00:00:00:017] 0 N No device found, check connection and permissions
Trimmed ioreg -p IOUSB -l
response:
| | {
| | "sessionID" = 98822594715630
| | "iManufacturer" = 0
| | "bNumConfigurations" = 1
| | "idProduct" = 321
| | "bcdDevice" = 279
| | "Bus Power Available" = 250
| | "USB Address" = 42
| | "bMaxPacketSize0" = 64
| | "iProduct" = 2
| | "iSerialNumber" = 0
| | "bDeviceClass" = 0
| | "Built-In" = No
| | "locationID" = 1114112
| | "bDeviceSubClass" = 0
| | "bcdUSB" = 272
| | "USB Product Name" = "USB Keyboard"
| | "PortNum" = 1
| | "non-removable" = "no"
| | "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
| | "bDeviceProtocol" = 0
| | "IOUserClientClass" = "IOUSBDeviceUserClientV2"
| | "IOPowerManagement" = {"DevicePowerState"=0,"CurrentPowerState"=3,"CapabilityFlags"=65536,"MaxPowerState"=4,"DriverPowerState"=3}
| | "kUSBCurrentConfiguration" = 1
| | "Device Speed" = 1
| | "idVendor" = 1241
| | "IOGeneralInterest" = "IOCommand is not serializable"
| | "IOClassNameOverride" = "IOUSBDevice"
| | }
That's not very exciting. I guess I don't have much debug output from the OSX functions. Alright, I'll try to reproduce this tonight.
So forget what I said about the list command not working. Apparently I fixed that over a year ago... I think I just blocked out that IOkit nightmare.
Now, pok3rtool list
and pok3rtool -t pok3r version
both work on my machine without sudo
on High Sierra. I am working on getting a Mojave machine to test on, but I'd be surprised if that made the difference. There is likely some other system configuration required to open devices the way I am. That would be good to know. I will look into it.
I also can't reproduce this on Mojave. Clean install in a VM, only installed Homebrew, developer tools, and CMake, cloned the repository, and compiled from master (68b94dc). The list
command works as expected, showing a keyboard attached from the host.
One thing i notice from your log output is that it saw no devices at all. Normally it will show a line for each USB device it found and inspected, but it shows none at all. I'm not familiar enough with macOS to think why that would be. Maybe a security setting?
I limited the output for that device. Here's the full output:
```
+-o Root
I'll take my kb home today and mess with my Windows computer. It might be an outdated firmware or it's just borked. I have a 2nd pok3r that I can test on as well.
Will keep you posted
Update: Updated firmware to 1.1.7 -- no success 2nd KB (1.1.7 too) -- no success
Both using an official apple USB-C to USB adapter
Just tried on my unraid server, mounting /dev/bus/usb on a ubuntu container and works. Same code as my Mac.
I'm curious as to wth is going on heh
I have the same issue on macOS Mojave:
$ ./pok3rtool version -v
[00:00:00:002] E Unknown device!
[00:00:00:002] N No device found, check connection and permissions
$ ./pok3rtool list -v
[00:00:00:002] N List Devices...
[00:00:00:016] D Found 0 devices
I just had a similar issue on macOS Catalina... funny thing is pok3rtool
was working perfectly fine and I was able to flash my custom QMK keymaps several times and then suddenly it just stopped finding my keyboard.
After hours of banging my head (recompiling pok3rtool
... and even re-soldering my debugger and reflashing again), I finally realized that while I was customizing my layout, I installed Karabiner and it was messing with pok3rtool
devices (it creates virtual USB devices). As soon as I uninstalled it and everything was fine!
Hopefully, this can help someone!
(Also lost many hours because my ribbon cable between the JLink and my breakout board wasn't plugged in the same direction and JLink/OpenOCD kept saying “Cannot connect to target” 😂)
That is very interesting. I'd be curious to see how Karabiner interferes with pok3rtool. It could be using some feature of the Apple USB system that I don't know about. I think I will try and reproduce this when I get a chance.