Script to run AP-Bridge on main wlan interface, station pseudobridge on virtual

Hi all,

I have tried to set up a script that periodically scans for networks on the main wlan interface that has been configured as a AP-bridge (to allow a AP to run while it is looking other AP’s as a station pseudobridge on the virtual interface).

This way I am always able to connect to the board trough wlan so that I can configure it without having the station pseudobridge set up on the main interface (where it would look for devices on all frequencies but block the virtual AP to run).

Short summary on what the script does:

  1. Make a string array of the ssid in the connect-list
  2. scan on main wlan interface and save the result in a file
  3. Parse the file and compare the ssid and RSSI with the ssid in the connect-list and select the best frequency (the one with highest RSSI) if it is different from the current frequency.[/list]

The script can be found on github: https://github.com/palhaland/routeros/blob/master/scripts/selectFrequency.rsc

I still have some issues with it:

  • It is not able to save the file when running the scan command when running as script, it works fine when running from console.
  • connect-list is not working, but this could be a configuration problem? (not related to the script) When setting the SSID manually and the security profile it works. This could be scripted as well.

If any of you have any suggestions/tips on how to fix and improve it, please feel free to comment

update 16.08.2016:
Found the issue related to why the script did not work in in script mode (not command line mode)