Page 1 of 1

Current Tx Powers Script?

Posted: Fri Jan 08, 2010 7:11 pm
by tackerman
Anyone know of a way to use scripting to display the same information as Winbox's "Current Tx Powers" table?

After setting tx-power-mode to "default", running the command ':put [/interface wireless get value-name=tx-power 0]', returns a blank line.


Re: Current Tx Powers Script?

Posted: Mon Jan 11, 2010 10:05 am
by janisk
check how you can get values out of
/interface wireless monitor 0

Re: Current Tx Powers Script?

Posted: Mon Jan 11, 2010 8:46 pm
by tackerman

How do you save that output to a file or variable? I am not having luck trying to do that.

I am using RouterOS 4.4
/file print file=power
/file set power.txt contents=[/interface wireless monitor wlan1 once]
The monitor command always prints to the screen and the contents of power.txt are empty.

I have a wide mix of installations.
My goal is to record the maximum power a radio card is capable of in a file stored on the routerboard with a "run-after-reset" script.
Normal operation is using "tx-power-mode=card-rates", I want to avoid going into tx-power-mode=default during normal operation.

Re: Current Tx Powers Script?

Posted: Mon Jan 11, 2010 9:47 pm
by Chupaka
/interface wireless monitor wlan1 once do={:put $"overall-tx-ccq"}

Re: Current Tx Powers Script?

Posted: Tue Jan 12, 2010 7:28 pm
by tackerman
Awesome thanks, you rule!

It sure isn't clear from the documentation that you can use a do= clause with a command in that manner.

Really RouterOS should provide support for
/interface wireless get value-name=current-tx-power wlan1

Re: Current Tx Powers Script?

Posted: Wed Jan 13, 2010 2:47 am
by Chupaka
on the other side, if you need to get, for example rx and tx rate, and will do like

<...>get interface1 rx-rate
<...>get interface1 tx-rate

then you will receive rx-rate at the time when line1 is executed, and tx-rate at the time when line2 is executed.

but if you do something like

<...> monitor interface1 once do={ <...> $"rx-rate" <...> $"tx-rate" }

then you get both values for one point of time, not at different times. it can be important in some cases, I hope :D