Skip to content

Add automatic configuration capability and other enhancements for Offline Mode #728

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

Merged
merged 75 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
1e6a8c7
hm how about trying adding the potential address to the driver..
brentru Mar 14, 2025
bd8095e
Prelim thoughts on SD API, tighten up FS APIs
brentru Mar 17, 2025
6f1b2d5
Add to FS for config file
brentru Mar 17, 2025
480e2c7
Refactoring within WS_SDCARD
brentru Mar 17, 2025
970901e
Move SD_CS_PIN into Boards
brentru Mar 17, 2025
de66744
Merge branch 'offline-mode' into offline-mode-autoconfig
brentru Mar 18, 2025
fcbd86a
Test with hardware, resolve spi_cfg issues
brentru Mar 18, 2025
bd2ec33
Starting to break out config file parsing so we can insert entry-poin…
brentru Mar 18, 2025
d3f0462
Break out components parsing
brentru Mar 19, 2025
c2f471f
add bus scan with storage for results, not hooked into ctroler
brentru Mar 19, 2025
e797fd4
Add controller hooks for managing the scan from another class
brentru Mar 19, 2025
b3a1edf
save work
brentru Mar 20, 2025
d9f6a36
putback old initbus, scan the non-alt bus by default, fixing the bug
brentru Mar 20, 2025
6d312c5
check scan results
brentru Mar 20, 2025
e17292f
Append scan results to config file?
brentru Mar 20, 2025
a5d8807
Hooks for detach/attach
brentru Mar 21, 2025
c4eba79
Refactor all ParseX component functions within ws_sdcard.h
brentru Mar 21, 2025
cef1bfc
save friday progress
brentru Mar 21, 2025
ebb36d6
Refresh USB for Pico if sd config was automatically found
brentru Mar 24, 2025
0b55693
add scan pb to config
brentru Mar 24, 2025
b7784df
add association within controller, TODO: remove association cruft in …
brentru Mar 24, 2025
f13a706
Associate driver with address, writeback to file
brentru Mar 25, 2025
8ce8b7b
Fix driver name issue
brentru Mar 25, 2025
aa557e2
Temporarily remove adding the device to the config file since it does…
brentru Mar 25, 2025
f83d534
add sensor types to components, (1)
brentru Mar 25, 2025
3686c6f
add sensor types to components, (2)
brentru Mar 25, 2025
ea3c17f
add all drivers
brentru Mar 26, 2025
f323fd0
use reverse map, unordered_map instead
brentru Mar 26, 2025
515ce9c
remove detach/attach issue
brentru Mar 26, 2025
f440847
remove the usb attach/detach and extra syncs
brentru Mar 26, 2025
f8b7610
Write back i2c device info to config file, doesn't work on boot yet
brentru Mar 27, 2025
0a208e2
Persistent init working from config
brentru Mar 28, 2025
8edabaa
Refactor parsing scan results into the buffer
brentru Mar 28, 2025
3b58f2e
Check for scan results within parse, log a warning
brentru Apr 2, 2025
161bacb
Reduce error string verbosity
brentru Apr 2, 2025
f778e46
working on hw
brentru Apr 2, 2025
387e66c
looking at autocfg->write->start
brentru Apr 3, 2025
01a4a72
Wow, uh, WSVs._fsv2 wasnt being called everywhere leading to a dangli…
brentru Apr 3, 2025
fa65af9
add use: fields
brentru Apr 3, 2025
40e80d9
check if scan == candidate
brentru Apr 4, 2025
77c9a53
autocfg->write->usb workflow implemented
brentru Apr 4, 2025
6018591
Load an existing file into the in-memory document and append to it as…
brentru Apr 4, 2025
4020e03
debugging existing file
brentru Apr 7, 2025
aaf718d
sync protos
brentru Apr 7, 2025
6c45959
put back old work without the no/auto/yes
brentru Apr 7, 2025
fbfcc08
debugging mux
brentru Apr 8, 2025
9fc3e4d
still debugging mux inclusion
brentru Apr 8, 2025
0a422f5
pair: working mux
brentru Apr 9, 2025
8614a6d
pair 2: remove debug code
brentru Apr 9, 2025
f579bbd
reenum adding cdc and msc doesnt reenum til the end
brentru Apr 9, 2025
d86a445
reviewing
brentru Apr 10, 2025
8313b66
trim controller
brentru Apr 10, 2025
f13f8b7
review modifications
brentru Apr 10, 2025
9205787
putback old sketch
brentru Apr 10, 2025
c58774c
doxygen:
brentru Apr 10, 2025
b7c89e5
Release for offline fix
brentru Apr 10, 2025
8baad48
clang
brentru Apr 10, 2025
4335c24
Fix - automatic scan backing out incorrectly after candidate list exh…
brentru Apr 10, 2025
765cb4a
build for esp32dev CLI
brentru Apr 10, 2025
0b072e2
clang
brentru Apr 10, 2025
ff80728
fix regression - analogio, digitalio
brentru Apr 11, 2025
8d17e93
Fix all regressions
brentru Apr 11, 2025
44f351d
update release-caller.yml
brentru Apr 11, 2025
24c4961
flip conditinals
brentru Apr 11, 2025
14fe05a
ignore offline
brentru Apr 11, 2025
7362592
Fix tyeth issue
brentru Apr 11, 2025
4a680ad
build targets for offline mode
brentru Apr 11, 2025
1b51d0c
Test should work now, revert ci change for offline
brentru Apr 11, 2025
0ece23b
test demo offline, nonet and netifaces
brentru Apr 11, 2025
385537f
nonet update
brentru Apr 11, 2025
2d0d4fe
fix the swapped classes
brentru Apr 11, 2025
4912417
Fix target - metro rp2350 tinyusb
brentru Apr 11, 2025
eda059e
fix OFFLINE requirement that is causing msc detach/attach after logging
brentru Apr 11, 2025
ec229aa
Restore demo
brentru Apr 11, 2025
375fd39
address @tyeth review
brentru Apr 14, 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
4 changes: 3 additions & 1 deletion .github/workflows/build-clang-doxy.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# SPDX-FileCopyrightText: Brent Rubell for Adafruit Industries, 2023
# SPDX-FileCopyrightText: Brent Rubell for Adafruit Industries, 2023-2025
#
# SPDX-License-Identifier: MIT
name: WipperSnapper Build CI

on:
workflow_dispatch:
pull_request:
branches-ignore:
- 'offline-mode'
workflow_call:
secrets:
GH_REPO_TOKEN:
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/release-offline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
push:
branches:
- offline-mode
- offline-mode-*
release:
types: [published]
branches:
Expand Down Expand Up @@ -165,8 +166,8 @@ jobs:
tree
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
mv examples/*/build/*/Wippersnapper_demo.ino.bin wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.bin
mv examples/*/build/*/Wippersnapper_demo_offline_netiface.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
mv examples/*/build/*/Wippersnapper_demo_offline_netiface.ino.bin wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.bin
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -183,10 +184,10 @@ jobs:
fail-fast: false
matrix:
arduino-platform: ["pico_rp2040_tinyusb",
"pico_rp2350_tinyusb",
"feather_rp2040_adalogger_tinyusb",
"metro_rp2350_tinyusb"
]
"pico_rp2350_tinyusb",
"feather_rp2040_adalogger_tinyusb",
"metro_rp2350_tinyusb"
]
steps:
- uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -243,7 +244,7 @@ jobs:
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/Wippersnapper_demo_offline.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
mv examples/*/build/*/Wippersnapper_demo_offline_nonetiface.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// All text above must be included in any redistribution.

#include "ws_adapters.h"
ws_adapter_offline wipper;
ws_adapter_wifi wipper;
#define WS_DEBUG // Enable debug output!

void setup() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@



Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@



Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Adafruit IO WipperSnapper - Offline Mode
// USE ONLY WITH DEVICES WITH A NETWORK ADAPTER LIKE ESP32-x
//
// Adafruit invests time and resources providing this open source code.
// Please support Adafruit and open source hardware by purchasing
// products from Adafruit!
//
// Brent Rubell for Adafruit Industries, 2025
//
// All text above must be included in any redistribution.

#include "ws_adapters.h"
ws_adapter_offline wipper;
#define WS_DEBUG // Enable debug output!

void setup() {
Serial.begin(115200);
wipper.provision();
wipper.connect();
}

void loop() {
wipper.run();
}
6 changes: 3 additions & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ lib_compat_mode = soft ; can be strict once pio detects SleepyDog on RP2040
extends = common:esp32
board = esp32dev
board_build.partitions = default_8MB.csv
build_flags = -DARDUINO_ESP32_DEV -DOFFLINE_MODE_DEBUG -DOFFLINE_MODE_WOKWI
build_flags = -DARDUINO_ESP32_DEV -DOFFLINE_MODE_DEBUG -DOFFLINE_MODE_WOKWI -DBUILD_OFFLINE_ONLY
board_build.filesystem = littlefs
upload_speed = 921600

Expand Down Expand Up @@ -165,7 +165,7 @@ board_build.filesystem = littlefs
[env:featheresp32s2]
extends = common:esp32
board = featheresp32-s2
build_flags = -DARDUINO_ADAFRUIT_FEATHER_ESP32S2 -DBOARD_HAS_PSRAM
build_flags = -DARDUINO_ADAFRUIT_FEATHER_ESP32S2 -DBOARD_HAS_PSRAM -DBUILD_OFFLINE_ONLY
board_build.partitions = tinyuf2-partitions-4MB-noota.csv
;board_build.partitions = tinyuf2-partitions-4MB.csv
;build_type = debug
Expand Down Expand Up @@ -434,7 +434,7 @@ platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop
board = adafruit_feather_adalogger
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git
board_build.filesystem_size = 0.5m
build_flags = -DUSE_TINYUSB -DBUILD_OFFLINE_ONLY
build_flags = -DUSE_TINYUSB
; Once https://github.com/platformio/platformio-core > 6.1.11 these can be removed
lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library

Expand Down
Loading
Loading