-
Notifications
You must be signed in to change notification settings - Fork 0
promote: platformio profile baseline to main #5
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
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Repository Context Index | ||
|
|
||
| Repository structure: | ||
|
|
||
| Source: | ||
| * src | ||
| * lib | ||
| * scripts | ||
|
|
||
| Tests: | ||
| * tests | ||
|
|
||
| Documentation: | ||
| * docs | ||
|
|
||
| ANR migration generated this file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| profile_id: platformio-iot | ||
| category: firmware | ||
| focus: | ||
| - platformio | ||
| - hardware-validation | ||
| - device-config | ||
| - telemetry | ||
| recommended_docs: | ||
| - docs/hardware.md | ||
| - docs/verification.md | ||
| - docs/operations.md | ||
| - docs/topic-contracts.md | ||
| recommended_skills: | ||
| - embedded-debugging | ||
| - hardware-bringup | ||
| - telemetry-review | ||
| recommended_guardrails: | ||
| - secret-handling | ||
| - hardware-assumption-boundaries | ||
| - deployment-safety |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| anr_version: "0.1" | ||
| context_index: .agents/context-index.md | ||
| detected_directories: | ||
| - src | ||
| - lib | ||
| - scripts | ||
| - tests | ||
| - docs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Hardware | ||
|
|
||
| ## Target | ||
|
|
||
| HiveTech currently targets a generic `esp32dev` board definition with a single BME280 environmental sensor. | ||
|
|
||
| Current firmware assumptions from the code: | ||
|
|
||
| - board: ESP32 dev board (`[env:esp32dev]` in `platformio.ini`) | ||
| - primary sensor: BME280 via I2C | ||
| - I2C address: `0x77` | ||
| - sleep cycle: `TIME_TO_SLEEP = 60` seconds | ||
| - deep sleep wake source: timer wakeup | ||
|
|
||
| The code calls `Wire.begin()` without explicit pins, so the active SDA/SCL mapping depends on the actual ESP32 board defaults or local hardware wiring. | ||
|
|
||
| ## Pin Map | ||
|
|
||
| - `GPIO25`: `redLEDpin` | ||
| - `GPIO4`: `greenLEDpin` | ||
| - `GPIO15`: `ONE_WIRE_BUS` | ||
| - `GPIO5`: `SD_CS` | ||
|
|
||
| Not every declared pin is currently exercised in the active telemetry flow. Treat this list as the current code-level hardware contract, not as proof that every peripheral is physically assembled on the node. | ||
|
|
||
| ## Notes | ||
|
|
||
| - The firmware currently uses only BME280 telemetry in the active publish path. | ||
| - OTA is enabled, so the deployed node must stay reachable on the local network during maintenance. | ||
| - Before adding more hive-specific sensors, document their wiring and topic outputs here first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Operations | ||
|
|
||
| ## Runtime | ||
|
|
||
| HiveTech is a local-first firmware repo. | ||
|
|
||
| Current runtime flow: | ||
|
|
||
| 1. local `src/config.h` provides Wi-Fi SSID, password, and MQTT broker | ||
| 2. firmware boots on ESP32 | ||
| 3. node connects to Wi-Fi | ||
| 4. OTA is initialized | ||
| 5. BME280 values are read and published to MQTT | ||
| 6. node returns to timed deep sleep | ||
|
|
||
| `platformio.ini` currently contains a developer-local `upload_port`. Treat that as local machine state, not as committed team-wide truth. | ||
|
|
||
| ## Safety Rules | ||
|
|
||
| - separate local credentials from committed templates | ||
| - keep `src/config.h` untracked | ||
| - verify the target IP/device before OTA uploads | ||
| - document any destructive or risky deployment step explicitly | ||
|
|
||
| ## Recovery Notes | ||
|
|
||
| - If Wi-Fi or MQTT details change, update only local config files. | ||
| - If OTA fails, fall back to a direct flash path rather than repeatedly retrying against the wrong node. | ||
| - If BME280 detection fails, check wiring and I2C address assumptions before changing code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Topic Contracts | ||
|
|
||
| ## Purpose | ||
|
|
||
| Document the MQTT topics currently published by HiveTech. | ||
|
|
||
| ## Topics | ||
|
|
||
| - `HT_BME280_Temperature` | ||
| Payload: numeric value as text | ||
| Meaning: ambient temperature from the BME280 in degrees Celsius | ||
| - `HT_BME280_Humidity` | ||
| Payload: numeric value as text | ||
| Meaning: relative humidity from the BME280 | ||
| - `HT_BME280_Pressure` | ||
| Payload: numeric value as text | ||
| Meaning: barometric pressure from the BME280 divided by `100` | ||
| - `HT_BME280_Altitude` | ||
| Payload: numeric value as text | ||
| Meaning: altitude reported by the BME280 library | ||
|
|
||
| Current code publishes these topics once per wake cycle after sensor readout and MQTT reconnect. | ||
|
|
||
| ## Change Rules | ||
|
|
||
| - Keep topic names stable unless downstream automations are migrated deliberately. | ||
| - Treat unit changes or payload-format changes as interface changes. | ||
| - If retained messages, availability topics, or structured payloads are introduced, document them here before rollout. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Verification | ||
|
|
||
| ## Goal | ||
|
|
||
| Keep firmware changes reproducible and separate "compiles locally" from "works on the hive node". | ||
|
|
||
| ## Minimum Checks | ||
|
|
||
| 1. Copy `src/config_template.h` to local `src/config.h` or provide an equivalent local config file. | ||
| 2. Run `platformio run` for `env:esp32dev`. | ||
| 3. Flash or OTA-update the node using the local deployment path from `platformio.ini`. | ||
| 4. Confirm serial boot output reaches: | ||
| - Wi-Fi connect | ||
| - MQTT connect | ||
| - BME280 detection | ||
| - deep sleep entry | ||
| 5. Verify these MQTT topics receive fresh values: | ||
| - `HT_BME280_Temperature` | ||
| - `HT_BME280_Humidity` | ||
| - `HT_BME280_Pressure` | ||
| - `HT_BME280_Altitude` | ||
|
|
||
| ## Separation Of Checks | ||
|
|
||
| - Compile-only validation is useful for refactors and dependency changes. | ||
| - Real hardware validation is still mandatory after sensor, networking, OTA, or sleep-logic changes. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description of the topics can be made more precise for clarity, especially since this is an API contract. I suggest specifying that the payload is a string representation of a float and explicitly stating the units for all measurements.
For example: