UltimateHackingKeyboard / agent

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

'Save to Keyboard' Not Working #2219

Closed the-andrewblackman closed 3 months ago

the-andrewblackman commented 3 months ago

I updated to the newest Agent 4.0.2 and flashed to newest firmware 11.0. Both halves say 11.0 but when I change something on keyboard and click "Save to Keyboard", I get the message "Communications error with UHK. Response code: undefined" and the keyboard is unresponsive.

I have to unplug for it to respond again. The keyboard is usable, I just can't change anything on it. When I use a macro that used to work which would untoggle a layer back to mod, ERR flashes in the left halves LED and I see the error in Agent:

About

WIN / switch to BASE map set doubletapTimeout 300 unToggleLayer mod

Error at WIN / switch to BASE map 1/2/15: Unrecognized command: mod> 2 | unToggleLayer mod

I try to turn off the macro, thinking it's the problem, click 'Save to Keyboard' and I'm back to an unresponsive keyboard.

So I reflash and get this in the update log:

Start flashing firmware [DeviceService] Operating system: Darwin 20.6.0 x64 [DeviceService] Agent version: 4.0.2 [DeviceService] New firmware version: 11.0.0 [DeviceService] New firmware user config version: 7.0.0 [DeviceService] stop poll UHK Device [DeviceService] stopped poll UHK Device [DeviceOperation] right module deviceProtocolVersion: 4.10.0 [DeviceOperation] Read "leftHalf" version information [DeviceOperation] Read "leftHalf" repo information [DeviceOperation] Read "leftHalf" firmware checksum [DeviceService] UHK Device firmware upgrade starts: {"id":2,"name":"UHK 60 v2","vendorId":"0x1D50","keyboardPid":"0x6124","bootloaderPid":"0x6123","buspalPid":"0x6121"} [DeviceService] Device right firmware version: 11.0.0 [UhkOperations] Start flashing right firmware [UhkOperations] Reenumerate bootloader [UhkHidDevice] Start reenumeration, mode: Bootloader, timeout: 5000ms [UhkHidDevice] Could not find reenumerated device: Bootloader. Waiting... [UhkHidDevice] Available devices changed. [UhkHidDevice] Removed: {"vendorId":"0x1D50","productId":"0x6124","path":"DevSrvsID:4295047085","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v2","release":258,"interface":1,"usagePage":1,"usage":2} [UhkHidDevice] Removed: {"vendorId":"0x1D50","productId":"0x6124","path":"DevSrvsID:4295047089","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v2","release":258,"interface":0,"usagePage":1,"usage":6} [UhkHidDevice] Removed: {"vendorId":"0x1D50","productId":"0x6124","path":"DevSrvsID:4295047090","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v2","release":258,"interface":3,"usagePage":1,"usage":128} [UhkHidDevice] Removed: {"vendorId":"0x1D50","productId":"0x6124","path":"DevSrvsID:4295047087","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v2","release":258,"interface":2,"usagePage":12,"usage":1} [UhkHidDevice] Removed: {"vendorId":"0x1D50","productId":"0x6124","path":"DevSrvsID:4295047095","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v2","release":258,"interface":4,"usagePage":65280,"usage":1} [UhkHidDevice] Could not find reenumerated device: Bootloader. Waiting... [UhkHidDevice] Reenumerating devices [UhkHidDevice] Device communication closing. [UhkHidDevice] Device communication closed. [UhkOperations] Waiting for bootloader [UhkOperations] Flash security disable [UhkOperations] Flash erase region [UhkOperations] Read RIGHT firmware from file [UhkOperations] Write memory [UhkOperations] Reset bootloader [UhkOperations] Close communication channels [UhkOperations] Right firmware successfully flashed [DeviceService] Waiting for keyboard [UhkHidDevice] Available devices changed. [UhkHidDevice] Added: {"vendorId":"0x1D50","productId":"0x6124","path":"DevSrvsID:4295047571","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v2","release":258,"interface":3,"usagePage":1,"usage":128} [UhkHidDevice] Added: {"vendorId":"0x1D50","productId":"0x6124","path":"DevSrvsID:4295047572","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v2","release":258,"interface":0,"usagePage":1,"usage":6} [UhkHidDevice] Added: {"vendorId":"0x1D50","productId":"0x6124","path":"DevSrvsID:4295047577","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v2","release":258,"interface":4,"usagePage":65280,"usage":1} [UhkHidDevice] Added: {"vendorId":"0x1D50","productId":"0x6124","path":"DevSrvsID:4295047569","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v2","release":258,"interface":2,"usagePage":12,"usage":1} [UhkHidDevice] Used device: {"vendorId":"0x1D50","productId":"0x6124","path":"DevSrvsID:4295047577","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v2","release":258,"interface":4,"usagePage":65280,"usage":1} [DeviceOperation] right module deviceProtocolVersion: 4.10.0 [DeviceOperation] Read "leftHalf" version information [DeviceOperation] Read "leftHalf" repo information [DeviceOperation] Read "leftHalf" firmware checksum [DeviceService] User configuration will be saved after right module firmware upgrade [DeviceOperation] Transferring error Error: Communications error with UHK. Response code: undefined at /Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:604190 [UhkHidDevice] Device communication closing. [UhkHidDevice] Device communication closed. [DeviceService] updateFirmware error {"message":"Communications error with UHK. Response code: undefined","stack":"Error: Communications error with UHK. Response code: undefined\n at /Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:604190"} [UhkHidDevice] Available devices unchanged [UhkHidDevice] Used device: {"vendorId":"0x1D50","productId":"0x6124","path":"DevSrvsID:4295047577","serialNumber":"","manufacturer":"Ultimate Gadget Laboratories","product":"UHK 60 v2","release":258,"interface":4,"usagePage":65280,"usage":1} [UhkHidDevice] Transfer error: TypeError: Cannot write to hid device at /Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:604068 at new Promise () at Object.write (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:603867) at Object.getDeviceState (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:606596) at Object.waitUntilKeyboardBusy (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:615945) at li.getHardwareModules (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:500310) at li.updateFirmware (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:506247) at async Cr.process (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:477460) [UhkHidDevice] Device communication closing. [UhkHidDevice] Device communication closed. [DeviceService] Read hardware modules information failed TypeError: Cannot write to hid device at /Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:604068 at new Promise () at Object.write (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:603867) at Object.getDeviceState (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:606596) at Object.waitUntilKeyboardBusy (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:615945) at li.getHardwareModules (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:500310) at li.updateFirmware (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:506247) at async Cr.process (/Applications/UHK Agent.app/Contents/Resources/app.asar/electron-main.js:2:477460) [DeviceService] start poll UHK Device Communications error with UHK. Response code: undefined

kareltucek commented 3 months ago

As to the macro... unToggleLayer does not take a parameter. New firmware is just more strict about checking leftover tokens than the older firmwares were. So just replace unToggleLayer mod with untoggleLayer. (The new spelling is prefered nowadays, but both should work.)

But just having an error in your macro syntax shouldn't make UHK unresponsive.

I don't know what is wrong though. If this happened to me, I would:

kareltucek commented 3 months ago

If you restart Agent, does it load UHK fine?

the-andrewblackman commented 3 months ago

Yes, UHK loads fine if restarted.

Just tried saving config, resetting config, reflashed the firmware. Now keyboard is in default state. When I import the saved config and save to keyboard it still gives me the "Communications error with UHK. Response code: undefined" I also went into JSON file, and deleted the command steps for that macro, and saved it. And tried to import that, but got the same result.

In default state I am able to save anything I do.

kareltucek commented 3 months ago

So saving default config works, but saving your imported config does not?

Can you post that UserConfig?

the-andrewblackman commented 3 months ago

Sorry. Thanks for the help, btw UserConfiguration.txt

kareltucek commented 3 months ago

Good news! Can reproduce it, found the problem, and fixed it.

Will be fixed in next firmware release. Meanwhile, please flash uhk-firmware-11.0.1-fix_unresponsive_ifgesture_tag.tar.gz.

Thanks for report!

the-andrewblackman commented 3 months ago

It works now, thankyou so much!!