Skip to content

Commit

Permalink
Merge pull request #2503 from UltimateHackingKeyboard/feat-improve-fi…
Browse files Browse the repository at this point in the history
…rmware-update-failed

feat: improve update firmware failed instructions
  • Loading branch information
mondalaci authored Jan 19, 2025
2 parents 1b4cbf9 + 3e58f43 commit b8ef544
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 21 deletions.
10 changes: 10 additions & 0 deletions packages/uhk-common/src/models/hardware-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ export interface HardwareModules {
moduleInfos?: ModuleInfo[];
rightModuleInfo?: RightModuleInfo;
}

export function defaultHardwareModules() {
return {
moduleInfos: [],
rightModuleInfo: {
firmwareVersion: '',
modules: {}
}
};
}
1 change: 0 additions & 1 deletion packages/uhk-common/src/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export namespace Constants {
export const AGENT_GITHUB_URL = 'https://github.com/UltimateHackingKeyboard/agent';
export const AGENT_CONTRIBUTORS_GITHUB_PAGE_URL = 'https://github.com/UltimateHackingKeyboard/agent/graphs/contributors';
export const AGENT_CONTRIBUTORS_GITHUB_API_URL = 'https://api.github.com/repos/UltimateHackingKeyboard/agent/contributors';
export const FIRMWARE_GITHUB_ISSUE_URL = 'https://github.com/UltimateHackingKeyboard/agent/issues/new';
export const MAX_ALLOWED_MACROS = 255;
export const MAX_ALLOWED_MACROS_TOOLTIP = `No more than ${MAX_ALLOWED_MACROS} macros are supported.`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,26 @@ <h1>

<div *ngIf="firmwareUpgradeFailed" class="alert alert-danger" role="alert">
<p>
{{ upgradeType }} update failed. Reconnect your UHK over USB and retry.
{{ upgradeType }} update failed. Please try the following steps:
</p>

<ul>
<li>
Reconnect your UHK over USB and retry.
Disconnect and reconnect your UHK cable directly to a USB port on your computer and retry the update
</li>
<li>
If your UHK is connected via a USB hub, docking station, or KVM switch, connect it directly to your computer.
If using a USB hub, docking station, or KVM switch, connect the keyboard directly to your computer instead
</li>
<li>
It might help to join the keyboard halves during the update.
Close any virtual machine software like VMware or VirtualBox that might interfere with USB devices
</li>
<li>
If you're running any application that might capture USB devices, such as VMware or VirtualBox, please stop them.
If your UHK got bricked during the update, <a class="link-github" href="https://ultimatehackingkeyboard.com/knowledgebase?q=unbrick" externalUrl>unbrick it</a>
</li>
<li>
If you've tried the above and the update still keeps failing, please
<a class="link-github" [href]="firmwareGithubIssueUrl" externalUrl>create a GitHub issue</a>,
and attach the update log.
If the issue persists after trying these steps, please
<a class="link-github" href="https://github.com/UltimateHackingKeyboard/agent/issues/new" externalUrl>submit a GitHub issue</a>,
with your update log attached
</li>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, OnDestroy, ViewChild } from '@angular/cor
import { Store } from '@ngrx/store';
import { Observable, Subscription } from 'rxjs';
import { faCheck, faExclamation, faLongArrowAltRight, faSlidersH, faSpinner } from '@fortawesome/free-solid-svg-icons';
import { Constants, FirmwareUpgradeFailReason, UhkModule, VersionInformation } from 'uhk-common';
import { FirmwareUpgradeFailReason, UhkModule, VersionInformation } from 'uhk-common';

import {
AppState,
Expand Down Expand Up @@ -71,7 +71,6 @@ export class DeviceFirmwareComponent implements OnDestroy {
this.firmwareUpgradeSuccess = data;
this.scrollToTheEndOfTheLogs();
}));
this.firmwareGithubIssueUrl = Constants.FIRMWARE_GITHUB_ISSUE_URL;
}

ngOnDestroy(): void {
Expand Down
15 changes: 5 additions & 10 deletions packages/uhk-web/src/app/store/reducers/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
BackupUserConfiguration,
BackupUserConfigurationInfo,
ConfigSizesInfo,
defaultHardwareModules,
Dongle,
getDefaultHalvesInfo,
HalvesInfo,
Expand Down Expand Up @@ -69,13 +70,7 @@ export const initialState: State = {
saveToKeyboard: initProgressButtonState,
modifiedConfigWhileSaved: false,
savingToKeyboard: false,
modules: {
moduleInfos: [],
rightModuleInfo: {
firmwareVersion: '',
modules: {}
}
},
modules: defaultHardwareModules(),
restoringUserConfiguration: false,
backupUserConfiguration: {
info: BackupUserConfigurationInfo.Unknown
Expand Down Expand Up @@ -139,7 +134,7 @@ export function reducer(state = initialState, action: Action): State {
halvesInfo: data.halvesInfo,
leftHalfBootloaderActive: data.leftHalfBootloaderActive,
leftHalfDetected: data.leftHalfDetected,
modules: data.hardwareModules,
modules: data.hardwareModules || defaultHardwareModules(),
multiDevice: data.multiDevice,
udevRuleInfo: data.udevRulesInfo,
};
Expand Down Expand Up @@ -234,13 +229,13 @@ export function reducer(state = initialState, action: Action): State {
case Device.ActionTypes.UpdateFirmwareFailed:
return {
...state,
modules: (action as Device.UpdateFirmwareFailedAction).payload.modules
modules: (action as Device.UpdateFirmwareFailedAction).payload.modules || defaultHardwareModules(),
};

case Device.ActionTypes.ModulesInfoLoaded:
return {
...state,
modules: (action as Device.HardwareModulesLoadedAction).payload
modules: (action as Device.HardwareModulesLoadedAction).payload || defaultHardwareModules(),
};

case Device.ActionTypes.ResetUserConfiguration:
Expand Down

0 comments on commit b8ef544

Please sign in to comment.