House panel example and the sensor hub it runs on - #155
Merged
Merged
Conversation
The sensor hub runs on a board (the T-Embed for now): nodes publish readings over UDP, HTTP or a Bluetooth GATT service, and a dashboard shows them live over a WebSocket feed. The fleet page runs on the PC and lists every board mpftp can reach, without interrupting any of them unless asked.
…bers A name longer than 8 characters beside a 128-bit service UUID only arrives in the scan response, and Chrome's chooser then shows 'Unknown or Unsupported Device'. The hub now takes a separate ble_name, the fleet page matches on it, and the T-Embed advertises as 'T-Embed'.
…ght, motion, RSSI) with a status screen
…y every 30 frames
…ashboard.html under Windows paths
…r hub's dashboard and a SHOW-TV cast The house display on the P4 (rooms, thresholds, alerts, the chime), the sensor hub's server with the house dashboard for a phone, and a SHOW-TV button that casts the panel with sound through the cast example. Real nodes (the FunHouse) take the first cards. Hub gains an optional page= so an app can serve its own dashboard without overwriting the hub's.
Collaborator
Author
|
The landed copy now runs on the board. The P4, on the #27 landing image, boots this branch's |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This lands the P4 house appliance as
lib/examples/house/, together with the sensor hub it depends on, which until now lived only on the unmergedspike/scenarios-batch2branch. Its README starts with what it does:http://<board ip>/;Real nodes such as the FunHouse take the first cards.
What's in it:
spike/scenarios-batch0/-batch2, rebased onto main. The only conflicts were in generated files (packages/examples.json, the PyScript TOML), and they're regenerated in the last commit. The spike branches stay as they were.house_panel(the display, the alerts,SimHouse) andhouse_app(panel, dashboard and SHOW-TV on one asyncio loop).house_server, the dashboard alone.dashboard.html, the house page.main.py, to boot into it.Hub(..., page=), so an app can serve its own dashboard. The board used to overwrite the hub'sdashboard.htmlinstead.Depends on #154, the cast example. The house app imports
roku_cast/castfastfrom the example beside it when you press SHOW-TV, and it needs the P4 firmware with castif (PyDevices/micropython-pydevices#27). Merge #154 first.Evidence, from the spike copy that ran as the P4's boot app on 2026-09-27:
The landed copy differs from that one only in how it's imported. It no longer uses
/castpaths, it no longer writes a painter-error log to flash (a flash write stalls a running cast), and it serves the house page throughpage=. That landed copy hasn't run on the board yet; it gets proven after merge, when the P4 is rebuilt from main.Marked
# gallery: skip: it needs the board.