Meadow doesn't build propelly

problemMeadow

( The gif takes a while so be patient. )

As you can see, I get a build error, but my error log doesn’t show any error. However, The output gives me a timeout.

1>[14-7-2021 13:18:34] Found System.Numerics.dll (CRC: 2891790009)
1>[14-7-2021 13:18:34] Found Meadow.Foundation.dll (CRC: 3959266955)
1>[14-7-2021 13:18:34] Found App.deps.json (CRC: 0)
1>[14-7-2021 13:18:34] Writing file: App.deps.json
1>[14-7-2021 13:18:34] Meadow StdInfo: Meadow file download of 'App.deps.json' has begun
1>[14-7-2021 13:19:34] Exception sending command to Meadow
1>Command timeout waiting for response.
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

So I thought I would need to update my project, so I tried the following commands:

dotnet tool update Wildernesslabs.Meadow.CLI --global

and

meadow flash os

And this gives me the following error:

Flashing OS with C:\Users\onema\AppData\Local\WildernessLabs\Firmware\Meadow.OS.bin
ERROR
System.ComponentModel.Win32Exception: The system cannot find the specified file.
  at Meadow.CLI.Core.Internals.Dfu.DfuUtils.GetDfuUtilVersion() in C:\Projects\Meadow.CLI\Meadow.CLI.Core\Internals\Dfu\DfuUtils.cs:232
  at Meadow.CLI.Core.Internals.Dfu.DfuUtils.DfuFlashAsync(String filename, UsbRegistry device, ILogger logger) in C:\Projects\Meadow.CLI\Meadow.CLI.Core\Internals\Dfu\DfuUtils.cs:91
  at Meadow.CLI.Core.Devices.MeadowDeviceHelper.DfuFlashAsync(String serialPortName, String osPath, ILogger logger, CancellationToken cancellationToken) in C:\Projects\Meadow.CLI\Meadow.CLI.Core\Devices\MeadowDeviceHelper.cs:494
  at Meadow.CLI.Commands.DeviceManagement.FlashOsCommand.ExecuteAsync(IConsole console) in C:\Projects\Meadow.CLI\Meadow.CLI\Commands\DeviceManagement\FlashOsCommand.cs:43
  at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in \home\runner\work\CliFx\CliFx\CliFx\CliApplication.cs:147
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in \home\runner\work\CliFx\CliFx\CliFx\CliApplication.cs:191
Done!

Dfu-Utils is missing. So I tried the following command:

meadow install dfu-util

Which gives me a “Done!” message. After that I did the command again but still same error…
I don’t know what to do so this is my last change, I tried some stuff this guy (Meadow OS Flash Failure ) said, but still doesn’t work…

Hopefully someone can help me.

Do you get any output when you run the command meadow device info?

At first I got an error, it said

Value cannot be null. (Parameter 'PortName')

So I tried the following command:

meadow device info -s COM3

and this is the result:

Well the good news is that you can communicate to your Meadow on COM3.

Here is my output for the same command

Connecting to Meadow on COM3
Meadow by Wilderness Labs, Model: F7Micro, MeadowOS Version: 0.5.1.0 (Jun 19 2021 01:49:23), Processor: STM32F777IIK6, Processor Id: 38-00-41-00-0d-51-38-32-37-35-36-30, Serial Number: 307735793238, CoProcessor: ESP32, CoProcessor OS Version: Not available, Mono Version: 0.5.1.0, Device Name: MeadowF7
Done!

One thing I see is that it is behind in version. So I just tried to set this up on a different laptop that didn’t have anything Meadow related on it.

Couple of things to try:

  • Make sure you have used the Zadig tool to update the USB driver - Wilderness Labs Developer Portal
  • Make sure that dfu-util has been installed and on version 0.10 (I just used the built in meadow command that you referenced and where dfu-util will tell you if you have it installed and where it is located)
meadow install dfu-util
Installing dfu-util...
dfu-util 0.10 installed
Done!

where dfu-util
C:\Windows\System32\dfu-util.exe

This laptop didn’t have either, but once I did both of these things I was able to flash my Meadow on this new laptop.

Here is my device info after this update (note that the ESP was updated with this update.)

meadow device info -s COM3
Connecting to Meadow on COM3
Meadow by Wilderness Labs, Model: F7Micro, MeadowOS Version: 0.5.1.0 (Jun 19 2021 01:49:23), Processor: STM32F777IIK6, Processor Id: 38-00-41-00-0d-51-38-32-37-35-36-30, Serial Number: 307735793238, CoProcessor: ESP32, CoProcessor OS Version: 0.5.1.0, Mono Version: 0.5.1.0, Device Name: MeadowF7
Done!

I did everything you did but still nothing to find when searching for dfu-utils. And even after updating, my meadowOs version stays the same…

Hmmm well I am kinda running out of ideas myself.

Maybe try and run the command prompt as adminstrator. Maybe that is why the dfu-util isn’t installing (it does install it to the System32 folder so might need to be admin for that.)

Without the dfu-util app I’m not sure you will get it working. You could try and download the app manually, place it in its own folder in c:\Program Files and then add that folder to the PATH. A lot of extra work, but in the end you should see something when you run where dfu-util

If you do get dfu-util installed somehow, you will want to run a meadow flash os after running the meadow download os

Thanks for helping anyways! i’ll do my best and see what I can do, you atleast helped me to the good direction!

It worked! All I had to do is to start command prompt as adminstrator! Thanks for your help

1 Like

I figured out the issue with the dfu-util.exe error and building and deploying the app and downloading the OS to the meadow. What is happening is that when your run meadow dowload os -s COM4. On my PC it was bombing on the dfu-util.exe app because I never installed it. So I went to sourceforge and downloaded the tar file. Then unzipped it in to a new empty folder. Then I navigated in that newly unzipped file structure to the win64 folder. I copied all those file to c:\windows\system32 folder. Then presto. Everything worked. I guess you could update your path settings in your environment variables to include the newly unzipped dfu-util.exe location. This fixed my deploy from vs2019 as well.