Community discussions

MikroTik App
 
tackerman
newbie
Topic Author
Posts: 29
Joined: Tue Jul 14, 2009 7:37 pm

Current Tx Powers Script?

Fri Jan 08, 2010 7:11 pm

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.

Thanks
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Current Tx Powers Script?

Mon Jan 11, 2010 10:05 am

check how you can get values out of
/interface wireless monitor 0
 
tackerman
newbie
Topic Author
Posts: 29
Joined: Tue Jul 14, 2009 7:37 pm

Re: Current Tx Powers Script?

Mon Jan 11, 2010 8:46 pm

Thanks!

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.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Current Tx Powers Script?

Mon Jan 11, 2010 9:47 pm

/interface wireless monitor wlan1 once do={:put $"overall-tx-ccq"}
 
tackerman
newbie
Topic Author
Posts: 29
Joined: Tue Jul 14, 2009 7:37 pm

Re: Current Tx Powers Script?

Tue Jan 12, 2010 7:28 pm

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
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Current Tx Powers Script?

Wed Jan 13, 2010 2:47 am

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

Who is online

Users browsing this forum: No registered users and 15 guests