├── .gitignore
├── Design
├── EnableDisable.png
├── meadow-projectlab-samples.jpg
├── meadow_samples_banner.jpg
├── project-lab-specs.jpg
├── projectlab-pinout-v1.jpg
├── projectlab-pinout-v2.jpg
├── projectlab-pinout-v3.jpg
├── template_empty.png
├── wildernesslabs-projectlab-ambient-room-monitor.png
├── wildernesslabs-projectlab-azure-iot-hub-web.png
├── wildernesslabs-projectlab-azure-iot-hub.png
├── wildernesslabs-projectlab-azure-servo.png
├── wildernesslabs-projectlab-bluetooth.png
├── wildernesslabs-projectlab-galleryviewer.png
├── wildernesslabs-projectlab-getting-started.png
├── wildernesslabs-projectlab-grove-moisture-meter.png
├── wildernesslabs-projectlab-magic-eight-meadow.png
├── wildernesslabs-projectlab-maple.png
├── wildernesslabs-projectlab-meadow-cloud-client.png
├── wildernesslabs-projectlab-meadow-cloud-logging.jpg
├── wildernesslabs-projectlab-meadow-cloud-relay-command.png
├── wildernesslabs-projectlab-micrographics.png
├── wildernesslabs-projectlab-microlayout-menu.png
├── wildernesslabs-projectlab-morse-code-trainer.png
├── wildernesslabs-projectlab-simon.png
└── wildernesslabs-projectlab-wifiweather.png
├── LICENSE
├── README.md
└── Source
├── AmbientRoomMonitor
├── .vscode
│ └── launch.config
├── AmbientRoomMonitor.csproj
├── Controllers
│ └── DisplayController.cs
├── Hardware
│ ├── AmbientRoomMonitorHardware.cs
│ └── IAmbientRoomMonitorHardware.cs
├── MainController.cs
├── MeadowApp.cs
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── AnalogClockFace
├── .vscode
│ └── launch.config
├── AnalogClockFace.csproj
├── MeadowApp.cs
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── Connectivity
├── .vscode
│ └── launch.config
├── Connectivity.Common
│ ├── Bluetooth
│ │ └── BluetoothConstants.cs
│ ├── CommonContracts.projitems
│ ├── Connectivity.Common.shproj
│ └── Models
│ │ ├── ClimateModel.cs
│ │ ├── IlluminanceModel.cs
│ │ └── MotionModel.cs
├── MeadowConnectedSample
│ ├── Connectivity
│ │ ├── BluetoothServer.cs
│ │ └── MapleRequestHandler.cs
│ ├── Controllers
│ │ ├── DisplayController.cs
│ │ ├── LedController.cs
│ │ └── MainController.cs
│ ├── MeadowApp.cs
│ ├── MeadowConnectedSample.csproj
│ ├── Resources
│ │ ├── img_ble_paired.bmp
│ │ ├── img_ble_pairing.bmp
│ │ ├── img_meadow.bmp
│ │ ├── img_wifi_connected.bmp
│ │ └── img_wifi_connecting.bmp
│ ├── Secrets.cs
│ ├── app.config.yaml
│ ├── meadow.config.yaml
│ └── wifi.config.yaml
└── MobileProjectLab
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AppShell.xaml
│ ├── AppShell.xaml.cs
│ ├── Converter
│ └── InverseBoolConverter.cs
│ ├── MauiProgram.cs
│ ├── MobileProjectLab.csproj
│ ├── Platforms
│ └── Android
│ │ ├── AndroidManifest.xml
│ │ ├── MainActivity.cs
│ │ ├── MainApplication.cs
│ │ └── Resources
│ │ ├── values
│ │ └── colors.xml
│ │ └── xml
│ │ └── network_security_config.xml
│ ├── Properties
│ └── launchSettings.json
│ ├── Resources
│ ├── AppIcon
│ │ ├── appicon.svg
│ │ └── appiconfg.svg
│ ├── Fonts
│ │ ├── OpenSans-Regular.ttf
│ │ └── OpenSans-Semibold.ttf
│ ├── Images
│ │ ├── img_ble_pair.svg
│ │ ├── img_ble_paired.svg
│ │ ├── img_project_lab.png
│ │ └── img_search.svg
│ ├── Raw
│ │ └── AboutAssets.txt
│ ├── Splash
│ │ └── splash.svg
│ └── Styles
│ │ ├── Colors.xaml
│ │ └── Styles.xaml
│ ├── Utils
│ └── BleConstants.cs
│ ├── View
│ ├── BluetoothPage.xaml
│ ├── BluetoothPage.xaml.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── MaplePage.xaml
│ └── MaplePage.xaml.cs
│ └── ViewModel
│ ├── BaseViewModel.cs
│ ├── BluetoothViewModel.cs
│ └── MapleViewModel.cs
├── GalleryViewer
├── .vscode
│ └── launch.config
├── Controllers
│ └── DisplayController.cs
├── GalleryViewer.csproj
├── Hardware
│ ├── GalleryViewerHardware.cs
│ └── IGalleryViewerHardware.cs
├── MainController.cs
├── MeadowApp.cs
├── Resources
│ ├── image1.jpg
│ ├── image2.jpg
│ └── image3.jpg
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── GridEYE
├── GridEYE.csproj
├── MeadowApp.cs
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── MagicEightMeadow
├── Controllers
│ └── DisplayController.cs
├── Hardware
│ ├── IMagicEightMeadowHardware.cs
│ └── MagicEightMeadowHardware.cs
├── MagicEightMeadow.csproj
├── MainController.cs
├── MeadowApp.cs
├── Resources
│ ├── m8b_01.bmp
│ ├── m8b_02.bmp
│ ├── m8b_03.bmp
│ ├── m8b_04.bmp
│ ├── m8b_05.bmp
│ ├── m8b_06.bmp
│ ├── m8b_07.bmp
│ ├── m8b_08.bmp
│ ├── m8b_09.bmp
│ ├── m8b_10.bmp
│ ├── m8b_11.bmp
│ ├── m8b_12.bmp
│ ├── m8b_13.bmp
│ ├── m8b_14.bmp
│ ├── m8b_15.bmp
│ ├── m8b_16.bmp
│ ├── m8b_17.bmp
│ ├── m8b_18.bmp
│ ├── m8b_19.bmp
│ ├── m8b_20.bmp
│ └── m8b_question.bmp
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── MathLineCharts
├── MathLineCharts.csproj
├── MeadowApp.cs
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── Meadow.Cloud_Update
├── .vscode
│ └── launch.json
├── DisplayController.cs
├── Meadow.Cloud_Update.csproj
├── MeadowApp.cs
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── Meadow.ProjectLab.Samples.sln
├── MeadowAzureFunction
├── .gitignore
├── Function1.cs
├── MeadowAzureFunction.csproj
├── Properties
│ ├── serviceDependencies.json
│ └── serviceDependencies.local.json
├── app.config.yaml
├── host.json
├── meadow.config.yaml
└── wifi.config.yaml
├── MeadowAzureIoTHub
├── MeadowAzureIoTHub
│ ├── Controllers
│ │ ├── DisplayController.cs
│ │ ├── IIoTHubController.cs
│ │ ├── IoTHubAmqpController.cs
│ │ └── IoTHubMqttController.cs
│ ├── Hardware
│ │ ├── IMeadowAzureIoTHubHardware.cs
│ │ └── MeadowAzureIoTHubHardware.cs
│ ├── MainController.cs
│ ├── MeadowApp.cs
│ ├── MeadowAzureIoTHub.csproj
│ ├── Resources
│ │ ├── img_meadow.bmp
│ │ ├── img_refreshed.bmp
│ │ ├── img_refreshing.bmp
│ │ ├── img_wifi_connected.bmp
│ │ └── img_wifi_connecting.bmp
│ ├── Secrets.cs
│ ├── app.config.yaml
│ ├── meadow.config.yaml
│ └── wifi.config.yaml
└── WebAzureIoTHub
│ ├── .vscode
│ └── launch.json
│ ├── LICENSE
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ ├── css
│ │ └── style.css
│ ├── index.html
│ └── js
│ │ └── chart-device-data.js
│ ├── scripts
│ ├── event-hub-reader.js
│ └── iot-hub-connection-string.js
│ └── server.js
├── MeadowAzureServo
├── Azure
│ └── IoTHubManager.cs
├── MeadowApp.cs
├── MeadowAzureServo.csproj
├── Models
│ └── RotateToEventArgs.cs
├── Secrets.cs
├── Views
│ └── ServoController.cs
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── MicroLayoutMenu
├── MeadowApp.cs
├── Menu.cs
├── MicroLayoutMenu.csproj
├── app.config.yaml
├── img_meadow.bmp
├── meadow.config.yaml
└── wifi.config.yaml
├── ModbusServer
├── DesktopModbusClient
│ ├── DesktopModbusClient.csproj
│ └── Program.cs
└── MeadowModbusServer
│ ├── MeadowApp.cs
│ ├── MeadowModbusServer.csproj
│ ├── RegisterBank.cs
│ ├── app.config.yaml
│ ├── meadow.config.yaml
│ └── wifi.config.yaml
├── MoistureMeter
├── .vscode
│ └── launch.config
├── Controllers
│ └── DisplayController.cs
├── MeadowApp.cs
├── MoistureMeter.csproj
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── MorseCodeTrainer
├── .vscode
│ └── launch.config
├── Controllers
│ └── DisplayController.cs
├── MeadowApp.cs
├── MorseCodeTrainer.csproj
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── PlantMonitor
├── .vscode
│ └── launch.config
├── Controllers
│ └── DisplayController.cs
├── MeadowApp.cs
├── PlantMonitor.csproj
├── level_0.jpg
├── level_1.jpg
├── level_2.jpg
├── level_3.jpg
└── meadow.config.yaml
├── RotatingCube
├── Cube3d.cs
├── MeadowApp.cs
├── RotatingCube.csproj
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── Simon
├── .vscode
│ └── launch.config
├── MeadowApp.cs
├── Simon.csproj
├── SimonGame.cs
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── ThermalCamera
├── MeadowApp.cs
├── ThermalCamera.csproj
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── WakeOnInterrupt
├── MeadowApp.cs
├── WakeOnInterrupt.csproj
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
├── WaterStorageMonitor
├── .vscode
│ └── launch.config
├── MaxBotix_to_Grove.png
├── Source
│ ├── Controllers
│ │ └── DisplayController.cs
│ ├── Hardware
│ │ ├── BenchProtoWaterMonitorHardware.cs
│ │ ├── HardwareConfigTypes.cs
│ │ ├── IWaterMonitorHardware.cs
│ │ ├── LabProtoWaterMonitorHardware.cs
│ │ └── WaterMonitorHardwareBase.cs
│ ├── MeadowApp.cs
│ ├── StorageContainer.cs
│ ├── StorageContainerConfig.cs
│ ├── WaterStorageMonitor.csproj
│ └── meadow.config.yaml
├── WaterStorageMonitor.jpg
├── Water_Barrel.jpg
├── app.config.yaml
├── meadow.config.yaml
├── readme.md
└── wifi.config.yaml
└── WifiWeather
├── .vscode
└── launch.config
├── Controllers
├── DisplayController.cs
└── RestClientController.cs
├── DTOs
└── WeatherReadingDTO.cs
├── Hardware
├── IWifiWeatherHardware.cs
└── WifiWeatherHardware.cs
├── MainController.cs
├── MeadowApp.cs
├── Resources
├── img_meadow.bmp
├── img_refreshed.bmp
├── img_refreshing.bmp
├── img_wifi_connected.bmp
├── img_wifi_connecting.bmp
├── w_clear_moon.bmp
├── w_clear_sun.bmp
├── w_clouds.bmp
├── w_clouds_moon.bmp
├── w_clouds_sun.bmp
├── w_drizzle.bmp
├── w_drizzle_heavy.bmp
├── w_drizzle_light_moon.bmp
├── w_drizzle_light_sun.bmp
├── w_misc.bmp
├── w_mist.bmp
├── w_rain.bmp
├── w_rain_heavy.bmp
├── w_rain_light_moon.bmp
├── w_rain_light_sun.bmp
├── w_snow.bmp
├── w_snow_light_moon.bmp
├── w_snow_light_sun.bmp
├── w_snow_rain.bmp
├── w_storm.bmp
├── w_storm_heavy.bmp
├── w_storm_light_moon.bmp
└── w_storm_light_sun.bmp
├── Secrets.cs
├── Utils
└── WeatherCodeConstants.cs
├── WifiWeather.csproj
├── app.config.yaml
├── meadow.config.yaml
└── wifi.config.yaml
/Design/EnableDisable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/EnableDisable.png
--------------------------------------------------------------------------------
/Design/meadow-projectlab-samples.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/meadow-projectlab-samples.jpg
--------------------------------------------------------------------------------
/Design/meadow_samples_banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/meadow_samples_banner.jpg
--------------------------------------------------------------------------------
/Design/project-lab-specs.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/project-lab-specs.jpg
--------------------------------------------------------------------------------
/Design/projectlab-pinout-v1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/projectlab-pinout-v1.jpg
--------------------------------------------------------------------------------
/Design/projectlab-pinout-v2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/projectlab-pinout-v2.jpg
--------------------------------------------------------------------------------
/Design/projectlab-pinout-v3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/projectlab-pinout-v3.jpg
--------------------------------------------------------------------------------
/Design/template_empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/template_empty.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-ambient-room-monitor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-ambient-room-monitor.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-azure-iot-hub-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-azure-iot-hub-web.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-azure-iot-hub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-azure-iot-hub.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-azure-servo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-azure-servo.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-bluetooth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-bluetooth.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-galleryviewer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-galleryviewer.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-getting-started.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-getting-started.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-grove-moisture-meter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-grove-moisture-meter.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-magic-eight-meadow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-magic-eight-meadow.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-maple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-maple.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-meadow-cloud-client.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-meadow-cloud-client.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-meadow-cloud-logging.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-meadow-cloud-logging.jpg
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-meadow-cloud-relay-command.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-meadow-cloud-relay-command.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-micrographics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-micrographics.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-microlayout-menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-microlayout-menu.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-morse-code-trainer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-morse-code-trainer.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-simon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-simon.png
--------------------------------------------------------------------------------
/Design/wildernesslabs-projectlab-wifiweather.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Design/wildernesslabs-projectlab-wifiweather.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/WildernessLabs/Meadow.Samples)
--------------------------------------------------------------------------------
/Source/AmbientRoomMonitor/.vscode/launch.config:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Deploy",
9 | "type": "meadow",
10 | "request": "launch",
11 | "preLaunchTask": "meadow: Build"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Source/AmbientRoomMonitor/AmbientRoomMonitor.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | PreserveNewest
15 |
16 |
17 | PreserveNewest
18 |
19 |
20 | PreserveNewest
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Source/AmbientRoomMonitor/Hardware/AmbientRoomMonitorHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Devices;
2 | using Meadow.Foundation.Sensors.Atmospheric;
3 | using Meadow.Peripherals.Displays;
4 | using Meadow.Peripherals.Leds;
5 | using Meadow.Peripherals.Sensors.Light;
6 |
7 | namespace AmbientRoomMonitor.Hardware
8 | {
9 | internal class AmbientRoomMonitorHardware : IAmbientRoomMonitorHardware
10 | {
11 | protected IProjectLabHardware ProjLab { get; private set; }
12 |
13 | public IPixelDisplay Display { get; set; }
14 |
15 | public IRgbPwmLed RgbPwmLed { get; set; }
16 |
17 | public ILightSensor LightSensor { get; set; }
18 |
19 | public Bme68x EnvironmentalSensor { get; set; }
20 |
21 | public void Initialize()
22 | {
23 | ProjLab = ProjectLab.Create();
24 |
25 | Display = ProjLab.Display;
26 |
27 | RgbPwmLed = ProjLab.RgbLed;
28 |
29 | LightSensor = ProjLab.LightSensor;
30 |
31 | EnvironmentalSensor = (ProjLab as ProjectLabHardwareBase).AtmosphericSensor;
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/Source/AmbientRoomMonitor/Hardware/IAmbientRoomMonitorHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Foundation.Sensors.Atmospheric;
2 | using Meadow.Peripherals.Displays;
3 | using Meadow.Peripherals.Leds;
4 | using Meadow.Peripherals.Sensors.Light;
5 |
6 | namespace AmbientRoomMonitor.Hardware
7 | {
8 | internal interface IAmbientRoomMonitorHardware
9 | {
10 | public IPixelDisplay Display { get; }
11 |
12 | public ILightSensor LightSensor { get; }
13 |
14 | public Bme68x EnvironmentalSensor { get; }
15 |
16 | public IRgbPwmLed RgbPwmLed { get; }
17 |
18 | public void Initialize();
19 | }
20 | }
--------------------------------------------------------------------------------
/Source/AmbientRoomMonitor/MainController.cs:
--------------------------------------------------------------------------------
1 | using AmbientRoomMonitor.Hardware;
2 | using AmbientRoomMonitor.Services;
3 | using Meadow;
4 | using System;
5 |
6 | namespace AmbientRoomMonitor
7 | {
8 | internal class MainController
9 | {
10 | IAmbientRoomMonitorHardware hardware;
11 |
12 | DisplayController displayService;
13 |
14 | public MainController(IAmbientRoomMonitorHardware hardware)
15 | {
16 | this.hardware = hardware;
17 | }
18 |
19 | public void Initialize()
20 | {
21 | hardware.Initialize();
22 |
23 | displayService = new DisplayController(hardware.Display);
24 |
25 | hardware.EnvironmentalSensor.Updated += EnvironmentalSensorUpdated;
26 | }
27 |
28 | private void EnvironmentalSensorUpdated(object sender, Meadow.IChangeResult<(Meadow.Units.Temperature? Temperature, Meadow.Units.RelativeHumidity? Humidity, Meadow.Units.Pressure? Pressure, Meadow.Units.Resistance? GasResistance)> e)
29 | {
30 | hardware.RgbPwmLed.StartBlink(Color.Orange);
31 |
32 | displayService.UpdateAtmosphericConditions(
33 | light: $"{hardware.LightSensor.Illuminance.Value.Lux:N0}",
34 | pressure: $"{e.New.Pressure.Value.Millibar:N0}",
35 | humidity: $"{e.New.Humidity.Value.Percent:N0}",
36 | temperature: $"{e.New.Temperature.Value.Celsius:N0}");
37 |
38 | hardware.RgbPwmLed.StartBlink(Color.Green);
39 | }
40 |
41 | public void Run()
42 | {
43 | hardware.LightSensor.StartUpdating(TimeSpan.FromSeconds(5));
44 | hardware.EnvironmentalSensor.StartUpdating(TimeSpan.FromSeconds(5));
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/Source/AmbientRoomMonitor/MeadowApp.cs:
--------------------------------------------------------------------------------
1 | using AmbientRoomMonitor.Hardware;
2 | using Meadow;
3 | using Meadow.Devices;
4 | using System.Threading.Tasks;
5 |
6 | namespace AmbientRoomMonitor
7 | {
8 | // Change F7CoreComputeV2 to F7FeatherV2 for ProjectLab v2
9 | public class MeadowApp : App
10 | {
11 | MainController mainController;
12 |
13 | public override Task Initialize()
14 | {
15 | Resolver.Log.Info("Initialize...");
16 |
17 | var hardware = new AmbientRoomMonitorHardware();
18 |
19 | mainController = new MainController(hardware);
20 | mainController.Initialize();
21 |
22 | return Task.CompletedTask;
23 | }
24 |
25 | public override Task Run()
26 | {
27 | Resolver.Log.Info("Run...");
28 |
29 | mainController.Run();
30 |
31 | return Task.CompletedTask;
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/Source/AmbientRoomMonitor/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/AmbientRoomMonitor/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/AmbientRoomMonitor/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/AnalogClockFace/.vscode/launch.config:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Deploy",
9 | "type": "meadow",
10 | "request": "launch",
11 | "preLaunchTask": "meadow: Build"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Source/AnalogClockFace/AnalogClockFace.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 | PreserveNewest
14 |
15 |
16 | PreserveNewest
17 |
18 |
19 | PreserveNewest
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Source/AnalogClockFace/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | Logging:
13 | LogLevel:
14 | Default: Trace
--------------------------------------------------------------------------------
/Source/AnalogClockFace/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | Device:
6 |
7 | # Name of the device on the network.
8 | Name: MeadowF7V2_ConfigSample
9 |
10 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
11 | # SdStorageSupported: true
12 |
13 | # Control how the ESP coprocessor will start and operate.
14 | Coprocessor:
15 |
16 | # Should the ESP32 automatically attempt to connect to an access point at startup?
17 | # If set to true, wifi.config.yaml credentials must be stored in the device.
18 | AutomaticallyStartNetwork: true
19 |
20 | # Should the ESP32 automatically reconnect to the configured access point?
21 | AutomaticallyReconnect: true
22 |
23 | # Maximum number of retry attempts for connections etc. before an error code is returned.
24 | MaximumRetryCount: 7
25 |
26 | # Network configuration.
27 | Network:
28 |
29 | # Interfaces:
30 | # - Name: Ethernet
31 | # UseDHCP: false
32 | # IPAddress: 192.168.1.60
33 | # NetMask: 255.255.255.0
34 | # Gateway: 192.168.1.254
35 | # - Name: WiFi
36 | # UseDHCP: true
37 | # IPAddress:
38 | # NetMask:
39 | # Gateway:
40 |
41 | # Which interface should be used?
42 | DefaultInterface: WiFi
43 |
44 | # Automatically attempt to get the time at startup?
45 | GetNetworkTimeAtStartup: true
46 |
47 | # Time synchronization period in seconds.
48 | NtpRefreshPeriodSeconds: 600
49 |
50 | # Name of the NTP servers.
51 | NtpServers:
52 | - 0.pool.ntp.org
53 | - 1.pool.ntp.org
54 | - 2.pool.ntp.org
55 | - 3.pool.ntp.org
56 |
57 | # IP addresses of the DNS servers.
58 | DnsServers:
59 | - 1.1.1.1
60 | - 8.8.8.8
--------------------------------------------------------------------------------
/Source/AnalogClockFace/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | Credentials:
7 | Ssid: Ssid
8 | Password: Password
9 |
--------------------------------------------------------------------------------
/Source/Connectivity/.vscode/launch.config:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Deploy",
9 | "type": "meadow",
10 | "request": "launch",
11 | "preLaunchTask": "meadow: Build"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Source/Connectivity/Connectivity.Common/Bluetooth/BluetoothConstants.cs:
--------------------------------------------------------------------------------
1 | namespace CommonContracts.Bluetooth
2 | {
3 | public static class CharacteristicsConstants
4 | {
5 | public const string PAIRING = "19933423-6f14-41c0-bb03-637b2e6ef6b0";
6 | public const string LED_TOGGLE = "2eb9edce-d7c4-4079-b3d3-5becfcf0c49d";
7 | public const string LED_BLINK = "7cb9817d-6754-46e7-be72-d5790eaf678b";
8 | public const string LED_PULSE = "23d3bd90-5966-4eff-9ac7-b6cafe9c182a";
9 | public const string ENVIRONMENTAL_DATA = "8787e846-51e5-4d9b-87aa-eaf4a8f0056f";
10 | public const string LIGHT_DATA = "7f36402d-3612-4127-9a33-b94de96b1ef8";
11 | public const string MOTION_ACCELERATION = "29171115-4bbe-4ac1-a0b0-257b54bcc464";
12 | public const string MOTION_ANGULAR_VELOCITY = "8468a412-99ae-457c-b2fd-2085ab9aac37";
13 | public const string MOTION_TEMPERATURE = "810169ba-a0be-4cf5-a67d-ee68c20d4d18";
14 | }
15 | }
--------------------------------------------------------------------------------
/Source/Connectivity/Connectivity.Common/CommonContracts.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | 5e32a8f6-1ec5-46ba-ae3d-e3e376fd82d0
7 |
8 |
9 | CommonContracts
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Source/Connectivity/Connectivity.Common/Connectivity.Common.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 5e32a8f6-1ec5-46ba-ae3d-e3e376fd82d0
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Source/Connectivity/Connectivity.Common/Models/ClimateModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommonContracts.Models
2 | {
3 | public class ClimateModel
4 | {
5 | public string? Temperature { get; set; }
6 |
7 | public string? Pressure { get; set; }
8 |
9 | public string? Humidity { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/Source/Connectivity/Connectivity.Common/Models/IlluminanceModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommonContracts.Models
2 | {
3 | public class IlluminanceModel
4 | {
5 | public string? Illuminance { get; set; }
6 | }
7 | }
--------------------------------------------------------------------------------
/Source/Connectivity/Connectivity.Common/Models/MotionModel.cs:
--------------------------------------------------------------------------------
1 | namespace Connectivity.Common.Models
2 | {
3 | public class MotionModel
4 | {
5 | public string Acceleration3dX { get; set; }
6 | public string Acceleration3dY { get; set; }
7 | public string Acceleration3dZ { get; set; }
8 |
9 | public string AngularVelocity3dX { get; set; }
10 | public string AngularVelocity3dY { get; set; }
11 | public string AngularVelocity3dZ { get; set; }
12 |
13 | public string Temperature { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/Source/Connectivity/MeadowConnectedSample/Controllers/LedController.cs:
--------------------------------------------------------------------------------
1 | using Meadow;
2 | using Meadow.Peripherals.Leds;
3 | using System;
4 | using System.Threading.Tasks;
5 |
6 | namespace MeadowConnectedSample.Controllers
7 | {
8 | public class LedController
9 | {
10 | private static readonly Lazy instance =
11 | new Lazy(() => new LedController());
12 | public static LedController Instance => instance.Value;
13 |
14 | IRgbPwmLed rgbPwmLed;
15 | bool isAnimating;
16 |
17 | private LedController() { }
18 |
19 | public void Initialize(IRgbPwmLed rgbPwmLed)
20 | {
21 | this.rgbPwmLed = rgbPwmLed;
22 | }
23 |
24 | public void SetColor(Color color)
25 | {
26 | rgbPwmLed.SetColor(color);
27 | }
28 |
29 | public async Task Toggle()
30 | {
31 | if (rgbPwmLed.IsOn || isAnimating)
32 | {
33 | await rgbPwmLed.StopAnimation();
34 | rgbPwmLed.IsOn = false;
35 | isAnimating = false;
36 | }
37 | else
38 | {
39 | await rgbPwmLed.StopAnimation();
40 | rgbPwmLed.SetColor(GetRandomColor());
41 | rgbPwmLed.IsOn = true;
42 | }
43 | }
44 |
45 | public async Task StartBlink()
46 | {
47 | await rgbPwmLed.StopAnimation();
48 | await rgbPwmLed.StartBlink(GetRandomColor());
49 | isAnimating = true;
50 | }
51 |
52 | public async Task StartPulse()
53 | {
54 | await rgbPwmLed.StopAnimation();
55 | await rgbPwmLed.StartPulse(GetRandomColor());
56 | isAnimating = true;
57 | }
58 |
59 | protected Color GetRandomColor()
60 | {
61 | var random = new Random();
62 | return new Color(random.Next(256), random.Next(256), random.Next(256));
63 | }
64 | }
65 | }
--------------------------------------------------------------------------------
/Source/Connectivity/MeadowConnectedSample/MeadowConnectedSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | PreserveNewest
32 |
33 |
34 | PreserveNewest
35 |
36 |
37 | PreserveNewest
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Source/Connectivity/MeadowConnectedSample/Resources/img_ble_paired.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/Connectivity/MeadowConnectedSample/Resources/img_ble_paired.bmp
--------------------------------------------------------------------------------
/Source/Connectivity/MeadowConnectedSample/Resources/img_ble_pairing.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/Connectivity/MeadowConnectedSample/Resources/img_ble_pairing.bmp
--------------------------------------------------------------------------------
/Source/Connectivity/MeadowConnectedSample/Resources/img_meadow.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/Connectivity/MeadowConnectedSample/Resources/img_meadow.bmp
--------------------------------------------------------------------------------
/Source/Connectivity/MeadowConnectedSample/Resources/img_wifi_connected.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/Connectivity/MeadowConnectedSample/Resources/img_wifi_connected.bmp
--------------------------------------------------------------------------------
/Source/Connectivity/MeadowConnectedSample/Resources/img_wifi_connecting.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/Connectivity/MeadowConnectedSample/Resources/img_wifi_connecting.bmp
--------------------------------------------------------------------------------
/Source/Connectivity/MeadowConnectedSample/Secrets.cs:
--------------------------------------------------------------------------------
1 | namespace MeadowConnectedSample
2 | {
3 | public class Secrets
4 | {
5 | ///
6 | /// Name of the WiFi network to use.
7 | ///
8 | public const string WIFI_NAME = "WIFI_NAME";
9 |
10 | ///
11 | /// Password for the WiFi network names in WIFI_NAME.
12 | ///
13 | public const string WIFI_PASSWORD = "WIFI_PASSWORD";
14 | }
15 | }
--------------------------------------------------------------------------------
/Source/Connectivity/MeadowConnectedSample/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/Connectivity/MeadowConnectedSample/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/Connectivity/MeadowConnectedSample/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/App.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace MobileProjectLab
2 | {
3 | public partial class App : Application
4 | {
5 | public App()
6 | {
7 | InitializeComponent();
8 |
9 | MainPage = new AppShell();
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/AppShell.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/AppShell.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace MobileProjectLab;
2 |
3 | public partial class AppShell : Shell
4 | {
5 | public AppShell()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Converter/InverseBoolConverter.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace MobileProjectLab.Converter
4 | {
5 | public class InverseBoolConverter
6 | {
7 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
8 | {
9 | return !(bool)value;
10 | }
11 |
12 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
13 | {
14 | return !(bool)value;
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/MauiProgram.cs:
--------------------------------------------------------------------------------
1 | namespace MobileProjectLab;
2 |
3 | public static class MauiProgram
4 | {
5 | public static MauiApp CreateMauiApp()
6 | {
7 | var builder = MauiApp.CreateBuilder();
8 | builder
9 | .UseMauiApp()
10 | .ConfigureFonts(fonts =>
11 | {
12 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
13 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
14 | });
15 |
16 | return builder.Build();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Platforms/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Platforms/Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 |
4 | namespace MobileProjectLab
5 | {
6 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true,
7 | ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation |
8 | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize |
9 | ConfigChanges.Density)]
10 | public class MainActivity : MauiAppCompatActivity
11 | {
12 |
13 | }
14 | }
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Platforms/Android/MainApplication.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Runtime;
3 |
4 | namespace MobileProjectLab;
5 |
6 | [Application]
7 | public class MainApplication : MauiApplication
8 | {
9 | public MainApplication(IntPtr handle, JniHandleOwnership ownership)
10 | : base(handle, ownership)
11 | {
12 | }
13 |
14 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
15 | }
16 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Platforms/Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #512BD4
4 | #14607F
5 | #2B0B98
6 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Platforms/Android/Resources/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Windows Machine": {
4 | "commandName": "MsixPackage",
5 | "nativeDebugging": false
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Resources/AppIcon/appicon.svg:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Resources/AppIcon/appiconfg.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Resources/Fonts/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/Connectivity/MobileProjectLab/Resources/Fonts/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Resources/Fonts/OpenSans-Semibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/Connectivity/MobileProjectLab/Resources/Fonts/OpenSans-Semibold.ttf
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Resources/Images/img_ble_pair.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Resources/Images/img_ble_paired.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Resources/Images/img_project_lab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/Connectivity/MobileProjectLab/Resources/Images/img_project_lab.png
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Resources/Images/img_search.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Resources/Raw/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories). Deployment of the asset to your application
3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
4 |
5 |
6 |
7 | These files will be deployed with you package and will be accessible using Essentials:
8 |
9 | async Task LoadMauiAsset()
10 | {
11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
12 | using var reader = new StreamReader(stream);
13 |
14 | var contents = reader.ReadToEnd();
15 | }
16 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Resources/Splash/splash.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/Utils/BleConstants.cs:
--------------------------------------------------------------------------------
1 | namespace MobileProjectLab.Utils
2 | {
3 | public static class CharacteristicsConstants
4 | {
5 | public const string ON = "73cfbc6f-61fa-4d80-a92f-eec2a90f8a3e";
6 | public const string OFF = "6315119d-d619-49bb-a21d-ef9e99941948";
7 | public const string PULSING = "d7551801-31fc-435d-a994-1e7f15e17baf";
8 | public const string BLINKING = "3a6cc4f2-a6ab-4709-a9bf-c9611c6bf892";
9 | public const string RUNNING_COLORS = "30df1258-f42b-4788-af2e-a8ed9d0b932f";
10 |
11 | public const string IS_CYCLING = "24517ccc-888e-4ffc-9da5-21884353b08d";
12 | public const string ANGLE = "5a0bb016-69ab-4a49-a2f2-de5b292458f3";
13 | }
14 | }
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/View/BluetoothPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using MobileProjectLab.ViewModel;
2 |
3 | namespace MobileProjectLab.View
4 | {
5 | public partial class BluetoothPage : ContentPage
6 | {
7 | BluetoothViewModel vm;
8 |
9 | public BluetoothPage()
10 | {
11 | InitializeComponent();
12 | BindingContext = vm = new BluetoothViewModel();
13 | }
14 |
15 | protected override void OnAppearing()
16 | {
17 | base.OnAppearing();
18 | vm.CmdSearchForDevices.Execute(null);
19 | }
20 |
21 | protected override void OnDisappearing()
22 | {
23 | base.OnDisappearing();
24 |
25 | if (vm.IsConnected)
26 | {
27 | vm.CmdToggleConnection.Execute(null);
28 | }
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/View/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 | #555
12 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/View/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace MobileProjectLab.View
2 | {
3 | public partial class MainPage : ContentPage
4 | {
5 | public MainPage()
6 | {
7 | InitializeComponent();
8 | }
9 |
10 | void BtnMapleClicked(object sender, EventArgs e)
11 | {
12 | Navigation.PushAsync(new MaplePage());
13 | }
14 |
15 | void BtnBluetoothClicked(object sender, EventArgs e)
16 | {
17 | Navigation.PushAsync(new BluetoothPage());
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/View/MaplePage.xaml.cs:
--------------------------------------------------------------------------------
1 | using MobileProjectLab.ViewModel;
2 |
3 | namespace MobileProjectLab.View
4 | {
5 | public partial class MaplePage : ContentPage
6 | {
7 | public MaplePage()
8 | {
9 | InitializeComponent();
10 | BindingContext = new MapleViewModel();
11 | }
12 |
13 | protected override void OnAppearing()
14 | {
15 | base.OnAppearing();
16 | (BindingContext as MapleViewModel).CmdSearchServers.Execute(null);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/Source/Connectivity/MobileProjectLab/ViewModel/BaseViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Runtime.CompilerServices;
3 |
4 | namespace MobileProjectLab.ViewModel
5 | {
6 | public class BaseViewModel : INotifyPropertyChanged
7 | {
8 | bool isBusy;
9 | public bool IsBusy
10 | {
11 | get => isBusy;
12 | set { isBusy = value; OnPropertyChanged(nameof(IsBusy)); }
13 | }
14 |
15 | #region INotifyPropertyChanged Implementation
16 | public event PropertyChangedEventHandler PropertyChanged;
17 | public void OnPropertyChanged([CallerMemberName] string name = null)
18 | {
19 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
20 | }
21 | #endregion
22 | }
23 | }
--------------------------------------------------------------------------------
/Source/GalleryViewer/.vscode/launch.config:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Deploy",
9 | "type": "meadow",
10 | "request": "launch",
11 | "preLaunchTask": "meadow: Build"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Source/GalleryViewer/Controllers/DisplayController.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Foundation.Graphics;
2 | using Meadow.Foundation.Graphics.Buffers;
3 | using Meadow.Peripherals.Displays;
4 | using SimpleJpegDecoder;
5 | using System.IO;
6 | using System.Reflection;
7 |
8 | namespace GalleryViewer.Controllers
9 | {
10 | internal class DisplayController
11 | {
12 | readonly MicroGraphics graphics;
13 | readonly string[] images = new string[3]
14 | {
15 | "GalleryViewer.Resources.image1.jpg",
16 | "GalleryViewer.Resources.image2.jpg",
17 | "GalleryViewer.Resources.image3.jpg"
18 | };
19 |
20 | public DisplayController(IPixelDisplay display)
21 | {
22 | graphics = new MicroGraphics(display)
23 | {
24 | IgnoreOutOfBoundsPixels = true
25 | };
26 | }
27 |
28 | IPixelBuffer LoadJpeg(byte[] jpgData)
29 | {
30 | var decoder = new JpegDecoder();
31 | var jpg = decoder.DecodeJpeg(jpgData);
32 |
33 | return new BufferRgb888(decoder.Width, decoder.Height, jpg);
34 | }
35 |
36 | byte[] LoadResource(string fileName)
37 | {
38 | var assembly = Assembly.GetExecutingAssembly();
39 |
40 | using (Stream stream = assembly.GetManifestResourceStream(fileName))
41 | {
42 | using (var ms = new MemoryStream())
43 | {
44 | stream.CopyTo(ms);
45 | return ms.ToArray();
46 | }
47 | }
48 | }
49 |
50 | public void DrawImage(int imageIndex)
51 | {
52 | var buffer = LoadJpeg(LoadResource(images[imageIndex]));
53 | graphics.DrawBuffer((graphics.Width - buffer.Width) / 2, 0, buffer);
54 | graphics.Show();
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/Source/GalleryViewer/GalleryViewer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | PreserveNewest
20 |
21 |
22 | PreserveNewest
23 |
24 |
25 | PreserveNewest
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Source/GalleryViewer/Hardware/GalleryViewerHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Devices;
2 | using Meadow.Peripherals.Displays;
3 | using Meadow.Peripherals.Leds;
4 | using Meadow.Peripherals.Sensors.Buttons;
5 |
6 | namespace GalleryViewer.Hardware
7 | {
8 | internal class GalleryViewerHardware : IGalleryViewerHardware
9 | {
10 | protected IProjectLabHardware ProjLab { get; private set; }
11 |
12 | public IPixelDisplay Display { get; set; }
13 |
14 | public IButton RightButton { get; set; }
15 |
16 | public IButton LeftButton { get; set; }
17 |
18 | public IRgbPwmLed RgbPwmLed { get; set; }
19 |
20 | public void Initialize()
21 | {
22 | ProjLab = ProjectLab.Create();
23 |
24 | Display = ProjLab.Display;
25 |
26 | RightButton = ProjLab.RightButton;
27 |
28 | LeftButton = ProjLab.LeftButton;
29 |
30 | RgbPwmLed = ProjLab.RgbLed;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Source/GalleryViewer/Hardware/IGalleryViewerHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Peripherals.Displays;
2 | using Meadow.Peripherals.Leds;
3 | using Meadow.Peripherals.Sensors.Buttons;
4 |
5 | namespace GalleryViewer.Hardware
6 | {
7 | internal interface IGalleryViewerHardware
8 | {
9 | public IPixelDisplay Display { get; }
10 |
11 | public IButton RightButton { get; }
12 |
13 | public IButton LeftButton { get; }
14 |
15 | public IRgbPwmLed RgbPwmLed { get; }
16 |
17 | public void Initialize();
18 | }
19 | }
--------------------------------------------------------------------------------
/Source/GalleryViewer/MainController.cs:
--------------------------------------------------------------------------------
1 | using GalleryViewer.Controllers;
2 | using GalleryViewer.Hardware;
3 | using Meadow;
4 | using Meadow.Foundation.Leds;
5 | using Meadow.Peripherals.Leds;
6 | using System;
7 | using System.Threading.Tasks;
8 |
9 | namespace GalleryViewer
10 | {
11 | internal class MainController
12 | {
13 | IGalleryViewerHardware hardware;
14 | DisplayController displayController;
15 | IRgbPwmLed onboardLed;
16 | int selectedIndex = 0;
17 |
18 | public MainController(IGalleryViewerHardware hardware)
19 | {
20 | this.hardware = hardware;
21 | }
22 |
23 | public void Initialize()
24 | {
25 | hardware.Initialize();
26 |
27 | displayController = new DisplayController(hardware.Display);
28 |
29 | hardware.RightButton.Clicked += ButtonRightClicked;
30 | hardware.LeftButton.Clicked += ButtonLeftClicked;
31 |
32 | onboardLed = hardware.RgbPwmLed;
33 | onboardLed.SetColor(Color.Green);
34 | }
35 |
36 | void ButtonLeftClicked(object sender, EventArgs e)
37 | {
38 | onboardLed.SetColor(Color.Red);
39 |
40 | if (selectedIndex + 1 > 2)
41 | selectedIndex = 0;
42 | else
43 | selectedIndex++;
44 |
45 | displayController.DrawImage(selectedIndex);
46 |
47 | onboardLed.SetColor(Color.Green);
48 | }
49 |
50 | void ButtonRightClicked(object sender, EventArgs e)
51 | {
52 | onboardLed.SetColor(Color.Red);
53 |
54 | if (selectedIndex - 1 < 0)
55 | selectedIndex = 2;
56 | else
57 | selectedIndex--;
58 |
59 | displayController.DrawImage(selectedIndex);
60 |
61 | onboardLed.SetColor(Color.Green);
62 | }
63 |
64 | public Task Run()
65 | {
66 | displayController.DrawImage(0);
67 |
68 | return Task.CompletedTask;
69 | }
70 | }
71 | }
--------------------------------------------------------------------------------
/Source/GalleryViewer/MeadowApp.cs:
--------------------------------------------------------------------------------
1 | using GalleryViewer.Hardware;
2 | using Meadow;
3 | using Meadow.Devices;
4 | using System.Threading.Tasks;
5 |
6 | namespace GalleryViewer
7 | {
8 | // Change F7CoreComputeV2 to F7FeatherV2 for ProjectLab v2
9 | public class MeadowApp : App
10 | {
11 | MainController mainController;
12 |
13 | public override Task Initialize()
14 | {
15 | Resolver.Log.Info("Initialize...");
16 |
17 | var hardware = new GalleryViewerHardware();
18 |
19 | mainController = new MainController(hardware);
20 | mainController.Initialize();
21 |
22 | return Task.CompletedTask;
23 | }
24 |
25 | public override Task Run()
26 | {
27 | Resolver.Log.Info("Run...");
28 |
29 | mainController.Run();
30 |
31 | return Task.CompletedTask;
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/Source/GalleryViewer/Resources/image1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/GalleryViewer/Resources/image1.jpg
--------------------------------------------------------------------------------
/Source/GalleryViewer/Resources/image2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/GalleryViewer/Resources/image2.jpg
--------------------------------------------------------------------------------
/Source/GalleryViewer/Resources/image3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/GalleryViewer/Resources/image3.jpg
--------------------------------------------------------------------------------
/Source/GalleryViewer/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/GalleryViewer/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/GalleryViewer/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/GridEYE/GridEYE.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 | 10
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Always
17 |
18 |
19 | Always
20 |
21 |
22 | Always
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Source/GridEYE/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/GridEYE/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/GridEYE/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Controllers/DisplayController.cs:
--------------------------------------------------------------------------------
1 | using Meadow;
2 | using Meadow.Foundation.Graphics;
3 | using Meadow.Foundation.Graphics.MicroLayout;
4 | using Meadow.Peripherals.Displays;
5 | using System;
6 |
7 | namespace MagicEightMeadow.Controllers
8 | {
9 | internal class DisplayController
10 | {
11 | private readonly Random random;
12 |
13 | private readonly Image simonQuestion;
14 |
15 | private readonly DisplayScreen displayScreen;
16 |
17 | private readonly Picture simonImage;
18 |
19 | Color backgroundColor = Color.FromHex("#00000C");
20 |
21 | public DisplayController(IPixelDisplay display)
22 | {
23 | random = new Random();
24 |
25 | displayScreen = new DisplayScreen(display, RotationType._270Degrees)
26 | {
27 | BackgroundColor = backgroundColor
28 | };
29 |
30 | simonQuestion = Image.LoadFromResource("MagicEightMeadow.Resources.m8b_question.bmp");
31 | simonImage = new Picture((displayScreen.Width - displayScreen.Width) / 2, 0, displayScreen.Width, displayScreen.Height, simonQuestion);
32 | displayScreen.Controls.Add(simonImage);
33 | }
34 |
35 | public void ShowQuestion()
36 | {
37 | simonImage.Image = simonQuestion;
38 | }
39 |
40 | public void ShowAnswer()
41 | {
42 | var simonAnswer = Image.LoadFromResource($"MagicEightMeadow.Resources.m8b_{random.Next(1, 21).ToString("00")}.bmp");
43 | simonImage.Image = simonAnswer;
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Hardware/IMagicEightMeadowHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Foundation.Sensors.Accelerometers;
2 | using Meadow.Peripherals.Displays;
3 | using Meadow.Peripherals.Leds;
4 |
5 | namespace MagicEightMeadow.Hardware
6 | {
7 | internal interface IMagicEightMeadowHardware
8 | {
9 | public IPixelDisplay Display { get; }
10 |
11 | public IRgbPwmLed RgbPwmLed { get; }
12 |
13 | public Bmi270 MotionSensor { get; }
14 |
15 | public void Initialize();
16 | }
17 | }
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Hardware/MagicEightMeadowHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Devices;
2 | using Meadow.Foundation.Sensors.Accelerometers;
3 | using Meadow.Peripherals.Displays;
4 | using Meadow.Peripherals.Leds;
5 |
6 | namespace MagicEightMeadow.Hardware
7 | {
8 | internal class MagicEightMeadowHardware : IMagicEightMeadowHardware
9 | {
10 | protected IProjectLabHardware projectLab { get; private set; }
11 |
12 | public IPixelDisplay Display { get; set; }
13 |
14 | public IRgbPwmLed RgbPwmLed { get; set; }
15 |
16 | public Bmi270 MotionSensor { get; set; }
17 |
18 | public void Initialize()
19 | {
20 | projectLab = ProjectLab.Create();
21 |
22 | Display = projectLab.Display;
23 |
24 | RgbPwmLed = projectLab.RgbLed;
25 |
26 | MotionSensor = (projectLab as ProjectLabHardwareBase).MotionSensor;
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/MainController.cs:
--------------------------------------------------------------------------------
1 | using MagicEightMeadow.Controllers;
2 | using MagicEightMeadow.Hardware;
3 | using Meadow;
4 | using Meadow.Foundation.Sensors.Accelerometers;
5 | using Meadow.Units;
6 | using System;
7 | using System.Threading.Tasks;
8 |
9 | namespace MagicEightMeadow
10 | {
11 | internal class MainController
12 | {
13 | private bool isAnswering;
14 | private IMagicEightMeadowHardware hardware;
15 | private DisplayController displayController;
16 |
17 | public MainController(IMagicEightMeadowHardware hardware)
18 | {
19 | this.hardware = hardware;
20 | }
21 |
22 | public void Initialize()
23 | {
24 | hardware.Initialize();
25 |
26 | displayController = new DisplayController(hardware.Display);
27 |
28 | var consumer = Bmi270.CreateObserver(
29 | handler: result => MotionSensorHandler(result),
30 | filter: result => MotionSensorFilter(result));
31 | hardware.MotionSensor.Subscribe(consumer);
32 | }
33 |
34 | private async void MotionSensorHandler(IChangeResult<(Acceleration3D? a3D, AngularVelocity3D? v3D, Temperature? t)> e)
35 | {
36 | if (isAnswering)
37 | return;
38 | isAnswering = true;
39 |
40 | hardware.RgbPwmLed.SetColor(Color.Orange);
41 |
42 | displayController.ShowAnswer();
43 |
44 | await Task.Delay(TimeSpan.FromSeconds(5));
45 |
46 | displayController.ShowQuestion();
47 |
48 | hardware.RgbPwmLed.SetColor(Color.Green);
49 |
50 | isAnswering = false;
51 | }
52 |
53 | private bool MotionSensorFilter(IChangeResult<(Acceleration3D? a3D, AngularVelocity3D? v3D, Temperature? t)> e)
54 | {
55 | return e.New.v3D.Value.X.DegreesPerSecond > 0.75 || e.New.v3D.Value.Y.DegreesPerSecond > 0.75 || e.New.v3D.Value.Z.DegreesPerSecond > 0.75;
56 | }
57 |
58 | public void Run()
59 | {
60 | displayController.ShowQuestion();
61 |
62 | hardware.MotionSensor.StartUpdating(TimeSpan.FromSeconds(1));
63 | }
64 | }
65 | }
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/MeadowApp.cs:
--------------------------------------------------------------------------------
1 | using MagicEightMeadow.Hardware;
2 | using Meadow;
3 | using Meadow.Devices;
4 | using System.Threading.Tasks;
5 |
6 | namespace MagicEightMeadow
7 | {
8 | public class MeadowApp : App
9 | {
10 | MainController mainController;
11 |
12 | public override Task Initialize()
13 | {
14 | Resolver.Log.Info("Initialize...");
15 |
16 | var hardware = new MagicEightMeadowHardware();
17 |
18 | mainController = new MainController(hardware);
19 | mainController.Initialize();
20 |
21 | return Task.CompletedTask;
22 | }
23 |
24 | public override Task Run()
25 | {
26 | Resolver.Log.Info("Run...");
27 |
28 | mainController.Run();
29 |
30 | return Task.CompletedTask;
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_01.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_01.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_02.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_02.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_03.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_03.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_04.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_04.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_05.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_05.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_06.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_06.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_07.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_07.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_08.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_08.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_09.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_09.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_10.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_10.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_11.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_11.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_12.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_12.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_13.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_13.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_14.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_14.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_15.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_15.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_16.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_16.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_17.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_17.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_18.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_18.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_19.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_19.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_20.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_20.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/Resources/m8b_question.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MagicEightMeadow/Resources/m8b_question.bmp
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/MagicEightMeadow/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/MathLineCharts/MathLineCharts.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Always
15 |
16 |
17 | Always
18 |
19 |
20 | Always
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Source/MathLineCharts/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/MathLineCharts/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/MathLineCharts/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/Meadow.Cloud_Update/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Deploy",
9 | "type": "meadow",
10 | "request": "launch",
11 | "preLaunchTask": "meadow: Build"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Source/Meadow.Cloud_Update/Meadow.Cloud_Update.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Always
15 |
16 |
17 | Always
18 |
19 |
20 | Always
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Source/Meadow.Cloud_Update/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | # AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | # Logging:
13 | # LogLevel:
14 | # Default: "Trace"
15 |
16 | Update:
17 | Enabled: true
18 |
19 |
--------------------------------------------------------------------------------
/Source/Meadow.Cloud_Update/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | # Device:
6 | # # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 | #
9 | # # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 | # # Control how the ESP coprocessor will start and operate.
12 | # Coprocessor:
13 | # # Should the ESP32 automatically attempt to connect to an access point at startup?
14 | # # If set to true, wifi.config.yaml credentials must be stored in the device.
15 | # AutomaticallyStartNetwork: true
16 | #
17 | # # Should the ESP32 automatically reconnect to the configured access point?
18 | # AutomaticallyReconnect: true
19 | #
20 | # # Maximum number of retry attempts for connections etc. before an error code is returned.
21 | # MaximumRetryCount: 7
22 | # # Network configuration.
23 | # Network:
24 | # Interfaces:
25 | # - Name: Ethernet
26 | # UseDHCP: false
27 | # IPAddress: 192.168.1.60
28 | # NetMask: 255.255.255.0
29 | # Gateway: 192.168.1.254
30 | # - Name: WiFi
31 | # UseDHCP: true
32 | # IPAddress:
33 | # NetMask:
34 | # Gateway:
35 | #
36 | # # Which interface should be used?
37 | # DefaultInterface: WiFi
38 | #
39 | # # Automatically attempt to get the time at startup?
40 | # GetNetworkTimeAtStartup: true
41 | #
42 | # # Time synchronization period in seconds.
43 | # NtpRefreshPeriodSeconds: 600
44 | #
45 | # # Name of the NTP servers.
46 | # NtpServers:
47 | # - 0.pool.ntp.org
48 | # - 1.pool.ntp.org
49 | # - 2.pool.ntp.org
50 | # - 3.pool.ntp.org
51 | #
52 | # # IP addresses of the DNS servers.
53 | # DnsServers:
54 | # - 1.1.1.1
55 | # - 8.8.8.8
56 |
57 |
--------------------------------------------------------------------------------
/Source/Meadow.Cloud_Update/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | # Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Source/MeadowAzureFunction/MeadowAzureFunction.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net7.0
4 | v4
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | PreserveNewest
18 |
19 |
20 | PreserveNewest
21 | Never
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Source/MeadowAzureFunction/Properties/serviceDependencies.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "storage1": {
4 | "type": "storage",
5 | "connectionId": "AzureWebJobsStorage"
6 | },
7 | "appInsights1": {
8 | "type": "appInsights",
9 | "connectionId": "APPLICATIONINSIGHTS_CONNECTION_STRING"
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/Source/MeadowAzureFunction/Properties/serviceDependencies.local.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "appInsights1": {
4 | "type": "appInsights.sdk"
5 | },
6 | "storage1": {
7 | "type": "storage.emulator",
8 | "connectionId": "AzureWebJobsStorage"
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/Source/MeadowAzureFunction/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/MeadowAzureFunction/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0",
3 | "logging": {
4 | "applicationInsights": {
5 | "samplingSettings": {
6 | "isEnabled": true,
7 | "excludedTypes": "Request"
8 | }
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/Source/MeadowAzureFunction/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/MeadowAzureFunction/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Controllers/IIoTHubController.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Units;
2 | using System.Threading.Tasks;
3 |
4 | namespace MeadowAzureIoTHub.Controllers
5 | {
6 | internal interface IIoTHubController
7 | {
8 | bool isAuthenticated { get; }
9 |
10 | Task Initialize();
11 |
12 | Task SendEnvironmentalReading((Temperature? Temperature, RelativeHumidity? Humidity, Pressure? Pressure, Resistance? GasResistance) reading);
13 | }
14 | }
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Hardware/IMeadowAzureIoTHubHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Foundation.Sensors.Atmospheric;
2 | using Meadow.Peripherals.Displays;
3 | using Meadow.Peripherals.Leds;
4 |
5 | namespace MeadowAzureIoTHub.Hardware
6 | {
7 | internal interface IMeadowAzureIoTHubHardware
8 | {
9 | public IPixelDisplay Display { get; }
10 |
11 | public Bme68x EnvironmentalSensor { get; }
12 |
13 | public IRgbPwmLed RgbPwmLed { get; }
14 |
15 | public void Initialize();
16 | }
17 | }
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Hardware/MeadowAzureIoTHubHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Devices;
2 | using Meadow.Foundation.Sensors.Atmospheric;
3 | using Meadow.Peripherals.Displays;
4 | using Meadow.Peripherals.Leds;
5 |
6 | namespace MeadowAzureIoTHub.Hardware
7 | {
8 | internal class MeadowAzureIoTHubHardware : IMeadowAzureIoTHubHardware
9 | {
10 | protected IProjectLabHardware ProjLab { get; private set; }
11 |
12 | public IPixelDisplay Display { get; set; }
13 |
14 | public Bme68x EnvironmentalSensor { get; set; }
15 |
16 | public IRgbPwmLed RgbPwmLed { get; set; }
17 |
18 | public void Initialize()
19 | {
20 | ProjLab = ProjectLab.Create();
21 |
22 | Display = ProjLab.Display;
23 |
24 | RgbPwmLed = ProjLab.RgbLed;
25 |
26 | EnvironmentalSensor = (ProjLab as ProjectLabHardwareBase).AtmosphericSensor;
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/MeadowApp.cs:
--------------------------------------------------------------------------------
1 | using Meadow;
2 | using Meadow.Devices;
3 | using Meadow.Hardware;
4 | using MeadowAzureIoTHub.Hardware;
5 | using System.Threading.Tasks;
6 |
7 | namespace MeadowAzureIoTHub
8 | {
9 | // Change F7CoreComputeV2 to F7FeatherV2 for ProjectLab v2
10 | public class MeadowApp : App
11 | {
12 | MainController mainController;
13 |
14 | public override async Task Initialize()
15 | {
16 | Resolver.Log.Info("Initialize...");
17 |
18 | var hardware = new MeadowAzureIoTHubHardware();
19 | var network = Device.NetworkAdapters.Primary();
20 |
21 | mainController = new MainController(hardware, network);
22 | await mainController.Initialize();
23 | }
24 |
25 | public override async Task Run()
26 | {
27 | Resolver.Log.Info("Run...");
28 |
29 | await mainController.Run();
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/MeadowAzureIoTHub.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 | 10.0
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | PreserveNewest
38 |
39 |
40 | PreserveNewest
41 |
42 |
43 | PreserveNewest
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Resources/img_meadow.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Resources/img_meadow.bmp
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Resources/img_refreshed.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Resources/img_refreshed.bmp
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Resources/img_refreshing.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Resources/img_refreshing.bmp
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Resources/img_wifi_connected.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Resources/img_wifi_connected.bmp
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Resources/img_wifi_connecting.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Resources/img_wifi_connecting.bmp
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/Secrets.cs:
--------------------------------------------------------------------------------
1 | namespace MeadowAzureIoTHub
2 | {
3 | public class Secrets
4 | {
5 | ///
6 | /// Name of the Azure IoT Hub created
7 | ///
8 | public const string HUB_NAME = "HUB_NAME";
9 |
10 | ///
11 | /// Name of the Azure IoT Hub created
12 | ///
13 | public const string DEVICE_ID = "DEVICE_ID";
14 |
15 | ///
16 | /// example "SharedAccessSignature sr=MeadowIoTHub ..... "
17 | ///
18 | /// az iot hub generate-sas-token --hub-name HUB_NAME --device-id DEVICE_ID --resource-group RESOURCE_GROUP --login [Open Shared access policies -> Select iothubowner -> copy Primary connection string]
19 | ///
20 | public const string SAS_TOKEN = "SAS_TOKEN";
21 | }
22 | }
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # Adjust the level of logging detail.
12 | Logging:
13 | LogLevel:
14 | Default: Trace
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | Device:
6 | # Name of the device on the network.
7 | Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | NtpServers:
49 | - 0.pool.ntp.org
50 | - 1.pool.ntp.org
51 | - 2.pool.ntp.org
52 | - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | DnsServers:
56 | - 1.1.1.1
57 | - 8.8.8.8
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/MeadowAzureIoTHub/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | Ssid: YourSSID
8 | Password: SSIDPassword
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/WebAzureIoTHub/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "type": "node",
9 | "request": "launch",
10 | "name": "Launch Program",
11 | "program": "${workspaceFolder}/server.js",
12 | "protocol": "inspector",
13 | "smartStep": true,
14 | "showAsyncStacks": true,
15 | "sourceMaps": true,
16 | "env": {
17 | "NODE_ENV": "local",
18 | "IotHubConnectionString": "IOT_HUB_CONNECTION_STRING",
19 | "EventHubConsumerGroup": "EVENT_HUB_CONSUMER_GROUP"
20 | }
21 | }
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/WebAzureIoTHub/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation. All rights reserved.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
22 |
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/WebAzureIoTHub/README.md:
--------------------------------------------------------------------------------
1 | # Visualize Azure IoT Hub data on a local web app
2 |
3 | This is a tweaked sample project from [Visualize real-time sensor data from your Azure IoT hub in a web application](https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps)
4 |
5 | ### Run locally
6 |
7 | 1. To pass parameters to the website, you may use environment variables or parameters.
8 | - Open a command prompt or PowerShell terminal and set the environment variables **IotHubConnectionString** and **EventHubConsumerGroup**.
9 |
10 | > Syntax for Windows command prompt is `set key=value`, PowerShell is `$env:key="value"`, and Linux shell is `export key="value"`.
11 |
12 | - Or, if you are debugging with [VS Code](https://code.visualstudio.com/docs/nodejs/nodejs-debugging), you can edit the launch.json file and add these values in the env property.
13 |
14 | ```json
15 | "env": {
16 | "NODE_ENV": "local",
17 | "IotHubConnectionString": "IOT_HUB_CONNECTION_STRING",
18 | "EventHubConsumerGroup": "EVENT_HUB_CONSUMER_GROUP"
19 | }
20 | ```
21 |
22 | 1. In the same directory as package.json, run `npm install` to download and install referenced packages.
23 |
24 | 1. Run the website one of the following ways:
25 | - From the command-line (with environment variables set), use `npm start`
26 | - In VS Code, press F5 to start debugging
27 |
28 | 1. Watch for console output from the website.
29 |
30 | 1. If you are debugging, you may set breakpoints in any of the server-side scripts and step through the code to watch the code work.
31 |
32 | 1. Open a browser to .
33 |
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/WebAzureIoTHub/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "webapp",
3 | "version": "0.0.1",
4 | "private": true,
5 | "engines": {
6 | "node": ">=10.6",
7 | "npm": ">=6.0.0"
8 | },
9 | "scripts": {
10 | "start": "node server.js"
11 | },
12 | "dependencies": {
13 | "@azure/event-hubs": ">=5.0.2",
14 | "buffer": "^5.5.0",
15 | "crypto": "^1.0.1",
16 | "eslint": "^6.8.0",
17 | "eslint-config-airbnb": ">=18.0.1",
18 | "eslint-config-standard": ">=14.1.0",
19 | "eslint-plugin-import": ">=2.18.2",
20 | "eslint-plugin-jsx-a11y": ">=6.2.3",
21 | "eslint-plugin-node": ">=9.2.0",
22 | "eslint-plugin-promise": ">=4.2.1",
23 | "eslint-plugin-react": ">=7.14.3",
24 | "eslint-plugin-standard": ">=4.0.1",
25 | "express": ">=4.17.1",
26 | "minimist": ">=1.2.5",
27 | "rhea-promise": "^1.0.0",
28 | "ws": ">=7.1.2"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/WebAzureIoTHub/public/css/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
3 | padding: 50px;
4 | margin: 0;
5 | text-align: center;
6 | }
7 |
8 | .flexHeader {
9 | display: flex;
10 | flex-direction: row;
11 | flex-wrap: nowrap;
12 | justify-content: space-between;
13 | }
14 |
15 | a {
16 | color: #00B7FF;
17 | }
18 |
19 | body select {
20 | padding: 10px 70px 10px 13px;
21 | max-width: 100%;
22 | height: auto;
23 | border: 1px solid #e3e3e3;
24 | border-radius: 3px;
25 | background: url("https://i.ibb.co/b7xjLrB/selectbox-arrow.png") right center no-repeat;
26 | background-color: #fff;
27 | color: #444444;
28 | line-height: 16px;
29 | appearance: none;
30 | /* this is must */ -webkit-appearance: none;
31 | -moz-appearance: none;
32 | }
33 |
34 | /* body select.select_box option */
35 | body select option {
36 | padding: 0 4px;
37 | }
38 |
39 | /* for Edge */
40 | select::-ms-expand {
41 | display: none;
42 | }
43 |
44 | select:disabled::-ms-expand {
45 | background: #f60;
46 | }
47 |
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/WebAzureIoTHub/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Temperature & Humidity Real-time Data
14 |
15 |
16 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/WebAzureIoTHub/scripts/event-hub-reader.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Microsoft Sample Code - Copyright (c) 2020 - Licensed MIT
3 | */
4 |
5 | const { EventHubProducerClient, EventHubConsumerClient } = require('@azure/event-hubs');
6 | const { convertIotHubToEventHubsConnectionString } = require('./iot-hub-connection-string.js');
7 |
8 | class EventHubReader {
9 | constructor(iotHubConnectionString, consumerGroup) {
10 | this.iotHubConnectionString = iotHubConnectionString;
11 | this.consumerGroup = consumerGroup;
12 | }
13 |
14 | async startReadMessage(startReadMessageCallback) {
15 | try {
16 | const eventHubConnectionString = await convertIotHubToEventHubsConnectionString(this.iotHubConnectionString);
17 | const consumerClient = new EventHubConsumerClient(this.consumerGroup, eventHubConnectionString);
18 | console.log('Successfully created the EventHubConsumerClient from IoT Hub event hub-compatible connection string.');
19 |
20 | const partitionIds = await consumerClient.getPartitionIds();
21 | console.log('The partition ids are: ', partitionIds);
22 |
23 | consumerClient.subscribe({
24 | processEvents: (events, context) => {
25 | for (let i = 0; i < events.length; ++i) {
26 | startReadMessageCallback(
27 | events[i].body,
28 | events[i].enqueuedTimeUtc,
29 | events[i].systemProperties["iothub-connection-device-id"]);
30 | }
31 | },
32 | processError: (err, context) => {
33 | console.error(err.message || err);
34 | }
35 | });
36 | } catch (ex) {
37 | console.error(ex.message || ex);
38 | }
39 | }
40 |
41 | // Close connection to Event Hub.
42 | async stopReadMessage() {
43 | const disposeHandlers = [];
44 | this.receiveHandlers.forEach((receiveHandler) => {
45 | disposeHandlers.push(receiveHandler.stop());
46 | });
47 | await Promise.all(disposeHandlers);
48 |
49 | this.consumerClient.close();
50 | }
51 | }
52 |
53 | module.exports = EventHubReader;
54 |
--------------------------------------------------------------------------------
/Source/MeadowAzureIoTHub/WebAzureIoTHub/server.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const http = require('http');
3 | const WebSocket = require('ws');
4 | const path = require('path');
5 | const EventHubReader = require('./scripts/event-hub-reader.js');
6 |
7 | const iotHubConnectionString = process.env.IotHubConnectionString;
8 | if (!iotHubConnectionString) {
9 | console.error(`Environment variable IotHubConnectionString must be specified.`);
10 | return;
11 | }
12 | console.log(`Using IoT Hub connection string [${iotHubConnectionString}]`);
13 |
14 | const eventHubConsumerGroup = process.env.EventHubConsumerGroup;
15 | console.log(eventHubConsumerGroup);
16 | if (!eventHubConsumerGroup) {
17 | console.error(`Environment variable EventHubConsumerGroup must be specified.`);
18 | return;
19 | }
20 | console.log(`Using event hub consumer group [${eventHubConsumerGroup}]`);
21 |
22 | // Redirect requests to the public subdirectory to the root
23 | const app = express();
24 | app.use(express.static(path.join(__dirname, 'public')));
25 | app.use((req, res /* , next */) => {
26 | res.redirect('/');
27 | });
28 |
29 | const server = http.createServer(app);
30 | const wss = new WebSocket.Server({ server });
31 |
32 | wss.broadcast = (data) => {
33 | wss.clients.forEach((client) => {
34 | if (client.readyState === WebSocket.OPEN) {
35 | try {
36 | console.log(`Broadcasting data ${data}`);
37 | client.send(data);
38 | } catch (e) {
39 | console.error(e);
40 | }
41 | }
42 | });
43 | };
44 |
45 | server.listen(process.env.PORT || '3000', () => {
46 | console.log('Listening on %d.', server.address().port);
47 | });
48 |
49 | const eventHubReader = new EventHubReader(iotHubConnectionString, eventHubConsumerGroup);
50 |
51 | (async () => {
52 | await eventHubReader.startReadMessage((message, date, deviceId) => {
53 | try {
54 | const payload = {
55 | IotData: message,
56 | MessageDate: date || Date.now().toISOString(),
57 | DeviceId: deviceId,
58 | };
59 |
60 | wss.broadcast(JSON.stringify(payload));
61 | } catch (err) {
62 | console.error('Error broadcasting: [%s] from [%s].', err, message);
63 | }
64 | });
65 | })().catch();
--------------------------------------------------------------------------------
/Source/MeadowAzureServo/MeadowAzureServo.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Always
16 |
17 |
18 | Always
19 |
20 |
21 | Always
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Source/MeadowAzureServo/Models/RotateToEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace MeadowAzureServo.Models
4 | {
5 | public class RotateToEventArgs : EventArgs
6 | {
7 | public int AngleInDegrees { get; set; }
8 |
9 | public RotateToEventArgs(int angleInDegrees)
10 | {
11 | AngleInDegrees = angleInDegrees;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/Source/MeadowAzureServo/Secrets.cs:
--------------------------------------------------------------------------------
1 | namespace MeadowAzureServo
2 | {
3 | public class Secrets
4 | {
5 | ///
6 | /// Name of the Azure IoT Hub created
7 | ///
8 | public const string HUB_NAME = "HUB_NAME";
9 |
10 | ///
11 | /// Name of the Azure IoT Hub created
12 | ///
13 | public const string DEVICE_ID = "DEVICE_ID";
14 |
15 | ///
16 | /// example "SharedAccessSignature sr=MeadowIoTHub ..... "
17 | ///
18 | public const string SAS_TOKEN = "SharedAccessSignature ...";
19 | }
20 | }
--------------------------------------------------------------------------------
/Source/MeadowAzureServo/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/MeadowAzureServo/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/MeadowAzureServo/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/MicroLayoutMenu/MicroLayoutMenu.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | Always
21 |
22 |
23 | Always
24 |
25 |
26 | Always
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Source/MicroLayoutMenu/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/MicroLayoutMenu/img_meadow.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/MicroLayoutMenu/img_meadow.bmp
--------------------------------------------------------------------------------
/Source/MicroLayoutMenu/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/MicroLayoutMenu/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/ModbusServer/DesktopModbusClient/DesktopModbusClient.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net7.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Source/ModbusServer/DesktopModbusClient/Program.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Modbus;
2 | using System.Net;
3 |
4 | internal class Program
5 | {
6 | private static async Task Main(string[] args)
7 | {
8 | Console.WriteLine("Meadow Modbus Client");
9 | Console.WriteLine("Enter your Meadow IP address:");
10 |
11 | var input = Console.ReadLine();
12 |
13 | IPAddress? ip;
14 |
15 | if (!IPAddress.TryParse(input, out ip))
16 | {
17 | Console.WriteLine("Invalid IP Address!");
18 | return;
19 | }
20 |
21 | var client = new ModbusTcpClient(ip);
22 | Console.WriteLine($"Connecting to {ip}...");
23 |
24 | await client.Connect();
25 |
26 | var buffer = new byte[12];
27 |
28 | while (true)
29 | {
30 | var registers = await client.ReadInputRegisters(255, 0, 6);
31 |
32 | Console.WriteLine($"Read {registers.Length} registers");
33 |
34 | Buffer.BlockCopy(registers, 0, buffer, 0, registers.Length * 2);
35 |
36 | var temp = BitConverter.ToSingle(buffer, 0);
37 | var humidity = BitConverter.ToSingle(buffer, 4);
38 | var pressure = BitConverter.ToSingle(buffer, 8);
39 | Console.WriteLine($"Temp: {temp:0.00}C Humidity: {humidity:0.0}% Pressure: {pressure:0.0}Pa");
40 |
41 | await Task.Delay(2000);
42 | }
43 |
44 | }
45 | }
--------------------------------------------------------------------------------
/Source/ModbusServer/MeadowModbusServer/MeadowModbusServer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 | 10
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Always
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Source/ModbusServer/MeadowModbusServer/RegisterBank.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace MeadowModbusServer;
4 |
5 | internal class RegisterBank
6 | {
7 | private byte[] registers;
8 |
9 | public RegisterBank(int registerCount)
10 | {
11 | registers = new byte[registerCount * 2];
12 | }
13 |
14 | public void SetRegisters(Registers register, float value)
15 | {
16 | var offset = (int)register;
17 |
18 | // all registers are ushorts, so split the incoming data
19 | var bytes = BitConverter.GetBytes(value);
20 | Buffer.BlockCopy(bytes, 0, registers, offset * 2, bytes.Length);
21 | }
22 |
23 | public void SetRegisters(Registers register, int value)
24 | {
25 | var offset = (int)register;
26 |
27 | // all registers are ushorts, so split the incoming data
28 | var bytes = BitConverter.GetBytes(value);
29 | Buffer.BlockCopy(bytes, 0, registers, offset * 2, bytes.Length);
30 | }
31 |
32 | public ushort[]? GetRegisters(int startRegister, int count)
33 | {
34 | var end = (int)Registers.TotalLength;
35 | if (startRegister >= end) return null;
36 | if (end - startRegister < count) return null;
37 |
38 | var result = new ushort[count];
39 |
40 | Buffer.BlockCopy(registers, startRegister * 2, result, 0, count * 2);
41 |
42 | return result;
43 | }
44 |
45 | public enum Registers : ushort
46 | {
47 | Temperature = 0,
48 | Humidity = 2,
49 | AirPressure = 4,
50 | TotalLength = 6
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Source/ModbusServer/MeadowModbusServer/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/ModbusServer/MeadowModbusServer/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/ModbusServer/MeadowModbusServer/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/MoistureMeter/.vscode/launch.config:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Deploy",
9 | "type": "meadow",
10 | "request": "launch",
11 | "preLaunchTask": "meadow: Build"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Source/MoistureMeter/MeadowApp.cs:
--------------------------------------------------------------------------------
1 | using Meadow;
2 | using Meadow.Devices;
3 | using Meadow.Foundation;
4 | using Meadow.Foundation.Grove.Sensors.Moisture;
5 | using Meadow.Foundation.Leds;
6 | using Meadow.Peripherals.Leds;
7 | using MoistureMeter.Controllers;
8 | using System;
9 | using System.Threading.Tasks;
10 |
11 | namespace MoistureMeter
12 | {
13 | // Change F7CoreComputeV2 to F7FeatherV2 for ProjectLab v2
14 | public class MeadowApp : App
15 | {
16 | private IRgbPwmLed onboardLed;
17 | private MoistureSensor sensor;
18 | private IProjectLabHardware projectLab;
19 |
20 | public override Task Initialize()
21 | {
22 | Resolver.Log.Info("Initialize...");
23 |
24 | projectLab = ProjectLab.Create();
25 | Resolver.Log.Info($"Running on ProjectLab Hardware {projectLab.RevisionString}");
26 |
27 | onboardLed = projectLab.RgbLed;
28 | onboardLed.SetColor(Color.Red);
29 |
30 | DisplayController.Instance.Initialize(projectLab.Display);
31 |
32 | sensor = new MoistureSensor(projectLab.GroveAnalog.Pins.D0);
33 |
34 | sensor.Updated += (sender, result) =>
35 | {
36 | var percentage = (int)ExtensionMethods.Map(result.New.Millivolts, 0, 1750, 0, 100);
37 |
38 | DisplayController.Instance.UpdatePercentage(Math.Clamp(percentage, 0, 100));
39 | };
40 |
41 | sensor.StartUpdating(TimeSpan.FromMilliseconds(1000));
42 |
43 | onboardLed.SetColor(Color.Green);
44 |
45 | return base.Initialize();
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/Source/MoistureMeter/MoistureMeter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 | 10.0
14 |
15 |
16 |
17 | Always
18 |
19 |
20 | Always
21 |
22 |
23 | Always
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Source/MoistureMeter/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/MoistureMeter/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/MoistureMeter/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/MorseCodeTrainer/.vscode/launch.config:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Deploy",
9 | "type": "meadow",
10 | "request": "launch",
11 | "preLaunchTask": "meadow: Build"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Source/MorseCodeTrainer/MorseCodeTrainer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Always
15 |
16 |
17 | Always
18 |
19 |
20 | Always
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Source/MorseCodeTrainer/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/MorseCodeTrainer/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/MorseCodeTrainer/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/PlantMonitor/.vscode/launch.config:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Deploy",
9 | "type": "meadow",
10 | "request": "launch",
11 | "preLaunchTask": "meadow: Build"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Source/PlantMonitor/MeadowApp.cs:
--------------------------------------------------------------------------------
1 | using Meadow;
2 | using Meadow.Devices;
3 | using Meadow.Foundation;
4 | using Meadow.Foundation.Grove.Sensors.Moisture;
5 | using Meadow.Foundation.Leds;
6 | using Meadow.Hardware;
7 | using Meadow.Peripherals.Leds;
8 | using PlantMonitor.Controllers;
9 | using System;
10 | using System.Threading.Tasks;
11 |
12 | namespace PlantMonitor
13 | {
14 | // Change F7CoreComputeV2 to F7FeatherV2 for ProjectLab v2
15 | public class MeadowApp : App
16 | {
17 | private IRgbPwmLed onboardLed;
18 | private IProjectLabHardware projectLab;
19 | private MoistureSensor moistureSensor;
20 | private DisplayController displayController;
21 |
22 | public override Task Initialize()
23 | {
24 | Resolver.Log.Info("Initialize...");
25 |
26 | projectLab = ProjectLab.Create();
27 | Resolver.Log.Info($"Running on ProjectLab Hardware {projectLab.RevisionString}");
28 |
29 | onboardLed = projectLab.RgbLed;
30 | onboardLed.SetColor(Color.Red);
31 |
32 | displayController = DisplayController.Instance;
33 | displayController.Initialize(projectLab.Display);
34 |
35 | moistureSensor = new MoistureSensor(Device.Pins.A01.CreateAnalogInputPort(1));
36 | var moistureSensorObserver = MoistureSensor.CreateObserver(
37 | handler: result =>
38 | {
39 | onboardLed.SetColor(Color.Purple);
40 |
41 | displayController.Update((int)ExtensionMethods.Map(result.New.Millivolts, 0, 1500, 0, 100));
42 |
43 | onboardLed.SetColor(Color.Green);
44 | },
45 | filter: null
46 | );
47 | moistureSensor.Subscribe(moistureSensorObserver);
48 |
49 | onboardLed.SetColor(Color.Green);
50 |
51 | return base.Initialize();
52 | }
53 |
54 | public override Task Run()
55 | {
56 | moistureSensor.StartUpdating(TimeSpan.FromMinutes(1));
57 |
58 | return base.Run();
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/Source/PlantMonitor/PlantMonitor.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 10.0
21 |
22 |
23 |
24 | Always
25 |
26 |
27 | Always
28 |
29 |
30 | Always
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Source/PlantMonitor/level_0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/PlantMonitor/level_0.jpg
--------------------------------------------------------------------------------
/Source/PlantMonitor/level_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/PlantMonitor/level_1.jpg
--------------------------------------------------------------------------------
/Source/PlantMonitor/level_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/PlantMonitor/level_2.jpg
--------------------------------------------------------------------------------
/Source/PlantMonitor/level_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/PlantMonitor/level_3.jpg
--------------------------------------------------------------------------------
/Source/PlantMonitor/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | MonoControl:
2 | Options: --jit
--------------------------------------------------------------------------------
/Source/RotatingCube/RotatingCube.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 | Always
14 |
15 |
16 | Always
17 |
18 |
19 | Always
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Source/RotatingCube/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/RotatingCube/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/RotatingCube/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/Simon/.vscode/launch.config:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Deploy",
9 | "type": "meadow",
10 | "request": "launch",
11 | "preLaunchTask": "meadow: Build"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Source/Simon/Simon.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 | Always
14 |
15 |
16 | Always
17 |
18 |
19 | Always
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Source/Simon/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/Simon/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/Simon/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/ThermalCamera/ThermalCamera.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Always
15 |
16 |
17 | Always
18 |
19 |
20 | Always
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Source/ThermalCamera/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/ThermalCamera/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/ThermalCamera/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/WakeOnInterrupt/WakeOnInterrupt.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 | 10
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Always
16 |
17 |
18 | Always
19 |
20 |
21 | Always
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Source/WakeOnInterrupt/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/WakeOnInterrupt/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/WakeOnInterrupt/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/.vscode/launch.config:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Deploy",
9 | "type": "meadow",
10 | "request": "launch",
11 | "preLaunchTask": "meadow: Build"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/MaxBotix_to_Grove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WaterStorageMonitor/MaxBotix_to_Grove.png
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/Source/Hardware/BenchProtoWaterMonitorHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow;
2 | using Meadow.Foundation.Sensors.Distance;
3 |
4 | namespace RainWaterMonitor.Hardware
5 | {
6 | public class BenchProtoWaterMonitorHardware : WaterMonitorHardwareBase
7 | {
8 | public BenchProtoWaterMonitorHardware() : base()
9 | {
10 | //---- instantiate the distance sensor
11 | Logger?.Info("Instantiating distance sensor.");
12 | DistanceSensor = new Vl53l0x(Resolver.Device, base.Hardware.I2cBus);
13 | Logger?.Info("Distance sensor up.");
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/Source/Hardware/HardwareConfigTypes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | namespace RainWaterMonitor.Hardware
3 | {
4 | public enum HardwareConfigTypes
5 | {
6 | BenchProto,
7 | LabProto
8 | }
9 | }
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/Source/Hardware/IWaterMonitorHardware.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Meadow.Devices;
3 | using Meadow.Foundation.Sensors.Distance;
4 | using Meadow.Peripherals.Sensors;
5 |
6 | namespace RainWaterMonitor.Hardware
7 | {
8 | public interface IWaterMonitorHardware : IProjectLabHardware
9 | {
10 | IRangeFinder DistanceSensor { get; }
11 | }
12 | }
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/Source/Hardware/LabProtoWaterMonitorHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow;
2 | using Meadow.Devices;
3 | using Meadow.Foundation.Sensors.Distance;
4 | using Meadow.Gateways.Bluetooth;
5 |
6 | namespace RainWaterMonitor.Hardware
7 | {
8 | public class LabProtoWaterMonitorHardware : WaterMonitorHardwareBase
9 | {
10 | public LabProtoWaterMonitorHardware() : base()
11 | {
12 | F7FeatherV2 device = Resolver.Device as F7FeatherV2;
13 | //---- instantiate the distance sensor
14 | Logger?.Info("Instantiating distance sensor.");
15 | DistanceSensor = new MaxBotix(Resolver.Device, device.SerialPortNames.Com1, MaxBotix.SensorType.XL);
16 | Logger?.Info("Distance sensor up.");
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/Source/Hardware/WaterMonitorHardwareBase.cs:
--------------------------------------------------------------------------------
1 | using Meadow;
2 | using Meadow.Devices;
3 | using Meadow.Peripherals.Sensors;
4 |
5 | namespace RainWaterMonitor.Hardware
6 | {
7 | public class WaterMonitorHardwareBase : ProjectLab, IWaterMonitorHardware
8 | {
9 | public IRangeFinder DistanceSensor { get; protected set; }
10 |
11 | public WaterMonitorHardwareBase()
12 | {
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/Source/WaterStorageMonitor.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.1
4 | true
5 | Library
6 | App
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Always
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/Source/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | MonoControl:
2 | Options: --jit
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/WaterStorageMonitor.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WaterStorageMonitor/WaterStorageMonitor.jpg
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/Water_Barrel.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WaterStorageMonitor/Water_Barrel.jpg
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | #Logging:
13 | # LogLevel:
14 | # Default: Trace
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncommented these options as needed.
2 | # To learn more about these config options, check out the OS & Device Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/OS_Device_Configuration/
4 |
5 | #Device:
6 | # Name of the device on the network.
7 | # Name: MeadowF7V2_ConfigSample
8 |
9 | # Uncomment if SD card hardware present on this hardware (e.g., Core-Compute module with SD add-on)? Optional; default value is `false`.
10 | # SdStorageSupported: true
11 |
12 | # Control how the ESP coprocessor will start and operate.
13 | #Coprocessor:
14 | # Should the ESP32 automatically attempt to connect to an access point at startup?
15 | # If set to true, wifi.config.yaml credentials must be stored in the device.
16 | # AutomaticallyStartNetwork: true
17 |
18 | # Should the ESP32 automatically reconnect to the configured access point?
19 | # AutomaticallyReconnect: true
20 |
21 | # Maximum number of retry attempts for connections etc. before an error code is returned.
22 | # MaximumRetryCount: 7
23 |
24 | # Network configuration.
25 | #Network:
26 | # Interfaces:
27 | # - Name: Ethernet
28 | # UseDHCP: false
29 | # IPAddress: 192.168.1.60
30 | # NetMask: 255.255.255.0
31 | # Gateway: 192.168.1.254
32 | # - Name: WiFi
33 | # UseDHCP: true
34 | # IPAddress:
35 | # NetMask:
36 | # Gateway:
37 |
38 | # Which interface should be used?
39 | # DefaultInterface: WiFi
40 |
41 | # Automatically attempt to get the time at startup?
42 | # GetNetworkTimeAtStartup: true
43 |
44 | # Time synchronization period in seconds.
45 | # NtpRefreshPeriodSeconds: 600
46 |
47 | # Name of the NTP servers.
48 | # NtpServers:
49 | # - 0.pool.ntp.org
50 | # - 1.pool.ntp.org
51 | # - 2.pool.ntp.org
52 | # - 3.pool.ntp.org
53 |
54 | # IP addresses of the DNS servers.
55 | # DnsServers:
56 | # - 1.1.1.1
57 | # - 8.8.8.8
--------------------------------------------------------------------------------
/Source/WaterStorageMonitor/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment to set the default Wi-Fi credentials. (This file will be processed into secure storage on the ESP32 and then deleted from the device.)
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/WiFi_Configuration/
4 |
5 | # # To enable automatically connecting to a default network, make sure to enable the Coprocessor > AutomaticallyStartNetwork value in meadow.config.yaml.
6 | #Credentials:
7 | # Ssid: YourSSID
8 | # Password: SSIDPassword
9 |
--------------------------------------------------------------------------------
/Source/WifiWeather/.vscode/launch.config:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Deploy",
9 | "type": "meadow",
10 | "request": "launch",
11 | "preLaunchTask": "meadow: Build"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/Source/WifiWeather/DTOs/WeatherReadingDTO.cs:
--------------------------------------------------------------------------------
1 | namespace WifiWeather.DTOs
2 | {
3 | public class WeatherReadingDTO
4 | {
5 | public Coordinates coord { get; set; }
6 | public Weather[] weather { get; set; }
7 | public WeatherValues main { get; set; }
8 | public int visibility { get; set; }
9 | public Wind wind { get; set; }
10 | public Clouds clouds { get; set; }
11 | public int dt { get; set; }
12 | public System sys { get; set; }
13 | public long timezone { get; set; }
14 | public int id { get; set; }
15 | public string name { get; set; }
16 | public int cod { get; set; }
17 | }
18 |
19 | public class Coordinates
20 | {
21 | public double lon { get; set; }
22 | public double lat { get; set; }
23 | }
24 |
25 | public class Weather
26 | {
27 | public int id { get; set; }
28 | public string nain { get; set; }
29 | public string description { get; set; }
30 | public string icon { get; set; }
31 | }
32 |
33 | public class WeatherValues
34 | {
35 | public double temp { get; set; }
36 | public double feels_like { get; set; }
37 | public double temp_min { get; set; }
38 | public double temp_max { get; set; }
39 | public int pressure { get; set; }
40 | public int humidity { get; set; }
41 | }
42 |
43 | public class Wind
44 | {
45 | public decimal speed { get; set; }
46 | public int deg { get; set; }
47 | public double gust { get; set; }
48 | }
49 |
50 | public class Clouds
51 | {
52 | public int all { get; set; }
53 | }
54 |
55 | public class System
56 | {
57 | public int type { get; set; }
58 | public int id { get; set; }
59 | public string country { get; set; }
60 | public long sunrise { get; set; }
61 | public long sunset { get; set; }
62 | }
63 | }
--------------------------------------------------------------------------------
/Source/WifiWeather/Hardware/IWifiWeatherHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Peripherals.Displays;
2 | using Meadow.Peripherals.Sensors;
3 | using Meadow.Peripherals.Sensors.Buttons;
4 |
5 | namespace WifiWeather.Hardware
6 | {
7 | internal interface IWifiWeatherHardware
8 | {
9 | IButton UpButton { get; }
10 |
11 | IButton DownButton { get; }
12 |
13 | IPixelDisplay Display { get; }
14 |
15 | ITemperatureSensor TemperatureSensor { get; }
16 |
17 | void Initialize();
18 | }
19 | }
--------------------------------------------------------------------------------
/Source/WifiWeather/Hardware/WifiWeatherHardware.cs:
--------------------------------------------------------------------------------
1 | using Meadow.Devices;
2 | using Meadow.Peripherals.Displays;
3 | using Meadow.Peripherals.Sensors;
4 | using Meadow.Peripherals.Sensors.Buttons;
5 |
6 | namespace WifiWeather.Hardware
7 | {
8 | internal class WifiWeatherHardware : IWifiWeatherHardware
9 | {
10 | protected IProjectLabHardware ProjLab { get; private set; }
11 |
12 | public IButton UpButton { get; set; }
13 |
14 | public IButton DownButton { get; set; }
15 |
16 | public IPixelDisplay Display { get; set; }
17 |
18 | public ITemperatureSensor TemperatureSensor { get; set; }
19 |
20 | public void Initialize()
21 | {
22 | ProjLab = ProjectLab.Create();
23 |
24 | UpButton = ProjLab.UpButton;
25 |
26 | DownButton = ProjLab.DownButton;
27 |
28 | Display = ProjLab.Display;
29 |
30 | TemperatureSensor = (ProjLab as ProjectLabHardwareBase).AtmosphericSensor;
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/Source/WifiWeather/MeadowApp.cs:
--------------------------------------------------------------------------------
1 | using Meadow;
2 | using Meadow.Devices;
3 | using Meadow.Hardware;
4 | using System.Threading.Tasks;
5 | using WifiWeather.Hardware;
6 |
7 | namespace WifiWeather
8 | {
9 | public class MeadowApp : App
10 | {
11 | MainController mainController;
12 |
13 | public override Task Initialize()
14 | {
15 | Resolver.Log.Info("Initialize...");
16 |
17 | var hardware = new WifiWeatherHardware();
18 | var network = Device.NetworkAdapters.Primary();
19 |
20 | mainController = new MainController(hardware, network);
21 | mainController.Initialize();
22 |
23 | return Task.CompletedTask;
24 | }
25 |
26 | public override async Task Run()
27 | {
28 | Resolver.Log.Info("Run...");
29 |
30 | await mainController.Run();
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/img_meadow.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/img_meadow.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/img_refreshed.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/img_refreshed.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/img_refreshing.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/img_refreshing.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/img_wifi_connected.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/img_wifi_connected.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/img_wifi_connecting.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/img_wifi_connecting.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_clear_moon.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_clear_moon.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_clear_sun.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_clear_sun.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_clouds.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_clouds.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_clouds_moon.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_clouds_moon.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_clouds_sun.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_clouds_sun.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_drizzle.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_drizzle.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_drizzle_heavy.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_drizzle_heavy.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_drizzle_light_moon.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_drizzle_light_moon.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_drizzle_light_sun.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_drizzle_light_sun.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_misc.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_misc.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_mist.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_mist.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_rain.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_rain.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_rain_heavy.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_rain_heavy.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_rain_light_moon.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_rain_light_moon.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_rain_light_sun.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_rain_light_sun.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_snow.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_snow.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_snow_light_moon.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_snow_light_moon.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_snow_light_sun.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_snow_light_sun.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_snow_rain.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_snow_rain.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_storm.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_storm.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_storm_heavy.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_storm_heavy.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_storm_light_moon.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_storm_light_moon.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Resources/w_storm_light_sun.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WildernessLabs/Meadow.ProjectLab.Samples/35075266e16bd153dc09f54945b39c48e0548cb7/Source/WifiWeather/Resources/w_storm_light_sun.bmp
--------------------------------------------------------------------------------
/Source/WifiWeather/Secrets.cs:
--------------------------------------------------------------------------------
1 | namespace WifiWeather
2 | {
3 | public class Secrets
4 | {
5 | ///
6 | /// Open Weather Map API key.
7 | ///
8 | public const string WEATHER_API_KEY = "WEATHER_API_KEY";
9 |
10 | ///
11 | /// City to get weather for.
12 | ///
13 | public const string WEATHER_CITY = "WEATHER_CITY";
14 | }
15 | }
--------------------------------------------------------------------------------
/Source/WifiWeather/app.config.yaml:
--------------------------------------------------------------------------------
1 | # Uncomment additional options as needed.
2 | # To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
3 | # http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/
4 |
5 | Lifecycle:
6 | # Control whether Meadow will restart when an unhandled app exception occurs. Combine with Lifecycle > AppFailureRestartDelaySeconds to control restart timing.
7 | RestartOnAppFailure: false
8 | # # When app set to restart automatically on app failure,
9 | #AppFailureRestartDelaySeconds: 15
10 |
11 | # # Adjust the level of logging detail.
12 | Logging:
13 | LogLevel:
14 | Default: Trace
--------------------------------------------------------------------------------
/Source/WifiWeather/meadow.config.yaml:
--------------------------------------------------------------------------------
1 | # Acceptable values for true: true, 1, yes
2 | # Acceptable values for false: false, 0, no
3 |
4 | # Main Device Config
5 | Device:
6 | # Name of the device on the network.
7 | Name: WifiWeather
8 |
9 | # Control how the ESP coprocessor will start and operate.
10 | Coprocessor:
11 | # Should the ESP32 automatically attempt to connect to an access point at startup?
12 | # If set to true, wifi.yaml credentials must be stored in the device.
13 | AutomaticallyStartNetwork: true
14 |
15 | # Should the ESP32 automatically reconnect to the configured access point?
16 | AutomaticallyReconnect: true
17 |
18 | # Maximum number of retry attempts for connections etc. before an error code is returned.
19 | MaximumRetryCount: 7
20 |
21 | # Network configuration.
22 | Network:
23 | # Default Interface
24 | DefaultInterface: Wifi
25 |
26 | # Automatically attempt to get the time at startup?
27 | GetNetworkTimeAtStartup: 1
28 |
29 | # Time synchronization period in seconds.
30 | NtpRefreshPeriod: 600
31 |
32 | # Name of the NTP servers.
33 | NtpServers:
34 | - 0.pool.ntp.org
35 | - 1.pool.ntp.org
36 | - 2.pool.ntp.org
37 | - 3.pool.ntp.org
38 |
39 | # IP addresses of the DNS servers.
40 | DnsServers:
41 | - 1.1.1.1
42 | - 8.8.8.8
--------------------------------------------------------------------------------
/Source/WifiWeather/wifi.config.yaml:
--------------------------------------------------------------------------------
1 | Credentials:
2 | Ssid: Ssid
3 | Password: Password
--------------------------------------------------------------------------------