-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new login (choose between pre-v6.43 and post-v6.43 (post-v6.43 by default)) #97
base: release
Are you sure you want to change the base?
Conversation
It would be great to merge and publish this fix. Today is this libary almost unusable without support of new login API 🙏 |
@nunokisc Hi how can I use this fix ? Below are my dependencies
And heres my sample code. connection.connect(function(conn) {
conn.closeOnDone(true);
var chan2=conn.openChannel(2);
chan2.write('/interface/listen',function(chan) {
chan.on('read',function(data) {
packet=api.parseItems([data])[0];
console.log('Interface change: '+JSON.stringify(packet));
});
});
}); And got this error internal/timers.js:361
throw new ERR_OUT_OF_RANGE(name, 'a non-negative finite number', msecs);
^
RangeError [ERR_OUT_OF_RANGE]: The value of "msecs" is out of range. It must be a non-negative finite number. Received NaN
�[90m at getTimerDuration (internal/timers.js:361:11)�[39m
�[90m at Socket.setStreamTimeout [as setTimeout] (internal/stream_base_commons.js:227:11)�[39m
at SocketStream.setTimeout (E:\Projects\mikrotek-test\node_modules\�[4mmikronode�[24m\dist\mikronode.js:577:32)
at new SocketStream (E:\Projects\mikrotek-test\node_modules\�[4mmikronode�[24m\dist\mikronode.js:550:15)
at MikroNode.connect (E:\Projects\mikrotek-test\node_modules\�[4mmikronode�[24m\dist\mikronode.js:330:30)
at Object.<anonymous> (E:\Projects\mikrotek-test\index.js:5:12)
�[90m at Module._compile (internal/modules/cjs/loader.js:959:30)�[39m
�[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)�[39m
�[90m at Module.load (internal/modules/cjs/loader.js:815:32)�[39m
�[90m at Function.Module._load (internal/modules/cjs/loader.js:727:14)�[39m {
code: �[32m'ERR_OUT_OF_RANGE'�[39m
} |
This fix is only for the login issue. The login method change on v6.43. |
I don't have permission to approve your commit , My permission is maintainer may be we should have to fork this project because the maintainer didn't update project for a long time. |
Any news on this fix? It's almost mandatory on 07/2021 |
22 Ağu 2021 Paz 12:54 tarihinde fajarnurprasetyo ***@***.***>
şunu yazdı:
… ***@***.**** approved this pull request.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#97 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQ4GCCG3TFGCOG2TFZM6UR3T6DCM7ANCNFSM4KMCT7QA>
.
|
Guys! If you wanna fix connection with mikrotik via API: https://help.mikrotik.com/docs/display/ROS/API:
Just open your file /node_modules/mikronode/dist/mikronode.js var MikroNode = require('mikronode'); var device = new MikroNode('IP'); device.setDebug(MikroNode.DEBUG); device.connect().then(([login])=>login('username','password')).then(function(conn) { var chan=conn.openChannel(); chan.write('/ip/address/add',{'interface':'ether1','address':'192.168.1.1'}); My version RouterOS now is 6.47. Hope this helps someone! |
Changing it to post-v6.43 the password will be sent to the network in plain text. As result, this is not good when using Mikrotik API. |
No description provided.