Skip to content

Commit 1e1fcc2

Browse files
committed
Merge branch 'connection_flow_fixes_tests'
2 parents 4009506 + 44fe1b3 commit 1e1fcc2

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/server/lib/Connection.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ class Connection extends EventEmitter {
3434
return;
3535
}
3636

37-
const grblR = data.match(/.*Grbl.*/i);
38-
const grblHalR = data.match(/.*(grblHAL|GrblHAL).*/i);
37+
// Note - Do we need two grblHAL clauses if we're using i insensitive flag? - ie grblHAL|GrblHAL
38+
// https://regex101.com/r/oPVkkF/1
39+
const grblR = data.match(/.*(grbl|fluidnc).*/i);
40+
const grblHalR = data.match(/.*(grblhal).*/i);
3941

4042
if (grblHalR) {
4143
this.controllerType = GRBLHAL;
@@ -181,6 +183,7 @@ class Connection extends EventEmitter {
181183
this.callback,
182184
);
183185
} else if (!this.controllerType) {
186+
this.connection.writeImmediate('$I\n');
184187
this.timeout = setInterval(() => {
185188
if (this.count >= 5) {
186189
this.controllerType = this.options.defaultFirmware;
@@ -193,9 +196,9 @@ class Connection extends EventEmitter {
193196
clearInterval(this.timeout);
194197
return;
195198
}
196-
this.connection.writeImmediate('$I\n');
199+
this.connection.writeImmediate('\x18');
197200
this.count++;
198-
}, 1000);
201+
}, 800);
199202
}
200203
});
201204
};

0 commit comments

Comments
 (0)