Repository navigation
feat(serial): desktop port chooser and xTool firmware support (PRs #3 and #4) - #7
Merged
Merged
Conversation
xTool's controllers answer GRBL commands but differ in ways that left the D1 connected yet unable to move: - input is line based, so the bare '?' poll corrupted the next command; - '$J=' jogs are acknowledged but ignored, and motion only runs after an M2 program end (which is how LightBurn jogs it); - status reports carry no state word and come with an extra 'ok'; - 'ok:IDLE' / 'ok:512' chatter is not an acknowledgement. The dialect lives in serial/dialect.ts. On connect the machine sends $I and switches to the xTool command set only when the controller answers '[XTool ...]'; otherwise, or if nothing answers within 1.5 s, it behaves as before. A new Firmware device setting (Auto-detect / GRBL / xTool) lets users force either dialect; GRBL skips the $I entirely. Verified on an xTool D1 (fw 40.30.002.01): connect, status and jog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The desktop build answered Electron's select-serial-port event itself, taking the first port whose name contained "tty". On Linux that is often the motherboard UART (/dev/ttyS0), so the app reported "connected" while GCode went nowhere, and the user never saw which port was used. - Forward the port list to a renderer dialog that shows OS port names, preselects the USB adapter and flags built-in UARTs. - Show the chosen port name in the Laser panel and the port dropdown. - Disconnect now cancels the pending read so the port actually closes. - Serialize writes so a status poll overlapping a command no longer fails on the locked writer and drops the connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings pkkid's fix/serial-port-selection (2e95336) into main. The desktop build used to answer Electron's select-serial-port event by picking the first port whose name matched /usb|tty|acm|serial/, which on Linux is usually the motherboard UART (/dev/ttyS0): the app reported 'connected' while GCode went nowhere. - A renderer dialog lists the real ports with their USB chip and hides built-in UARTs behind 'Show N built-in ports'. - Disconnect cancels the pending read so the port actually closes. - Writes are serialised so a status poll overlapping a command no longer fails on the locked writer and drops the connection. Verified locally: typecheck clean, 256/256 unit tests (22 new in src/serial, SerialPortDialog.test.tsx and electron/serialPort.test.ts).
Brings pkkid's feat/xtool-firmware (d0af971) on top of PR #3. xTool's controllers answer GRBL commands but differ in ways that left the D1 connected yet unable to move: '?' corrupts the next line, '$J=' jogs are ignored until M2, status reports carry no state word and 'ok:IDLE' chatter is not an acknowledgement. - New src/serial/dialect.ts (poll, jog, chatter, identification). - On connect the machine sends $I and switches to the xTool command set only when the controller answers '[XTool ...]'; 1.5 s fallback. - New Firmware device setting (Auto-detect / GRBL / xTool). Conflict resolution: src/serial/machine.ts keeps the port-name argument from PR #3 and adds the firmware assignment from PR #4; TODO.md keeps the xTool limitation note and drops the 'auto-selects the first port' note that PR #3 already fixes. Verified: typecheck clean, 289/289 tests in 41 files.
…ration Tie the two merged PRs together in user-facing docs: - CHANGELOG [Unreleased]: xTool firmware and the desktop port chooser under Added, the ttyS0 / disconnect / locked-writer bugs under Fixed, the xTool M2 limitation, and credit to @pkkid. - README and README.es: the port chooser and xTool detection in the GRBL control section. - ARCHITECTURE: xTool status polling and the M2 caveat next to the pause and stop commands. - TODO: a Serial/firmware block with the remaining follow-ups (port chooser e2e, hardware verification on xTool, migration test for openburn.device). Verified: npm run typecheck, npm run test (289/289) and npm run build.
This was referenced Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrates the two open pull requests from @pkkid's fork, reviewed and combined locally.
What this brings
Serial port chooser (PR #3,
2e95336)The desktop build answered Electron's
select-serial-portevent by picking the first port whose name matched/usb|tty|acm|serial/. On Linux that is usually the motherboard UART (/dev/ttyS0), so the app reported "connected" while GCode went nowhere and the user never saw which port was used.electron/serialPort.ts: USB chip catalogue (CH340, FTDI, CP210x, PL2303, Arduino…), apickSerialPortthat never recommendsttyS*/Bluetooth, and aSerialPortBrokerrouting the choice to the renderer over IPC.src/ui/SerialPortDialog.tsx: lists the real OS ports with the chip name, preselects the USB adapter and hides built-in UARTs behind Show N built-in ports.xTool firmware (PR #4,
d0af971)xTool controllers answer GRBL commands but differ: a bare
?corrupts the next line,$J=jogs are ignored untilM2, status reports carry no state word andok:IDLEchatter is not an acknowledgement.src/serial/dialect.ts(poll, jog, chatter, identification).$Iand switches to the xTool command set only when the controller answers[XTool …], with a 1.5 s fallback to stock GRBL.Docs
CHANGELOG [Unreleased],README.md/README.es.md,docs/USAGE.md,docs/ARCHITECTURE.mdand a Serial / firmware block inTODO.md.Conflict resolution
src/serial/machine.tskeeps the port-name argument from fix(serial): let users pick the laser's port instead of silently using ttyS0 #3 and adds the firmware assignment from feat(serial): make xTool lasers (D1) move by speaking their GRBL dialect #4.TODO.mdkeeps the xTool limitation note and drops the "auto-selects the first port" note that fix(serial): let users pick the laser's port instead of silently using ttyS0 #3 already fixes.Verification
npm run typechecknpm run test— 289/289 tests in 41 filesnpm run buildnpx playwright test e2e/app.spec.ts— 4/4 (headless Electron)sh scripts/flatpak-local.sh+flatpak info io.github.SJLS27.OpenBurnpackage-lock.jsonandflatpak/node-sources.jsonare untouchedKnown limitation
xTool was only verified on connect and jog (D1, fw 40.30.002.01). The firmware commits motion on
M2, so job progress can run ahead of the head, and Pause/Stop (!,~,Ctrl+X) is unverified. Tracked inTODO.md.Follow-ups (not in this PR)
select-serial-portin the main process).openburn.devicewithoutfirmware.Closes #3
Closes #4