Community discussions

MikroTik App
 
tomswenson
Member Candidate
Member Candidate
Topic Author
Posts: 115
Joined: Wed Apr 13, 2005 11:17 pm

How to access tdma settings in a script

Tue Apr 19, 2011 10:50 pm

I'm still trying to figure out how to change an AP to nv2. I thought maybe I could make a script and have it determine whether it was connecting to an nv2 ap and then switch it to station-bridge, since station-pseudobridge doesn't work yet in nv2. I haven't been able to retrieve any tdma settings like tdma-timing-offset from a script, but when I do a /int wireless registration-table pr stats, it shows up in there.

Here is the script I'm using:

:local tomnv [/interface wireless registration-table get [find interface="wlan1"] tdma-timing-offset];
:put $tomnv

Here is the data from a pr stat:

[admin@XXXX] /interface wireless registration-table> pr stats
0 interface=wlan1 radio-name="xxxxx" mac-address=00:15:6D:33:06:B7 ap=yes wds=no bridge=yes rx-rate="13.5Mbps" tx-rate="12.0Mbps" packets=26250,46365 bytes=7777009,4304577 frames=25865,46310 frame-bytes=7778707,4299796 uptime=4h32m17s last-activity=0ms signal-strength=-52dBm signal-to-noise=52dB strength-t-rates=-52dBm@6Mbps 0ms,-52dBm@9Mbps 3h56m22s40ms,-55dBm@12Mbps 3h53m48s40ms,-50dBm@18Mbps 3h50m58s170ms,-56dBm@24Mbps 3h48m12s600ms,-58dBm@36Mbps 1h1m17s730ms,-56dBm@48Mbps 20ms,-57dBm@54Mbps 1s80ms tx-signal-strength=-58dBm tx-ccq=93% rx-ccq=99% distance=2 routeros-version="5.1" last-ip=xx.xx.xx.xx tdma-timing-offset=13 tdma-tx-size=496 tdma-rx-size=496 tdma-retx=0 tdma-winfull=0

Any ideas or is there another way I can tell how it is connected.

Tom
 
tomswenson
Member Candidate
Member Candidate
Topic Author
Posts: 115
Joined: Wed Apr 13, 2005 11:17 pm

Re: How to access tdma settings in a script

Wed Apr 20, 2011 5:46 pm

I figured out something that will work for me and figured I'd post it for the next guy trying to do the same thing. Since I couldn't get values from the tdma variables, I looked for something else. I found I could trigger on the 802.1x variable. Here is my script:

#Get current mode
:local tommode [/interface wireless get [find interface="wlan1"] mode];

#Get 802.1x port enabled setting
:local tomnv [/interface wireless registration-table get [find interface="wlan1"] 802.1x-port-enabled];

#Test to see if things have changed
:if ($tomnv != true && $tommode= "station-pseudobridge") do={/interface wireless set 0 mode=station-bridge }
:if ($tomnv = true && $tommode= "station-bridge") do={/interface wireless set 0 mode=station-pseudobridge }

I put this in a schedule running every 30 seconds or so. I does nothing if the AP has not changed. Now to upgrade all the radios to 5.1 and give this a try.

I'm going to post this also in the last post where I asked about how to transition from station-pseudobridge to NV2.

I hope it helps someone someday.

Tom

Who is online

Users browsing this forum: 4l4R1, AndyGs, Bing [Bot], gaspo, tjanas94 and 59 guests