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

Review PR: Add "Offline" SDLogger Mode #676

Open
wants to merge 211 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
43282c8
rip off beta tag
brentru Aug 13, 2024
65d864a
Refactor generateWSTopics()
brentru Aug 13, 2024
f2c89d4
Refactor generateWSTopics() 2
brentru Aug 13, 2024
23c42bb
Refactor generateDeviceUID()
brentru Aug 13, 2024
cd8d7dc
refactor out shared statuses into helper_status.h header
brentru Aug 14, 2024
035446e
Refactor out macros, helper topics, build v2 class, init manager clas…
brentru Aug 14, 2024
5667ecc
Implement API check when pin tied hi
brentru Aug 15, 2024
47a8642
refactor v2, no collisions in the namespace or linker
brentru Aug 15, 2024
e188011
check api version just a basic POC
brentru Aug 15, 2024
732a0a3
provisioning v1 working
brentru Aug 16, 2024
67600de
not compiling, add esp32_v2.h but conflict with registration class me…
brentru Aug 16, 2024
a12ccc9
bring in the Wippersnapper_registration methods
brentru Aug 16, 2024
6d71ba0
connects to wifi and mqtt using v1, not v2
brentru Aug 16, 2024
abc8315
bring in noota partition scheme, 47.2% of flash space on ESP32-S2
brentru Aug 16, 2024
310b3e5
get the mac
brentru Aug 16, 2024
5388152
set ssid and pass
brentru Aug 19, 2024
e9427cb
break out fs to v2 class, attempting to pull all info from json, not …
brentru Aug 19, 2024
a963245
pulling from json now
brentru Aug 19, 2024
e5850a4
Merge branch 'switch-runtimes' into migrate-api-v2
brentru Aug 19, 2024
f65ea11
♻️ Move refactored topic generation from Wippersnapper class to Wippe…
brentru Aug 19, 2024
2bafd29
fix generateDeviceUIDV2 failure and crash
brentru Aug 20, 2024
1c8ffa0
🐛 Fixed incorrect malloc check within generatewstopicsv2()
brentru Aug 20, 2024
f663d28
🦺 Add v2 api folder, files generated locally
brentru Aug 20, 2024
2c4c58f
🦺 Add hooks for error/throttle callbacks
brentru Aug 20, 2024
5f6ecaa
⬆️ Update protobufs
brentru Aug 21, 2024
2aa532b
🎨 Start implementing new checkin process
brentru Aug 22, 2024
0f57639
🎨 Implement high-level publish call for d2b signal messages
brentru Aug 22, 2024
84c69cb
🎨 Implement publish call for checkin process
brentru Aug 22, 2024
f1cf4be
♻️ Refactor out v1 registration code from app
brentru Aug 22, 2024
9a88822
🚀 CheckinRequest message is publishing across the DeviceToBroker topic
brentru Aug 26, 2024
d2cd420
🐛 Fix topic names to include / at end for autoresponder expected topic
brentru Aug 27, 2024
5db8dcb
🎨 Improved EncodeCheckinRequest by encoding prior to publishing to ge…
brentru Aug 27, 2024
5d7ad71
🎨 Improve publishSignal to reduce overhead
brentru Aug 27, 2024
77e49e4
🎨 Add getter/setters, parser to encapsulate checkinresponse variables…
brentru Aug 27, 2024
dd79c67
✨ Add callback for decoding a BrokerToDevice signal, auto-decoder
brentru Aug 27, 2024
c754eee
🗑️ Deprecate callbacks for pixels, uart
brentru Aug 29, 2024
c06ed44
🗑️ Deprecate callbacks for servo, pwm, dsx
brentru Aug 29, 2024
f366a43
🗑️ Deprecate I2C code within app
brentru Aug 29, 2024
5d11057
🗑️ Deprecate old signal callbacks, analog/digital callbacks
brentru Aug 29, 2024
3fcaf0e
✨ Add ws_helper_esp.h and use new ESP-IDF reset reason code
brentru Aug 29, 2024
9b67169
use extern ws for CheckInModel so its accessable outside the publish …
brentru Aug 30, 2024
74b2cc1
🚧 WIP - Decode checkin response
brentru Aug 30, 2024
aaa5961
🚧 WIP - Handle checkin response, refactor handler out of signal decod…
brentru Aug 30, 2024
602261a
🚧 WIP - Validate checkin response, configure GPIO classes with parsed…
brentru Aug 30, 2024
6018295
🎨 Remove debug prints
brentru Aug 30, 2024
642cc62
🎨 Improve structure of the new checkin api and deprecate unused class…
brentru Aug 30, 2024
08172e2
🚀 Complete checkin process
brentru Sep 3, 2024
02765aa
🚧 Begin digitalio.proto migration
brentru Sep 3, 2024
0667b91
🚧 WIP, DigitalIO - Rough out the pb model
brentru Sep 3, 2024
916d966
🚧 WIP, DigitalIO - Add controller class, pin subclasses
brentru Sep 3, 2024
d56f8d5
🚧 WIP, DigitalIO - Deprecate old digitalio members in Wippersnapper.h
brentru Sep 3, 2024
1534649
🚧 WIP, DigitalIO - Build out controller's add pin func.
brentru Sep 3, 2024
3acd2bc
⬆️ Upgrade compiled pb wrappers
brentru Sep 3, 2024
3583f0d
🚧 WIP, DigitalIO - Fix linker error, don't create a pb struct within …
brentru Sep 4, 2024
b37fb72
🐛 Fix runV2() not executing by adding run() to ws_manager class and s…
brentru Sep 4, 2024
8c5d92c
🐛 Fix nullptr due to digitaliomodel not being init'd
brentru Sep 4, 2024
fedac2d
🚧 WIP, DigitalIO - Set max pins of dio controller, no vect.or
brentru Sep 4, 2024
8292ad2
🚧 WIP, digitalio - Implement hardware class, add setpinmode for hw
brentru Sep 4, 2024
9919945
⬆️ Upgrade TinyUSB for enumeration patch
brentru Sep 5, 2024
6588c15
🎨 Improve structure of code by moving digitalio model to the controll…
brentru Sep 5, 2024
01f26b6
🚧 WIP, digitalio - Detect status led pin
brentru Sep 6, 2024
099efb7
🚧 WIP - Begin integrating sensor api
brentru Sep 9, 2024
014b2ba
🚧 WIP, digitalio - Implement hardware digital write, update model to …
brentru Sep 9, 2024
1007802
🚧 WIP, digitalio - Fix linker error, refactor get pin to get pin idx,…
brentru Sep 10, 2024
1a6fc3d
🚧 WIP, digitalio - blink demo
brentru Sep 10, 2024
c29f210
🚧 WIP, digitalio: Add input, input pullup to ConfigurePin
brentru Sep 10, 2024
1363329
🚧 WIP, digitalio - Refactor ConfigurePin, AddDigitalPin
brentru Sep 10, 2024
60fb5f6
refactor adddigitalpin() call
brentru Sep 10, 2024
3ac8472
🚧 WIP, digitalio: Add Update() service for reading pins
brentru Sep 10, 2024
10a19bf
🚧 WIP, digitalio - Add encoder for digital io event to model, encode/…
brentru Sep 11, 2024
434107c
🚧 WIP, digitalio - Refactor out the Update() conditional function cal…
brentru Sep 11, 2024
5288af0
🚧 WIP, digtialio: adhere to period better, fix bug
brentru Sep 11, 2024
a3386d3
🚧 WIP, digitalio - publishing to broker missing value
brentru Sep 11, 2024
3093b50
looking at flash failure
brentru Sep 24, 2024
1b2c10b
continue fix flash failure
brentru Sep 24, 2024
d872814
🚑️ Fix Filesystem bug in V2
brentru Sep 25, 2024
50609f7
🎨 Improve structure of the FS code
brentru Sep 25, 2024
fcc6914
🚧 WIP, digitalio - Sends boolean value from timer-based input
brentru Sep 25, 2024
0675abc
🚧 WIP, digitalio - Refactoring in update()
brentru Sep 26, 2024
70406f3
🚧 WIP, digitalio - Add doxygen comments
brentru Sep 26, 2024
624ba3d
🚧 WIP, digitalio - refactoring
brentru Sep 26, 2024
e513533
🚧 WIP, digitalio - Address TODO for statusled
brentru Sep 27, 2024
ce7d5ed
🎨 Add doxygen across new v2 classes
brentru Sep 27, 2024
47dcb93
🎨 Doxygen sensor model, ws_manager classes
brentru Sep 27, 2024
fbaadb9
🎨 Doxygen pass complete
brentru Sep 27, 2024
4a2ccac
🚧 WIP, digitalio - Implement remove pin API
brentru Sep 30, 2024
e42e963
🚧 WIP, digitalio - Attach dio remove to b2d cb
brentru Sep 30, 2024
3cc50de
🚧 WIP, digitalio - refactor naming to match python
brentru Sep 30, 2024
c20e45b
rm unused model func
brentru Sep 30, 2024
49e110d
🚧 WIP, analogio - Create controller, hardware, model and hooks for An…
brentru Oct 1, 2024
6b93efc
⬆️ Upgrade protobuf to match ee1df09fb542fd9ba27271cfa5aebc75bd9842a3
brentru Oct 1, 2024
b9f7c12
⬆️ Upgrade protos, 7dd0fe6
brentru Oct 1, 2024
4ca038c
🚧 WIP, analogio - Fix compiler errors and build pass
brentru Oct 1, 2024
fcd87d1
🚧 WIP, analogio - Add deinit, scale reads, update
brentru Oct 1, 2024
eb6bf12
🚧 WIP, analogio - Read voltage, precalculate scale factor for optimiz…
brentru Oct 2, 2024
e5e2724
🎨 WIP, analogio - Encode, publish voltage event
brentru Oct 2, 2024
fac050e
🚧 WIP, analogio - Add encoder for a raw analogio event
brentru Oct 2, 2024
e5d3199
🚧 WIP, analogio - refactor encode/publish in controller, refactor model
brentru Oct 2, 2024
6a82e77
🚧 WIP, analogio - publish out
brentru Oct 2, 2024
067c220
🎨 WIP, analogio - Doxygen analogio classes
brentru Oct 3, 2024
549874a
🐛 WIP, analogio - bring in
brentru Oct 3, 2024
e30d4e4
🐛 WIP, analogio - Bug fixes during testing
brentru Oct 3, 2024
7f2d550
🐛 WIP, analogio - Refactor hardware.cpp for raw adc reads, fix underf…
brentru Oct 4, 2024
706652f
add partitions, use larger parition size
brentru Oct 4, 2024
a9288cc
🚧 WIP, dsx - Sketch out ds18x20 classes
brentru Oct 7, 2024
e342564
🚧 WIP, dsx - Plumbing for ds18x in App, switch to OneWireNG interface
brentru Oct 7, 2024
307fd43
implement setup for dsx, remove deps that conflict
brentru Oct 8, 2024
b8377e5
🚧 WIP, dsx - added message
brentru Oct 8, 2024
d207447
🚧 WIP, analogio - publish out to the broker
brentru Oct 8, 2024
312c8f6
🚧 WIP, dsx - Add read and sensor id funcs
brentru Oct 8, 2024
f4184e5
🚧 WIP, dsx - Implement readF, getters
brentru Oct 8, 2024
b424c79
🚧 WIP, dsx - Add to hardware, updat eloop
brentru Oct 9, 2024
540b116
🚧 WIP, dsx - Attempt towards encoding multiple sensor events in one u…
brentru Oct 10, 2024
72f5a3f
🚧 Remove the onewire bus from the pin and vec erase
brentru Oct 10, 2024
697b6e9
🎨 WIP, dsx - Doxygen and remove unused code implemented in the sensor…
brentru Oct 10, 2024
458e7a6
🚧 WIP, dsx - Read temperature and properly reset all counters
brentru Oct 15, 2024
16412d4
🚧 WIP, dsx, handle event/remove
brentru Oct 15, 2024
a5e43c1
add logging facility for dsx
brentru Oct 15, 2024
8e5a4de
🚧 WIP, dsx - Add debug profile, remove redundant code within update()…
brentru Oct 17, 2024
5468207
🐛 WIP, dsx - Fix bug where two sensors are initd but only the first i…
brentru Oct 17, 2024
6d4e85d
🐛 Fix DSx bug, onewirePin not added to ds18x20Evetn messages
brentru Oct 17, 2024
407b1e4
🐛 Don't allow non-object-temp SensorTypes to init a ds18 sensor
brentru Oct 17, 2024
c1efd3e
📝 Review controller/hardware classes, self-review
brentru Oct 17, 2024
54edb4c
🎨 Review dsx model
brentru Oct 18, 2024
4fde183
🚧 SD - include sd cs pins for all boards
brentru Oct 28, 2024
473b6ab
🚧 SD - entry point and detect if inserted in all boards
brentru Oct 28, 2024
9ee268e
🚧 SD - Add global flag for sd mode, detection in connect and entry po…
brentru Oct 28, 2024
55c3d08
🚧 SD - parsing hooks for arduinojson
brentru Oct 29, 2024
2c16f18
🚧 Integrate Wokwi CLI and simulator builds, begin
brentru Oct 30, 2024
186a1ec
🚧 Wokwi progress
brentru Oct 30, 2024
e289bfe
🚧 Working simulation with Wokwi
brentru Oct 30, 2024
c635987
🚧 SD - refactor out sd func. to a new class
brentru Oct 31, 2024
fcdb5f3
🚀 SD - wokwi simulator detecting and switching to offline mode
brentru Oct 31, 2024
4ae5e1e
🚧 SD - add waitForIncomingConfigFile() parse serial over TCP
brentru Nov 1, 2024
c3888a6
🚧 SD - parse out component type, add offline/debug flag, parse json s…
brentru Nov 1, 2024
12f0923
🚧 SD - Start building out json->pb parser, allow debug passthru for p…
brentru Nov 4, 2024
a3053e8
🚧 SD - Add parsing for AnalogIOAdd, remove DigitalIOAdd global messag…
brentru Nov 4, 2024
ff0cb90
🎨 SD - Add formatting logging
brentru Nov 4, 2024
c6d472b
🚧 SD - parsing to dispatch working for one component only
brentru Nov 5, 2024
bc2132f
add rtc
brentru Nov 5, 2024
f351ddb
🚧 SD - prioritizeds1307 rtc over ds3231
brentru Nov 5, 2024
851a63a
switch from func to property to test online mode
brentru Nov 5, 2024
5b8977f
🚧 SD - hardcode the checkin process
brentru Nov 5, 2024
1a5f920
✨ [SD] Add PCF8253 RTC compatibility
brentru Nov 7, 2024
bb61208
✨ [SD] Log jsonl to serial
brentru Nov 7, 2024
ce6fe72
[SD] implement checkin process dynamic instead of hardcode
brentru Nov 7, 2024
d139185
[SD] 2x component json add
brentru Nov 8, 2024
9944680
[SD] Add vector of vectors for processing > 1 component from JSON, pr…
brentru Nov 12, 2024
c7530d0
[SD] Implement DigitalIO Output parsing, untested
brentru Nov 12, 2024
6ad6e17
[SD] Get codebase show-ready
brentru Nov 13, 2024
3ae0aa9
[SD] Implement DS18x20 JSON->PB parsing, decoding at the component-ha…
brentru Nov 14, 2024
52853ca
[SD] ds18x20 decode thru controller via HandleAdd OK
brentru Nov 14, 2024
7ebb898
[SD] Multiple DS18b20 events, multiple ds18b20 instances
brentru Nov 18, 2024
e5eeb46
[SD] Refactor diagram, doxygen sd class
brentru Nov 18, 2024
a8091db
[SD] Add offline analog input scenario
brentru Nov 19, 2024
fc6912d
[SD] Rm sd read json scenario that we aren't using
brentru Nov 19, 2024
5e26f96
[SD] Add test for offline digital input
brentru Nov 19, 2024
9c040ac
[SD] Add test for parsing invalid json edge case
brentru Nov 19, 2024
94344b4
[SD] Add Pytest file, rename to scenario yaml
brentru Nov 19, 2024
188d06e
[SD] Add binary for offline
brentru Nov 20, 2024
3e3acfb
[SD] Run via GH:A
brentru Nov 20, 2024
aa9a73f
[SD] Fix path
brentru Nov 20, 2024
8c073a3
update tests, result ignore
brentru Nov 20, 2024
236255a
Merge pull request #647 from tyeth/add-metro-s3
brentru Oct 24, 2024
51d5993
merge in upstream esp32s3 metro patch
brentru Nov 21, 2024
6552617
looking at metro s3
brentru Nov 21, 2024
caa9a3b
putback main way to attach msc
brentru Nov 21, 2024
fbc6a62
[SD] Refactoring ParseFile1
brentru Nov 22, 2024
0dab4ad
[SD] Refactoring ParseFile2
brentru Nov 22, 2024
97a7daf
[SD] Push #offline config into the PIO build ini for one platform only
brentru Nov 25, 2024
a637ad2
[SD] Refactor all parsing
brentru Nov 26, 2024
f697b61
[SD] Fully refactor ParseConfigFile
brentru Nov 26, 2024
c856a9d
[SD] Parsing and dispatch working on Metro ESP32S3 hardware
brentru Nov 26, 2024
ff4d0d7
[SD] Implement buffered JSON stream writes to sd card, refactoring al…
brentru Nov 27, 2024
4ebe95e
[SD] Refactor sd header and clean it up
brentru Nov 29, 2024
41afb04
[SD] Refactor out LogSensorEventTOSD funcs
brentru Nov 29, 2024
8a80f14
[SD] Handle error cases during parsing for DIOAdd
brentru Dec 2, 2024
f208fef
[SD] All tests green again
brentru Dec 3, 2024
c8d1f19
[SD] first working offline log to sd
brentru Dec 3, 2024
fca42e6
[SD] Add some overhead for pico2, generate json checksum data script
brentru Dec 5, 2024
3625517
[SD] Refactor checksum validation out, dont require it to operate
brentru Dec 6, 2024
2c195b3
[SD] Refactor and make pins dynaically allocated for sdcard
brentru Dec 6, 2024
68f18d9
[SD] dynamic pin refactor 2
brentru Dec 9, 2024
6673238
[SD] Link tinyusb, refactor init
brentru Dec 9, 2024
a8dbe4a
[SD] Finish refactoring to allow config.json to sit on WIPPER drive, …
brentru Dec 9, 2024
233d89c
clean up
brentru Dec 9, 2024
fbf407e
[SD] Address error cases/states for sd_cs handling
brentru Dec 10, 2024
65fdd78
[SD] Handle sd cards of varying capacities!
brentru Dec 10, 2024
eac81d4
[SD] Set status led green after successful config
brentru Dec 10, 2024
78e7187
[SD] Start to support pico2
brentru Dec 11, 2024
10bd3dd
[SD] add pico2
brentru Dec 12, 2024
488a36a
rm old terms
brentru Dec 12, 2024
c043c49
[SD] Move to ws_adapters naming scheme to allow flexibility for offli…
brentru Dec 12, 2024
330b261
[SD] Complete adapters/ work and build
brentru Dec 13, 2024
fc9bacc
[SD] Add debug output to adapter classes, valid return values where a…
brentru Dec 13, 2024
c5920fe
[SD] Support for LittleFS based provisioning
brentru Dec 16, 2024
24dc705
[SD] Untested on HW | Fix for ESP32 SPI clock issue
brentru Dec 19, 2024
492deb1
[SD] Tested with ESP32 Pico QT Py and DS3231
brentru Dec 20, 2024
0639d8a
[SD] Fix Wokwi Testing, test_digital_input is having issues still
brentru Dec 26, 2024
6b8806d
[SD] Resolve all Wokwi test issues, all green
brentru Dec 27, 2024
d9ff1bd
[SD] Bring bcd script in-line with main
brentru Dec 27, 2024
05f5133
remove TODOs, small refactor
brentru Dec 27, 2024
84bb7f6
fix checksum test
brentru Dec 27, 2024
57afd65
review continue
brentru Dec 27, 2024
651f527
add config json example for Tyeth
brentru Jan 6, 2025
8d699d5
address tyeth review
brentru Jan 10, 2025
0111000
clang
brentru Jan 10, 2025
99000df
remove test boolean
brentru Jan 10, 2025
7e2fbc6
Fix Wokwi tests, all green
brentru Jan 10, 2025
6d2159c
Fix Pico (non-W) for Tyeth review
brentru Jan 10, 2025
d5a4a39
return fresult
brentru Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
493 changes: 424 additions & 69 deletions .github/workflows/build-clang-doxy.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/release-callee.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Brent Rubell for Adafruit Industries, 2022
# SPDX-FileCopyrightText: Brent Rubell for Adafruit Industries, 2022-2024
#
# SPDX-License-Identifier: MIT
name: WipperSnapper Release Callee
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-caller.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Brent Rubell for Adafruit Industries, 2022
# SPDX-FileCopyrightText: Brent Rubell for Adafruit Industries, 2022 - 2024
#
# SPDX-License-Identifier: MIT
name: WipperSnapper Release Workflow
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# SPDX-FileCopyrightText: Brent Rubell for Adafruit Industries, 2024
#
# SPDX-License-Identifier: MIT
name: WipperSnapper Tests

on:
pull_request:

permissions:
checks: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
test:
- test_offline
fail-fast: false
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Check out repository code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt

- name: Install Wokwi CI server
uses: wokwi/wokwi-ci-server-action@v1

- name: Install Wokwi CLI
run: curl -L https://wokwi.com/ci/install.sh | sh

- name: Test on Wokwi
run: pytest tests/${{ matrix.test }}.py --junitxml=report.xml -v
env:
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
/home/runner/work/Adafruit_Wippersnapper_Arduino/Adafruit_Wippersnapper_Arduino/report.xml
17 changes: 13 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,22 @@ html/*
# VSCode artifacts
.vscode/*
src/.vscode/settings.json

.DS_STORE

examples/Wippersnapper_demo/build/

# Virtual environment directories
.venv/
venv/

# Python artifacts
tests/__pycache__/

# Platformio artifacts
.pio/

# Secrets
data/
# These sometimes contain credentials, don't commit them!
src/Wippersnapper_demo_wokwi.ino
data/

# Test results
report.xml
12 changes: 10 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
{
"files.associations": {
"limits": "c",
"type_traits": "c"
"type_traits": "c",
"vector": "cpp",
"array": "cpp",
"deque": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"string_view": "cpp",
"initializer_list": "cpp",
"span": "cpp"
},
"C_Cpp.dimInactiveRegions": true,
"C_Cpp.dimInactiveRegions": false,
"dotnet.defaultSolution": "disable",
"cmake.configureOnOpen": false
}
Loading