Skip to content

Commit

Permalink
Add basic ESP32 Firmware support (#302)
Browse files Browse the repository at this point in the history
* WIP add esp web tools dep

* basic demo

* wording

* create initial fw manifest

* Add test fw
  • Loading branch information
zjwhitehead authored Dec 8, 2024
1 parent 6ddbfca commit 260e5ff
Show file tree
Hide file tree
Showing 8 changed files with 7,484 additions and 4,752 deletions.
Empty file added assets/js/configurator/esp32.js
Empty file.
3 changes: 3 additions & 0 deletions config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ rel = "sitemap"
[[module.mounts]]
source = "node_modules/clipboard"
target = "assets/js/vendor/clipboard"
[[module.mounts]]
source = "node_modules/esptool-js"
target = "assets/js/vendor/esptool-js"
30 changes: 30 additions & 0 deletions content/configurators/esp32.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: "OpenPPG ESP32 Configurator"
description: "Upgrade firmware on your OpenPPG device via USB"
helplink: "/docs/controllers/esp32/"
date: 2022-02-28T15:34:28-06:00\
configurator: "esp32"
draft: false
---


<div class="row">
<div class="col-md-8 my-4">
<div class="card card-body bg-light">
<h4 class="card-title mt-0">Upgrades </h4>
<small class="text-muted">New firmware can add features and improve functionality.</small>
<h5>Latest ESP32 firmware </h5>
<span><a href="https://github.com/openppg/eppg-controller/releases/" target="_blank">Release notes <i class="fas fa-info-circle"></i></a></span>
<div class="row mb-4">
<div class="col-md-5 mb-2">
<esp-web-install-button
manifest="/esp32-manifest.json">
<button slot="activate" class="btn btn-primary btn-lg">Install</button>
<span slot="unsupported">Ah snap, your browser doesn't work! Please use Chrome.</span>
<span slot="not-allowed">Ah snap, you are not allowed to use this on HTTP!</span>
</esp-web-install-button>
</div>
</div>
</div>
</div>
</div>
9 changes: 8 additions & 1 deletion layouts/partials/head/script-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
{{ $configPath := (printf "js/configurator/%s.js" (.Param "configurator") )}}
<script src="/js/vendor/serial.js"></script>
<script src="/js/vendor/weather.js"></script>

<!-- ESP Web Tools lives at node_modules/esptool-js/bundle.js
{{ $espWebTools := resources.Get "js/vendor/esptool-js/bundle.js" -}}
<script src="{{ $espWebTools.Permalink }}" crossorigin="anonymous"></script>
-->
<script
type="module"
src="https://unpkg.com/esp-web-tools@10/dist/web/install-button.js?module"
></script>
{{ if eq (hugo.Environment) "development" -}}
{{ $configuratorJs := resources.Get $configPath }}
<script src="{{ $configuratorJs.Permalink }}"></script>
Expand Down
12,170 changes: 7,419 additions & 4,751 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,8 @@
},
"overrides": {
"semver": "^7.5.4"
},
"dependencies": {
"esp-web-tools": "^10.0.1"
}
}
21 changes: 21 additions & 0 deletions static/esp32-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "OpenPPG Firmware",
"version": "7.0.0",
"new_install_prompt_erase": true,
"builds": [
{
"chipFamily": "ESP32-S3",
"ota": {
"path": "24.11.1/esp-web-tools-example-esp32s3.ota.bin",
"summary": "## What's Changed\r\n* Updates for OpenPPG 7.0.0 testing in https://github.com/openppg/eppg-controller/pull/\r\n",
"release_url": "https://github.com/openppg/eppg-controller/releases/tag/7.0.0"
},
"parts": [
{
"path": "firmware/test-firmware-merged.bin",
"offset": 0
}
]
}
]
}
Binary file added static/firmware/test-firmware-merged.bin
Binary file not shown.

0 comments on commit 260e5ff

Please sign in to comment.