Community discussions

MUM Europe 2020
 
ckgth
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 64
Joined: Wed Jun 06, 2007 5:03 pm

:global not set?

Wed Mar 19, 2014 1:50 pm

Hi,

i will made a simple tx-power script, but the global are not set:

:global txold [/interface wireless registration-table get number=0 tx-signal-strength];
:log info $txold;

becomes a zero in script - no data. Why?
With cli it works.

regards
Christian
 
toni17
newbie
Posts: 36
Joined: Thu Dec 15, 2011 9:55 pm

Re: :global not set?

Wed Mar 19, 2014 1:55 pm

Yes the same problem with my routers after upgraded to 6.10
Please Mikrotik do something in next Ros .
 
ckgth
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 64
Joined: Wed Jun 06, 2007 5:03 pm

Re: :global not set?

Wed Mar 19, 2014 3:12 pm

Hi,

this is not an ROS Problem.
I have mailed the support (!!!Answer in 5 min!!!!)
Hello,

You cannot user get number=0 in scripts.
Use find command to find specific entry.

Regards,
Maris
you should use:
:global txold [/interface wireless registration-table get [ find interface=wlan1 ] tx-signal-strength];
:log info $txold;

in script. Works. tested.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 2950
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: :global not set?

Thu Mar 20, 2014 2:59 am

Hi,

this is not an ROS Problem.
I have mailed the support (!!!Answer in 5 min!!!!)
Hello,

You cannot user get number=0 in scripts.
Use find command to find specific entry.

Regards,
Maris
you should use:
:global txold [/interface wireless registration-table get [ find interface=wlan1 ] tx-signal-strength];
:log info $txold;

in script. Works. tested.
Tested?
NOT WORK IF 0 OR MORE THAN ONE WIRELESS REGISTRATION ARE PRESENT!!!
It do error, and stop the script execution, and is not RouterOS problem.
Last edited by rextended on Thu Mar 20, 2014 3:39 am, edited 1 time in total.
I'm Italian, not English. Sorry for my imperfect grammar.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 2950
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: :global not set?

Thu Mar 20, 2014 3:30 am

Use this:
:global tmpInterfaceToCheck value="wlan1";
:global tmpHowManyReg value=[:toarray [/interface wireless registration-table find where interface=$tmpInterfaceToCheck]];
:if ([:len $tmpHowManyReg] < 1) do={
 :log error message="No device registered on wlan1";
}
:if ([:len $tmpHowManyReg] = 1) do={
 :log info message=("Only ".[/interface wireless registration-table get $tmpHowManyReg value-name=mac-address]." ".[/interface wireless registration-table get $tmpHowManyReg value-name=radio-name]." registered on wlan1 with tx-signal-strength of ".[/interface wireless registration-table get $tmpHowManyReg value-name=tx-signal-strength]);
}
:if ([:len $tmpHowManyReg] > 1) do={
 :log warning message=([:len $tmpHowManyReg]." device registered on wlan1");
 :foreach tmpTest in=$tmpHowManyReg do={
  :log warning message=([/interface wireless registration-table get $tmpTest value-name=mac-address]." ".[/interface wireless registration-table get $tmpTest value-name=radio-name]." registered with tx-signal-strength of ".[/interface wireless registration-table get $tmpTest value-name=tx-signal-strength]);
 }
}
radio-name and tx-signal-strength are readable only if remote radio are powered by RouterOS
the tx-signal-strength are a value sended from client RouterOS to the access point

If you like, please add Karma.
I'm Italian, not English. Sorry for my imperfect grammar.

Who is online

Users browsing this forum: No registered users and 24 guests