index.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. <html>
  2. <head>
  3. <meta charset="utf-8" />
  4. <title>ESP Web Tools</title>
  5. <meta
  6. name="description"
  7. content="Easily allow users to flash new firmware for their ESP-devices on the web."
  8. />
  9. <meta name="viewport" content="width=device-width" />
  10. <meta property="og:title" content="ESP Web Tools" />
  11. <meta property="og:site_name" content="ESP Web Tools" />
  12. <meta
  13. property="og:url"
  14. content="https://esphome.github.io/esp-web-tools/"
  15. />
  16. <meta property="og:type" content="website" />
  17. <meta
  18. property="og:description"
  19. content="Easily allow users to flash new firmware for their ESP-devices on the web."
  20. />
  21. <meta
  22. property="og:image"
  23. content="https://esphome.github.io/esp-web-tools/static/social.png"
  24. />
  25. <meta name="twitter:card" content="summary_large_image" />
  26. <meta name="twitter:title" content="ESP Web Tools" />
  27. <meta
  28. name="twitter:description"
  29. content="Easily allow users to flash new firmware for their ESP-devices on the web."
  30. />
  31. <meta
  32. name="twitter:image"
  33. content="https://esphome.github.io/esp-web-tools/static/social.png"
  34. />
  35. <meta name="color-scheme" content="dark light" />
  36. <style>
  37. body {
  38. font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI",
  39. Roboto, Ubuntu, sans-serif;
  40. padding: 0;
  41. margin: 0;
  42. line-height: 1.4;
  43. }
  44. .content {
  45. max-width: 600px;
  46. margin: 0 auto;
  47. padding: 12px;
  48. }
  49. h2 {
  50. margin-top: 2em;
  51. }
  52. h3 {
  53. margin-top: 1.5em;
  54. }
  55. .projects {
  56. display: flex;
  57. text-align: center;
  58. flex-wrap: wrap;
  59. gap: 24px;
  60. justify-content: center;
  61. }
  62. .projects a {
  63. color: initial;
  64. text-decoration: none;
  65. }
  66. .project .logo img {
  67. height: 50px;
  68. }
  69. .project .name {
  70. margin-top: 8px;
  71. }
  72. a {
  73. color: #03a9f4;
  74. }
  75. .screenshot {
  76. text-align: center;
  77. }
  78. .screenshot img {
  79. max-width: 100%;
  80. box-shadow: rgb(0 0 0 / 20%) 0px 2px 1px -1px,
  81. rgb(0 0 0 / 14%) 0px 1px 1px 0px, rgb(0 0 0 / 12%) 0px 1px 3px 0px;
  82. border-radius: 4px;
  83. }
  84. .screenshot i {
  85. margin-top: 4px;
  86. display: block;
  87. }
  88. .videoWrapper {
  89. position: relative;
  90. padding-bottom: 56.25%; /* 16:9 */
  91. height: 0;
  92. margin-bottom: 25px;
  93. background: #ccc;
  94. }
  95. .hidden {
  96. display: none;
  97. }
  98. .content pre {
  99. max-width: 100%;
  100. overflow-y: scroll;
  101. }
  102. .footer {
  103. margin-top: 24px;
  104. border-top: 1px solid #ccc;
  105. padding-top: 24px;
  106. text-align: center;
  107. }
  108. .footer .initiative {
  109. font-style: italic;
  110. margin-top: 16px;
  111. }
  112. table {
  113. border-spacing: 0;
  114. }
  115. td {
  116. padding: 8px;
  117. border-bottom: 1px solid #ccc;
  118. }
  119. @media (prefers-color-scheme: dark) {
  120. body {
  121. background-color: #333;
  122. color: #fff;
  123. }
  124. a {
  125. color: #58a6ff;
  126. }
  127. }
  128. </style>
  129. <script
  130. type="module"
  131. src="https://unpkg.com/@justinribeiro/lite-youtube@1.3.0/lite-youtube.js"
  132. ></script>
  133. <script module>
  134. import(
  135. // In development we import locally.
  136. window.location.hostname === "localhost"
  137. ? "/dist/web/install-button.js"
  138. : "https://unpkg.com/esp-web-tools@7.2.0/dist/web/install-button.js?module"
  139. );
  140. </script>
  141. </head>
  142. <body>
  143. <div class="content">
  144. <h1>ESP Web Tools</h1>
  145. <p>
  146. User friendly tools to manage ESP8266 and ESP32 devices in the browser:
  147. </p>
  148. <ul>
  149. <li>Install &amp; update firmware</li>
  150. <li>Connect device to the Wi-Fi network</li>
  151. <li>Visit the device's hosted web interface</li>
  152. <li>Access logs and send terminal commands</li>
  153. <li>
  154. Add devices to
  155. <a href="https://www.home-assistant.io">Home Assistant</a>
  156. </li>
  157. </ul>
  158. <div class="videoWrapper">
  159. <lite-youtube
  160. videoid="E8bdATqXM8c"
  161. videotitle="ESP Web Tools in action"
  162. ></lite-youtube>
  163. </div>
  164. <h2 id="demo">Try a live demo</h2>
  165. <p>
  166. This demo will install
  167. <a href="https://esphome.io">ESPHome</a>. To get started, connect an ESP
  168. device to your computer and hit the button:
  169. </p>
  170. <esp-web-install-button manifest="static/firmware_build/manifest.json">
  171. <i slot="unsupported">
  172. The demo is not available because your browser does not support Web
  173. Serial. Open this page in Google Chrome or Microsoft Edge instead<span
  174. class="not-supported-i hidden"
  175. >
  176. (but not on your iOS device)</span
  177. >.
  178. </i>
  179. </esp-web-install-button>
  180. <h2 id="used-by">Products using ESP Web Tools</h2>
  181. <div class="projects">
  182. <a href="https://install.wled.me" target="_blank" class="project">
  183. <div class="logo">
  184. <img src="static/logos/wled.png" alt="WLED logo" />
  185. </div>
  186. <div class="name">WLED</div>
  187. </a>
  188. <a
  189. href="https://arendst.github.io/Tasmota-firmware/"
  190. target="_blank"
  191. class="project"
  192. >
  193. <div class="logo">
  194. <img src="static/logos/tasmota.svg" alt="Tasmota logo" />
  195. </div>
  196. <div class="name">Tasmota</div>
  197. </a>
  198. <a href="https://td-er.nl/ESPEasy/" target="_blank" class="project">
  199. <div class="logo">
  200. <img src="static/logos/espeasy.png" alt="ESPEasy logo" />
  201. </div>
  202. <div class="name">ESPEasy</div>
  203. </a>
  204. <a
  205. href="https://canair.io/installer.html"
  206. target="_blank"
  207. class="project"
  208. >
  209. <div class="logo">
  210. <img src="static/logos/canairio.png" alt="CanAirIO logo" />
  211. </div>
  212. <div class="name">CanAirIO</div>
  213. </a>
  214. <a href="https://web.esphome.io" target="_blank" class="project">
  215. <div class="logo">
  216. <img src="static/logos/esphome.svg" alt="ESPHome logo" />
  217. </div>
  218. <div class="name">ESPHome</div>
  219. </a>
  220. </div>
  221. <h2>How it works</h2>
  222. <p>
  223. ESP Web Tools works by combining
  224. <a
  225. href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API"
  226. >Web Serial</a
  227. >, <a href="https://www.improv-wifi.com/">Improv Wi-Fi</a> (optional),
  228. and a manifest which describes the firmware. ESP Web Tools detects the
  229. chipset of the connected ESP device and automatically selects the right
  230. firmware variant from the manifest.
  231. </p>
  232. <p>
  233. Web Serial is available in Google Chrome and Microsoft Edge
  234. browsers<span class="not-supported-i hidden">
  235. (but not on your iOS device)</span
  236. >. Android support should be possible but has not been implemented yet.
  237. </p>
  238. <h3 id="improv">Configuring Wi-Fi</h3>
  239. <p>
  240. ESP Web Tools supports the
  241. <a href="https://www.improv-wifi.com/serial"
  242. >Improv Wi-Fi serial standard</a
  243. >. This is an open standard to allow configuring Wi-Fi via the serial
  244. port.
  245. </p>
  246. <p>
  247. If the firmware supports Improv, a user will be asked to connect the
  248. device to the network after installing the firmware. Once connected, the
  249. device can send the user to a URL to finish configuration. For example,
  250. this can be a link to the device's IP address where it serves a local
  251. UI.
  252. </p>
  253. <p>
  254. At any time in the future a user can use ESP Web Tools to find the
  255. device link or to reconfigure the Wi-Fi settings without doing a
  256. reinstall.
  257. </p>
  258. <p class="screenshot">
  259. <img
  260. src="./static/screenshots/dashboard.png"
  261. alt="Screenshot showing ESP Web Tools dialog offering visting the device, adding it to Home Assistant, change Wi-Fi, show logs and console and reset data."
  262. />
  263. <i>Screenshot showing the ESP Web Tools interface</i>
  264. </p>
  265. <h3 id="logs">Viewing logs & sending commands</h3>
  266. <p>
  267. ESP Web Tools allows users to open a serial console to see the logs and
  268. send commands.
  269. </p>
  270. <p class="screenshot">
  271. <img
  272. src="./static/screenshots/logs.png"
  273. alt="Screenshot showing ESP Web Tools dialog with a console showing ESPHome logs and a terminal prompt to sent commands."
  274. />
  275. <i>Screenshot showing the ESP Web Tools logs & console</i>
  276. </p>
  277. <h2 id="add-website">Adding ESP Web Tools to your website</h2>
  278. <p>
  279. To add this to your own website, you need to include the ESP Web Tools
  280. JavaScript files on your website, create a manifest file and add the ESP
  281. Web Tools button HTML.
  282. </p>
  283. <p>
  284. You can import the JavaScript files directly from the unpkg CDN or
  285. <a href="https://unpkg.com/browse/esp-web-tools/dist/web/"
  286. >download the files</a
  287. >
  288. and put them on your website.
  289. </p>
  290. <pre>
  291. &lt;script
  292. type="module"
  293. src="https://unpkg.com/esp-web-tools@7.2.0/dist/web/install-button.js?module"
  294. >&lt;/script></pre
  295. >
  296. <p>
  297. Find a place on your page where you want the button to appear and
  298. include the following bit of HTML. Update the
  299. <code>manifest</code> attribute to point at your manifest file.
  300. </p>
  301. <pre>
  302. &lt;esp-web-install-button
  303. manifest="/static/firmware_build/manifest.json"
  304. >&lt;/esp-web-install-button></pre
  305. >
  306. <p>
  307. ESP Web Tools requires that your website is served over
  308. <code>https://</code> to work. This is a Web Serial security
  309. requirement.
  310. </p>
  311. <p>
  312. If your manifest or the firmware files are hosted on another server,
  313. make sure you configure
  314. <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS"
  315. >the CORS-headers</a
  316. >
  317. such that your website is allowed to fetch those files by adding the
  318. header
  319. <code
  320. >Access-Control-Allow-Origin: https://domain-of-your-website.com</code
  321. >.
  322. </p>
  323. <p>
  324. ESP Web Tools can also be integrated in your projects by installing it
  325. <a href="https://www.npmjs.com/package/esp-web-tools">via NPM</a>.
  326. </p>
  327. <h3 id="manifest">Creating your manifest</h3>
  328. <p>
  329. Manifests describe the firmware that you want to offer the user to
  330. install. It allows specifying different builds for the different types
  331. of ESP devices. Current supported chip families are
  332. <code>ESP8266</code>, <code>ESP32</code>, <code>ESP32-C3</code>,
  333. <code>ESP32-S2</code> and <code>ESP32-S3</code>. The correct build will
  334. be automatically selected based on the type of the connected ESP device.
  335. </p>
  336. <pre>
  337. {
  338. "name": "ESPHome",
  339. "version": "2021.11.0",
  340. "home_assistant_domain": "esphome",
  341. "new_install_prompt_erase": false,
  342. "builds": [
  343. {
  344. "chipFamily": "ESP32",
  345. "parts": [
  346. { "path": "bootloader.bin", "offset": 4096 },
  347. { "path": "partitions.bin", "offset": 32768 },
  348. { "path": "ota.bin", "offset": 57344 },
  349. { "path": "firmware.bin", "offset": 65536 }
  350. ]
  351. },
  352. {
  353. "chipFamily": "ESP8266",
  354. "parts": [
  355. { "path": "esp8266.bin", "offset": 0 }
  356. ]
  357. }
  358. ]
  359. }</pre
  360. >
  361. <p>
  362. Each build contains a list of parts to be installed to the ESP device.
  363. Each part consists of a path to the file and an offset on the flash
  364. where it should be installed. Part paths are resolved relative to the
  365. path of the manifest, but can also be URLs to other hosts.
  366. </p>
  367. <p>
  368. If your firmware is supported by Home Assistant, you can add the
  369. optional key <code>home_assistant_domain</code>. If present, ESP Web
  370. Tools will link the user to add this device to Home Assistant.
  371. </p>
  372. <p>
  373. By default a new installation will erase all data before installation.
  374. If you want to leave this choice to the user, set the optional manifest
  375. key
  376. <code>new_install_prompt_erase</code> to <code>true</code>. ESP Web
  377. Tools offers users a new installation if it is unable to detect the
  378. current firmware of the device (via Improv Serial) or if the detected
  379. firmware does not match the name specififed in the manifest.
  380. </p>
  381. <p>
  382. When a firmware is first installed on a device, it might need to do some
  383. time consuming tasks like initializing the file system. By default ESP
  384. Web Tools will wait 10 seconds to receive an Improv Serial response to
  385. indicate that the boot is completed. You can increase this timeout by
  386. setting the optional manifest key
  387. <code>new_install_improv_wait_time</code> to the number of seconds to
  388. wait. Set to <code>0</code> to disable Improv Serial detection.
  389. </p>
  390. <h3 id="customize">Customizing the look and feel</h3>
  391. <p>
  392. You can change the colors of the default UI elements with CSS custom
  393. properties (variables), the following variables are available:
  394. </p>
  395. <ul>
  396. <li><code>--esp-tools-button-color</code></li>
  397. <li><code>--esp-tools-button-text-color</code></li>
  398. </ul>
  399. <p>There are also some attributes that can be used for styling:</p>
  400. <table>
  401. <tr>
  402. <td><code>install-supported</code></td>
  403. <td>Added if installing firmware is supported</td>
  404. </tr>
  405. <tr>
  406. <td>
  407. <code>install-unsupported</code>
  408. </td>
  409. <td>Added if installing firmware is not supported</td>
  410. </tr>
  411. </table>
  412. <h4>Replace the button and message with a custom one</h4>
  413. <p>
  414. You can replace both the activation button and the message that is shown
  415. when the user uses an unsupported browser or non-secure context with
  416. your own elements. This can be done using the <code>activate</code>,
  417. <code>unsupported</code> and <code>not-allowed</code> slots:
  418. </p>
  419. <pre>
  420. &lt;esp-web-install-button
  421. manifest="/static/firmware_build/manifest.json"
  422. >
  423. &lt;button slot="activate">Custom install button&lt;/button>
  424. &lt;span slot="unsupported">Ah snap, your browser doesn't work!&lt;/span>
  425. &lt;span slot="not-allowed">Ah snap, you are not allowed to use this on HTTP!&lt;/span>
  426. &lt;/esp-web-install-button>
  427. </pre
  428. >
  429. <h2>Why we created ESP Web Tools</h2>
  430. <div class="videoWrapper">
  431. <lite-youtube
  432. videoid="6ZMXE5PXPqU"
  433. videotitle="Why we created ESP Web Tools"
  434. videoStartAt="1255"
  435. ></lite-youtube>
  436. </div>
  437. <div class="footer">
  438. <div>
  439. ESP Web Tools –
  440. <a href="https://github.com/esphome/esp-web-tools">GitHub</a>
  441. </div>
  442. <div class="initiative">
  443. ESP Web Tools is a project by
  444. <a href="https://esphome.io">ESPHome</a>.<br />
  445. Development is funded by
  446. <a href="https://www.nabucasa.com">Nabu Casa</a>.
  447. </div>
  448. </div>
  449. </div>
  450. <script>
  451. if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
  452. document.querySelector(".not-supported-i").classList.remove("hidden");
  453. }
  454. </script>
  455. </body>
  456. </html>