Somewhere in the Pacific Ocean, near the world’s best shortcut, lies an island some 20 miles offshore.
This island now has a fast PtP 5 GHz wireless connection, thanks to some routerboards and other accessories.
While the connection works well most of the time, unfortunately there is a problem.
The tide in Pacific varies by 18 feet and this creates havoc with the link.
Regardless of the frequency used, the connection will go offline (because of reflections and destructive interference) for some period of time every day.
However, with each different frequency, the water height at which the link will go offline is different.
For example, at 3 PM I might have -90 dB on 5200 MHz and -75 dB on 5800 MHz. A few hours later, I have -92 dB on 5800 MHz and -73 dB on 5200 MHz.
If I could dynamically switch between the two frequencies, I could achieve nearly 100% uptime (except for the 1-2 seconds it takes for the station to reconnect).
I would like to have a script that takes a TX signal reading, from the AP side, every 30 seconds. If the average over 4 readings is -85 dB or worse, I want it to switch to the other channel. I just need it to move between the two channels.
If someone could post the code for this, it would be great.
I’ll be happy to PayPal you $30 for your time.
Please, no comments suggesting I use bigger antennas. If that is your suggestion then you don’t understand the problem.
DFS picks the least busy frequency but it only does it once. It does not re-pick when the link goes down.
Also, some of the frequencies which are not busy on one end, are VERY busy on the other end so the frequency it picks often does not work at all.
Actually, his suggestion is appriopriate. When you establish a link you have to provide enough signal strength to cover such changes in propagation. Even if conditions are better, -72dBm is low signal. It should be stronger anyways.
unfortunately off the top of my head i cant think of a way to script frequency changes off signal strength, but if it truely based off of the tides, a little research of tide tables and you could simply set scripts to change frequency at given times. also you could create a script that if signal is worse than -xx dBi then change to 5xxx GHz, which would create a “search” for a frequency that gave it a signal that was acceptable.
it is certainly doable, many people have used similar scripts for alignment scripts and whatnot… just search for one and modify the signal levels and the “do” portion of the command.
p.s. - “can’t think of a way off the top of my head” = i don’t have it memorized and it is late and i need to go to bed
i agree with those that say you should have a better signal, however signal quality is more dependent upon snr that straight levels… i.e. a -50dBi signal is great, but if noise floor is at -55 dBi then it’s crap. transversely if signal is at -70dBi, and noise floor is at -95dBi, you are in much better shape. As you are well aware it is all about the “bigger picture”. there are way too many components to have a good connection to be able to say it wont work based on 1 “bad” aspect. there is almost always a way to compensate, many times without having to buy expensive and huge equipment.
keep on track with what you are doing, it certainly isn’t a simple fix, but it can be done
I have created a script to meet your exact specifications (well I had to add a few specs that were critical, but not considered). Please contact me via AIM (see profile) if you would like to proceed.
The script features the following:
Global variables to set desired minimum dBm (default=-85) as well as minimum SNR (default=12), interface name (in case you have more than 1 wireless interface in the AP, default=wlan1), the two frequencies (default=5200,5800), a check delay in seconds (checking 4 times as fast as possible rarely produces different numbers, so I put a short delay between each of the 4 values to be averaged, default=5), the number of checks to average together (default=4) and the ability to choose whether you are swapping based on dBm (default), SNR, or either. Finally, it logs all frequency swaps as script info, showing the frequency it changed to as well as why (no clients or it lists the average dBm and SNR values).
It will swap frequencies if NO clients are registered (in other words, signal so poor they dropped) as well as if they are registered but do not meet the qualifications you specified in the variables.
You will be able to get it to execute as often as you like using the System Scheduler, and while you can choose 30 seconds if you like, I would recommend something more like 1 minute as a minimum and 5 minutes preferred. Bringing the link back up within 5 minutes is still a might better than having to keep an eye on it. Plus, with a longer time between execution, you may wish to increase the number of samples in the average or extend the delay between samples.
Besides the variable definitions and easy to read formatting, it’s just a lean 12 lines of code for fast execution and low cpu overhead.
It was great chatting with you and I hope you enjoy the script. It was thoughtful of you to pay for the work and then let the community benefit from it freely.
If you or anyone else should have a need for advanced MT scripting and design, please do not hesitate to call on me!
-John
INSTALLATION INSTRUCTIONS:
While I love the cmd line for everything else, scripting is not in that category.
Within Winbox…
Add a New Schedule under System>Scheduler (alternately, you could add this as a System>Script and just call it from the scheduler with ‘/sys scr run scriptname’ as your scheduler event)
Name it as you wish, set your Start Time as startup from the dropdown
Set you interval as you wish (I recommend no less than 1 minute, but prefer 5 minutes to allow clients to register successfully and signals to settle)
Paste the code below into the “On Event” box
Edit only the last word of the first 8 lines, leave everything else as is.
wlanname is the name of the wireless interface to affect