Coder Social home page Coder Social logo

Dbii Networks interface about tik4net HOT 19 CLOSED

danikf avatar danikf commented on July 20, 2024
Dbii Networks interface

from tik4net.

Comments (19)

danikf avatar danikf commented on July 20, 2024

from tik4net.

AsafMag avatar AsafMag commented on July 20, 2024
var redInterface = connection.LoadAll<InterfaceWireless>().First(wlan => wlan.Name == "red");

connection.Save(redInterface);

Have to say that I encountered many more problems with the library, including trap interrupted exceptions a second after I start a sniff command, strangely without any unusual bytes sent to TCP 8728 compared to other libraries in different languages.

from tik4net.

danikf avatar danikf commented on July 20, 2024

Hi,
I am not sure which version of library/mikrotik do you use, but I am 100% sure that your example works like a charm. I am using various versions of mikrotiks, but for unitesting I am using 6.10 version (virtual image).

Instead of sniffer I would recommend you to hook OnWriteRow event on connection to see what is going to the mikrotik router. See https://github.com/danikf/tik4net/wiki/Communication-debugging-&-testing

And finaly - if you want to achieve "standard" library behavior with full control of communication, you can use pure connection commands - see https://github.com/danikf/tik4net/wiki/Low-level-API

BTW - 8728 is standard port for mikrotik API and 'trap interupted' is standard behavior when you send bad request :-)

As last point - there could be problem with encoding some exotic characters (names/comments) - see https://github.com/danikf/tik4net/wiki/How-to-use-tik4net-library#how-to-encode-non-ascii-characters.

D

from tik4net.

AsafMag avatar AsafMag commented on July 20, 2024

I think this problem is specific to Dbii's interfaces http://www.dbii.com/f36N-PRO.html
I'll try to find some answers and update

from tik4net.

danikf avatar danikf commented on July 20, 2024

Hi,
you can try to use lowlevel API or use "usedFieldsFilter" (last optional parameter in Save method) to specify fields you have modified (to avoid "full save").
D

from tik4net.

AsafMag avatar AsafMag commented on July 20, 2024

I'm using it now, but it's pretty ugly - it makes the user have to know the underlying strings, which is a bad idea for a wrapping library in my opinion.

from tik4net.

danikf avatar danikf commented on July 20, 2024

from tik4net.

AsafMag avatar AsafMag commented on July 20, 2024

I think I figured the cause of the interrupted bug - both interfaces stop sniffing because of the done / interrupted response to the first one to finish (cancel).

I found that requesting a /cancel for a specific tag returns a trap interrupted for the tags of all the open sniffers. This is not the behavior in another library I use with a different language.

Do you have an idea on how to solve this? I know it is possible.

from tik4net.

danikf avatar danikf commented on July 20, 2024

from tik4net.

AsafMag avatar AsafMag commented on July 20, 2024

It is possible

from tik4net.

danikf avatar danikf commented on July 20, 2024

Hi,
not sure about sniffer (do you reallu use /tool/sniffer?), but /tool/torch seams to have "singleton" behavior by design.

  • Started cmd1, cmd2 (LoadAsync<ToolTorch>)
  • cmd2.Cancel
  • Result: both cmd1 and cmd2 cancelled by mikrotik (.tag seams to be ignored)

And in console script it looks like:

/tool/torch
=interface=ether1
.tag=1

/tool/torch
=interface=wlan1
.tag=2

!re
.....
.....

/cancel
=.tag=2
!trap
=category=2
=message=interrupted
.tag=1

!trap
=category=2
=message=interrupted
.tag=2

!done
.tag=1

!done
.tag=2

So - one cancel and two canceled commands ... And no exception/error callback from API. This is correct behavoir of API and understandable behavior of mikrotik router.

D

from tik4net.

RaelKbg avatar RaelKbg commented on July 20, 2024

Hi

when I'm trying to reset-counters im getting a 'no such command' error.

Please help, this is my code:
var cmd= connection.CreateCommandAndParameters("/tool/user-manager/user/reset-counters ", "?=numbers", txtreset.Text);

from tik4net.

danikf avatar danikf commented on July 20, 2024

Hi RaelKbg - please use your thread with proper name :-)

D

from tik4net.

RaelKbg avatar RaelKbg commented on July 20, 2024

Hi danikf

please specify. I used the same code to print where download-used > and it worked fine.

from tik4net.

danikf avatar danikf commented on July 20, 2024

Don't use Issue with name "Dbii Networks interface" dor discussion about different topic please ...

  • see my comment in issue #27
    D

from tik4net.

AsafMag avatar AsafMag commented on July 20, 2024

Hi,

Actually I use interface/wireless/sniffer/sniff

from tik4net.

AsafMag avatar AsafMag commented on July 20, 2024

? :-)

from tik4net.

RaelKbg avatar RaelKbg commented on July 20, 2024

Hi AsafMag

Im sorted thank you.

from tik4net.

AsafMag avatar AsafMag commented on July 20, 2024

About the sniffing cancellation - opened issue #35 , closing this one.

from tik4net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.