Hello,
I updated all libraries and flashed device, at the end of the post.
Below is my code and I am getting error.
Mono enabled, will run app.exe Unhandled Exception: System.InvalidOperationException: Coprocessor is not ready or is sleeping.
protected void ScanForAccessPoints()
{
Device.InitWiFiAdapter().Wait();
Device.WiFiAdapter.SetAntenna(Meadow.Gateways.AntennaType.OnBoard);
Console.WriteLine(“Getting list of access points.”);
ObservableCollection networks = Device.WiFiAdapter.Scan();
if (networks.Count > 0)
{
Console.WriteLine("|-------------------------------------------------------------|---------|");
Console.WriteLine("| Network Name | RSSI | BSSID | Channel |");
Console.WriteLine("|-------------------------------------------------------------|---------|");
foreach (WifiNetwork accessPoint in networks)
{
Console.WriteLine($"| {accessPoint.Ssid,-32} | {accessPoint.SignalDbStrength,4} | {accessPoint.Bssid,17} | {accessPoint.ChannelCenterFrequency,3} |");
}
}
else
{
Console.WriteLine($“No access points detected.”);
}
}
‘App.exe’ (CLR v4.0.30319: DefaultDomain): Loaded ‘C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll’. Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.
‘App.exe’ (CLR v4.0.30319: DefaultDomain): Loaded ‘D:\Source\repos\meadow\MeadowApplication1\bin\Debug\net472\App.exe’. Symbols loaded.
‘App.exe’ (CLR v4.0.30319: App.exe): Loaded ‘D:\Source\repos\meadow\MeadowApplication1\bin\Debug\net472\Meadow.dll’. Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.
The program ‘[16628] App.exe’ has exited with code 0 (0x0).
Meadow successfully started MONO Initialize hardware…
Mono enabled, will run app.exe Unhandled Exception: System.InvalidOperationException: Coprocessor is not ready or is sleeping.
at Meadow.Devices.Esp32Coprocessor.CheckStatus () <0xc0d94bb8 + 0x00018> in <1d12d24bb4cb45e5b8da959c3c36c73b>:0
at Meadow.Devices.Esp32Coprocessor.SetAntenna (Meadow.Gateways.AntennaType antenna, System.Boolean persist) <0xc0d94a98 + 0x0001a> in <1d12d24bb4cb45e5b8da959c3c36c73b>:
at MeadowApplication1.MeadowApp.ScanForAccessPoints () <0xc0d93c60 + 0x00032> in :0
at MeadowApplication1.MeadowApp…ctor () <0xc0833898 + 0x00012> in :0
at MeadowApplication1.Program.Main (System.String[] args) <0xc08336b8 + 0x00034> in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationExcept ion: Coprocessor is not ready or is sleeping.
at Meadow.Devices.Esp32Coprocessor.CheckStatus () <0xc0d94bb8 + 0x00018> in <1d12d24bb4cb45e5b8da959c3c36c73b>:0
at Meadow.Devices.Esp32Coprocessor.SetAntenna (Meadow.Gateways.AntennaType antenna, System.Boolean persist) <0xc0d94a98 + 0x0001a> in <1d12d24bb4cb45e5b8da959c3c36c73b>:0
at MeadowApplication1.MeadowApp.ScanForAccess oints () <0xc0d93c60 + 0x00032> in :0
at MeadowApplication1.MeadowApp…ctor () <0xc0833898 + 0x00012> in :0
at MeadowApplication1.Program.Main (System.String[] args) <0xc08336b8 + 0x00034> in :0
UPDATE STEPS
D:\Source\repos\meadow>meadow --InstallDfuUtil
Installing dfu-util…
dfu-util 0.10 installed
D:\Source\repos\meadow>meadow --FlashOS
Flashing OS with C:\Users…\AppData\Local\WildernessLabs\Firmware\Meadow.OS.bin
dfu-util 0.10
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2020 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Warning: Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Match vendor ID from file: 0000
Match product ID from file: 0000
Opening DFU capable USB device…
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface…
Setting Alternate Setting #0 …
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash "
Downloading element to address = 0x08000000, size = 2097152
Erase [=========================] 100% 2097152 bytes
Erase done.
Download [=========================] 100% 2097152 bytes
Download done.
File downloaded successfully
Transitioning to dfuMANIFEST state
D:\Source\repos\meadow> meadow --MonoDisable -s COM9
Opening port ‘COM9’
Data: Mono enabled, will run app.exe
Data: Mono has been disabled. Restarting Meadow
Device successfully reconnected
Data: Mono enabled, will run app.exe
D:\Source\repos\meadow>meadow --MonoUpdateRt -s COM9
Opening port ‘COM9’
FileName not specified, using latest download.
Updating runtime…
[==================================================]
Data: Download of ‘Meadow.OS.Runtime.bin’ success (checksums calc:0xECE2E753, expected:0xECE2E753)
Data: Erasing mono flash memory
Data: Mono memory erase success
Data: Flashing 10% complete
Data: Flashing 20% complete
Data: Flashing 30% complete
Data: Flashing 40% complete
Data: Flashing 50% complete
Data: Flashing 60% complete
Data: Flashing 70% complete
Data: Flashing 80% complete
Data: Flashing 90% complete
Data: Mono runtime successfully flashed.
D:\Source\repos\meadow>meadow --FlashEsp -s COM9
Opening port ‘COM9’
Transferring MeadowComms.bin
Erasing ESP32 Flash…Data: Mono must be disabled for ESP32 file download
done.
[==================================================]
Transferring bootloader.bin
Erasing ESP32 Flash…done.
[==================================================]
Transferring partition-table.bin
Erasing ESP32 Flash…done.
[==================================================]
D:\Source\repos\meadow> meadow --MonoEnable -s COM9
Opening port ‘COM9’
Data: Mono has been enabled. Restarting F7 Micro
Device successfully reconnected
Data: Mono enabled, will run app.exe
D:\Source\repos\meadow>meadow --Download
Download and extracted OS version 0.4.6.2 to:
C:\Users…\AppData\Local\WildernessLabs\Firmware