RC-1.1

RC-1.1 (RC1 Hotfix Release 1)

We’re happy to announce an amendment release to RC1, providing an out-of-band critical fix for the AMQP protocol and therefore for connecting to Azure Iot Hubs and other cloud services. To get started on connecting your Meadow to the cloud, check out our sample!

In addition, this release includes:

Meadow.OS + Meadow.Core

  • Debugging fix - A Meadow Debugging connection fix for the latest versions of Visual Studio
  • Battery voltage API - Device.GetBatteryInfo().Voltage now properly works on FeatherV2 devices
  • Sensor abstractions - A new ISamplingSensor abstraction makes it easier to swap sensor hardware with minimal code changes

Meadow.Foundation

  • New GPS driver - The NEO-M8 GPS module is now supported over serial
  • New Air quality sensor - The SCD40/41 air quality sensor is now supported
  • MicroGraphics vertical text alignment - It’s now possible to align text both horizontally and vertically with MicroGraphic

This release also includes several Meadow.Foundation bug fixes - details are here

Updating to RC-1.1

This release includes an OS update, and new Meadow nuget packages. The CLI and extensions are unchanged.

Updating Meadow.OS

Download the latest os:

meadow download os

Update by putting your Meadow device in boot loader mode and running:

meadow flash os

If you experience any stability or deployment issues you may need to erase the flash on Meadow and then re-install the latest OS:

meadow flash erase

RC-1

We’re so excited to present to you the first Meadow v1.0 Release-Candidate!!! This is a MASSIVE release with a pile of fixes and way more features than we expected.

Meadow.Cloud

  • OtA Updates - Meadow.OS and Meadow applications can now be updated Over-the-Air via Meadow.Cloud!
  • Push Messaging - Meadow.OS now supports push-messaging from Meadow.Cloud as well as MQTT as a first-class feature. Meadow.OS + Meadow.Core

  • Power & Sleep APIs - Meadow.OS now supports Sleep and Wake operations for the device, and has a new set of APIs that expose the ability ability to put the device to sleep and then wake up on schedule.
  • Just-in-Time (JIT) Compilation - Meadow applications can now enable JIT execution, providing a ~5x-10x performance boost for app execution.
  • New App Lifecycle - We’ve greatly simplified the boilerplate code needed to create a Meadow application, as well as provided an easy way to integrate with the new Power, Sleep, and OS/App update lifecycle.
  • Lower Power Use on Idle - The STM32 CPU now idles using its hardware capabilities, reducing total Meadow power consumption considerably.
  • TLS Certificate Validation & other improvements - The OS now checks the full validity of TLS (aka. HTTPS/SSL) server certificates against a root Certificate Authority registry. We also implemented logic for more edge cases of TLS datastream processing.
  • Faster WiFi Connection - We have made changes to the event model on the ESP32 resulting in a 90% decrease in WiFi connection times, reducing WiFi connection time to 3-5 second on average.
  • Faster Meadow.OS Startup - We removed an errant 10 second wait time on startup.
  • Core-Compute Module Ethernet Support - Ethernet connectivity is now available on the Core-Compute Module.
  • Network Improvements - We’ve spent a lot of cycles on advanced web socket features that weren’t implemented yet that unlock a number of important service connectivity use cases.
  • Configuration Files - Meadow now has robust support for compile-time configuration via YAML or JSON files.
  • Improved Meadow.OS Stability - Some deep assembly-level instruction calls have been fixed up, providing stability around long-running processes, advanced socket operation, and more.
  • System.IO.Compression - Meadow apps can now zip and unzip files and streams!
  • Memory Usage Decrease - The .NET runtime was configured to reduce its memory use for internal data structures.

Meadow.Foundation

  • MicroGraphics - We’ve optimized the APIs, combined with JiT and you’ll see a 10x improvement in drawing speed. We’ve also cleaned up APIs and added an 8x16 font!
  • ePaper driver updates - We’ve updated APIs and added new drivers including 12 new WaveShare ePaper drivers.
  • IO Expanders - This release includes the long awaited updates to the MCP23008 with working interrupts! It also includes 7 other MCP expanders and we released drivers for the AS1115 and the SerialWombat!
  • BMI270 - We’ve added a driver for this top-of-the line motion sensor which is included on the Project Lab board!

Tooling

  • App Linking - Meadow apps are now linked at deploy time, which removes unused code. Deployment size with linking is typically reduced by 2/3rds. The result is a massive reduction of space on flash, RAM usage and results in faster startup and faster deployment.
  • Deployment/Debugging Stability - We’ve fixed lots of paper cuts in the IDE extensions and added a number of new features that massively improve the day to day development experience with Meadow.
  • App Template Updates - We’ve updated the Meadow App templates to support the new app lifecycle.

Updating to RC-1

This is a full stack release requiring an OS update, new nuget packages, a new Meadow CLI and new Visual Studio extensions.

Updating Meadow.CLI

Start by making sure you have the latest version of the CLI (0.90.0) by running:

dotnet tool update Wildernesslabs.Meadow.CLI --global

Updating Meadow.OS

Download the latest os:

meadow download os

And update by putting your Meadow device in boot loader mode and running:

meadow flash os

NOTE: - After flashing Meadow.OS, if the runtime upload does not complete with an error of cannot connect to Meadow, push the RST button on your Meadow device and then execute:

meadow flash os -d

This skips the initial (already completed) Meadow.OS upload and retries the runtime upload. We’re not sure what’s causing this issue, but it’s under investigation.

If you experience any stability or deployment issues you may need to erase the flash on Meadow and then re-install the latest OS:

meadow flash erase

Release Details

Meadow.Cloud

With Meadow.OS v1.0 RC-1, we’ve also launched the first beta of Meadow.Cloud, including two core features:

  • MQTT Push-Messaging - Each Meadow device is now individually addressable and you can push messages containing arbitrary data to them.
  • Over-the-Air (OtA) Updates - You can now push App updates remotely to devices.

Users interested in the beta can sign up using this form. Meadow Cloud OtA is available via Meadow.CLI right now, with a Web UI coming in the future.

Meadow.OS

Faster OS and App Startup

There was a leftover 10 second startup delay from debugging Meadow.OS startup and initialization code that we removed. Additionally, linking (see below) also greatly improved app startup speed. The net effect of these improvements has seen a dramatic increase in OS and App startup speed.

Meadow.OS and .NET Stability

We’ve fixed several issues with the Mono runtime’s execution on Meadow, including a bad value in a bespoke ARM-Thumb2 assembly-code trampoline that caused .NET runtime stability issues when using runtime internal calls from .NET code (e.g. in file and network I/O).

We also did a lot of work around the .NET Runtime -> Meadow.OS glue that fixed up a number of stability issues.

Just-in-Time (JiT) Compilation

Meadow.OS now has JiT compilation support, which compiles code on startup to low-level assembly language, rather than executing .NET Intermediate-Language (IL) in a virtual machine as interpreted instructions. This provides around a magnitude of performance improvement across the board, with some code instructions seeing even more improvements. Check out the Meadow Benchmarks Sample for specific performance improvement benchmarks.

Enabling JiT

While we’ve thoroughly tested JiT with all samples, there may still be edge cases where unexpected behavior is seen, so JiT is off by default. A later release will make it on by default.

To enable JIT in your Meadow application

  1. Add a Meadow config file - add a text file named meadow.config.yaml
  2. Configure Build Action - Ensure file is set to a Build configuration of none and is always copied to the Output Directory
  3. Enable JiT in Config - Enable JIT in the meadow.config.yaml file - add the following YAML

     MonoControl:
         Options: --jit
    
  4. Deploy - Deploy your app using the IDE extension or Meadow.CLI as you normally would, at startup, Meadow.OS will compile your app for all the speed!

Networking Stack

Faster WiFi Connection

WiFi connection time has been reduced by 90%. Meadow should now connect to WiFi in 3 seconds or less.

Stabilization

We’ve invested a huge amount of effort in this release resolving customer reported networking issues (thank you for filing issues with repros!) that exercised advanced socket features.

This release fixes a number of issues around web request stability as well as cloud integrations with Azure IoT, Google Cloud, and more.

Core-Compute Ethernet Support

Ethernet is now available for use on the Core-Compute module.

Configuration Files

We did a major overhaul to app, network, and OS build-time configuration support. We also re-enabled the WiFi configuration which was disabled in the last release due to a crasher bug.

Meadow apps now have sophisticated support for a number of configuration files and formats (both YAML and JSON).

Check out the Configuration Guide for more information.

Meadow.Core

Since breaking APIs after release is never a good thing, we’re driving hard toward a solid, future-proof Core API. The largest change here is in the application lifecycle. With the addition of Over-the Air (OtA) updating capability, Meadow needs to be able to do controlled shutdown and startup of the application. These changes require updating existing applications, and those changes are outlined below.

API and Stability Fixes

Serial Ports

We’ve exposed public setters for Parity, DataBits and StopBits so they don’t have to be set only during construction.

More Unitized

An underlying philosophy on Meadow is that to improve code clarity and reduce bugs, data should always carry units with it and all methods should use units where applicable. PWMs have been reworked to use Frequency units and DigitalInputPorts have been changed to use TimeSpan for both GlitchDuration and DebounceDuration

Disposable Objects

While it’s common for many applications to allocate and use a Port for its lifetime, it’s not required. We’ve implemented the IDisposable pattern in the lower levels of many of the Port classes to free up pin allocations when the consuming port has been Disposed.

New Meadow App Lifecycle

Meadow applications now have a prescriptive lifecycle that greatly simplifies the amount of boilerplate code necessary to create an app, including removal of the static void Main() launch method. There are also a number of new lifecycle events overridable in the App class that provide an easy way to hook into the new lifecycle features such as the Power & Sleep APIs, as well as OtA updates.

If you’re moving from a Meadow.OS Beta app to a Meadow.OS Release Candidate app, you’ll need to make a few updates.

For more information check out the following docs:

  • Lifecycle Update - Instructions for updating apps from previous betas to the new app pattern.
  • Meadow Apps - Provides an overview of the new app model and lifecycle events.

Service Resolver

Meadow.Core now contains a static service resolver called Resolver that can be used to create, store, retrieve and even do dependency injection of class instances. The Resolver is the new mechanism for retrieving the existing IApp or IMeadowDevice in your application instead of static instances in the Application.

Logging

The Resolver also contains an instance of a simple Logger. This Logger supports the same methods as the larger .NET logging interface and provides the ability to add log providers to allow your application to log to things like files, databases or REST endpoints. The default instance logs to the Console.

Application Configuration

Meadow.Core now supports application configuration through config files names app.config.json or app.config.yaml. These files use the Microsoft Configuration Extensions API to maintain familiarity and a common API. Take a look at the Application Settings Configuration Guide for more information.

Network APIs

A unified API for getting access to the devices INetworkAdapters has been introduced and the old mechanisms for interacting with the WiFi adapter have been deprecated. See the updates in the Networking Guide for more information.

Power & Sleep APIs

Sleep API

The Sleep API has been implemented and moved to PlatformOS.

To put your Meadow into a low-power Sleep state, use the following call:

Device.PlatformOS.Sleep(TimeSpan.FromSeconds(5));

Known Issue: When waking from Sleep, if your application attempts to write to the Console within less than approximately 3 seconds, the underlying serial connection will not be available and the application will halt. For this reason, we recommend adding a Thread.Sleep(3000); immediately after any call to Sleep() or at the top of any Device.PlatformOS.AfterWake handler.

Reset API

The Reset API has been moved to PlatformOS.

To reset your meadow, use the following call:

Device.PlatformOS.Reset();

Serial Ports

We’ve exposed public setters for Parity, DataBits and StopBits so they don’t have to be set only during construction.

Counters

We’ve added support for a Counter class on the device to count interrupt edges or pulses.

Meadow.Foundation

This release includes new drivers, improved APIs, improved performance, and bug fixes. You can see the full is of fixes, improvements and new drivers here.

New drivers

  • BMI270 - We’ve added a driver for this top-of-the line motion sensor which is included on the Project Lab board!
  • MCP23xxx - This release includes a complete rewrite of the MCP23008 driver and adds the MCP23S08, MCP23009, MCP23S09, MCP23017, MCP23S17 MCP23018, MCP23S18.
  • UC8151C - An ePaper controller driver commonly used by WaveShare.
  • SSD1680 - Another ePaper driver used in a variety of displays including Adafruit.
  • WaveShare ePaper drivers - We’ve added 12 WaveShare-specific drivers that make it easy to use WaveShare displays without hunting for drivers controller names.
  • SerialWombat - We’ve added support for the popular PIC powered Serial Wombat IO expander.
  • AS1115 - This is a commonly used commodity priced IO expander and LED driver.
  • Altair 8800 Click board - This special edition Click board includes 16 buttons and a 8x8 LED matrix.

MicroGraphics

We’ve optimized the APIs, combined with JiT and you’ll see a 10x improvement in drawing speed. We’ve also cleaned up APIs and added a 8x16 font!

CommonType Moved

The CommonType enum has moved out of the Leds class.

If you’ve previously used CommonType with a fully qualified name - i.e. Meadow.Peripherals.Leds.CommonType.CommonAnode, update it to CommonType.CommonAnode and add using Meadow.Foundation.Leds.

displayColorMode display driver parameter renamed to colorMode

This parameter has been renamed for simplicity and consistency. Will only impact code that explicitly assigns the ctor parameter by name.

Tooling (Meadow.CLI, IDE Extensions, and Templates)

We’ve been reviewing the tooling code line-by-line and this release delivers dozens of fixes and optimizations. You should see better stability, consistency, and performance with both the Meadow CLI and the Visual Studio extensions.

  • Application Templates - We’ve also updated the Meadow application templates to reflect the new and improved Meadow lifecycle APIs.
  • Just-in-time compilation - JiT is enabled by default when creating new applications in Visual Studio.(JiT can be disabled by editing meadow.config.yaml in your Meadow project).

Linking Enabled by Default

With RC-1, app code is linked by default. Linking (AKA “Tree-Shaking”) walks the code tree and removes unused functions. This drastically reduces the amount of deployed code (Hello, World goes from ~26MB to 5MB) and has a number of massive benefits, including:

  • Faster Deployments - App deployment is much faster, due to less code being uploaded.
  • More Available Storage - Less uploaded code means more room on non-volatile storage (flash).
  • Faster App Startup and More Available Memory - Less code means less code loaded into memory, reducing app startup and more available memory for allocations.

Project Template Changes

With the greatly simplified boilerplate code needed to create a Meadow application, the project templates have been updated with the new lifecycle methods.

Just-in-time compilation - JiT is enabled by default when creating new applications in Visual Studio. (JiT can be disabled by editing meadow.config.yaml in your Meadow project).

Debugging Stability

As part of the stability and performance work, we’ve invested significant time on debugging. Debugging should be more consistent and more stable across Visual Studio on Windows, Visual Studio for Mac and Visual Studio Code.

RC-1 Bug Fixes

Known Issues

  • If the Deploy fails during the file transfer, you MUST reset the board before deploying again. Deploy will fail if you don’t. After resetting and re-deploying the transfer should then continue where it left off. A fix is being worked on for RC2
  • There is some extra logging code that shows how many bytes are being sent and received between the Meadow and Visual Studio, so we can track down a buffer overflow bug. This extra logging will be removed in RC2.
  • Occationally (hopefully rarely) you may get an error which relates to serial port/addresses already being in use. You may have to reboot your machine and meadow device to be able to free up the port/address and be able to redeploy your Meadow. If you see it and can supply us with a consistent repro, that would be very useful to squashing this bug.
  • [Windows Extensions] Due to an MS API change auto-deploy when debugging does not currently work. WORK AROUND: To debug on Windows deploy your app 1st, then hit the Debug button to step through your deployed code etc. We are working on a fix for this issue for RC2. Appologies for the inconvenience.

Meadow.OS Deploy, App Deploy/Debug Workflow

This release has been a long journey that added our final v1.0 features, and did final polishes to our APIs, however, the OS Deploy, App Deploy/Debug cycles still have some hiccups that we’ll spend time stabilizing for RC-2/v1.0.

 


These docs are open source. If you find an issue, please file a bug, or send us a pull request. And if you want to contribute, we'd love that too!