From 421bc33b5e512f2282be89428c589f94a3239a16 Mon Sep 17 00:00:00 2001 From: Adrian Stevens Date: Tue, 23 Jul 2024 20:36:26 -0700 Subject: [PATCH 1/3] fix Meadow file initial --- .../v2/Meadow.Cli/Commands/Current/File/FileInitialCommand.cs | 2 +- Source/v2/Meadow.Cli/Meadow.CLI.csproj | 2 +- Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs | 2 +- Source/v2/Meadow.Cli/Properties/launchSettings.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/v2/Meadow.Cli/Commands/Current/File/FileInitialCommand.cs b/Source/v2/Meadow.Cli/Commands/Current/File/FileInitialCommand.cs index 22277c0f..91c6e78f 100644 --- a/Source/v2/Meadow.Cli/Commands/Current/File/FileInitialCommand.cs +++ b/Source/v2/Meadow.Cli/Commands/Current/File/FileInitialCommand.cs @@ -19,7 +19,7 @@ protected override async ValueTask ExecuteCommand() Logger?.LogInformation($"Reading file '{MeadowFile}' from device...\n"); - var data = await device.ReadFileString(AppTools.SanitizeMeadowFilename(MeadowFile), CancellationToken); + var data = await device.ReadFileString(MeadowFile, CancellationToken); if (data == null) { diff --git a/Source/v2/Meadow.Cli/Meadow.CLI.csproj b/Source/v2/Meadow.Cli/Meadow.CLI.csproj index 91a3000d..3624b1bf 100644 --- a/Source/v2/Meadow.Cli/Meadow.CLI.csproj +++ b/Source/v2/Meadow.Cli/Meadow.CLI.csproj @@ -10,7 +10,7 @@ Wilderness Labs, Inc Wilderness Labs, Inc true - 2.0.53.0 + 2.0.54.0 AnyCPU http://developer.wildernesslabs.co/Meadow/Meadow.CLI/ https://github.com/WildernessLabs/Meadow.CLI diff --git a/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs b/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs index cec335f4..fe1b57c9 100644 --- a/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs +++ b/Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs @@ -6,5 +6,5 @@ namespace Meadow.CLI; public static class Constants { - public const string CLI_VERSION = "2.0.53.0"; + public const string CLI_VERSION = "2.0.54.0"; } \ No newline at end of file diff --git a/Source/v2/Meadow.Cli/Properties/launchSettings.json b/Source/v2/Meadow.Cli/Properties/launchSettings.json index 4c48e266..2075af16 100644 --- a/Source/v2/Meadow.Cli/Properties/launchSettings.json +++ b/Source/v2/Meadow.Cli/Properties/launchSettings.json @@ -105,7 +105,7 @@ }, "File initial": { "commandName": "Project", - "commandLineArgs": "file initial meadow.log" + "commandLineArgs": "file initial app.build.yaml" }, "File Read Large": { "commandName": "Project", From 25f5dc86a0a4fc362e1cc9115e66fd32d48e9631 Mon Sep 17 00:00:00 2001 From: Adrian Stevens Date: Tue, 23 Jul 2024 20:58:24 -0700 Subject: [PATCH 2/3] Add delay between deletes when calling meadow file delete all --- Source/v2/Meadow.Cli/Commands/Current/File/FileDeleteCommand.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/v2/Meadow.Cli/Commands/Current/File/FileDeleteCommand.cs b/Source/v2/Meadow.Cli/Commands/Current/File/FileDeleteCommand.cs index 6c36588f..fb789510 100644 --- a/Source/v2/Meadow.Cli/Commands/Current/File/FileDeleteCommand.cs +++ b/Source/v2/Meadow.Cli/Commands/Current/File/FileDeleteCommand.cs @@ -92,5 +92,6 @@ private async Task DeleteFileRecursive(IMeadowDevice device, string directorynam Logger?.LogInformation($"Deleting file '{meadowFile}' from device..."); await device.DeleteFile(meadowFile, cancellationToken); + await Task.Delay(100); } } \ No newline at end of file From 6da0aa5acf1350a9b2bb477b6343e24ace73a46a Mon Sep 17 00:00:00 2001 From: Adrian Stevens Date: Tue, 23 Jul 2024 21:36:57 -0700 Subject: [PATCH 3/3] Add delay between writing coprocessor files to try to avoid 'device not connected' errors --- .../Meadow.Cli/Commands/Current/Firmware/FirmwareWriteCommand.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/v2/Meadow.Cli/Commands/Current/Firmware/FirmwareWriteCommand.cs b/Source/v2/Meadow.Cli/Commands/Current/Firmware/FirmwareWriteCommand.cs index 1cc45d41..b1d436b9 100644 --- a/Source/v2/Meadow.Cli/Commands/Current/Firmware/FirmwareWriteCommand.cs +++ b/Source/v2/Meadow.Cli/Commands/Current/Firmware/FirmwareWriteCommand.cs @@ -404,6 +404,7 @@ private async Task WriteEspFiles(IMeadowConnection? connection, DeviceInfo? devi foreach (var file in fileList) { await connection!.Device!.WriteFile(file, $"/{AppTools.MeadowRootFolder}/update/os/{Path.GetFileName(file)}"); + await Task.Delay(500); } } }