Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: increase response timeout to 30 seconds and maximum to 60 seconds #6378

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/zwave-js/src/lib/driver/Driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ const defaultOptions: ZWaveOptions = {
timeouts: {
ack: 1000,
byte: 150,
response: 10000,
// Ideally we'd want to have this as low as possible, but some
// 500 series controllers can take upwards of 10 seconds to respond sometimes.
response: 30000,
report: 1000, // ReportTime timeout SHOULD be set to CommandTime + 1 second
nonce: 5000,
sendDataCallback: 65000, // as defined in INS13954
Expand Down Expand Up @@ -297,9 +299,9 @@ function checkOptions(options: ZWaveOptions): void {
ZWaveErrorCodes.Driver_InvalidOptions,
);
}
if (options.timeouts.response < 500 || options.timeouts.response > 20000) {
if (options.timeouts.response < 500 || options.timeouts.response > 60000) {
throw new ZWaveError(
`The Response timeout must be between 500 and 20000 milliseconds!`,
`The Response timeout must be between 500 and 60000 milliseconds!`,
ZWaveErrorCodes.Driver_InvalidOptions,
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/zwave-js/src/lib/driver/ZWaveOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ZWaveOptions extends ZWaveHostOptions {
* How long to wait for a controller response. Usually this timeout should never elapse,
* so this is merely a safeguard against the driver stalling.
*/
response: number; // [500...20000], default: 10000 ms
response: number; // [500...60000], default: 30000 ms

/** How long to wait for a callback from the host for a SendData[Multicast]Request */
sendDataCallback: number; // >=10000, default: 65000 ms
Expand Down