Skip to content

Commit da05a38

Browse files
authored
Merge pull request #419 from EnviroDIY/develop
Update `hmac_auth` from `develop`
2 parents a38c1ed + 5cecc37 commit da05a38

File tree

86 files changed

+1728
-1613
lines changed

Some content is hidden

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

86 files changed

+1728
-1613
lines changed

.clang-format

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,39 @@ AlignTrailingComments: true
1212
AllowAllArgumentsOnNextLine: true
1313
AllowAllConstructorInitializersOnNextLine: true
1414
AllowAllParametersOfDeclarationOnNextLine: true
15-
AllowShortBlocksOnASingleLine: true
15+
AllowShortBlocksOnASingleLine: Always
1616
AllowShortCaseLabelsOnASingleLine: true
17+
AllowShortEnumsOnASingleLine: true
1718
AllowShortFunctionsOnASingleLine: Empty
18-
AllowShortLambdasOnASingleLine: All
1919
AllowShortIfStatementsOnASingleLine: WithoutElse
20+
AllowShortLambdasOnASingleLine: All
2021
AllowShortLoopsOnASingleLine: true
2122
AlwaysBreakAfterDefinitionReturnType: None
2223
AlwaysBreakAfterReturnType: None
2324
AlwaysBreakBeforeMultilineStrings: false
2425
AlwaysBreakTemplateDeclarations: Yes
2526
BinPackArguments: true
2627
BinPackParameters: true
28+
BreakAfterJavaFieldAnnotations: false
2729
BreakBeforeBinaryOperators: None
2830
BreakBeforeBraces: Attach
2931
BreakBeforeInheritanceComma: false
30-
BreakInheritanceList: BeforeColon
3132
BreakBeforeTernaryOperators: true
3233
BreakConstructorInitializersBeforeComma: false
3334
BreakConstructorInitializers: BeforeColon
34-
BreakAfterJavaFieldAnnotations: false
35+
BreakInheritanceList: BeforeColon
3536
BreakStringLiterals: true
3637
ColumnLimit: 80
37-
CommentPragmas: "^ IWYU pragma:"
38+
CommentPragmas: '^ IWYU pragma:'
3839
CompactNamespaces: false
3940
ConstructorInitializerAllOnOneLineOrOnePerLine: false
4041
ConstructorInitializerIndentWidth: 4
4142
ContinuationIndentWidth: 4
4243
Cpp11BracedListStyle: true
4344
DerivePointerAlignment: false
4445
DisableFormat: false
46+
EmptyLineAfterAccessModifier: Leave
47+
EmptyLineBeforeAccessModifier: Leave
4548
ExperimentalAutoDetectBinPacking: false
4649
FixNamespaceComments: true
4750
ForEachMacros:
@@ -50,32 +53,38 @@ ForEachMacros:
5053
- BOOST_FOREACH
5154
IncludeBlocks: Preserve
5255
IncludeCategories:
53-
- Regex: "TinyGsmClient.h"
56+
- Regex: 'TinyGsmClient.h'
5457
Priority: -1
55-
- Regex: "VariableBase.h"
58+
- Regex: 'VariableBase.h'
5659
Priority: -1
5760
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
5861
Priority: 2
5962
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
6063
Priority: 3
61-
- Regex: ".*"
64+
- Regex: '.*'
6265
Priority: 1
6366
IncludeIsMainRegex: '([-_](test|unittest))?$'
67+
IndentAccessModifiers: false
68+
IndentCaseBlocks: false
6469
IndentCaseLabels: true
70+
IndentExternBlock: Indent
71+
IndentGotoLabels: true
6572
IndentPPDirectives: None
6673
IndentWidth: 4
6774
IndentWrappedFunctionNames: false
75+
InsertTrailingCommas: None
6876
JavaScriptQuotes: Leave
6977
JavaScriptWrapImports: true
7078
KeepEmptyLinesAtTheStartOfBlocks: false
71-
MacroBlockBegin: ""
72-
MacroBlockEnd: ""
79+
MacroBlockBegin: ''
80+
MacroBlockEnd: ''
7381
MaxEmptyLinesToKeep: 2
7482
NamespaceIndentation: None
7583
# ObjCBinPackProtocolList: Auto
7684
ObjCBlockIndentWidth: 2
7785
ObjCSpaceAfterProperty: false
7886
ObjCSpaceBeforeProtocolList: true
87+
PackConstructorInitializers: CurrentLine
7988
PenaltyBreakAssignment: 25
8089
PenaltyBreakBeforeFirstCallParameter: 19
8190
PenaltyBreakComment: 300
@@ -86,13 +95,17 @@ PenaltyExcessCharacter: 600
8695
PenaltyReturnTypeOnItsOwnLine: 50
8796
PointerAlignment: Left
8897
PointerBindsToType: true
98+
QualifierAlignment: Left
99+
ReferenceAlignment: Left
89100
ReflowComments: true
101+
SeparateDefinitionBlocks: Leave
90102
SortIncludes: false
91103
SortUsingDeclarations: true
92104
SpaceAfterCStyleCast: false
93105
SpaceAfterLogicalNot: false
94106
SpaceAfterTemplateKeyword: true
95107
SpaceBeforeAssignmentOperators: true
108+
SpaceBeforeCaseColon: false
96109
SpaceBeforeCpp11BracedList: false
97110
SpaceBeforeCtorInitializerColon: true
98111
SpaceBeforeInheritanceColon: true
@@ -101,9 +114,11 @@ SpaceBeforeRangeBasedForLoopColon: true
101114
SpaceInEmptyParentheses: false
102115
SpacesBeforeTrailingComments: 2
103116
SpacesInAngles: false
104-
SpacesInCStyleCastParentheses: false
105117
SpacesInContainerLiterals: true
106118
SpacesInCStyleCastParentheses: false
119+
SpacesInConditionalStatement: false
120+
SpacesInLineCommentPrefix:
121+
Minimum: 1
107122
SpacesInParentheses: false
108123
SpacesInSquareBrackets: false
109124
Standard: Cpp11

.github/workflows/build_documentation.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ jobs:
3838
- uses: actions/checkout@v3
3939

4040
- name: Set up Python
41-
uses: actions/setup-python@v3
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: '3.x'
4244

4345
- name: check for classes in the menu example
4446
run: |
@@ -56,7 +58,9 @@ jobs:
5658
path: code_docs/ModularSensors
5759

5860
- name: Set up Python
59-
uses: actions/setup-python@v3
61+
uses: actions/setup-python@v4
62+
with:
63+
python-version: '3.x'
6064

6165
- name: Restore Python Dependencies
6266
uses: actions/cache@v3

.github/workflows/build_examples_platformio.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ jobs:
4646
fi
4747
4848
- name: Set up Python
49-
uses: actions/setup-python@v3
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: '3.x'
5052

5153
- name: Install PlatformIO
5254
run: |

.github/workflows/build_menu.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ jobs:
9595
- modemFlag: BUILD_MODEM_SIM_COM_SIM7080
9696
sensorFlag: BUILD_SENSOR_CAMPBELL_OBS3
9797
publisherFlag: BUILD_PUB_ENVIRO_DIY_PUBLISHER
98+
- modemFlag: BUILD_MODEM_SIM_COM_SIM7080
99+
sensorFlag: BUILD_SENSOR_CAMPBELL_RAINVUE10
100+
publisherFlag: BUILD_PUB_ENVIRO_DIY_PUBLISHER
98101
- modemFlag: BUILD_MODEM_SIM_COM_SIM7080
99102
sensorFlag: BUILD_SENSOR_DECAGON_CTD
100103
publisherFlag: BUILD_PUB_ENVIRO_DIY_PUBLISHER
@@ -224,7 +227,9 @@ jobs:
224227
fi
225228
226229
- name: Set up Python
227-
uses: actions/setup-python@v3
230+
uses: actions/setup-python@v4
231+
with:
232+
python-version: '3.x'
228233

229234
- name: Install PlatformIO
230235
run: |

.github/workflows/prepare_release.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
echo "ZIP_NAME=$ZIP_FILE" >> $GITHUB_ENV
3131
3232
- name: Set up python
33-
uses: actions/setup-python@v3
33+
uses: actions/setup-python@v4
34+
with:
35+
python-version: '3.x'
3436

3537
- name: Install PlatformIO
3638
run: |

.github/workflows/verify_library_structure.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ jobs:
1616
- uses: actions/checkout@v3
1717

1818
- name: Set up Python
19-
uses: actions/setup-python@v3
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.x'
2022

2123
- name: Install PlatformIO
2224
run: |

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Windows image file caches
22
Thumbs.db
33
ehthumbs.db
4+
~*
45

56
# Folder config file
67
Desktop.ini
@@ -94,4 +95,5 @@ cache
9495
docs/output_copyFunctions.log
9596
docs/output_documentExamples.log
9697
docs/output_fixSectionsInXml.log
97-
*HMAC_secret_key.h
98+
examples/DRWI_Mayfly1_Wifi_5tm_ds18b20_1/DRWI_Mayfly1_Wifi_5tm_ds18b20_1.ino
99+
clang_format_all.bat

ChangeLog.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
***
2222

2323

24+
## [0.34.0]
25+
26+
### Changed
27+
- **BREAKING** - Removed support for light sleep on Espressif modules.
28+
**This changes the order of the constructor for the ESP32 and ESP8266!**
29+
- The light sleep mode is non-functional anyway, and confusion over the sleep request pin was putting the board in a position not to sleep at all.
30+
- Minor tweek to clang-format
31+
- Moved all variable initialization to default header values and initializer lists
32+
- Converted all "c-style" casts to static casts
33+
- Switched cases of strcat and strcpy to snprintf
34+
- Specify python version 3.x for actions (used by PlatformIO)
35+
36+
### Added
37+
38+
### Removed
39+
40+
### Fixed
41+
- Fixed non-concurrent data fetch for SDI-12 when *NOT* using debugging.
42+
- Fixed internet connection when in "testing mode"
43+
- Allow a non-zero wait time for SDI-12 sensors
44+
45+
***
46+
47+
2448
## [0.33.4]
2549

2650
### Fixed

docs/Modem-Notes.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If you are having trouble, please see the pages for the specific modems and the
2929
| Digi XBee3 LTE Cat 1 AT&T (Telit LE866A1-NA) | DigiXBeeCellularTransparent |
3030
| Digi XBee S6B WiFi | DigiXBeeWifi |
3131
| Espressif ESP8266 | EspressifESP8266 |
32-
| Espressif ESP32 | EspressifESP8266 |
32+
| Espressif ESP32 | EspressifESP32 |
3333
| Quectel BG96 | QuectelBG96 |
3434
| Mikroe LTE IOT 2 Click (_BG96_| QuectelBG96 |
3535
| Dragino NB IOT Bee (_BG96_| QuectelBG96 |
@@ -139,7 +139,7 @@ Here are the pin numbers to use for modules that can be attached directly to an
139139
| Digi XBee/XBee3, all variants (direct connection)¹ | -1 | 19² | -1 | 23 |
140140
| Digi XBee/XBee3, all variants (with LTE adapter<sup>8</sup>) | -1<sup>3</sup> | 19<sup>4</sup> | 20 | 23 |
141141
| Itead Wee (ESP8266)<sup>8</sup> | -1 | -1 | -1<sup>5</sup> | -1 |
142-
| DFRobot WiFi Bee (ESP8266) | -1 | -1 | -1 | 19<sup>6</sup> |
142+
| DFRobot WiFi Bee (ESP8266) | -1 | -1 | -1 | N/A |
143143
| Dragino NB IOT Bee (BG96) | -1 | -1 | -1<sup>7</sup> | -1<sup>7</sup> |
144144
| Sodaq GPRSBee R4 (SIM900) | -1 | 19 | -1 | 23 |
145145
| Sodaq GPRSBee R6 or R7 (SIM800H) | 23 | 19 | N/A | N/A |
@@ -163,8 +163,6 @@ You should set the argument `useCTSforStatus` to `false` in the bee constructor
163163
<sup>5</sup> I *strongly* recommend running a new wire along the back of the Mayfly to connect pin 5 of the XBee socket to pin A4.
164164
This will enable you to use A4 as the reset pin which allows you to use deep sleep.
165165

166-
<sup>6</sup> Use 13 as the `espSleepRqPin` for light sleep.
167-
168166
<sup>7</sup> I *strongly* recommend running two new wires along the back of the Mayfly to connect pin 5 of the XBee socket to pin A4 and pin 18 of the XBee socket to A3.
169167
This will enable you to use A4 as the reset pin and A3 as the sleep request pin.
170168
With those connections made, the Dragino BG96 becomes the _**only**_ LTE module that can be run using only the 500mA regulator on the Mayfly (ie, without a separate battery connection for the modem).

examples/DRWI_Mayfly1_WiFi/DRWI_Mayfly1_WiFi.ino

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*
55
* This example shows proper settings for the following configuration:
66
*
7-
* Mayfly v1.0 board
8-
* EnviroDIY SIM7080 LTE module (with Hologram SIM card)
7+
* Mayfly v1.x board
8+
* EnviroDIY ESP32 Wifi Bee module
99
* Hydros21 CTD sensor
1010
*
1111
* @author Sara Geleskie Damiano <sdamiano@stroudcenter.org>
@@ -95,19 +95,18 @@ const int32_t modemBaud = 115200; // Communication speed of the modem
9595
// NOTE: Use -1 for pins that do not apply
9696
// Example pins here are for a EnviroDIY ESP32 Bluetooth/Wifi Bee with
9797
// Mayfly 1.1
98-
const int8_t modemVccPin = 18; // MCU pin controlling modem power
99-
const int8_t modemStatusPin = -1; // MCU pin used to read modem status
100-
const int8_t modemResetPin = A5; // MCU pin connected to modem reset pin
101-
const int8_t modemLEDPin = redLED; // MCU pin connected an LED to show modem
102-
// status
98+
const int8_t modemVccPin = 18; // MCU pin controlling modem power
99+
const int8_t modemResetPin = -1; // MCU pin connected to modem reset pin
100+
const int8_t modemLEDPin = redLED; // MCU pin connected an LED to show modem
101+
// status
103102

104103
// Network connection information
105104
const char* wifiId = "xxxxx"; // WiFi access point name
106105
const char* wifiPwd = "xxxxx"; // WiFi password (WPA2)
107106

108107
// Create the modem object
109-
EspressifESP32 modemESP(&modemSerial, modemVccPin, modemStatusPin,
110-
modemResetPin, wifiId, wifiPwd);
108+
EspressifESP32 modemESP(&modemSerial, modemVccPin, modemResetPin, wifiId,
109+
wifiPwd);
111110
// Create an extra reference to the modem by a generic name
112111
EspressifESP32 modem = modemESP;
113112
/** End [espressif_esp32] */
@@ -137,20 +136,6 @@ MaximDS3231 ds3231(1);
137136
/** End [ds3231] */
138137

139138

140-
// ==========================================================================
141-
// Everlight ALS-PT19 Ambient Light Sensor
142-
// Built in on Mayfly 1.x
143-
// ==========================================================================
144-
/** Start [everlight_alspt19] */
145-
#include <sensors/EverlightALSPT19.h>
146-
147-
// Create a Everlight ALS-PT19 sensor object
148-
// For an EnviroDIY Mayfly, you can use the abbreviated version
149-
const uint8_t alsNumberReadings = 10;
150-
EverlightALSPT19 alsPt19(alsNumberReadings);
151-
/** End [everlight_alspt19] */
152-
153-
154139
// ==========================================================================
155140
// Sensirion SHT4X Digital Humidity and Temperature Sensor
156141
// Built in on Mayfly 1.x
@@ -195,8 +180,6 @@ Variable* variableList[] = {
195180
new MeterHydros21_Temp(&hydros), // Temperature (Meter_Hydros21_Temp)
196181
new SensirionSHT4x_Humidity(&sht4x), // Relative humidity (Sensirion_SHT40_Humidity)
197182
new SensirionSHT4x_Temp(&sht4x), // Temperature (Sensirion_SHT40_Temperature)
198-
new EverlightALSPT19_Illuminance(&alsPt19), // Illuminance (Everlight_AnalogALS_Illuminance)
199-
new MaximDS3231_Temp(&ds3231), // Temperature (Maxim_DS3231_Temp)
200183
new ProcessorStats_Battery(&mcuBoard), // Battery voltage (EnviroDIY_Mayfly_Batt)
201184
new Modem_SignalPercent(&modem), // Percent full scale (EnviroDIY_LTEB_SignalPercent)
202185
};
@@ -225,8 +208,6 @@ const char* UUIDs[] = // UUID array for device sensors
225208
"12345678-abcd-1234-ef00-1234567890ab", // Temperature (Meter_Hydros21_Temp)
226209
"12345678-abcd-1234-ef00-1234567890ab", // Relative humidity (Sensirion_SHT40_Humidity)
227210
"12345678-abcd-1234-ef00-1234567890ab", // Temperature (Sensirion_SHT40_Temperature)
228-
"12345678-abcd-1234-ef00-1234567890ab", // Illuminance (Everlight_AnalogALS_Illuminance)
229-
"12345678-abcd-1234-ef00-1234567890ab", // Temperature (Maxim_DS3231_Temp)
230211
"12345678-abcd-1234-ef00-1234567890ab", // Battery voltage (EnviroDIY_Mayfly_Batt)
231212
"12345678-abcd-1234-ef00-1234567890ab", // Percent full scale (EnviroDIY_LTEB_SignalPercent)
232213
};

examples/data_saving/data_saving.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,9 @@ void setup() {
404404
// NOTE: Only use this when debugging - if not connected to a PC, this
405405
// could prevent the script from starting
406406
#if defined SERIAL_PORT_USBVIRTUAL
407-
while (!SERIAL_PORT_USBVIRTUAL && (millis() < 10000)) {}
407+
while (!SERIAL_PORT_USBVIRTUAL && (millis() < 10000)) {
408+
// wait
409+
}
408410
#endif
409411

410412
// Start the primary serial connection
@@ -622,4 +624,5 @@ void loop() {
622624
// Only need to do this for one of the loggers
623625
loggerAllVars.systemSleep();
624626
}
627+
625628
/** End [loop] */

examples/logging_to_MMW/logging_to_MMW.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ void setup() {
264264
// NOTE: Only use this when debugging - if not connected to a PC, this
265265
// could prevent the script from starting
266266
#if defined SERIAL_PORT_USBVIRTUAL
267-
while (!SERIAL_PORT_USBVIRTUAL && (millis() < 10000)) {}
267+
while (!SERIAL_PORT_USBVIRTUAL && (millis() < 10000)) {
268+
// wait
269+
}
268270
#endif
269271

270272
// Start the primary serial connection

0 commit comments

Comments
 (0)