Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.
Merged
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
18 changes: 13 additions & 5 deletions packages/server/src/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,23 @@ export function initializeWs(server: HttpServer) {
});
}

// Find the PROVESKit serial port
const PROVESKIT_PIDS = {
OLD_V4: "0011",
V4: "e004",
};

// Find a valid PROVESKit serial port
async function findDevicePort() {
const bindings = autoDetect();

try {
const ports = await bindings.list();
const device = ports.find((port) => {
// check for the proveskit vendorId and productId
return port.vendorId === "1209" && port.productId === "0011";
// Check for a valid productId
return (
port.vendorId === "1209" &&
Object.values(PROVESKIT_PIDS).includes(port.productId ?? "")
);
});

if (device) {
Expand Down Expand Up @@ -196,10 +204,10 @@ async function loopUntilUsbConnected() {
break;
}

await new Promise((res) => setTimeout(res, 5000));
await new Promise((res) => setTimeout(res, 1000));
} catch (e) {
console.error("Failed to check for USB devices: ", e);
await new Promise((res) => setTimeout(res, 5000));
await new Promise((res) => setTimeout(res, 1000));
}
}
}