How to perform frequency-monitor using API?

Uisng the 3.0 API, How can I get noise figures for all of the channels, like
“/interface wireless> frequency-monitor wlan1” works using the telnet interface?

I’d be happy to get exactly one sample. How can I get this data using the API?

Thanks,

Bob Rubendunst
Soft Machines
Sidney, IL
USA

OK, I found an answer.

From my quick look at the API docs, I assumed tags were only needed if you expected to queue commands. My plans was to never queue commands, at least at first.

Alas, I cannot keep things so simple that tags are never used!

Command tags are REQUIRED when using any command that continues to output to the “console” until you stop it.

(I think the single sentence above should be added to the API reference’s TAG section to clarify that using tags are not optional for any but the most primitive applications that will use the API.)

So, using the Python example test application which is in the API doc on the wiki, you get a frequency scan by entering this command:

/interface/wireless/frequency-monitor
=.id=wlan1
.tag=Whatever

The frequency-monitor data arrives at regular intervals.

To end the frequency-monitor command, you must issue a /cancel command:
/cancel
=tag=Whatever

Bob Rubendunst

same goes for bandwidth-test even if you set time limit, you have to tag it, or otherwise it will run forever shoing that bandwidth test has ended.