Community discussions

MikroTik App
 
el berto
Member Candidate
Member Candidate
Topic Author
Posts: 220
Joined: Wed Sep 26, 2007 10:53 am

How to get value in wireless monitor?

Wed May 12, 2021 9:48 am

Hi guys, I would like to get wlan1 frequency (wlan1 is set as client) as value inside a script to avoid wlan2 (set as AP) frequency could overlap wlan1.
I've found script examples on the forum working for eth interfaces but not for wireless.
/inter wireless monitor [find name="wlan1"] once do={:global avoid1 $"frequency" } 
This hangs.
How solve?
Thanks.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 3884
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: How to get value in wireless monitor?

Wed May 12, 2021 12:24 pm

Why use monitor for read "fixed" values?
That's is bad habit...

:global wlan1freq [/int wire get wlan1 frequency]
:global wlan2freq [/int wire get wlan2 frequency]

And if you want change wlan1 and 2 name use this:
:global wlan1freq [/int wire get [find default-name=wlan1] frequency]
:global wlan2freq [/int wire get [find default-name=wlan2] frequency]
I'm Italian, not English. Sorry for my imperfect grammar.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 3884
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: How to get value in wireless monitor?

Wed May 12, 2021 12:39 pm

Tieni, questo te lo regalo, te l'ho già fatto io.

Just schedule this, set on failover 1 and 2 the right frequencies for your country, leave 60MHz between the two failover frequencies.
This do not only check if are overlapped frequencies, but also leave 20MHz of channel space between AP and Client
:global wlan1freq [/int wire get wlan1 frequency]
:global wlan2freq [/int wire get wlan2 frequency]
:global failoverF1 5500
:global failoverF2 5600

:if (!((($wlan1freq - $wlan2freq) < -20) || (($wlan1freq - $wlan2freq) > 20)) ) do={
 :if ($wlan2freq=$failoverF1) do={
  /int wire set wlan2 frequency=$failoverF2
 } else={
  /int wire set wlan2 frequency=$failoverF1
 }
}
trad: if not wlan1 and wlan2 have more than 20MHz space between, change frequency,
I'm Italian, not English. Sorry for my imperfect grammar.
 
el berto
Member Candidate
Member Candidate
Topic Author
Posts: 220
Joined: Wed Sep 26, 2007 10:53 am

Re: How to get value in wireless monitor?

Fri May 14, 2021 10:12 am

ROs 6.19
Frequency: 5510
scan list: 5495-5520
DFS Mode: radar detect

 1    ;;; ap bridge
      name="wlan2" mtu=1500 mac-address=00:1B:B1:04:BA:4A arp=enabled interface-type=Atheros AR5213 mode=ap-bridge ssid="MTLO"
      frequency=5510 band=5ghz-a channel-width=10mhz scan-list=5495-5520 wireless-protocol=nstreme antenna-mode=ant-a wds-mode=dynamic 
      wds-default-bridge=bridge1 wds-ignore-ssid=yes bridge-mode=enabled default-authentication=yes default-forwarding=yes default-ap-tx-l
      default-client-tx-limit=0 hide-ssid=no security-profile=crs_2018 compression=no 
[admin@mMTLO1] /interface wireless> monitor 
wlan1  wlan2  do  file  interval  numbers
[admin@mMTLO1] /interface wireless> monitor wlan2
                     ;;; ap bridge verso Monte Grappa - Pol H 287 
                 status: running-ap
                   band: 5ghz-10mhz
              frequency: 5500MHz
      wireless-protocol: nstreme
            noise-floor: -101dBm
         overall-tx-ccq: 26%
     registered-clients: 0
  authenticated-clients: 0
                polling: yes
          csma-disabled: no
      current-tx-powers: 6Mbps:15(15/15),9Mbps:15(15/15),12Mbps:15(15/15),18Mbps:15(15/15),24Mbps:15(15/15),36Mbps:15(15/15),48Mbps:14(14/14),54Mbps:13(13/13)
    notify-external-fdb: no

[admin@mMTLO1] /interface wireless> 
In this case I set frequency to 5510 but wlan2 is running at 5500.
I need to get 5500 in script.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 3884
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: How to get value in wireless monitor?

Fri May 14, 2021 10:43 am

Ok, your running freqency are different from "frequency" field because are set dynamic with DFS with scan-list pool, and you use 10MHz channel

You have RouterOS 6.19, I do not have this version, the scripts are for 6.46 and up,
but I think that can work..

I modified the script accordingly your scan list and channel size

/int wire monitor wlan1 once do={ :global wlan1freq $channel }
/int wire monitor wlan2 once do={ :global wlan2freq $channel }

:set $wlan1freq [:pick $wlan1freq -1 [:find $wlan1freq "/" -1]]
:set $wlan2freq [:pick $wlan2freq -1 [:find $wlan2freq "/" -1]]

:global failoverF1 5500
:global failoverF2 5520

:if (!((($wlan1freq - $wlan2freq) < -10) || (($wlan1freq - $wlan2freq) > 10)) ) do={
 :if ($wlan2freq=$failoverF1) do={
  /int wire set wlan2 frequency=$failoverF2
 } else={
  /int wire set wlan2 frequency=$failoverF1
 }
}

Ma se usi il DFS la frequenza della wlan2 può variare se sente radar o disturbi simili.
I'm Italian, not English. Sorry for my imperfect grammar.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 2162
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: How to get value in wireless monitor?

Fri May 14, 2021 2:48 pm

ROs 6.19
I do hope this is a standalone network not connected to internet.
If its connected to internet, you should upgrade. 6.19 are very old an have many security flaws.
 
Try Splunk> to monitor your MikroTik Router(s). Look at this page in how to set it up.

MikroTik->Splunk
 
 
el berto
Member Candidate
Member Candidate
Topic Author
Posts: 220
Joined: Wed Sep 26, 2007 10:53 am

Re: How to get value in wireless monitor?

Mon May 17, 2021 10:08 am

ROs 6.19
I do hope this is a standalone network not connected to internet.
If its connected to internet, you should upgrade. 6.19 are very old an have many security flaws.
Offtopic
I updated firmware but ROs dfs is a nightmare due to false "radar detected" and too long waiting times; I had only two options, move to Ubiquiti or came back to 6.19 and manage dfs by my own through script. Network is not connected to internet.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 3884
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: How to get value in wireless monitor?

Mon May 17, 2021 11:23 am

ROs 6.19
I do hope this is a standalone network not connected to internet.
If its connected to internet, you should upgrade. 6.19 are very old an have many security flaws.
Offtopic
I updated firmware but ROs dfs is a nightmare due to false "radar detected" and too long waiting times; I had only two options, move to Ubiquiti or came back to 6.19 and manage dfs by my own through script. Network is not connected to internet.

Paste this on terminal:
/interface wireless
set wlan1 country=debug frequency-mode=superchannel tx-power-mode=all-rates-fixed tx-power=15 wps-mode=disabled station-roaming=disabled
I'm Italian, not English. Sorry for my imperfect grammar.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 2162
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: How to get value in wireless monitor?

Mon May 17, 2021 11:30 am

It's not off topic.

1. Most here are on 6.47+, so this is what they know about.
2. Much has change since 6.19 so config are not the same (master/slave gone)
3. You put your system at risk if its connected to internet. (even worse if you do remote admin )
 
Try Splunk> to monitor your MikroTik Router(s). Look at this page in how to set it up.

MikroTik->Splunk
 
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 3884
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: How to get value in wireless monitor?

Mon May 17, 2021 11:41 am

It's not off topic.

1. Most here are on 6.47+, so this is what they know about.
2. Much has change since 6.19 so config are not the same (master/slave gone)
3. You put your system at risk if its connected to internet. (even worse if you do remote admin )
:) no... the user "el berto" consider offtopic the dfs problem :))
I'm Italian, not English. Sorry for my imperfect grammar.
 
excession
Frequent Visitor
Frequent Visitor
Posts: 62
Joined: Mon May 11, 2015 8:16 pm

Re: How to get value in wireless monitor?

Sat May 22, 2021 7:34 pm

Paste this on terminal:
/interface wireless
set wlan1 country=debug frequency-mode=superchannel tx-power-mode=all-rates-fixed tx-power=15 wps-mode=disabled station-roaming=disabled
It's fun to see the superchannel "solution" recommended; often no-one mentions it, possibly in the hope that if we never speak its name Mikrotik won't remove it.
I notice you didn't explain what it does... ;)

I wonder what "el barto" did in the end?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 3884
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: How to get value in wireless monitor?

Sat May 22, 2021 8:12 pm

>>>I notice you didn't explain what it does... ;)<<<
>>>often no-one mentions it, possibly in the hope that if we never speak its name Mikrotik won't remove it<<<

ssssssst!!!! :))
I'm Italian, not English. Sorry for my imperfect grammar.

Who is online

Users browsing this forum: foresthus, NEJI and 39 guests