Code for checking WiFi strength

Place code snippets and demo code here
Post Reply
Zim
Posts: 88
Joined: Mon Feb 08, 2021 9:15 pm
Has thanked: 61 times
Been thanked: 44 times

Code for checking WiFi strength

Post by Zim »

thanks to cicciocb, this is his code

Code: [Local Link Removed for Guests]

' wifi scanner example
mySSID$ = "mySSID" ' define your SSID here
wifi.scan
while wifi.networks(a$) = -1
wend

NL$ = chr$(10)   ' this means New Line
for z=1 to word.count(a$, NL$)  'browse all the lines
  z$ = word$(a$, z,NL$) 'extract line by line
  s$ = word$(z$, 1, ",") ' extract the SSID (the 1st argument)
  if (s$ = mySSID$) then ' if the SSID is the one we search
    RSSI$ = word$(z$, 3, ",") ' extract the RSSI (the 3rd argument)
    print s$, RSSI$
  end if
 next z

Last edited by Zim on Fri Feb 19, 2021 5:39 pm, edited 2 times in total.
N7QWT
Posts: 6
Joined: Fri Feb 19, 2021 4:03 am

Re: Code for checking WiFi strength

Post by N7QWT »

Just a question, Doesn't a WiFi scan cause a disconnect from the AP?
User avatar
PeterN
Posts: 97
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 41 times
Been thanked: 45 times
Contact:

Re: Code for checking WiFi strength

Post by PeterN »

There seems to be at least no permanent disconnect as I can send the results of Zim's WIFI search to a wlog without a problem. This shows all visible WIFI SSIDs:

Code: [Local Link Removed for Guests]

' wifi scanner example; shows ALL visible SSIDs

wifi.scan
while wifi.networks(a$) = -1
wend

NL$ = chr$(10)   ' this means New Line
for z=1 to word.count(a$, NL$)  'browse all the lines
  z$ = word$(a$, z,NL$) 'extract line by line
  s$ = word$(z$, 1, ",") ' extract the SSID (the 1st argument)
  RSSI$ = word$(z$, 3, ",") ' extract the RSSID (the 3rd argument)
  print s$, RSSI$
  wlog s$, RSSI$
 next z
Post Reply