All Projects â†’ nanoframework â†’ System.Device.WiFi

nanoframework / System.Device.WiFi

Licence: MIT license
đŸ“Ļ nanoFramework System.Device.Wifi Class Library

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to System.Device.WiFi

libwifi
An 802.11 Frame Generation and Parsing Library in C
Stars: ✭ 27 (+50%)
Mutual labels:  wifi
WiFiQRCodeKit
Library helping Wi-Fi configurations over QR codes
Stars: ✭ 35 (+94.44%)
Mutual labels:  wifi
lazyaircrack
Automated tool for WiFi hacking.
Stars: ✭ 301 (+1572.22%)
Mutual labels:  wifi
WifiBarcodeSample
Sample code for my article in DotNetCurry magazine on scanning barcodes. In this sample you can generate and scan QR codes that contain a Wi-Fi connection string
Stars: ✭ 13 (-27.78%)
Mutual labels:  wifi
Eduponics-Mini
MicroPython MQTT & code example for Eduponics mini ESP32 learning kit
Stars: ✭ 41 (+127.78%)
Mutual labels:  wifi
tuya-iotos-embeded-sdk-wifi-ble-bk7231n
Tuya IoTOS Embeded SDK WiFi & BLE for BK7231N
Stars: ✭ 21 (+16.67%)
Mutual labels:  wifi
ProxySwitcher
Easily enable / disable WiFi proxy on a jailbroken iOS device
Stars: ✭ 55 (+205.56%)
Mutual labels:  wifi
hashcatbenchmark
Benchmark in Hashcat for diferents GPU's
Stars: ✭ 19 (+5.56%)
Mutual labels:  wifi
rtl88x2bu-driver
Linux Kernel 4.15 and above compatible realtek driver for RTL8812BU/RTL8822BU chipset (Inamax/Edimax USB Wifi Adapters)
Stars: ✭ 36 (+100%)
Mutual labels:  wifi
LibTeleinfo
Librairie Universelle Teleinformation (TIC)
Stars: ✭ 77 (+327.78%)
Mutual labels:  wifi
anon-hotspot
On demand Debian Linux (Tor) Hotspot setup tool
Stars: ✭ 34 (+88.89%)
Mutual labels:  wifi
RaspberryPi-Packet-Sniffer
An HTTP and HTTPS sniffing tool created using a Raspberry Pi
Stars: ✭ 79 (+338.89%)
Mutual labels:  wifi
WifiIndoorPositioning
🚀 Evaluation of Location of the device using RSSI values of Access Points and Reference point which are made from Wi-Fi readings
Stars: ✭ 83 (+361.11%)
Mutual labels:  wifi
openwrt-useful-tools
A repo containing different tools compiled specifically for the Hak5 WiFi Pineapple MK6 and MK7.
Stars: ✭ 155 (+761.11%)
Mutual labels:  wifi
Peanuts
Peanuts is a free and open source wifi tracking tool. Based on the SensePosts Snoopy-NG project that is now closed.
Stars: ✭ 34 (+88.89%)
Mutual labels:  wifi
RetroWiFiModem
An ESP8266 based RS232 <-> WiFi modem with Hayes AT style commands and LED indicators
Stars: ✭ 65 (+261.11%)
Mutual labels:  wifi
fluxion
WiFi Cracking Tool (Using Evil Twin Attack) With Some Modification. (Only For Legal Purposes)
Stars: ✭ 115 (+538.89%)
Mutual labels:  wifi
madwifi
New repository: https://github.com/proski/madwifi
Stars: ✭ 16 (-11.11%)
Mutual labels:  wifi
ioBroker.tuya
ioBroker adapter to connect to several small and cheap Wifi devices that care connected to the Tuya Cloud and mostly use the Smartlife App/Alexa-Skill
Stars: ✭ 64 (+255.56%)
Mutual labels:  wifi
wirehack
Scripts for hacking through wireless network [WiFi]
Stars: ✭ 21 (+16.67%)
Mutual labels:  wifi

Quality Gate Status Reliability Rating License NuGet #yourfirstpr Discord

nanoFramework logo


Document Language: English | įŽ€äŊ“中文

Welcome to the .NET nanoFramework System.Device.Wifi Library repository

This repository contains the nanoFramework System.Device.Wifi class library.

Build status

Component Build Status NuGet Package
System.Device.Wifi Build Status NuGet

WifiNetworkHelper usage

The WifiNetworkHelper class is mainly dedicated to help you connect automatically to Wifi networks. That said, it can be used as well to check if you have a valid IP address and a valid date on any interface including on ethernet.

Preferred usage

The following code will allow you to connect automatically, wait for a valid IP address and a valid date with specific credentials:

const string Ssid = "YourSSID";
const string Password = "YourWifiPassword";
// Give 60 seconds to the wifi join to happen
CancellationTokenSource cs = new(60000);
var success = WifiNetworkHelper.ConnectDhcp(Ssid, Password, requiresDateTime: true, token: cs.Token);
if (!success)
{
    // Something went wrong, you can get details with the ConnectionError property:
    Debug.WriteLine($"Can't connect to the network, error: {WifiNetworkHelper.Status}");
    if (WifiNetworkHelper.HelperException != null)
    {
        Debug.WriteLine($"ex: {WifiNetworkHelper.HelperException}");
    }
}
// Otherwise, you are connected and have a valid IP and date

Note that this function will store the network credentials on the device.

Using stored credentials

You can as well connect to a network with pre stored credentials on the device depending on the type of device you have. Please check for proper support with your device.

if (!WifiNetworkHelper.IsConfigurationStored())
{
    Debug.WriteLine("No configuration stored in the device");
}
else
{
    // The wifi credentials are already stored on the device
    // Give 60 seconds to the wifi join to happen
    CancellationTokenSource cs = new(60000);
    var success = WifiNetworkHelper.Reconnect(requiresDateTime: true, token: cs.Token);
    if (!success)
    {
        // Something went wrong, you can get details with the ConnectionError property:
        Debug.WriteLine($"Can't connect to the network, error: {WifiNetworkHelper.Status}");
        if (WifiNetworkHelper.HelperException != null)
        {
            Debug.WriteLine($"ex: {WifiNetworkHelper.HelperException}");
        }
    }
    // Otherwise, you are connected and have a valid IP and date
}

Scan and join

You can force to scan the network and then join the network. This case can be useful in specific conditions. Be aware, that you may have to use this method with one of the previous method depending the support of rescanning while you are already connected.

const string Ssid = "YourSSID";
const string Password = "YourWifiPassword";
// Give 60 seconds to the wifi join to happen
CancellationTokenSource cs = new(60000);
var success = WifiNetworkHelper.ScanAndConnectDhcp(Ssid, Password, requiresDateTime: true, token: cs.Token);
if (!success)
{
    // Something went wrong, you can get details with the ConnectionError property:
    Debug.WriteLine($"Can't connect to the network, error: {WifiNetworkHelper.Status}");
    if (WifiNetworkHelper.HelperException != null)
    {
        Debug.WriteLine($"ex: {WifiNetworkHelper.HelperException}");
    }
}
// Otherwise, you are connected and have a valid IP and date

Note that this function will store the network credentials on the device.

Joining with a static IP address

You join a Wifi network with a static IP address:

const string Ssid = "YourSSID";
const string Password = "YourWifiPassword";
// Give 60 seconds to the wifi join to happen
CancellationTokenSource cs = new(60000);
var success = WifiNetworkHelper.ConnectFixAddress(Ssid, Password, new IPConfiguration("192.168.1.7", "255.255.255.0", "192.168.1.1"), requiresDateTime: true, token: cs.Token);

Checking valid IP address and date

The WifiNetworkHelper offers couple of functions to check validity of your IP address, the DateTime and helping setting them up:

var success = IsValidDateTime();
// if success is true, you have a valid DateTime
success = IsValidIpAddress(NetworkInterfaceType.Wireless80211);
// if success is true, you have a valid IP address on the Wireless adapter
// Be aware that a local address like 127.0.0.1 is considered as a valid address for ethernet

You can as well wait for a valid IP address and date time:

// Give 60 seconds to check if we have a valid IP and a valid DateTime
CancellationTokenSource cs = new(60000);
var success = WaitForValidIPAndDate(true, NetworkInterfaceType.Ethernet, cs.Token);
// if success is true then you are connected

WifiNetworkHelper usage

The WifiNetworkHelper is mainly dedicated to help you connect automatically to Wifi networks. That said, it can be used as well to check if you have a valid IP address and a valid date on any interface including on ethernet.

Preferred usage

The following code will allow you to connect automatically, wait for a valid IP address and a valid date with specific credentials:

const string Ssid = "YourSSID";
const string Password = "YourWifiPassword";
// Give 60 seconds to the wifi join to happen
CancellationTokenSource cs = new(60000);
var success = WifiNetworkHelper.ConnectDhcp(Ssid, Password, requiresDateTime: true, token: cs.Token);
if (!success)
{
    // Something went wrong, you can get details with the ConnectionError property:
    Debug.WriteLine($"Can't connect to the network, error: {WifiNetworkHelper.Status}");
    if (WifiNetworkHelper.HelperException != null)
    {
        Debug.WriteLine($"ex: {WifiNetworkHelper.HelperException}");
    }
}
// Otherwise, you are connected and have a valid IP and date

Note that this function will store the network credentials on the device.

Using stored credentials

You can as well connect to a network with pre stored credentials on the device depending on the type of device you have. Please check for proper support with your device.

// The wifi credentials are already stored on the device
 // Give 60 seconds to the wifi join to happen
CancellationTokenSource cs = new(60000);
var success = WifiNetworkHelper.Reconnect(requiresDateTime: true, token: cs.Token);
if (!success)
{
    // Something went wrong, you can get details with the ConnectionError property:
    Debug.WriteLine($"Can't connect to the network, error: {WifiNetworkHelper.Status}");
    if (WifiNetworkHelper.HelperException != null)
    {
        Debug.WriteLine($"ex: {WifiNetworkHelper.HelperException}");
    }
}
// Otherwise, you are connected and have a valid IP and date

Scan and join

You can force to scan the network and then join the network. This case can be useful in specific conditions. Be aware, that you may have to use this method with one of the previous method depending the support of rescanning while you are already connected.

const string Ssid = "YourSSID";
const string Password = "YourWifiPassword";
// Give 60 seconds to the wifi join to happen
CancellationTokenSource cs = new(60000);
var success = WifiNetworkHelper.ScanAndConnectDhcp(Ssid, Password, requiresDateTime: true, token: cs.Token);
if (!success)
{
    // Something went wrong, you can get details with the ConnectionError property:
    Debug.WriteLine($"Can't connect to the network, error: {WifiNetworkHelper.Status}");
    if (WifiNetworkHelper.HelperException != null)
    {
        Debug.WriteLine($"ex: {WifiNetworkHelper.HelperException}");
    }
}
// Otherwise, you are connected and have a valid IP and date

Note that this function will store the network credentials on the device.

Joining with a static IP address

You join a Wifi network with a static IP address:

const string Ssid = "YourSSID";
const string Password = "YourWifiPassword";
// Give 60 seconds to the wifi join to happen
CancellationTokenSource cs = new(60000);
var success = WifiNetworkHelper.ConnectFixAddress(Ssid, Password, new IPConfiguration("192.168.1.7", "255.255.255.0", "192.168.1.1"), requiresDateTime: true, token: cs.Token);

Checking valid IP address and date

The WifiNetworkHelper offers couple of functions to check validity of your IP address, the DateTime and helping setting them up:

var success = IsValidDateTime();
// if success is true, you have a valid DateTime
success = IsValidIpAddress(NetworkInterfaceType.Wireless80211);
// if success is true, you have a valid IP address on the Wireless adapter
// Be aware that a local address like 127.0.0.1 is considered as a valid address for ethernet

You can as well wait for a valid IP address and date time:

// Give 60 seconds to check if we have a valid IP and a valid DateTime
CancellationTokenSource cs = new(60000);
var success = WaitForValidIPAndDate(true, NetworkInterfaceType.Ethernet, cs.Token);
// if success is true then you are connected

Feedback and documentation

For documentation, providing feedback, issues and finding out how to contribute please refer to the Home repo.

Join our Discord community here.

Credits

The list of contributors to this project can be found at CONTRIBUTORS.

License

The nanoFramework Class Libraries are licensed under the MIT license.

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behaviour in our community. For more information see the .NET Foundation Code of Conduct.

.NET Foundation

This project is supported by the .NET Foundation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].