WildernessLabs.Meadow.CLI 2.0.0-alpha.3

This is a prerelease version of WildernessLabs.Meadow.CLI.
There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global WildernessLabs.Meadow.CLI --version 2.0.0-alpha.3
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local WildernessLabs.Meadow.CLI --version 2.0.0-alpha.3
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=WildernessLabs.Meadow.CLI&version=2.0.0-alpha.3&prerelease
nuke :add-package WildernessLabs.Meadow.CLI --version 2.0.0-alpha.3

<img alt="Meadow CLI project banner stating Meadow's Command-Line-Interface to interact with the board and perform functions via a terminal/command-line window." src="Design/banner.jpg" style="margin-bottom:10px" />

Build Status

Build

Getting Started

The CLI tool supports DFU flashing for nuttx.bin and nuttx_user.bin. When the application is run with -d, it looks for nuttx.bin and nuttx_user.bin in the application directory and if not found, it will abort. Optionally, paths for the files can be specific with --osFile and --userFile.

The CLI tool also supports device and file management including file transfers, flash partitioning, and MCU reset.

To install the latest Meadow.CLI release, run the .NET tool install command to get the latest package from NuGet.

dotnet tool install WildernessLabs.Meadow.CLI --global

For the latest getting started instructions with Meadow and Meadow.CLI, check out the Meadow guides in the Wilderness Labs documentations. Additionally, there are instructions there for updating an existing Meadow.CLI install.

If you want to develop or build a Meadow.CLI directly, or install a pre-release version, follow the instructions to install a pre-release Meadow.CLI.

Once installed, run the Meadow.CLI from a command line with meadow.

Options

To see the options, run the application with the --help arg.

Running Commands

Specifying the Serial Port

File and device commands require you to specify the serial port (-s or --SerialPort). You can determine the serial port name in Windows by viewing the Device Manager. The CLI will remember the last Serial Port used, so you only need to specify it if you need to change the value.

On Mac and Linux, the serial port will show up in the /dev folder, generally with the prefix tty.usb. You can likely find the serial port name by running the command ls /dev/tty.usb.

Setting the Log Verbosity

Appending -v or -vv to any command will increase the logging verbosity to Debug and Trace respectively. Trace should only be necessary when debugging issues with the CLI.

Available Commands

meadow v1.0.0

USAGE
  meadow [options]
  meadow [command] [...]

OPTIONS
  -h|--help         Shows help text. 
  --version         Shows version information. 

COMMANDS
  app deploy        Deploy the specified app to the Meadow 
  cloud login       Log into the Meadow Service 
  cloud logout      Logout of the Meadow Service 
  debug             Debug a Meadow Application 
  device info       Get the device info 
  device mac        Read the ESP32's MAC address 
  device name       Get the name of the Meadow 
  device provision  Registers and prepares connected device for use with Meadow Cloud 
  download os       Downloads the latest Meadow.OS to the host PC 
  esp32 file write  Write files to the ESP File System 
  esp32 restart     Restart the ESP32 
  file delete       Delete files from the Meadow File System Subcommands: file delete all.
  file initial      Get the initial bytes from a file 
  file list         List files in the on-board filesystem 
  file write        Write files to the Meadow File System 
  flash erase       Erase the flash on the Meadow Board 
  flash esp         Flash the ESP co-processor 
  flash os          Update the OS on the Meadow Board 
  flash verify      Verify the contents of the flash were deleted 
  fs renew          Create a File System on the Meadow Board 
  install dfu-util  Install the DfuUtil utility 
  list ports        List available COM ports 
  listen            Listen for console output from Meadow 
  mono disable      Sets mono to NOT run on the Meadow board then resets it 
  mono enable       Sets mono to run on the Meadow board and then resets it 
  mono flash        Uploads the mono runtime file to the Meadow device. Does NOT move it into place 
  mono state        Returns whether or not mono is enabled or disabled on the Meadow device 
  mono update rt    Uploads the mono runtime files to the Meadow device and moves it into place 
  nsh disable       Disables NSH on the Meadow device 
  nsh enable        Enables NSH on the Meadow device 
  package create    Create Meadow Package 
  package list      List Meadow Packages 
  package publish   List Meadow Packages 
  package upload    Upload Meadow Package 
  qspi init         Init the QSPI on the Meadow 
  qspi read         Read a QSPI value from the Meadow 
  qspi write        Write a QSPI value to the Meadow 
  set developer     Set developer value 
  trace disable     Disable Trace Logging on the Meadow 
  trace enable      Enable trace logging on the Meadow 
  trace level       Enable trace logging on the Meadow 
  uart trace        Configure trace logs to go to UART 
  use port          Set the preferred serial port

Getting Help

Specifying --help with no command will output the list of available commands. Specifying --help after a command (e.g., meadow file delete --help) will output command specific help.

meadow v1.0.0

USAGE
  meadow file delete --files <values...> [options]
  meadow file delete [command] [...]

DESCRIPTION
  Delete files from the Meadow File System

OPTIONS
* -f|--files        The file(s) to delete from the Meadow Files System
  -s|--SerialPort   Meadow COM port Default: "COM10".
  -g|--LogVerbosity  Log verbosity
  -h|--help         Shows help text.

COMMANDS
  all               Delete all files from the Meadow File System

You can run `meadow file delete [command] --help` to show help on a specific command.
Done!

Useful commands

Update the Meadow OS

meadow flash os
Meadow.CLI download location

If you need to find or clear out any of the OS download files retrieved by Meadow.CLI, they are located in a WildernessLabs folder in the user directory.

macOS: ~/.local/share/WildernessLabs/Firmware/ Windows: %LOCALAPPDATA%\WildernessLabs\Firmware

Listen for Meadow Console.WriteLine

meadow listen

Set the trace level

You can set the debug trace level to values 0, 1, 2, or 3. 2 is the most useful.

meadow trace enable --level 2

File transfers

meadow files write -f [NameOfFile]

You may specify multiple instances of -f to send multiple files

List files in flash

meadow files list

Delete a File

meadow files delete -f [NameOfFile]

You may specify multiple instances of -f to send multiple files

Stop/start the installed application from running automatically

meadow mono disable
meadow mono enable

Useful utilities

meadow device info
meadow device name

Debugging

NOTE THIS IS NOT YET FULLY IMPLEMENTED, IT WILL NOT WORK

meadow debug --DebugPort XXXX

This starts listening on the specified port for a debugger to attach

Note: you can use SDB command line debugger from https://github.com/mono/sdb. Just build it according to its readme, run the above command and then:

sdb "connect 127.0.0.1 XXXX"

Substitute XXXX for the same port number as above

Running applications

You'll typically need at least 5 files installed to the Meadow flash to run a Meadow app:

  1. System.dll
  2. System.Core.dll
  3. mscorlib.dll
  4. Meadow.Core.dll
  5. App.exe (your app)

It's a good idea to disable mono first, copy the files, and then enable mono

Uninstall the Meadow.CLI tool

If you ever need to remove the Meadow.CLI tool, you can remove it through the .NET command-line tool as you would any other global tool.

dotnet tool uninstall WildernessLabs.Meadow.CLI --global

Install a downloaded pre-release version

If you want to test one of the automated pre-release builds of the Meadow.CLI tool you have downloaded, you'll need to specific some extra parameters.

  1. Download a pre-release version, typically from an automated build.

  2. Extract the package .nupkg file from the downloaded archive.

  3. Uninstall the existing tool.

    dotnet tool uninstall WildernessLabs.Meadow.CLI --global
    
  4. Install the pre-release version from the download location by providing a version parameter for {pre-release-version} and source location of the .nupkg file for {path-to-folder-with-downloaded-nupkg}.

    dotnet tool install WildernessLabs.Meadow.CLI --version '{pre-release-version}' --global --add-source '{path-to-folder-with-downloaded-nupkg}'
    
  5. Verify the version of your Meadow.CLI tool.

    meadow --version
    

Return to an official release version

After you are done testing a pre-release build, you can return to the official Meadow.CLI release by uninstalling and reinstalling without the local overrides.

dotnet tool uninstall WildernessLabs.Meadow.CLI --global
dotnet tool install WildernessLabs.Meadow.CLI --global

License

Copyright Wilderness Labs Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
2.0.36-beta 44 4/25/2024
2.0.35 168 4/19/2024
2.0.34 87 4/18/2024
2.0.33 479 3/29/2024
2.0.32 233 3/29/2024
2.0.31 334 3/23/2024
2.0.30 307 3/19/2024
2.0.29 307 3/15/2024
2.0.28 274 3/15/2024
2.0.27 251 3/15/2024
2.0.26-beta 218 3/15/2024
2.0.25-beta 251 3/14/2024
2.0.24 378 3/14/2024
2.0.23 339 3/10/2024
2.0.22 277 3/7/2024
2.0.21 280 3/7/2024
2.0.20 379 3/6/2024
2.0.19 446 3/3/2024
2.0.18 469 2/29/2024
2.0.17 435 2/27/2024
2.0.16-beta 291 2/27/2024
2.0.15-alpha 356 2/27/2024
2.0.14-alpha 291 2/27/2024
2.0.13-alpha 260 2/27/2024
2.0.12-beta 253 2/27/2024
2.0.11-beta 272 2/24/2024
2.0.10 430 2/23/2024
2.0.9 454 2/22/2024
2.0.8 443 2/21/2024
2.0.7.1 425 2/18/2024
2.0.7 554 2/18/2024
2.0.6 300 2/15/2024
2.0.5 418 2/14/2024
2.0.4 315 2/13/2024
2.0.3 519 2/12/2024
2.0.2 525 2/9/2024
2.0.1.2 349 2/7/2024
2.0.1.1-beta 435 2/3/2024
2.0.1-beta 462 2/3/2024
2.0.0.10 387 2/1/2024
2.0.0-beta.4 46 2/1/2024
2.0.0-beta.3 50 1/30/2024
2.0.0-beta.2 52 1/28/2024
2.0.0-beta.1 56 1/24/2024
2.0.0-alpha.3 131 11/17/2023
2.0.0-alpha.1 85 10/31/2023
2.0.0-alpha 697 10/25/2023
1.9.0 342 2/28/2024
1.5.0 1,285 11/30/2023
1.4.0 1,031 10/31/2023
1.3.4 1,144 9/26/2023
1.3.0 1,147 8/29/2023
1.2.0 1,160 8/1/2023
1.1.1 981 7/20/2023
1.1.0 1,021 7/11/2023
1.0.4 964 6/29/2023
1.0.2.2 1,079 6/4/2023
1.0.2.1 895 6/4/2023
1.0.2 835 6/3/2023
1.0.0 1,013 5/18/2023
0.98.0 1,034 5/6/2023
0.96.2 1,092 4/2/2023
0.96.0-alpha 1,073 3/8/2023
0.95.0-alpha 1,029 2/22/2023
0.94.1-beta 898 2/17/2023
0.94.0-beta 902 2/16/2023
0.90.4 1,568 1/1/2023
0.90.3 1,008 1/1/2023
0.90.2 1,005 12/31/2022
0.90.0 1,501 10/24/2022
0.19.9-beta 1,025 9/27/2022
0.19.4 1,557 7/7/2022
0.19.3 1,547 5/30/2022
0.19.2 1,331 5/27/2022
0.19.1 1,584 3/18/2022
0.19.0 1,120 3/17/2022
0.15.2 1,452 3/7/2022
0.15.1 1,320 12/21/2021
0.15.0 1,363 11/8/2021
0.14.7 1,197 10/13/2021
0.14.5 1,267 8/26/2021
0.14.4 1,192 8/25/2021
0.14.3 1,167 8/10/2021
0.14.2 1,298 7/12/2021
0.14.1 1,205 7/10/2021
0.14.0 1,164 7/5/2021
0.13.0 1,259 5/25/2021
0.12.10 1,416 2/18/2021
0.12.9 1,232 2/17/2021
0.12.8 1,474 2/8/2021
0.12.7 1,445 2/7/2021
0.12.6 1,593 12/28/2020
0.12.5 1,526 12/15/2020
0.12.4 1,364 12/13/2020
0.12.3 1,500 12/12/2020
0.12.2 1,459 12/11/2020
0.12.1 1,308 12/11/2020
0.12.0 1,459 12/10/2020