Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vegapuls Implementation #465

Merged
merged 16 commits into from
May 15, 2024
Merged
8 changes: 4 additions & 4 deletions .github/workflows/build_documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down Expand Up @@ -89,12 +89,12 @@ jobs:
path: code_docs/ModularSensors

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Restore Python Dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: cache_python
with:
path: ~/.cache/pip
Expand All @@ -107,7 +107,7 @@ jobs:

- name: Restore Doxygen, Graphviz, and TeX Live
id: cache_doxygen
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
/usr/lib/x86_64-linux-gnu/texlive
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build_examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
uses: arduino/[email protected]

- name: Restore Arduino platforms and libraries
uses: actions/cache@v3
uses: actions/cache@v4
id: cache_libraries
with:
path: |
Expand Down Expand Up @@ -188,16 +188,16 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'

- name: Install python dependencies, including PlatformIO
run: pip install -r continuous_integration/requirements.txt

- name: Restore PlatformIO and Arduino platforms and libraries
uses: actions/cache@v3
- name: Restore PlatformIO platforms and libraries
uses: actions/cache@v4
id: cache_libraries
with:
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
echo "ZIP_NAME=$ZIP_FILE" >> $GITHUB_ENV

- name: Set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_library_structure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,4 @@ continuous_integration_artifacts/*
arduino_cli.log
**/sensor_tests/*
docs/Doxyfile.bak
continuous_integration/output_check_component_inclusion.log
6 changes: 5 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Changed
- **BREAKING** Refactored how the publisher transmit buffer works. This will require adjustment to custom data publishers.

### Added

### Removed

### Fixed
Expand All @@ -23,8 +23,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.35.0]

### Changed
- **BREAKING** Refactored how the publisher transmit buffer works. This will require adjustment to custom data publishers.

### Added
- Support [GroPoint Profile GPLP-8 Eight-Segment Soil Moisture and Temperature Profiling Probe](https://www.gropoint.com/products/soil-sensors/gropoint-profile)
- Support [Vega Puls 21 Radar](https://www.vega.com/en-us/products/product-catalog/level/radar/vegapuls-21)

## [0.34.1]

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ For some generalized information about attaching sensors to an Arduino style boa
- [TI ADS1115: external voltage with support for divided current](https://envirodiy.github.io/ModularSensors/group__sensor__ads1x15.html)
- [TI INA219: current, voltage, and power draw](https://envirodiy.github.io/ModularSensors/group__sensor__ina219.html)
- [Turner Cyclops-7F: various parameters](https://envirodiy.github.io/ModularSensors/group__sensor__cyclops.html)
- [Vega Puls 21: radar distance](https://envirodiy.github.io/ModularSensors/group__sensor__vega__puls21.html)
- [Yosemitech: water quality sensors](https://envirodiy.github.io/ModularSensors/group__yosemitech__group.html)
- [Y502-A or Y504-A: Optical DO and Temperature](https://envirodiy.github.io/ModularSensors/group__sensor__y504.html)
- [Y510-B: Optical Turbidity and Temperature](https://envirodiy.github.io/ModularSensors/group__sensor__y510.html)
Expand Down
2 changes: 1 addition & 1 deletion continuous_integration/check_component_inclusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def camel_to_snake(name, lower_case=True):

#%%
# make sure class names match file names
class_pattern = re.compile("^\s*class[\s\n]+(\w+)[\s\n]", re.MULTILINE)
class_pattern = re.compile(r"^\s*class[\s\n]+(\w+)[\s\n]", re.MULTILINE)

for header_file in header_files:
textfile = open(header_file, mode="r", encoding="utf-8")
Expand Down
34 changes: 18 additions & 16 deletions continuous_integration/generate_job_matrix.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
#%%
# %%
import json
import shutil
import re
Expand All @@ -9,7 +9,7 @@
import os
import copy

#%%
# %%
# Some working directories
# The workspace directory
if "GITHUB_WORKSPACE" in os.environ.keys():
Expand Down Expand Up @@ -37,7 +37,7 @@
os.makedirs(artifact_dir)

compilers = ["Arduino CLI", "PlatformIO"]
#%%
# %%
# The locations of some important files

# The massive "menu" example
Expand Down Expand Up @@ -72,6 +72,8 @@
"megaatmega2560": {"fqbn": "arduino:avr:mega"},
"zeroUSB": {"fqbn": "arduino:samd:mzero_bl"},
"adafruit_feather_m0": {"fqbn": "adafruit:samd:adafruit_feather_m0"},
"adafruit_feather_m4": {"fqbn": "adafruit:samd:adafruit_feather_m4"},
"adafruit_grandcentral_m4": {"fqbn": "adafruit:samd:adafruit_grandcentral_m4"},
}


Expand Down Expand Up @@ -183,14 +185,14 @@ def snake_to_camel(snake_str):
return camel_str


#%%
# %%
# set up outputs
arduino_job_matrix = []
pio_job_matrix = []
start_job_commands = "status=0"
end_job_commands = "\n\nexit $status"

#%%
# %%
# Create job info for the basic examples
# Use one job per board with one command per example
for pio_env in pio_config.envs():
Expand Down Expand Up @@ -234,7 +236,7 @@ def snake_to_camel(snake_str):
)


#%%
# %%
# Helper functions for preparing the menu-a-la-carte example for building
def modify_example_filename(example_subfolder, in_file_defines):

Expand Down Expand Up @@ -309,7 +311,7 @@ def extend_pio_config(added_envs):
return new_config_path


#%% read build flags out of the menu-a-la-cart example
# %% read build flags out of the menu-a-la-cart example
# Pattern for flags in the menu-a-la-cart example
pattern = re.compile(
"^(?:#if|#elif) defined[\s\(](?P<flag1>BUILD_\w+)((?:[\s\n\\\)]*?\|\|[\s\n\\]*defined[\s\n\\\(]*?)(?P<flag_last>BUILD_\w+))*",
Expand Down Expand Up @@ -350,7 +352,7 @@ def extend_pio_config(added_envs):
all_publisher_flags.append(match.group("flag1"))


#%%
# %%
# Create jobs for all of the modems together
for pio_env in pio_config.envs():
arduino_modem_commands = [
Expand Down Expand Up @@ -396,7 +398,7 @@ def extend_pio_config(added_envs):
}
)

#%%
# %%
# Create jobs for all of the publishers together
for pio_env in pio_config.envs():
arduino_pub_commands = [
Expand Down Expand Up @@ -442,7 +444,7 @@ def extend_pio_config(added_envs):
}
)

#%%
# %%
# Create jobs for all of the sensors together
# The sensors are a bit different because we run extra PlatformIO enviroments for some of the sensors
for pio_env in pio_config.envs():
Expand Down Expand Up @@ -540,7 +542,7 @@ def extend_pio_config(added_envs):
}
)

#%%
# %%
# Tack on a few extra build configurations for the menu example
for pio_env in pio_config.envs():
arduino_loop_commands = [
Expand Down Expand Up @@ -596,7 +598,7 @@ def extend_pio_config(added_envs):
}
)

#%%
# %%
# Tack on a few more extra build configurations for the software serial libraries
for pio_env in ["Mayfly"]:
arduino_serial_commands = [
Expand Down Expand Up @@ -654,7 +656,7 @@ def extend_pio_config(added_envs):
)


#%%
# %%
# Convert commands in the matrix into bash scripts
for matrix_job in arduino_job_matrix + pio_job_matrix:
bash_file_name = matrix_job["job_name"].replace(" ", "") + ".sh"
Expand All @@ -676,7 +678,7 @@ def extend_pio_config(added_envs):
del items["command"]


#%%
# %%
# Write out output
print(
'echo "arduino_job_matrix={}" >> $GITHUB_OUTPUT'.format(
Expand All @@ -694,14 +696,14 @@ def extend_pio_config(added_envs):
json_out.close()


#%%
# %%
# different attempt to save output
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
print("arduino_job_matrix={}".format(json.dumps(arduino_job_matrix)), file=fh)
print("pio_job_matrix={}".format(json.dumps(pio_job_matrix)), file=fh)


#%%
# %%
if "GITHUB_WORKSPACE" not in os.environ.keys():
try:
shutil.rmtree(artifact_dir)
Expand Down
4 changes: 2 additions & 2 deletions docs/copyFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ def get_section_to_paste(match: re.Match) -> str:
i += 1
new_line = line
match = re.search(
'\{\{ <a href="(?P<copy_source_file>.*?)#(?P<copy_section_id>.*?)" .*? \}\}',
r'{{ <a href="(?P<copy_source_file>.*?)#(?P<copy_section_id>.*?)" .*? }}',
line,
)
if match is not None:
copy_paste_needed = True
new_line = re.sub(
'\{\{ <a href="(?P<copy_source_file>.*?)#(?P<copy_section_id>.*?)" .*? \}\}',
r'{{ <a href="(?P<copy_source_file>.*?)#(?P<copy_section_id>.*?)" .*? }}',
get_section_to_paste,
line,
)
Expand Down
2 changes: 1 addition & 1 deletion docs/markdown_prefilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def github_slugify(name):
# Convert markdown comment tags to c++/dox style comment tags
massaged_line = re.sub(r"\[//\]: # \( @(\w+?.*) \)", r"@\1", massaged_line)
# allow thank you tags
massaged_line = massaged_line.replace("thanks to @", "thanks to \@")
massaged_line = massaged_line.replace("thanks to @", r"thanks to \@")

# Convert GitHub pages url's to refs
# I'm putting the long URL in the markdown because I want the links there to
Expand Down
12 changes: 11 additions & 1 deletion examples/menu_a_la_carte/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ ___
- [TI INA219 High Side Current Sensor ](#ti-ina219-high-side-current-sensor-)
- [Turner Cyclops-7F Submersible Fluorometer ](#turner-cyclops-7f-submersible-fluorometer-)
- [Analog Electrical Conductivity using the Processor's Analog Pins ](#analog-electrical-conductivity-using-the-processors-analog-pins-)
- [VEGA VEGA PULS 21 ](#vega-vega-puls-21-)
- [Yosemitech RS485/Modbus Environmental Sensors ](#yosemitech-rs485modbus-environmental-sensors-)
- [Yosemitech Y504 Dissolved Oxygen Sensor ](#yosemitech-y504-dissolved-oxygen-sensor-)
- [Yosemitech Y510 Turbidity Sensor ](#yosemitech-y510-turbidity-sensor-)
Expand Down Expand Up @@ -833,7 +834,7 @@ Because this sensor can have only one I2C address (0x60), it is only possible to
___


### GroPoint Profile GPLP-8 Eight-Segment Soil Moisture and Temperature Profiling Probe <!-- {#menu_walk_gplp8} -->
### GroPoint Profile GPLP-8 Eight-Segment Soil Moisture and Temperature Profiling Probe <!-- {#menu_walk_gro_point_gplp8} -->

@see @ref sensor_gplp8

Expand Down Expand Up @@ -1086,6 +1087,15 @@ For best results, you should also connect the AREF pin of your processors ADC to
___


#### VEGA VEGA PULS 21 <!-- {#menu_walk_vega_puls21} -->

@see @ref sensor_vega_puls21

[//]: # ( @menusnip{vega_puls21} )

___


### Yosemitech RS485/Modbus Environmental Sensors <!-- {#menu_walk_yosemitech_sensors} -->

The next several sections are for Yosemitech brand sensors.
Expand Down
Loading
Loading