I am trying to connect to wifi using esp32 nanoframework. Have tried various samples, for example: https://github.com/nanoframework/Samples/blob/main/samples/Wifi/ScanWiFi/Program.cs
I am getting the below exception on this line:
WifiAdapter wifi = WifiAdapter.FindAllAdapters()[0];
Exception:
Starting Wifi scan
++++ Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ++++
++++ Message:
++++ System.Device.Wifi.WifiAdapter::NativeScanAsync [IP: 0000] ++++
++++ System.Device.Wifi.WifiAdapter::ScanAsync [IP: 000d] ++++
Exception thrown: 'System.InvalidOperationException' in System.Device.Wifi.dll
message:Exception was thrown: System.InvalidOperationException
stack:System.Device.Wifi.WifiAdapter::NativeScanAsync
System.Device.Wifi.WifiAdapter::ScanAsync
I have tried various things such as
- reboot device
- manually enter network config, set
enabled
etc. - reflash