LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

List available wifi SSID's

Solved!
Go to solution

I'm trying to access the wireless network card and list the available SSID's, like how Windows is doing it.  Present a list of the SSID's of the available Wi-Fi networks.  Is this information available in e.g. .NET libraries?  I've been searching this for a while, but haven't found anything so far...

0 Kudos
Message 1 of 11
(7,090 Views)
Solution
Accepted by topic author ojohnsen79

Oh this is an easy one if you know netsh.  Use the command line call "netsh wlan show networks".  Attatched is an example saved in 2013.

Message 2 of 11
(7,048 Views)

Oh, this is cool! 🙂  It's possible to use netsh both to get SSID and signal quality information, and even to connect to and disconnect from networks.

Thanks a million!  Never thought it would be this easy. 🙂

0 Kudos
Message 3 of 11
(7,026 Views)

@ojohnsen79 wrote:

Oh, this is cool! 🙂  It's possible to use netsh both to get SSID and signal quality information, and even to connect to and disconnect from networks.

Thanks a million!  Never thought it would be this easy. 🙂


Yup it is really a neat utility.  I have testers setup offsite that upload reports to a central location.  This relies on a network connection, so each tester has a wireless card.  The problem is the environment these testers are in have spotty WIFI reception, and the network often goes down needing a retry of the uploading of reports.  

 

So I made a program that runs in the system tray, and will check internet connection every 30 minutes.  If the network goes down, it will disconnect from the wireless network, then attempt to connect again.  After another 30 minutes if there is no connection I disable the wireless card, and enable it.  This has solved all kinds of Windows device issues, and connection issues.  Some times routers just have issues and forcing a disconnector, or a disable really helps.  All of this is done using that comman line program.

Message 4 of 11
(6,999 Views)

Hello,

 

Is possible that you send to me the example in 2012 version? I need a similar aplication.

 

Thanks in advance.

 

Regards.

0 Kudos
Message 5 of 11
(6,434 Views)
0 Kudos
Message 6 of 11
(6,417 Views)

I have a related question: is it possible to connect to a wifi network using "netsh wlan" command set? My ultimate goal is to provide a LabVIEW user interface for surveying wifi networks (which can be done as Hooovahh described) and then connecting to one. I know that in principle it can be done with netsh wlan if this PC already has been connected to this network before, but what if it's the first time?

This problem came up in a project where LV application serves as the Windows shell and the end user has no access to anything except the LV interface. Naturally I can use System Exec, DLL's, .NET and all other toys, but I have not been able to figure out how to connect, and I don't want to dive into the Microsoft Native Wifi API.

Any suggestions? Thanks!

 

SL

0 Kudos
Message 7 of 11
(5,990 Views)

I've never tested it but several sites list that this is possible:

 

https://www.hanselman.com/blog/HowToConnectToAWirelessWIFINetworkFromTheCommandLineInWindows7.aspx

 

https://stackoverflow.com/questions/41163737/how-to-connect-to-a-wifi-using-cmd-only

 

https://www.techworm.net/2016/10/connect-manage-delete-wi-fi-networks-using-command-prompt.html

 

In my situation the network credentials were already saved, and the connection is to be established automatically, so all i did was disable the network adapter and then reenable it which would cause it to disconnect and then connect again.

Message 8 of 11
(5,979 Views)

Thanks Hooovahh! I've seen all these links in my web search. One problem with this approach is that in order to connect using netsh wlan you need admin rights, and I hope to be able to work around this. After all, with regular Windows WiFi, you can connect as a regular user. One possible workaround that I will explore is to ask the user to connect on another PC and give him a batch file to export the connection profile, then import it on my instrument and connect using this profile (I don't think one needs admin rights for that). We'll see. Worst case, I'll have to install the Windows SDK, dig into the wifi API, possibly build a DLL in Visual Studio and then try to call it in LV... Smiley Sad

0 Kudos
Message 9 of 11
(5,971 Views)

I have created a Community Example Program which performs the scanning of WiFi hotspots (SSID's) nearby, lists them in a ring, shows available network profiles and connects to a chosen hotspot (kudos welcome;) :

 

WiFi Network Scanning and Connecting with LabVIEW - Discussion Forums - National Instruments
https://forums.ni.com/t5/Example-Program-Drafts/WiFi-Network-Scanning-and-Connecting-with-LabVIEW/ta...

 

Screenshot_Front.PNG

Eric H.
Applications Engineering
National Instruments
Message 10 of 11
(5,911 Views)