On only 6 seconds you can not scan all, 30 seconds is better, find more signals, also weak, and is done also if you drop the WiFi connections (SSH has 5min timeout).
Are you sure? I’ve a RB435 with 4 wireless card and their id are 0, 1, 2, 3
They also have an ID like *a or *19a but using the print command i see 0, 1, 2, 3
If I write (using SSH):
:put [find where name="wlan4"]
It returns *id
Sure the script can be optimized and more user friendly, but it’s a working start point
You can also set another duration on the script if 6 isn’t enough.
Just checked using 30s duration and 60s timeout it works great!
Your SSH command connects from a router to another so it works like this script.
Using PHP you can quickly save your scan results to DB to make advanced queries to deal with interference.
You can also set another duration on the script if 6 isn't enough.
(Remember: i not know php.)
So… if i put 30 seconds scan on REMOTE machine connected by Wireless, not by Wire, the scan continue (not stop as winbox), using API, as when I use SSH?
When I issue the below line of code I get an error where I can’t connect to the router
$client = new RouterOS\Client($userIp, $username, $password, null, false, $connection_timeout, Transmitter\NetworkStream::CRYPTO_TLS);
it is dying on Transmitter\NetworkStream::CRYPTO_TLS
exception ‘Exception’ with message ‘Class Transmitter\NetworkStream could not be
loaded from Transmitter\NetworkStream.php, file does not exist (registered path
s=“C:\inetpub\wwwroot”) [PEAR2_Autoload-0.2.4]’ in C:\inetpub\wwwroot\PEAR2\Auto
load.php:181
Stack trace:
My basic connect code is - I must be over looking something…
<?php
use PEAR2\Net\RouterOS;
require_once 'PEAR2/Autoload.php';
set_time_limit(30);
$userIp = '192.168.88.1'; //ip here
$username = 'admin'; //password here
$password = ''; //username here
$wlan = 0; //wlan id here
$scan_duration = 6; //Duration of scan in seconds here
$connection_timeout = 30; //API connection timeout here (set it bigger than scan_duration)
\
\
try {
$client = new RouterOS\Client($userIp, $username, $password, null, false, $connection_timeout, Transmitter\NetworkStream::CRYPTO_TLS);
} catch (Exception $e) {
die('Unable to connect to the router.');
//Inspect $e if you want to know details about the failure.
}