How to get value in wireless monitor?

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.

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]

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,

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.

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 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

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 )

:slight_smile: no… the user “el berto” consider offtopic the dfs problem :))

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?

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!!! :))