Claude Ultracode Fixes

This commit is contained in:
chk
2026-06-08 18:17:53 +02:00
parent 7595bae8a1
commit 10d306b7d4
9 changed files with 46 additions and 14 deletions

View File

@@ -10219,3 +10219,17 @@
2026-06-08T15:25:42.319Z ::ffff:127.0.0.1: M114 2026-06-08T15:25:42.319Z ::ffff:127.0.0.1: M114
2026-06-08T15:25:53.707Z ::ffff:127.0.0.1: M114 2026-06-08T15:25:53.707Z ::ffff:127.0.0.1: M114
2026-06-08T15:25:59.281Z ::ffff:127.0.0.1: M114 2026-06-08T15:25:59.281Z ::ffff:127.0.0.1: M114
2026-06-08T16:15:02.308Z ::ffff:127.0.0.1: M114
2026-06-08T16:15:02.316Z ::ffff:127.0.0.1: G1 X1 Y2 Z3
2026-06-08T16:15:09.917Z ::ffff:127.0.0.1: M114
2026-06-08T16:15:09.925Z ::ffff:127.0.0.1: G1 X1 Y2 Z3
2026-06-08T16:15:18.670Z ::ffff:127.0.0.1: M114
2026-06-08T16:15:18.679Z ::ffff:127.0.0.1: G1 X1 Y2 Z3
2026-06-08T16:15:23.488Z ::ffff:127.0.0.1: M114
2026-06-08T16:15:23.495Z ::ffff:127.0.0.1: G1 X1 Y2 Z3
2026-06-08T16:15:31.077Z ::ffff:127.0.0.1: M114
2026-06-08T16:15:31.094Z ::ffff:127.0.0.1: G1 X1 Y2 Z3
2026-06-08T16:16:38.041Z ::ffff:127.0.0.1: M114
2026-06-08T16:16:38.051Z ::ffff:127.0.0.1: G1 X1 Y2 Z3
2026-06-08T16:17:00.361Z ::ffff:127.0.0.1: M114
2026-06-08T16:17:00.370Z ::ffff:127.0.0.1: G1 X1 Y2 Z3

View File

@@ -14559,3 +14559,10 @@
2026-06-08T15:25:42.307Z ::ffff:127.0.0.1 : Ping 2026-06-08T15:25:42.307Z ::ffff:127.0.0.1 : Ping
2026-06-08T15:25:53.690Z ::ffff:127.0.0.1 : Ping 2026-06-08T15:25:53.690Z ::ffff:127.0.0.1 : Ping
2026-06-08T15:25:59.273Z ::ffff:127.0.0.1 : Ping 2026-06-08T15:25:59.273Z ::ffff:127.0.0.1 : Ping
2026-06-08T16:15:02.289Z ::ffff:127.0.0.1 : Ping
2026-06-08T16:15:09.896Z ::ffff:127.0.0.1 : Ping
2026-06-08T16:15:18.652Z ::ffff:127.0.0.1 : Ping
2026-06-08T16:15:23.464Z ::ffff:127.0.0.1 : Ping
2026-06-08T16:15:31.061Z ::ffff:127.0.0.1 : Ping
2026-06-08T16:16:38.024Z ::ffff:127.0.0.1 : Ping
2026-06-08T16:17:00.351Z ::ffff:127.0.0.1 : Ping

View File

@@ -57,8 +57,10 @@ document.addEventListener('DOMContentLoaded', function() {
sendersUl.innerHTML = ''; sendersUl.innerHTML = '';
data.senders.forEach(sender => { data.senders.forEach(sender => {
const li = document.createElement('li'); const li = document.createElement('li');
li.textContent = `${sender.name}: ${sender.state}`; const state = sender.state || 'disconnected';
li.classList.add((sender.health || 'disconnected').toLowerCase()); const label = sender.url ? `${sender.name} (${sender.url}): ${state}` : `${sender.name}: ${state}`;
li.textContent = label;
li.classList.add(state.toLowerCase());
sendersUl.appendChild(li); sendersUl.appendChild(li);
}); });

View File

@@ -121,6 +121,12 @@ h1 {
content: "⛔"; content: "⛔";
} }
/* 🟡 CONNECTING / RECONNECTING */
.section#senders li.connecting::before,
.section#senders li.reconnecting::before {
content: "🟡";
}
.state-grid { .state-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(25px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(25px, 1fr));

View File

@@ -387,7 +387,7 @@ module.exports = class TelnetSenderGRBL extends SenderInterface {
// abhngig vom FluidNC und dessen speed interpretation ist. // abhngig vom FluidNC und dessen speed interpretation ist.
} }
if(data.indexOf("G90") == -1 && data.indexOf("G1 ") > 0){ if(data.indexOf("G90") == -1 && data.indexOf("G1 ") !== -1){
data = "G90 " + data; data = "G90 " + data;
} }

View File

@@ -387,8 +387,8 @@ module.exports = class WSSenderGrbl extends SenderInterface {
data += " f" + (this.maxSpeedF.toFixed(2).toString()); data += " f" + (this.maxSpeedF.toFixed(2).toString());
if (data.length > 3) { if (this.ws && data.length > 3) {
if (data.indexOf("G90") == -1) { if (data.indexOf("G90") == -1 && data.indexOf("G1 ") !== -1) {
data = "G90 " + data; data = "G90 " + data;
} }
console.log("Driver send to 🤖 " + this.urlGRBLstr + " the message: " + data); console.log("Driver send to 🤖 " + this.urlGRBLstr + " the message: " + data);

View File

@@ -29,6 +29,7 @@ function initInputWS(server, robot, GCode, sharedState) {
/* ---------- GCode ---------- */ /* ---------- GCode ---------- */
if (GCode.containsCommand(message)) { if (GCode.containsCommand(message)) {
console.log("🔵 GCode.receiveGCode: Incoming command: " + message); console.log("🔵 GCode.receiveGCode: Incoming command: " + message);
logCommand(sharedState, clientIP, message);
GCode.receiveGCode(robot, message); GCode.receiveGCode(robot, message);
broadcast(wss, GCode.getM114(robot)); broadcast(wss, GCode.getM114(robot));
return; return;

View File

@@ -99,11 +99,13 @@ function createApp(options = {}) {
consoleObj.warn(`Startup warning: ${disconnectedSenders.length} sender(s) disconnected at startup.`); consoleObj.warn(`Startup warning: ${disconnectedSenders.length} sender(s) disconnected at startup.`);
} }
setTimeoutFn(() => { // Register all senders as command receivers immediately and permanently.
senders.forEach(s => { // Each sender's execCommand() guards internally against sending while it is
if (s.instance?.tSocket) robot.cmdReceivers.push(s.instance); // disconnected, and resumes automatically once it (re)connects — so there is
}); // no need to wait for a socket or to re-register after a reconnect. The old
}, 5000); // 5s one-shot registration silently dropped senders that connected later
// (e.g. after EHOSTUNREACH backoff) and never registered WebSocket senders.
senders.forEach(s => robot.cmdReceivers.push(s.instance));
const port = Number(processEnv.PORT) || 2095; const port = Number(processEnv.PORT) || 2095;
httpsServer.listen(port); httpsServer.listen(port);

View File

@@ -25,8 +25,8 @@ describe("TelnetSenderGRBL.execCommand", () => {
sender.execCommand("G1", mOld, mNew); sender.execCommand("G1", mOld, mNew);
// ✅ verify output // ✅ verify output — G1 moves must be sent in absolute mode (G90 prefix)
expect(sender.tSocket.written).toBe("G1 x12.34 y90.00 z-90.00 f2300.00\r\n"); expect(sender.tSocket.written).toBe("G90 G1 x12.34 y90.00 z-90.00 f2300.00\r\n");
}); });
@@ -54,8 +54,8 @@ describe("TelnetSenderGRBL.execCommand", () => {
sender.execCommand("G1", mOld, mNew); sender.execCommand("G1", mOld, mNew);
// ✅ verify output // ✅ verify output — G1 moves must be sent in absolute mode (G90 prefix)
expect(sender.tSocket.written).toBe("G1 x22.50 f2300.00\r\n"); expect(sender.tSocket.written).toBe("G90 G1 x22.50 f2300.00\r\n");
}); });
test("writes correct G-code G92 to mocked tSocket", () => { test("writes correct G-code G92 to mocked tSocket", () => {