Skip to content

Commit

Permalink
Fix tcpserver for later firmware versions (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharee authored Sep 7, 2024
1 parent df59302 commit 91496e3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tcpserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const EOL = "\n";
const VERSION = "0.1.9";

// Configuration - start
const HOST = "0.0.0.0";
const PORT = 8124;
const EVENT_BUTTON = "button";
// Configuration - end
Expand Down Expand Up @@ -122,7 +123,7 @@ net.createServer(function (socket) {
buttons.on('buttonReady', buttonReadyHandler);
buttons.on('buttonAdded', buttonAddedHandler);

socket.setEncoding();
socket.setEncoding("utf8");

socket.on('end', function () {
console.log('Client disconnected: ' + socket.remoteAddress);
Expand Down Expand Up @@ -159,9 +160,9 @@ net.createServer(function (socket) {
}
});
});
}).listen(PORT, function () {
}).listen(PORT, HOST, function () {
console.log("Opened server on port: " + PORT);
});

console.log("The server should have started now!")
console.log("Waiting for connections...")
console.log("Waiting for connections...")

0 comments on commit 91496e3

Please sign in to comment.