Skip to content

Commit

Permalink
test dtr
Browse files Browse the repository at this point in the history
  • Loading branch information
petervanderwalt committed Apr 25, 2024
1 parent bdba80a commit 1459fd6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/js/jog.js
Expand Up @@ -404,7 +404,7 @@ $(document).ready(function() {


$('.xM').on('touchstart mousedown', function(ev) {
console.log(ev)
//console.log(ev)
if (ev.which > 1) {
return
}
Expand Down
29 changes: 10 additions & 19 deletions index.js
Expand Up @@ -38,12 +38,6 @@ if (process.env.DEBUGCONTROL) {
console.log("Console Debugging Enabled")
}

FORCECONNECTION = false
if (process.env.FORCECONNECTION) {
FORCECONNECTION = true;
console.log("Forced Firmware Connection")
}

function debug_log() {
if (DEBUG) {
console.log.apply(this, arguments);
Expand Down Expand Up @@ -1142,8 +1136,16 @@ io.on("connection", function(socket) {
port = new SerialPort({
path: data.port,
baudRate: parseInt(data.baud),
autoOpen: false
//hupcl: false // Don't set DTR - useful for X32 Reset
});
port.set({
setOptions: {
dtr: true,
rts: true
}
})
port.open()
} else if (data.type == "telnet") {
console.log("connect", "Connecting to " + data.ip + " via " + data.type);
port = net.connect(23, data.ip);
Expand Down Expand Up @@ -1250,26 +1252,15 @@ io.on("connection", function(socket) {

setTimeout(function() {

if (FORCECONNECTION || status.machine.firmware.type.length > 1) {
if (FORCECONNECTION || status.machine.firmware.type === "grbl") {
if (status.machine.firmware.type.length > 1) {
if (status.machine.firmware.type === "grbl") {
debug_log("GRBL detected");
var output = {
'command': 'connect',
'response': "Detecting Firmware: Detected Grbl Succesfully",
'type': 'info'
}
if (FORCECONNECTION) {
status.machine.firmware.type = "grbl";
status.machine.firmware.platform = "grblHAL"
status.machine.firmware.version = "1.1f"; // get version
var output = {
'command': 'connect',
'response': "FORCED CONNECTION",
'type': 'info'
}
io.sockets.emit('data', output);

}
setTimeout(function() {
io.sockets.emit('grbl', status.machine.firmware)
//v1.0.318 - commented out as a test - too many normal alarms clear prematurely
Expand Down

0 comments on commit 1459fd6

Please sign in to comment.