Skip to content

Commit

Permalink
SMIBHID has a webserver! Closes #248
Browse files Browse the repository at this point in the history
  • Loading branch information
sjefferson99 committed Oct 14, 2024
1 parent 69e551e commit e4d3e86
Show file tree
Hide file tree
Showing 9 changed files with 825 additions and 0 deletions.
5 changes: 5 additions & 0 deletions smibhid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Press the space_open or space_closed buttons to call the smib server endpoint ap
- Error information shown on connected displays where configured in modules using ErrorHandler class
- UI Logger captures timestamps of button presses and uploads to SMIB for logging and review of usage patterns
- Space open relay pin optionally sets a GPIO to high or low when the space is open
- Web server for admin functions - at present only provides API for version and MAC address

## Circuit diagram
### Pico W Connections
Expand Down Expand Up @@ -101,6 +102,10 @@ Use existing space state buttons, lights, slack API wrapper and watchers as an e
- Enter a new UI state by calling the transition_to() method on a UIstate instance and pass any arguments needed by that state
- You will need to pass any core objects needed by the base UIState class and apply using super() as normal. These are currently HID (for managing the current state instance) and SpaceState so that the open and close buttons are available in all UIs with default space open/closed behaviour.

### Web server
The admin web interface is hosted by a customised version of [tinyweb](https://github.com/belyalov/tinyweb) server which is a flask like implementation of a asyncio web server in MicroPython.
The website configuration and API definition is built out from the website.py module and all HTML/CSS/JS etc lives in the www subfolder.

### UI State diagram
The space state UI state machine is described in this diagram:

Expand Down
Empty file added smibhid/http/__init__.py
Empty file.
Loading

0 comments on commit e4d3e86

Please sign in to comment.