Skip to content

Commit 1f8b30f

Browse files
authored
Merge pull request #372 from EnviroDIY/y533_ORP
Merge Y533 ORP getValues() fixes, add ClariVUE and SIM7080
2 parents 96e2f17 + 86af4e5 commit 1f8b30f

File tree

61 files changed

+2408
-1407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2408
-1407
lines changed

.github/workflows/build_documentation.yaml

Lines changed: 13 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -26,94 +26,31 @@ jobs:
2626
with:
2727
path: code_docs/ModularSensors
2828

29-
- name: Restore or Cache pip
30-
uses: actions/cache@v2.1.6
31-
id: cache_pip
32-
with:
33-
path: ~/.cache/pip
34-
# if requirements.txt hasn't changed, then it will be a "cache hit" and pip will be restored
35-
# if requirements.txt HAS changed, it will be a "cache miss" and a new cache of pip will be created if the job completes successfully
36-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
37-
restore-keys: ${{ runner.os }}-pip-
38-
39-
- name: Restore or Cache PlatformIO and Libraries
40-
uses: actions/cache@v2.1.6
41-
id: cache_pio
42-
with:
43-
path: ~/.platformio
44-
# if nothing in the lock files has changed, then it will be a "cache hit"
45-
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
46-
4729
- name: Set up Python
4830
uses: actions/setup-python@v2.2.2
4931

50-
# This should be pulled from cache, if there's not a new version
5132
- name: Install PlatformIO
5233
run: |
5334
python -m pip install --upgrade pip
5435
pip install --upgrade platformio
5536
37+
- name: Restore or Cache PlatformIO and Libraries
38+
uses: actions/cache@v2.1.5
39+
id: cache_pio
40+
with:
41+
path: ~/.platformio
42+
# if nothing in the dependencies.json file has changed, then it will
43+
# be a "cache hit" and we can restore libraries from cache and not
44+
# download them. If it has changed we have to re-download.
45+
key: ${{ hashFiles('./continuous_integration/dependencies.json') }}
46+
5647
# Install *all* the dependencies!
5748
# We're including the dependencies just so the includes can follow in the doxygen pre-processor
5849
- name: Install the dependencies at global level
50+
if: steps.cache_pio.outputs.cache-hit != 'true'
5951
run: |
60-
echo "::debug::Installing envirodiy/EnviroDIY_DS3231"
61-
pio lib -g install envirodiy/EnviroDIY_DS3231
62-
echo "::debug::Installing arduino-libraries/RTCZero"
63-
pio lib -g install arduino-libraries/RTCZero
64-
echo "::debug::Installing greygnome/EnableInterrupt"
65-
pio lib -g install greygnome/EnableInterrupt
66-
echo "::debug::Installing greiman/SdFat"
67-
pio lib -g install greiman/SdFat
68-
echo "::debug::Installing vshymanskyy/TinyGSM"
69-
pio lib -g install vshymanskyy/TinyGSM
70-
echo "::debug::Installing knolleary/PubSubClient"
71-
pio lib -g install knolleary/PubSubClient
72-
echo "::debug::Installing adafruit/'Adafruit BusIO'"
73-
pio lib -g install adafruit/'Adafruit BusIO'
74-
echo "::debug::Installing adafruit/'Adafruit Unified Sensor'"
75-
pio lib -g install adafruit/'Adafruit Unified Sensor'
76-
echo "::debug::Installing https://github.com/soligen2010/Adafruit_ADS1X15.git"
77-
pio lib -g install https://github.com/soligen2010/Adafruit_ADS1X15.git
78-
echo "::debug::Installing adafruit/'Adafruit AM2315'"
79-
pio lib -g install adafruit/'Adafruit AM2315'
80-
echo "::debug::Installing adafruit/'Adafruit BME280 Library'"
81-
pio lib -g install adafruit/'Adafruit BME280 Library'
82-
echo "::debug::Installing adafruit/'DHT sensor library'"
83-
pio lib -g install adafruit/'DHT sensor library'
84-
echo "::debug::Installing adafruit/'Adafruit INA219'"
85-
pio lib -g install adafruit/'Adafruit INA219'
86-
echo "::debug::Installing adafruit/'Adafruit MPL115A2'"
87-
pio lib -g install adafruit/'Adafruit MPL115A2'
88-
echo "::debug::Installing paulstoffregen/OneWire"
89-
pio lib -g install paulstoffregen/OneWire
90-
echo "::debug::Installing milesburton/DallasTemperature"
91-
pio lib -g install milesburton/DallasTemperature
92-
echo "::debug::Installing envirodiy/SDI-12"
93-
pio lib -g install envirodiy/SDI-12
94-
echo "::debug::Installing northernwidget/MS5803"
95-
pio lib -g install northernwidget/MS5803
96-
echo "::debug::Installing https://github.com/NorthernWidget-Skunkworks/Tally_Library.git#Dev_I2C"
97-
pio lib -g install https://github.com/NorthernWidget-Skunkworks/Tally_Library.git#Dev_I2C
98-
echo "::debug::Installing envirodiy/SensorModbusMaster"
99-
pio lib -g install envirodiy/SensorModbusMaster
100-
echo "::debug::Installing envirodiy/KellerModbus"
101-
pio lib -g install envirodiy/KellerModbus
102-
echo "::debug::Installing envirodiy/YosemitechModbus"
103-
pio lib -g install envirodiy/YosemitechModbus
104-
echo "::debug::Installing vshymanskyy/StreamDebugger"
105-
pio lib -g install vshymanskyy/StreamDebugger
106-
echo "::debug::Installing https://github.com/EnviroDIY/SoftwareSerial_ExternalInts.git"
107-
pio lib -g install https://github.com/EnviroDIY/SoftwareSerial_ExternalInts.git
108-
echo "::debug::Installing https://github.com/PaulStoffregen/AltSoftSerial.git"
109-
pio lib -g install https://github.com/PaulStoffregen/AltSoftSerial.git
110-
echo "::debug::Installing https://github.com/SRGDamia1/NeoSWSerial.git"
111-
pio lib -g install https://github.com/SRGDamia1/NeoSWSerial.git
112-
echo "::debug::Installing https://github.com/Testato/SoftwareWire.git"
113-
pio lib -g install https://github.com/Testato/SoftwareWire.git
114-
115-
- name: Update Libraries from Cache
116-
run: pio lib -g update
52+
chmod +x continuous_integration/install-deps-platformio.sh
53+
sh continuous_integration/install-deps-platformio.sh
11754
11855
- name: Install GraphViz (dot)
11956
run: sudo apt-get -y install graphviz
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Build Examples with Arduino CLI
2+
3+
# Triggers the workflow on push or pull request events
4+
on: [push, pull_request]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
if: "!contains(github.event.head_commit.message, 'ci skip')"
10+
11+
strategy:
12+
matrix:
13+
example:
14+
[
15+
examples/single_sensor/,
16+
examples/simple_logging/,
17+
examples/simple_logging_LearnEnviroDIY/,
18+
examples/DRWI_CitSci/,
19+
examples/DRWI_LTE/,
20+
examples/DRWI_NoCellular/,
21+
examples/double_logger/,
22+
examples/baro_rho_correction/,
23+
examples/data_saving/,
24+
examples/logging_to_MMW/,
25+
examples/logging_to_ThingSpeak/,
26+
]
27+
# arduino-platform: ['EnviroDIY:avr', 'arduino:avr', 'arduino:samd', 'adafruit:samd']
28+
fqbn:
29+
[
30+
'EnviroDIY:avr:envirodiy_mayfly',
31+
'arduino:avr:mega',
32+
'arduino:samd:mzero_bl',
33+
'adafruit:samd:adafruit_feather_m0',
34+
'SODAQ:samd:sodaq_autonomo',
35+
]
36+
37+
steps:
38+
- uses: actions/checkout@v2
39+
40+
- name: Set environment variable for library installation source
41+
run: |
42+
if [[ -z "${GITHUB_HEAD_REF}" ]]; then
43+
echo "::debug::Push to commit ${GITHUB_SHA}"
44+
echo "LIBRARY_INSTALL_ZIP=https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.zip" >> $GITHUB_ENV
45+
else
46+
echo "::debug::Pull Request from the ${GITHUB_HEAD_REF} branch"
47+
echo "LIBRARY_INSTALL_ZIP=https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_HEAD_REF}.zip" >> $GITHUB_ENV
48+
fi
49+
50+
# We use the `arduino/setup-arduino-cli` action to install and
51+
# configure the Arduino CLI on the system.
52+
- name: Setup Arduino CLI
53+
uses: arduino/setup-arduino-cli@v1
54+
55+
- name: Restore or Cache Arduino Platforms and Libraries
56+
uses: actions/cache@v2.1.5
57+
id: cache_arduino
58+
with:
59+
path: home/arduino
60+
# if nothing in the dependencies.json file has changed, then it will
61+
# be a "cache hit" and we can restore libraries from cache and not
62+
# download them. If it has changed we have to re-download.
63+
key: ${{ hashFiles('./continuous_integration/dependencies.json') }}
64+
65+
# Install cores and library dependencies for the Arduino CLI, iff no cache
66+
- name: Install the Arduino libraries
67+
if: steps.cache_arduino.outputs.cache-hit != 'true'
68+
run: |
69+
chmod +x continuous_integration/install-deps-arduino-cli.sh
70+
sh continuous_integration/install-deps-arduino-cli.sh
71+
72+
# Install ModularSensors for the Arduino CLI
73+
- name: Install the testing version of Modular Sensors for the Arduino CLI
74+
run: |
75+
echo "::debug::Deleting any archived zips"
76+
rm -f home/arduino/downloads/ModularSensors.zip
77+
echo "::debug::Downloading library zip"
78+
curl -L --retry 15 --retry-delay 0 ${{ env.LIBRARY_INSTALL_ZIP }} --create-dirs -o home/arduino/downloads/ModularSensors.zip
79+
echo "::debug::Unzipping the library"
80+
unzip -o home/arduino/downloads/ModularSensors.zip -d home/arduino/downloads/ -x "*.git/*" "continuous_integration/*" "docs/*" "examples/*"
81+
echo "::debug::Ensuring no old directories exist"
82+
rm -r -f home/arduino/user/libraries/ModularSensors
83+
echo "::debug::Creating a new directory for the testing version of Modular sensors"
84+
mkdir -p home/arduino/user/libraries/ModularSensors
85+
echo "::debug::Moving the unzipped library to the new directory"
86+
if [[ -z "${GITHUB_HEAD_REF}" ]]; then
87+
mv home/arduino/downloads/ModularSensors-${GITHUB_SHA}/* home/arduino/user/libraries/ModularSensors
88+
else
89+
mv home/arduino/downloads/ModularSensors-${GITHUB_HEAD_REF}/* home/arduino/user/libraries/ModularSensors
90+
fi
91+
echo "::debug::Updating the library index"
92+
arduino-cli --config-file continuous_integration/arduino_cli.yaml lib update-index
93+
echo "::debug::Listing libraries detected by the Arduino CLI"
94+
arduino-cli --config-file continuous_integration/arduino_cli.yaml lib list
95+
echo "::debug::Listing the contents of the Arduino library directory"
96+
ls home/arduino/user/libraries
97+
98+
- name: Set appropriate build flags for Arduino CLI
99+
run: |
100+
echo "::group::Setting build flags"
101+
echo "::debug::Setting build flags for ${{ matrix.fqbn }}"
102+
if [ ${{ matrix.fqbn }} = 'EnviroDIY:avr:envirodiy_mayfly' ]; then
103+
echo "EXTRA_BUILD_FLAGS=-DNEOSWSERIAL_EXTERNAL_PCINT" >> $GITHUB_ENV
104+
fi
105+
if [ ${{ matrix.fqbn }} = 'arduino:avr:mega' ]; then
106+
echo "EXTRA_BUILD_FLAGS=-DNEOSWSERIAL_EXTERNAL_PCINT" >> $GITHUB_ENV
107+
fi
108+
if [ ${{ matrix.fqbn }} = 'arduino:samd:mzero_bl' ]; then
109+
echo "EXTRA_BUILD_FLAGS=-DNEOSWSERIAL_EXTERNAL_PCINT -DARDUINO_SAMD_ZERO -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON" >> $GITHUB_ENV
110+
fi
111+
if [ ${{ matrix.fqbn }} = 'adafruit:samd:adafruit_feather_m0' ]; then
112+
echo "EXTRA_BUILD_FLAGS=-DNEOSWSERIAL_EXTERNAL_PCINT -DARDUINO_SAMD_ZERO -DARM_MATH_CM0PLUS -DADAFRUIT_FEATHER_M0 -D__SAMD21G18A__ -DUSB_VID=0x239A -DUSB_PID=0x800B -DUSBCON -DUSB_CONFIG_POWER=100" >> $GITHUB_ENV
113+
fi
114+
if [ ${{ matrix.fqbn }} = 'SODAQ:samd:sodaq_autonomo' ]; then
115+
echo "EXTRA_BUILD_FLAGS=-DNEOSWSERIAL_EXTERNAL_PCINT -DVERY_LOW_POWER -D__SAMD21J18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON" >> $GITHUB_ENV
116+
fi
117+
echo "::endgroup::"
118+
119+
- name: Compile examples using the Arduino CLI
120+
env:
121+
BUILD_EXAMPLE: ${{ matrix.example }}
122+
run: |
123+
echo "::debug::Running Arduino CLI for ${{ matrix.example }}"
124+
arduino-cli --config-file continuous_integration/arduino_cli.yaml compile --clean --build-property "build.extra_flags=$EXTRA_BUILD_FLAGS" --fqbn ${{ matrix.fqbn }} $BUILD_EXAMPLE
125+
126+
- name: Uninstall testing version of Modular Sensors before caching
127+
run: arduino-cli --config-file continuous_integration/arduino_cli.yaml lib uninstall ModularSensors
Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Examples
1+
name: Build Examples with PlatformIO
22

33
# Triggers the workflow on push or pull request events
44
on: [push, pull_request]
@@ -24,11 +24,12 @@ jobs:
2424
examples/logging_to_MMW/,
2525
examples/logging_to_ThingSpeak/,
2626
]
27+
pio_environment: [mayfly, mega, arduino_zero, adafruit_feather_m0, autonomo]
2728

2829
steps:
2930
- uses: actions/checkout@v2.3.4
3031

31-
- name: Set variables
32+
- name: Set environment variable for library installation source
3233
run: |
3334
if [[ -z "${GITHUB_HEAD_REF}" ]]; then
3435
echo "::debug::Push to commit ${GITHUB_SHA}"
@@ -38,36 +39,43 @@ jobs:
3839
echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_HEAD_REF}" >> $GITHUB_ENV
3940
fi
4041
41-
- name: Restore or Cache pip
42-
uses: actions/cache@v2.1.6
43-
with:
44-
path: ~/.cache/pip
45-
# if requirements.txt hasn't changed, then it will be a "cache hit" and pip will be restored
46-
# if requirements.txt HAS changed, it will be a "cache miss" and a new cache of pip will be created if the job completes successfully
47-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
48-
restore-keys: ${{ runner.os }}-pip-
49-
50-
- name: Restore or Cache PlatformIO and Libraries
51-
uses: actions/cache@v2.1.6
52-
with:
53-
path: ~/.platformio
54-
# if nothing in the lock files has changed, then it will be a "cache hit" and pip will be restored
55-
# otherwise, it will be a "cache miss" and a new cache of libraries will be created if the job completes successfully
56-
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
57-
5842
- name: Set up Python
5943
uses: actions/setup-python@v2.2.2
6044

61-
# This should be pulled from cache, if there's not a new version
6245
- name: Install PlatformIO
6346
run: |
6447
python -m pip install --upgrade pip
6548
pip install --upgrade platformio
6649
50+
- name: Restore or Cache PlatformIO and Libraries
51+
uses: actions/cache@v2.1.5
52+
id: cache_libraries
53+
with:
54+
path: ~/.platformio
55+
# if nothing in the dependencies.json file has changed, then it will
56+
# be a "cache hit" and we can restore libraries from cache and not
57+
# download them. If it has changed we have to re-download.
58+
key: ${{ hashFiles('./continuous_integration/dependencies.json') }}
59+
60+
# Install the dependencies for PlatformIO
61+
- name: Install the PlatformIO dependencies at global level
62+
if: steps.cache_libraries.outputs.cache-hit != 'true'
63+
run: |
64+
chmod +x continuous_integration/install-deps-platformio.sh
65+
sh continuous_integration/install-deps-platformio.sh
66+
67+
# Install ModularSensors at the Global level for PlatformIO
68+
- name: Install the testing version of Modular Sensors for PlatformIO
69+
run: |
70+
pio lib -g install ${{ env.LIBRARY_INSTALL_SOURCE }}
71+
6772
- name: Run PlatformIO
6873
env:
6974
PLATFORMIO_CI_SRC: ${{ matrix.example }}
75+
PLATFORMIO_DEFAULT_ENVS: ${{ matrix.pio_environment}}
7076
run: |
71-
platformio lib --global update
7277
echo "${{ env.LIBRARY_INSTALL_SOURCE }}"
7378
platformio ci --project-conf="continuous_integration/platformio.ini"
79+
80+
- name: Uninstall testing version of Modular Sensors before caching
81+
run: pio lib -g uninstall EnviroDIY_ModularSensors

0 commit comments

Comments
 (0)