toplek
1
HI,
How to GET signal-signal-strength lower than 20dB?
I was trying this:
{
:local interface "wlan3 (AP_5G)";
/foreach i in=[ /interface wireless reg find] do={
:local SIGNAL [/interface wireless registration-table get $i signal-strength];
:local MAC [/interface wireless registration-table get $i mac-address ];
:if ($SIGNAL < -20) do= {log info "Signal too low: MAC: $MAC SIGNAL: $SIGNAL";};
};
But the problem is that variable SIGNAL is not INTEGER, so the question is how to get signal-strength as a INTEGER or how to convert this variable?
best regards
Piotr Polok
mrz
2
use :tonum command to convert variables
toplek
3
HI,
Thank you for the replay!
It this case resolving this problem by this way is not possible becouse input variable is like this:
:local SIGNAL [:tonum "-48dBm@24Mbps"];
:local test [:tonum $SIGNAL];
:log info "tonum: $test";
So the question is how to get this value as a integer or how to parse this variable and convert to integer 
best regards
Piotr Polok
Chupaka
4
{:local s "-48dBm@24Mbps"; :put [:pick $s 0 [:find $s "dBm"]]}
:local signal ([/interface wireless registration-table get [/int wireless registration-table find] tx-signal-strength] * -1)
that seems to get me the raw number without the @ sign or dbm …
toplek
6
Hi!
Chupaka Thanks for you reply, this solution is working properly!
I was trying also this solution on MT v4.3:
:local signal ([/interface wireless registration-table get [/int wireless registration-table find] tx-signal-strength] * -1)
but this one is not working
best regards
Piotr Polok