I am working with a Numato relay, and I try to connect to it via telnet using javascript with net.Socket, and then send commands.
However, when trying to connect, it rejects the username and password. The problem is that strange characters are entered after entering the username.
In the code you can see that I tried to look at the outputs in various ways, with no results.
If anyone knows why or has worked with Numato modules I would appreciate any help. Here is the code and its output:
var net = require('net');
var client = new net.Socket();
client.connect(23, '192.168.1.100', function() {
console.log('Connected');
});
client.on('connect', function(){
client.write('admin\n')
client.write('admin\n')
// client.write('admin\n' + 'admin\n')
})
client.on('data', function(data) {
console.log(''+data)
// var datos = []
// datos.push(data)
// datos.push(data.toJSON)
// console.log(datos)
// client.destroy(); // kill client after server's response
});
client.on('close', function() {
console.log('Connection closed');
});