UltimateHackingKeyboard / agent

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

Agent doesn't see keyboard #2215

Closed lotusnopes closed 3 months ago

lotusnopes commented 4 months ago

Hello,

I haven't updated my UHK in a while; went to update the agent and it's not recognized. I went through the older releases and the latest release that will recognize it is 1.2.2, but I'm unable to update the firmware on that release.

output from running the 4.0.2 appimage agent:

07:41:01.910 › [Electron Main] command line arguments {} 07:41:01.913 › [Electron Main] init services. 07:41:01.914 › [Electron Main] packagesDir: /tmp/.mount_UHK.AgiC5qMe/resources Gtk-Message: 07:41:01.938: Failed to load module "xapp-gtk3-module" 07:41:02.117 › [Electron Main] Create new window. 07:41:02.118 › [WindowState] load settings 07:41:02.118 › [WindowState] loaded settings { x: 183, y: 388, width: 1280, height: 768, isMaximized: false, isFullScreen: false } 07:41:02.119 › [WindowState] loaded settings is visible true 07:41:02.119 › [WindowState] return with loaded settings 07:41:02.119 › [SmartMacroService] starting... 07:41:02.120 › [SmartMacroCopy] start 07:41:02.211 › [SmartMacroCopy] copy { destination: '/home/databender/.config/uhk-agent/smart-macro-docs/UltimateHackingKeyboard/firmware/v11.0.0', smartMacroDocFirmwarePath: '/tmp/.mount_UHK.AgiC5qMe/resources/packages/firmware/doc' } 07:41:02.252 › [SmartMacroCopy] done 07:41:02.252 › [SmartMacroCopy] start copy loading.html 07:41:02.253 › [SmartMacroCopy] end copy loading.html 07:41:02.260 › [SmartMacroService] get free TCP port 07:41:02.262 › [SmartMacroService] acquired TCP port: 40173 07:41:02.283 › [SmartMacroService] started on 40173. 07:41:02.469 › [DeviceService] init success 07:41:02.469 › [AppUpdateService] init success 07:41:02.470 › [AppService] init success 07:41:02.470 › [SudoService] App root dir: /tmp/.mount_UHK.AgiC5qMe/resources 07:41:02.522 › [DeviceService] Udev info: Ok 07:41:02.847 › [AppService] get-config: application-settings 07:41:02.848 › [AppService] get-config of "application-settings": {"checkForUpdateOnStartUp":true,"everAttemptedSavingToKeyboard":true,"animationEnabled":true,"appTheme":"system","smartMacroPanelWidth":41} 07:41:03.095 › [DeviceRendererService] init success 07:41:03.099 › [AppRendererService] init success 07:41:03.116 › [SmartMacroDocRendererService] init success 07:41:03.118 › Renderer appStart effect start 07:41:03.118 › [AppRendererService] getAppStartInfo 07:41:03.119 › [SmartMacroService] getAppStartInfo 07:41:03.119 › [AppService] getAppStartInfo 07:41:03.119 › Renderer appStart effect end 07:41:03.120 › [AppService] get-config: application-settings 07:41:03.120 › [AppService] getAppStartInfo response: { commandLineArgs: { 'disable-agent-update-protection': false }, platform: 'linux', osVersion: '6.2.6-76060206-generic', udevFileContent: '# Ultimate Hacking Keyboard rules\n' + '# These are the udev rules for accessing the USB interfaces of the UHK as non-root users.\n' + '# Copy this file to /etc/udev/rules.d and physically reconnect the UHK afterwards.\n' + 'SUBSYSTEM=="input", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", GROUP="input", MODE="0660"\n' + 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", TAG+="uaccess"\n' + 'KERNEL=="hidraw", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", TAG+="uaccess"\n' } 07:41:03.121 › [AppUpdateService] check for update at startup: { checkForUpdateOnStartUp: true } 07:41:03.121 › [AppUpdateService] app started. Automatically check for update. 07:41:03.121 › Checking for update 07:41:03.122 › [AppUpdateService] checking for update 07:41:03.122 › sendIpcToWindow: checking-for-update null 07:41:03.122 › [AppService] get-config of "application-settings": {"checkForUpdateOnStartUp":true,"everAttemptedSavingToKeyboard":true,"animationEnabled":true,"appTheme":"system","smartMacroPanelWidth":41} 07:41:03.244 › [SmartMacroDocRendererService] dispatch action: [smart-macro-doc] service listening 07:41:03.246 › [AppRendererService] dispatch action: [app] process start info 07:41:03.246 › [AppEffect][processStartInfo] payload: { commandLineArgs: { 'disable-agent-update-protection': false }, platform: 'linux', osVersion: '6.2.6-76060206-generic', udevFileContent: '# Ultimate Hacking Keyboard rules\n' + '# These are the udev rules for accessing the USB interfaces of the UHK as non-root users.\n' + '# Copy this file to /etc/udev/rules.d and physically reconnect the UHK afterwards.\n' + 'SUBSYSTEM=="input", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", GROUP="input", MODE="0660"\n' + 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", TAG+="uaccess"\n' + 'KERNEL=="hidraw", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", TAG+="uaccess"\n' } 07:41:03.249 › [DeviceService] start poll UHK Device 07:41:03.480 › [UhkHidDevice] Devices before checking permission: 07:41:03.480 › [UhkHidDevice] Available devices unchanged 07:41:03.481 › [DeviceService] Device connection state changed to: { bootloaderActive: false, communicationInterfaceAvailable: false, hasPermission: true, halvesInfo: { areHalvesMerged: true, leftModuleSlot: 0, isLeftHalfConnected: true, rightModuleSlot: 0 }, hardwareModules: { moduleInfos: [], rightModuleInfo: { modules: '[object]' } }, isMacroStatusDirty: false, multiDevice: false } [789989:0306/074103.502130:ERROR:nss_util.cc(357)] After loading Root Certs, loaded==false: NSS error code: -8018 07:41:03.536 › [DeviceRendererService] dispatch action [device] connection state changed 07:41:03.733 › [UhkHidDevice] Devices before checking permission: 07:41:03.735 › [UhkHidDevice] Available devices unchanged 07:41:03.988 › [UhkHidDevice] Devices before checking permission: 07:41:03.990 › [UhkHidDevice] Available devices unchanged 07:41:04.243 › [UhkHidDevice] Devices before checking permission: 07:41:04.245 › [UhkHidDevice] Available devices unchanged 07:41:04.498 › [UhkHidDevice] Devices before checking permission: 07:41:04.500 › [UhkHidDevice] Available devices unchanged 07:41:04.689 › Update for version 4.0.2 is not available (latest version: 4.0.2, downgrade is disallowed). 07:41:04.690 › [AppUpdateService] checkForUpdate success 07:41:04.752 › [UhkHidDevice] Devices before checking permission: 07:41:04.754 › [UhkHidDevice] Available devices unchanged 07:41:05.008 › [UhkHidDevice] Devices before checking permission: 07:41:05.009 › [UhkHidDevice] Available devices unchanged 07:41:05.263 › [UhkHidDevice] Devices before checking permission: 07:41:05.265 › [UhkHidDevice] Available devices unchanged 07:41:05.519 › [UhkHidDevice] Devices before checking permission: 07:41:05.521 › [UhkHidDevice] Available devices unchanged 07:41:05.775 › [UhkHidDevice] Devices before checking permission: 07:41:05.777 › [UhkHidDevice] Available devices unchanged 07:41:06.031 › [UhkHidDevice] Devices before checking permission: 07:41:06.033 › [UhkHidDevice] Available devices unchanged 07:41:06.301 › [UhkHidDevice] Devices before checking permission: 07:41:06.302 › [UhkHidDevice] Available devices unchanged 07:41:06.555 › [UhkHidDevice] Devices before checking permission: 07:41:06.557 › [UhkHidDevice] Available devices unchanged 07:41:06.822 › [UhkHidDevice] Devices before checking permission: 07:41:06.822 › [UhkHidDevice] Available devices unchanged 07:41:07.075 › [UhkHidDevice] Devices before checking permission: 07:41:07.077 › [UhkHidDevice] Available devices unchanged 07:41:07.332 › [UhkHidDevice] Devices before checking permission: 07:41:07.334 › [UhkHidDevice] Available devices unchanged 07:41:07.587 › [UhkHidDevice] Devices before checking permission: 07:41:07.589 › [UhkHidDevice] Available devices unchanged 07:41:07.843 › [UhkHidDevice] Devices before checking permission: 07:41:07.845 › [UhkHidDevice] Available devices unchanged 07:41:08.100 › [UhkHidDevice] Devices before checking permission: 07:41:08.102 › [UhkHidDevice] Available devices unchanged 07:41:08.357 › [UhkHidDevice] Devices before checking permission: 07:41:08.359 › [UhkHidDevice] Available devices unchanged 07:41:08.613 › [UhkHidDevice] Devices before checking permission: 07:41:08.614 › [UhkHidDevice] Available devices unchanged 07:41:08.868 › [UhkHidDevice] Devices before checking permission: 07:41:08.870 › [UhkHidDevice] Available devices unchanged 07:41:09.124 › [UhkHidDevice] Devices before checking permission: 07:41:09.126 › [UhkHidDevice] Available devices unchanged 07:41:09.380 › [UhkHidDevice] Devices before checking permission: 07:41:09.381 › [UhkHidDevice] Available devices unchanged 07:41:09.635 › [UhkHidDevice] Devices before checking permission: 07:41:09.637 › [UhkHidDevice] Available devices unchanged 07:41:09.793 › [WindowState] save settings: { x: 183, y: 388, width: 1280, height: 768, isMaximized: false, isFullScreen: false } 07:41:09.821 › [WindowState] save settings success 07:41:09.831 › [Electron Main] win closed 07:41:09.831 › [DeviceService] stop poll UHK Device 07:41:09.832 › [DeviceService] stopped poll UHK Device 07:41:09.832 › [DeviceService] Device connection checker stopped. 07:41:09.832 › [UhkHidDevice] Device communication closing. 07:41:09.832 › [SmartMacroService] stopping... 07:41:09.833 › [SmartMacroService] stopped.

ert78gb commented 4 months ago

Please, run the app image with the following arguments -- --print-usb-devices. The first 2 dash is important. And share the result with me.

Is the keyboard directly connecting to the computer or do you use any USB hub, KVM switch or other too?

lotusnopes commented 3 months ago

I usually use it with a monitor KVM, but I've tried it both ways, and received the same result each time. Here's the result of the preceding instructions: ./UHK.Agent-4.0.2-linux-x86_64.AppImage -- --print-usb-devices 19:13:37.134 › [Electron Main] command line arguments { 'print-usb-devices': true } 19:13:37.138 › [Electron Main] init services. 19:13:37.138 › [Electron Main] packagesDir: /tmp/.mount_UHK.AgSkZMru/resources []


ert78gb commented 3 months ago

Weird, the hid-raw library can't read the devices list. It is looks like a security settings does not allow to Agent to access to HID devices.

You wrote the 1.2.2 version of Agent recognises the keyboard. I compared the 1.2.2 and 1.2.3 and we did not do any devices communication related change or updated any dependency that could affect the communication.

07:41:02.522 › [DeviceService] Udev info: Ok looks like the udev rules are up to date.

Could you review your security settings? I think there is a setting that blocks the access of Agent.

lotusnopes commented 3 months ago

That makes sense, as if I run it with sudo it recognizes the keyboard, but the application screen is blank.

Per your request, I'm a bit confused as to what you'd like me to check; are you referring to apparmor settings, udev file permissions, etc?

ert78gb commented 3 months ago

Based on the logs your udev file is up-to-date [DeviceService] Udev info: Ok, but you can find the expected udev rules in https://github.com/UltimateHackingKeyboard/agent/blob/master/rules/50-uhk60.rules

Linux is a highly customisable operation system, so I can't help you what should you check.

If you share the logs when Agent runs under the super user maybe I could investigate what is the reason of the blank screen.

lotusnopes commented 3 months ago

I got it figured out. I ended up going back to Agent 1.2.1, flashing my firmware back to the old packaged firmware, then moving to 4.0.2 and updating from there. Thank you.