Trakkasure / mikronode

Mikrotik API for Node
242 stars 97 forks source link

read ECONNRESET error #100

Open melsonmascarenhas opened 4 years ago

melsonmascarenhas commented 4 years ago

i want to print interface


try {
  var connection = MikroNode.getConnection("192.168.1.168", "admin", "admin");

  connection.connect(function (conn) {
    conn.closeOnDone = true;
    var chan2 = conn.openChannel(2);
    chan2.write("/interface/print", function (chan) {
      chan.on("read", function (data) {
        packet = MikroNode.parseItems(data);
        console.log("Interface change: " + JSON.stringify(packet));
      });
    });
  });
} catch (error) {}```
**Getting this error**
```Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:205:27)
Emitted 'error' event on Channel instance at:
    at Channel.errorListener (D:\mikrotik\node_modules\mikronode-ng\lib\channel.js:205:8)
    at Connection.madeListener (D:\mikrotik\node_modules\mikronode-ng\lib\utils.js:173:8)
    at Object.onceWrapper (events.js:417:26)
    at Connection.emit (events.js:310:20)
    at Socket.<anonymous> (D:\mikrotik\node_modules\mikronode-ng\lib\connection.js:503:10)
    at Socket.emit (events.js:310:20)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'read'
}```
0x133337 commented 2 years ago

same problem, you have resolved the issue?