Skip to content

Commit

Permalink
PR base compiles success
Browse files Browse the repository at this point in the history
  • Loading branch information
neilh20.gitk authored and neilh20.gitk committed Jan 5, 2021
1 parent ec94304 commit f34b70b
Show file tree
Hide file tree
Showing 5 changed files with 556 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sensor_tests/referenceTest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
61 changes: 61 additions & 0 deletions sensor_tests/referenceTest/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[//]: # ( @page example_mmw Monitor My Watershed Example )
# A ModularSensors reference Test for pushing data to Monitor My Watershed/EnviroDIY

A sketch for easy testing and configuration of a https://monitormywatershed.org/
It can be used by a newbie to easly verify their environment, an expert to easly download and test the latest.

Required: A minimium hardware configuration of a Mayfly (rev0.5b or later) with a DigiWiFi S6 to provide a reference test environment.

The code base is referenced as src/* instead of https://github.com/EnviroDIY/ModularSensors (develop)
This is the one gottcha - you need to have git installed and operational.
a) $ git pull #to get latest code, before mods ~ or git clone to get repo
b) $ git branch -b pr_<description>
make changes
c) $ git add . #for changes
d) $ git commit -m "change description"
e) $ git push # to push changes, and follow instructions.

This can be used for
1) Stability testing of https://github.com/EnviroDIY/ModularSensors (develop)
It can be modified in platform.io to point to any other stream eg https://github.com/EnviroDIY/ModularSensors (master)
2) Easly verifying program changes before submitting a PR to the (develop). Requies some knowledge of git

The test level sensors are Mayfly Sample Number, Mayfly Temperature,
The ms_mmw_cfg.h will contain Token and UUID as downloaded from https://monitormywatershed.org/

Use: Start platformIo (actually VSC configured with PlatformIO)
From the top left click on File
- File -> Open Folder
- select tools\retTestDevelop
(wait for it to start up and stabilize 1-5minutes)
on the bottom hover over the "tick" icon which will then show "PlatformIO: Build"
Click on the "tick" icon - and it will start the build process. This requires the internet, and brings in all the dependencies - libraries which are stored in .pio\libdeps\mayfly
Then it fill build - and should end with this and the RAM and FLASH per the project

Building in release mode
Checking size .pio\build\mayfly\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [=== ] 28.7% (used 4708 bytes from 16384 bytes)
Flash: [===== ] 54.6% (used 71046 bytes from 130048 bytes)
_______

(the following is included as boiler plate~ looks like it should provide references to docs)

[//]: # ( @tableofcontents )

[//]: # ( Start GitHub Only )
- [Using ModularSensors to log data to Monitor My Watershed/EnviroDIY](#using-modularsensors-to-log-data-to-monitor-my-watershedenvirodiy)
- [Walking Through the Code](#walking-through-the-code)
- [PlatformIO Configuration](#platformio-configuration)
- [The Complete Code](#the-complete-code)

[//]: # ( End GitHub Only )


[//]: # ( @section example_mmw_pio PlatformIO Configuration )
## PlatformIO Configuration

[//]: # ( @include{lineno} logging_to_MMW/platformio.ini )

[//]: # ( @section example_mmw_code The Complete Code )
## The Complete Code
44 changes: 44 additions & 0 deletions sensor_tests/referenceTest/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[platformio]
description = ModularSensors reference Test with internnal sensors logging to Monitor My Watershed

[common]
; We have to ignore these folders or PlatformIO will double count all the dependencies
lib_ignore = .git, .pioenvs, .piolibdeps, .vscode, include, doc, examples; , sensor_tests, compile_tests, pioScripts

[env:mayfly]
monitor_speed = 115200
board = mayfly
platform = atmelavr
framework = arduino
lib_ldf_mode = deep+
lib_ignore = ${common.lib_ignore},
RTCZero
Adafruit NeoPixel
Adafruit GFX Library
Adafruit SSD1306
Adafruit ADXL343
Adafruit STMPE610
Adafruit TouchScreen
Adafruit ILI9341

build_flags =
-DSDI12_EXTERNAL_PCINT
-DNEOSWSERIAL_EXTERNAL_PCINT
-fmax-errors=5

lib_deps =
; EnviroDIY_ModularSensors
; ^^ Use this when working from an official release of the library
https://github.com/EnviroDIY/ModularSensors.git#develop
; ^^ Use this when if you want to pull from the develop branch
; or if src delete .pio\libdeps\mayfly\EnviroDIY_ModularSensors
34 changes: 34 additions & 0 deletions sensor_tests/referenceTest/src/ms_mmw_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//Paste your own values below
const char* UUIDs[] = // UUID array for device sensors
{
"0f9c6292-3646-4ab6-8aa3-ca542d5eee49", // Battery voltage
// (EnviroDIY_Mayfly_Batt)
"4b36e862-8dea-4f8a-a0d1-29ae20a92812", // Temperature
// (EnviroDIY_Mayfly_Temp)
"b6500c40-6339-47c9-ba65-5f717550432f", // Percent full scale
// (Digi_WiFi_SignalPercent)
"ef0c5561-42c8-49b2-8bc1-67cfbe2ffdd7", // Battery voltage
// (All_ExternalVoltage_Battery)
"ea56e49f-ae3c-49b0-b993-736c92c034ff", // Battery voltage
// (All_ExternalVoltage_Battery)
"c552fac5-c45c-416c-a634-5f22a20672de", // Gage height
// (All_Calc_gageHeight)
"a5d01a6e-5328-4ec8-9ab7-1110720b304e", // Sequence number
// (EnviroDIY_Mayfly_SampleNum)
"08a02c91-5336-4b98-999e-9867cb1c80ae", // Received signal strength
// indication
// (Digi_Cellular_RSSI)
"988edc32-629f-4fc6-8ab2-59ef2fa81c9c", // Percent full scale
// (Digi_Cellular_SignalPercent)
"a3b360bb-683f-4fb3-b720-67f0d585b9a0" // Temperature
// (Digi_Cellular_Temp)
};
const char* registrationToken =
"38486242-cd9f-42f5-ad17-79b480cf2d";//28"; // Device registration token
const char* samplingFeature =
"cb344d37-b557-400d-b999-f9b125cade29"; // Sampling feature UUID

//Define only one modem
#define MODEM_WIFIID_CDEF "AddYourOwnGuest"
#define MODEM_WIFIPWD_CDEF "AddYourOwnGuest"
//#define MODEM_LTE_APN_CDEF "xxx"
Loading

0 comments on commit f34b70b

Please sign in to comment.