File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,8 +34,10 @@ class Connection extends EventEmitter {
3434 return ;
3535 }
3636
37- const grblR = data . match ( / .* G r b l .* / i) ;
38- const grblHalR = data . match ( / .* ( g r b l H A L | G r b l H A L ) .* / 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 ( / .* ( g r b l | f l u i d n c ) .* / i) ;
40+ const grblHalR = data . match ( / .* ( g r b l h a l ) .* / 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 } ;
You can’t perform that action at this time.
0 commit comments