UltimateHackingKeyboard / agent

Ultimate Hacking Keyboard configurator
https://ultimatehackingkeyboard.github.io/agent/
Other
692 stars 77 forks source link

Agent does not detect UHKv1 on windows #2273

Closed g5pw closed 1 month ago

g5pw commented 1 month ago

I'm having issues with the Agent not detecting my UHK v1 on Windows 11. I' ve tried with older version of the agent (since my firmware might be a bit old, but even with the latest 1.x version it is stuck detecting the UKH.

Relevant logs:

11:26:46.643 > [Electron Main] command line arguments {}
11:26:46.650 > [Electron Main] init services.
11:26:46.651 > [Electron Main] packagesDir: C:\Users\user\AppData\Local\Programs\uhk-agent\resources
11:26:46.703 > [Electron Main] Create new window.
11:26:46.704 > [WindowState] load settings
11:26:46.706 > [WindowState] loaded settings {
  x: 448,
  y: 141,
  width: 1024,
  height: 768,
  isMaximized: false,
  isFullScreen: false
}
11:26:46.710 > [WindowState] loaded settings is visible true
11:26:46.711 > [WindowState] return with loaded settings
11:26:46.712 > [SmartMacroService] starting...
11:26:46.714 > [SmartMacroCopy] start
11:26:46.732 > [SmartMacroCopy] copy {
  destination: 'C:\\Users\\user\\AppData\\Roaming\\uhk-agent\\smart-macro-docs\\UltimateHackingKeyboard\\firmware\\v11.1.0',
  smartMacroDocFirmwarePath: 'C:\\Users\\user\\AppData\\Local\\Programs\\uhk-agent\\resources\\packages\\firmware\\doc'
}
11:26:46.779 > [SmartMacroCopy] done
11:26:46.781 > [SmartMacroCopy] start copy loading.html
11:26:46.787 > [SmartMacroCopy] end copy loading.html
11:26:46.789 > [SmartMacroService] get free TCP port
11:26:46.803 > [SmartMacroService] acquired TCP port: 1407
11:26:46.839 > [SmartMacroService] started on 1407.
11:26:46.973 > [DeviceService] init success
11:26:46.975 > [AppUpdateService] init success
11:26:46.977 > [AppService] init success
11:26:46.977 > [SudoService] App root dir:  C:\Users\user\AppData\Local\Programs\uhk-agent\resources
11:26:46.989 > [DeviceService] Udev info: Ok
11:26:47.202 > [AppService] get-config: application-settings
11:26:47.238 > [AppService] get-config of "application-settings": {"checkForUpdateOnStartUp":true,"everAttemptedSavingToKeyboard":true,"animationEnabled":true,"appTheme":"system","backlightingColorPalette":[{"r":255,"g":0,"b":0},{"r":0,"g":255,"b":0},{"r":0,"g":0,"b":255}],"keyboardHalvesAlwaysJoined":false,"smartMacroPanelWidth":41}
11:26:47.543 > [DeviceRendererService] init success
11:26:47.549 > [AppRendererService] init success
11:26:47.572 > [SmartMacroDocRendererService] init success
11:26:47.576 > Renderer appStart effect start
11:26:47.577 > [AppRendererService] getAppStartInfo
11:26:47.579 > [SmartMacroService] getAppStartInfo
11:26:47.580 > [AppService] getAppStartInfo
11:26:47.580 > [AppService] getAppStartInfo response: {
  commandLineArgs: { 'disable-agent-update-protection': false },
  platform: 'win32',
  osVersion: '10.0.22631',
  udevFileContent: ''
}
11:26:47.578 > Renderer appStart effect end
11:26:47.583 > [AppService] get-config: application-settings
11:26:47.584 > [AppUpdateService] check for update at startup: { checkForUpdateOnStartUp: true }
11:26:47.585 > [AppUpdateService] app started. Automatically check for update.
11:26:47.586 > Checking for update
11:26:47.587 > [AppUpdateService] checking for update
11:26:47.588 > sendIpcToWindow: checking-for-update null
11:26:47.590 > [AppService] get-config of "application-settings": {"checkForUpdateOnStartUp":true,"everAttemptedSavingToKeyboard":true,"animationEnabled":true,"appTheme":"system","backlightingColorPalette":[{"r":255,"g":0,"b":0},{"r":0,"g":255,"b":0},{"r":0,"g":0,"b":255}],"keyboardHalvesAlwaysJoined":false,"smartMacroPanelWidth":41}
11:26:47.741 > [WindowState] save settings: {
  x: 448,
  y: 141,
  width: 1024,
  height: 768,
  isMaximized: false,
  isFullScreen: false
}
11:26:47.785 > [WindowState] save settings success
11:26:47.725 > [SmartMacroDocRendererService] dispatch action: [smart-macro-doc] service listening
11:26:47.739 > [AppRendererService] dispatch action: [app] process start info
11:26:47.741 > [AppEffect][processStartInfo] payload: {
  commandLineArgs: { 'disable-agent-update-protection': false },
  platform: 'win32',
  osVersion: '10.0.22631',
  udevFileContent: ''
}
11:26:47.819 > [DeviceService] start poll UHK Device
11:26:48.312 > [UhkHidDevice] Devices before checking permission:
11:26:48.426 > [UhkHidDevice] Available devices changed.
11:26:48.427 > [UhkHidDevice] Added: {"vendorId":"0x1D50","productId":"0x6122","path":"\\\\?\\HID#VID_1D50&PID_6122&MI_02#9&2f3456bc&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v1","release":258,"interface":2,"usagePage":12,"usage":1}
11:26:48.428 > [UhkHidDevice] Added: {"vendorId":"0x1D50","productId":"0x6122","path":"\\\\?\\HID#VID_1D50&PID_6122&MI_00#9&11e799b2&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v1","release":258,"interface":0,"usagePage":65280,"usage":1}
11:26:48.429 > [UhkHidDevice] Added: {"vendorId":"0x1D50","productId":"0x6122","path":"\\\\?\\HID#VID_1D50&PID_6122&MI_04#9&2320a53f&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v1","release":258,"interface":4,"usagePage":1,"usage":2}
11:26:48.430 > [UhkHidDevice] Added: {"vendorId":"0x1D50","productId":"0x6122","path":"\\\\?\\HID#VID_1D50&PID_6122&MI_01#9&35bed774&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\\KBD","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v1","release":258,"interface":1,"usagePage":1,"usage":6}
11:26:48.431 > [UhkHidDevice] Added: {"vendorId":"0x1D50","productId":"0x6122","path":"\\\\?\\HID#VID_1D50&PID_6122&MI_03#9&b5d18fa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v1","release":258,"interface":3,"usagePage":1,"usage":128}
11:26:48.646 > [UhkHidDevice] Available devices unchanged
11:26:48.649 > [UhkHidDevice] Used device: {"vendorId":"0x1D50","productId":"0x6122","path":"\\\\?\\HID#VID_1D50&PID_6122&MI_00#9&11e799b2&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v1","release":258,"interface":0,"usagePage":65280,"usage":1}
11:26:48.671 > [DeviceOperation] right module deviceProtocolVersion: 512.0.0
11:26:48.720 > [DeviceOperation] Read "leftHalf" version information
11:26:48.724 > [DeviceOperation] Read "leftHalf" repo information
11:26:48.731 > [DeviceOperation] Read "leftHalf" firmware checksum
11:26:48.737 > [DeviceService] Device connection state query error TypeError: Cannot read properties of undefined (reading 'slotId')
    at li.getHardwareModules (C:\Users\user\AppData\Local\Programs\uhk-agent\resources\app.asar\electron-main.js:2:501324)
    at async li.uhkDevicePoller (C:\Users\user\AppData\Local\Programs\uhk-agent\resources\app.asar\electron-main.js:2:510681)
11:26:49.224 > [DeviceOperation] right module deviceProtocolVersion: 512.0.0
11:26:49.286 > [DeviceOperation] Read "leftHalf" version information
11:26:49.290 > [DeviceOperation] Read "leftHalf" repo information
11:26:49.302 > [DeviceOperation] Read "leftHalf" firmware checksum
11:26:49.307 > [DeviceService] Device connection state query error TypeError: Cannot read properties of undefined (reading 'slotId')
    at li.getHardwareModules (C:\Users\user\AppData\Local\Programs\uhk-agent\resources\app.asar\electron-main.js:2:501324)
    at async li.uhkDevicePoller (C:\Users\user\AppData\Local\Programs\uhk-agent\resources\app.asar\electron-main.js:2:510681)
11:26:49.791 > Update for version 4.1.0 is not available (latest version: 4.1.0, downgrade is disallowed).
11:26:49.793 > [AppUpdateService] checkForUpdate success
11:26:49.796 > [DeviceOperation] right module deviceProtocolVersion: 512.0.0
11:26:49.817 > [DeviceOperation] Read "leftHalf" version information
11:26:49.821 > [DeviceOperation] Read "leftHalf" repo information
11:26:49.828 > [DeviceOperation] Read "leftHalf" firmware checksum
11:26:49.832 > [DeviceService] Device connection state query error TypeError: Cannot read properties of undefined (reading 'slotId')
    at li.getHardwareModules (C:\Users\user\AppData\Local\Programs\uhk-agent\resources\app.asar\electron-main.js:2:501324)
    at async li.uhkDevicePoller (C:\Users\user\AppData\Local\Programs\uhk-agent\resources\app.asar\electron-main.js:2:510681)
11:26:50.335 > [DeviceOperation] right module deviceProtocolVersion: 512.0.0
ert78gb commented 1 month ago

The problem is the device protocol version [DeviceOperation] right module deviceProtocolVersion: 512.0.0. The latest valid device protocol version is 4.10.0.

Have you used some custom firmware or did you used some custom tool that maybe overwrote this value?

g5pw commented 1 month ago

Not that I know of, I've only used stock firmware and the UHK agent. However, I'm an embedded developer, so maybe one of the tools I use overwrote the value unwittingly? Is there a way to change it back?

mondalaci commented 1 month ago

Are you perhaps running a development build and an official build of Agent simultaneously? The deviceProtocolVersion of your UHK is seriously off, and we haven't encountered anything like this so far.

g5pw commented 1 month ago

To my knowledge, I've never used an unofficial build of Agent or firmware, I'm as stumped as you are :/

kareltucek commented 1 month ago

Is there a way to change it back?

So, you are stuck at not being able to flash another firmware onto your uhk.

I guess the unbricking procedure might help: https://ultimatehackingkeyboard.com/repair/unbricking-the-right-keyboard-half.

ert78gb commented 1 month ago

The problem is Agent does not recognise the keyboard, because the keyboard returns with 512.0.0 device protocol number. In the reality the keyboard has older firmware that does not support features that depends from 4.8.0 or 4.10.0 device protocol.

Because the device protocol number is larger than 4.8.0 or 4.10.0 we try to read information from the firmware but it returns with invalid information.

I think the solution is:

It is not working on my mac. It is breaking in the middle of the process. If I use Agent the firmware upgrade works fine. Currently I don't have time to figure it out what is the problem.

I recommend to use the above script on linux

g5pw commented 1 month ago

Thanks for all responses, I'll try @ert78gb's suggestion first and disassemble the right half if that does not work.

mondalaci commented 1 month ago

Closing due to the lack of replies. Feel free to follow up regardless.

ert78gb commented 1 month ago

@g5pw Do you use smart macros?