Skip to content

Commit

Permalink
Startup changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kglovern committed Jul 30, 2024
1 parent 3689888 commit ea5a25e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/server/controllers/Grblhal/GrblHalController.js
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ class GrblHalController {
this.emit('grblHal:info', res);
});

this.runner.on('startup', (res) => {
this.runner.on('startup', async (res) => {
this.emit('serialport:read', res.raw);

// The startup message always prints upon startup, after a reset, or at program end.
Expand All @@ -924,6 +924,9 @@ class GrblHalController {
// Rewind any files in the sender
this.workflow.stop();

await delay(250);
this.connection.writeImmediate('$ES\n$ESH\n$EG\n$EA\n$spindles\n');

if (!this.initialized) {
this.initialized = true;

Expand Down Expand Up @@ -1333,8 +1336,6 @@ class GrblHalController {
this.connection.writeImmediate(String.fromCharCode(0x87));
await delay(100);
this.connection.write('$I\n');
await delay(250);
this.connection.writeImmediate('$ES\n$ESH\n$EG\n$EA\n$spindles\n');
}
let counter = 3;
const interval = setInterval(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class GrblHalLineParserResultGroupDetail {
label: r[3]
};

console.log(payload);

// Handle lookup for manual relabels of specific categories
if (Object.hasOwn(relabels, payload.label)) {
payload.label = relabels[payload.label];
Expand Down
2 changes: 1 addition & 1 deletion src/server/controllers/Grblhal/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const GRBLHAL_REALTIME_COMMANDS = {
VIRTUAL_STOP_TOGGLE: '\x88',
TOOL_CHANGE_ACK: '\xA3',
ERR_CLEAR: 'ErrClear',
GCODE_REPORT: String.fromCharCode(0x83),
GCODE_REPORT: '$G\n',
};

// https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.9
Expand Down

0 comments on commit ea5a25e

Please sign in to comment.