index.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  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. <style>
  36. body {
  37. font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI",
  38. Roboto, Ubuntu, sans-serif;
  39. padding: 0;
  40. margin: 0;
  41. line-height: 1.4;
  42. }
  43. .content {
  44. max-width: 600px;
  45. margin: 0 auto;
  46. padding: 12px;
  47. }
  48. .project .logo {
  49. float: right;
  50. }
  51. .project .logo img {
  52. height: 50px;
  53. }
  54. a {
  55. color: #03a9f4;
  56. }
  57. .videoWrapper {
  58. position: relative;
  59. padding-bottom: 56.25%; /* 16:9 */
  60. height: 0;
  61. margin-bottom: 25px;
  62. background: #000;
  63. }
  64. .videoWrapper iframe {
  65. position: absolute;
  66. top: 0;
  67. left: 0;
  68. width: 100%;
  69. height: 100%;
  70. }
  71. .content pre {
  72. max-width: 100%;
  73. overflow-y: scroll;
  74. }
  75. .footer {
  76. margin-top: 24px;
  77. border-top: 1px solid #ccc;
  78. padding-top: 24px;
  79. text-align: center;
  80. }
  81. .footer .initiative {
  82. font-style: italic;
  83. margin-top: 16px;
  84. }
  85. table {
  86. border-spacing: 0;
  87. }
  88. td {
  89. padding: 8px;
  90. border-bottom: 1px solid #ccc;
  91. }
  92. @media (prefers-color-scheme: dark) {
  93. body {
  94. background-color: #333;
  95. color: #fff;
  96. }
  97. a {
  98. color: #58a6ff;
  99. }
  100. }
  101. </style>
  102. <script module>
  103. import(
  104. // In development we import locally.
  105. window.location.hostname === "localhost"
  106. ? "/dist/web/install-button.js"
  107. : "https://unpkg.com/esp-web-tools@5.1.0/dist/web/install-button.js?module"
  108. );
  109. </script>
  110. </head>
  111. <body>
  112. <div class="content">
  113. <h1>ESP Web Tools</h1>
  114. <p>
  115. ESP Web Tools is a set of open source tools to allow working with ESP
  116. devices in the browser.
  117. <a href="https://github.com/esphome/esp-web-tools"
  118. >The code is available on GitHub.</a
  119. >
  120. </p>
  121. <p>
  122. To try it out and install
  123. <a href="https://esphome.io">ESPHome</a> on an ESP, connect it to your
  124. computer and hit the button:
  125. </p>
  126. <esp-web-install-button
  127. manifest="static/firmware_build/manifest.json"
  128. ></esp-web-install-button>
  129. <p>
  130. <i>
  131. Note, this only works in desktop Chrome and Edge. Android support
  132. should be possible but has not been implemented yet. If you don't see
  133. your ESP device, you might miss <a href="#drivers">drivers</a>.
  134. </i>
  135. </p>
  136. <p>
  137. This works by combining
  138. <a
  139. href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API"
  140. >Web Serial</a
  141. >
  142. with a manifest which describes the firmware. It will automatically
  143. detect the type of the connected ESP device and find the right firmware
  144. files in the manifest.
  145. </p>
  146. <div class="videoWrapper">
  147. <iframe
  148. width="560"
  149. height="315"
  150. src="https://www.youtube-nocookie.com/embed/k88BS8zgWq0"
  151. title="YouTube video player"
  152. frameborder="0"
  153. allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
  154. allowfullscreen
  155. ></iframe>
  156. </div>
  157. <h2 id="used-by">Products using ESP Web Tools</h2>
  158. <div class="project">
  159. <a href="https://wled.me" class="logo"
  160. ><img src="static/logos/wled.png" alt="WLED logo"
  161. /></a>
  162. <h3>WLED</h3>
  163. <p>
  164. Fast and feature-rich firmware to control NeoPixel (WS2812B, WS2811,
  165. SK6812) LEDs and SPI based chipsets like the WS2801 and APA102.
  166. </p>
  167. <p>
  168. <a href="https://install.wled.me" target="_blank"
  169. >Installation Website</a
  170. >
  171. </p>
  172. </div>
  173. <div class="project">
  174. <a href="https://tasmota.github.io" class="logo"
  175. ><img src="static/logos/tasmota.svg" alt="Tasmota logo"
  176. /></a>
  177. <h3>Tasmota</h3>
  178. <p>
  179. Firmware with easy configuration using webUI, OTA updates, automation
  180. using timers or rules, expandability and entirely local control over
  181. MQTT, HTTP, Serial or KNX.
  182. </p>
  183. <p>
  184. <a href="https://arendst.github.io/Tasmota-firmware/" target="_blank"
  185. >Installation Website</a
  186. >
  187. </p>
  188. </div>
  189. <div class="project">
  190. <a href="http://www.espeasy.com/" class="logo"
  191. ><img src="static/logos/espeasy.png" alt="ESPEasy logo"
  192. /></a>
  193. <h3>ESPEasy</h3>
  194. <p>Easy MultiSensor device based on ESP8266/ESP32.</p>
  195. <p>
  196. <a href="https://td-er.nl/ESPEasy/" target="_blank"
  197. >Installation Website</a
  198. >
  199. </p>
  200. </div>
  201. <div class="project">
  202. <a href="https://canair.io" class="logo"
  203. ><img src="static/logos/canairio.png" alt="CanAirIO logo"
  204. /></a>
  205. <h3>CanAirIO</h3>
  206. <p>
  207. Citizen science initiative for monitoring air quality. CanAirIO uses
  208. mobile and fixed sensors to measure air quality with smartphones and
  209. ESP32 devices.
  210. </p>
  211. <p>
  212. <a href="https://canair.io/installer.html" target="_blank"
  213. >Installation Website</a
  214. >
  215. </p>
  216. </div>
  217. <div class="project">
  218. <a href="https://esphome.io" class="logo"
  219. ><img src="static/logos/esphome.svg" alt="ESPHome logo"
  220. /></a>
  221. <h3>ESPHome</h3>
  222. <p>
  223. No-code platform for ESP devices. Uses ESP Web Tools in their
  224. dashboard to install ESPHome on devices.
  225. </p>
  226. <p>
  227. <a href="https://esphome.io" target="_blank">Website</a>
  228. </p>
  229. </div>
  230. <h2 id="add-website">Adding ESP Web Tools to your website</h2>
  231. <p>
  232. To add this to your own website, create a manifest and add the button to
  233. your website. Make sure you update the manifest attribute to point at
  234. your manifest.
  235. </p>
  236. <p>
  237. You can import ESP Web Tools directly from the unpkg CDN or
  238. <a href="https://unpkg.com/browse/esp-web-tools/dist/web/"
  239. >download the files</a
  240. >
  241. and put them on your website.
  242. </p>
  243. <pre>
  244. &lt;script
  245. type="module"
  246. src="https://unpkg.com/esp-web-tools@5.1.0/dist/web/install-button.js?module"
  247. >&lt;/script>
  248. &lt;esp-web-install-button
  249. manifest="static/firmware_build/manifest.json"
  250. >&lt;/esp-web-install-button></pre
  251. >
  252. <p>
  253. Your website needs to be served over <code>https://</code>. If your
  254. manifest is hosted on another server, make sure you configure
  255. <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS"
  256. >the CORS-headers</a
  257. >
  258. for your manifest and firmware files such that your website is allowed
  259. to fetch those files by adding the header
  260. <code
  261. >Access-Control-Allow-Origin: https://domain-of-your-website.com</code
  262. >.
  263. </p>
  264. <p>
  265. ESP Web Tools can also be integrated in your projects by installing it
  266. via NPM:<br />
  267. <code>npm install --save esp-web-tools</code>
  268. </p>
  269. <h3 id="manifest">Creating your manifest</h3>
  270. <p>
  271. ESP Web Tools manifest describe the firmware that you want to install.
  272. It allows specifying different builds for the different types of ESP
  273. devices. Current supported chip families are <code>ESP8266</code>,
  274. <code>ESP32</code>, <code>ESP32C3</code> and <code>ESP32S2</code>. The
  275. correct build will be automatically selected based on the type of the
  276. ESP device we detect via the serial port.
  277. </p>
  278. <pre>
  279. {
  280. "name": "ESPHome",
  281. "version": "2021.11.0",
  282. "home_assistant_domain": "esphome",
  283. "new_install_skip_erase": false,
  284. "builds": [
  285. {
  286. "chipFamily": "ESP32",
  287. "parts": [
  288. { "path": "bootloader.bin", "offset": 4096 },
  289. { "path": "partitions.bin", "offset": 32768 },
  290. { "path": "ota.bin", "offset": 57344 },
  291. { "path": "firmware.bin", "offset": 65536 }
  292. ]
  293. },
  294. {
  295. "chipFamily": "ESP8266",
  296. "parts": [
  297. { "path": "esp8266.bin", "offset": 0 }
  298. ]
  299. }
  300. ]
  301. }</pre
  302. >
  303. <p>
  304. Each build contains a list of parts to be flashed to the ESP device.
  305. Each part consists of a path to the file and an offset on the flash
  306. where it should be installed. Part paths are resolved relative to the
  307. path of the manifest, but can also be URLs to other hosts.
  308. </p>
  309. <p>
  310. If your firmware is supported by Home Assistant, you can add the
  311. optional key <code>home_assistant_domain</code>. If present, ESP Web
  312. Tools will link the user to add this device to Home Assistant.
  313. </p>
  314. <p>
  315. By default a new installation will erase the entire flash. If you want
  316. to skip this step, set the optional key
  317. <code>new_install_skip_erase</code> to <code>true</code>. ESP Web Tools
  318. considers it a new installation if it is unable to detect the current
  319. firmware of the device (via Improv Serial) or if the detected firmware
  320. does not match the name specififed in the manifest.
  321. </p>
  322. <h3 id="improv">Wi-Fi provisioning</h3>
  323. <p>
  324. ESP Web Tools has support for the
  325. <a href="https://www.improv-wifi.com/serial"
  326. >Improv Wi-Fi serial standard</a
  327. >. This is an open standard to allow configuring Wi-Fi via the serial
  328. port.
  329. </p>
  330. <p>
  331. If Improv is supported, a user will be guided to connect the device to
  332. the network after installation. It also allows the user to connect
  333. already installed devices and re-configure the wireless network
  334. settings.
  335. </p>
  336. <h3 id="customize">Customizing the look and feel</h3>
  337. <p>
  338. There are multiple options to change the look and feel of the button and
  339. other elements.
  340. </p>
  341. <h4>Change colors</h4>
  342. <p>
  343. You can change the colors of the default UI elements with CSS custom
  344. properties (variables), the following variables are available:
  345. </p>
  346. <ul>
  347. <li><code>--esp-tools-button-color</code></li>
  348. <li><code>--esp-tools-button-text-color</code></li>
  349. </ul>
  350. <p>There are also some attributes that can be used for styling:</p>
  351. <table>
  352. <tr>
  353. <td><code>install-supported</code></td>
  354. <td>Added if installing firmware is supported</td>
  355. </tr>
  356. <tr>
  357. <td>
  358. <code>install-unsupported</code>
  359. </td>
  360. <td>Added if installing firmware is not supported</td>
  361. </tr>
  362. </table>
  363. <h4>Replace the button and message with a custom one</h4>
  364. <p>
  365. You can replace both the activation button and the message that is shown
  366. when the user uses an unsupported browser or non-secure context with
  367. your own elements. This can be done using the <code>activate</code>,
  368. <code>unsupported</code> and <code>not-allowed</code> slots:
  369. </p>
  370. <pre>
  371. &lt;esp-web-install-button
  372. manifest="static/firmware_build/manifest.json"
  373. >
  374. &lt;button slot="activate">Custom install button&lt;/button>
  375. &lt;span slot="unsupported">Ah snap, your browser doesn't work!&lt;/span>
  376. &lt;span slot="not-allowed">Ah snap, you are not allowed to use this on HTTP!&lt;/span>
  377. &lt;/esp-web-install-button>
  378. </pre
  379. >
  380. <h3 id="drivers">USB Serial Drivers</h3>
  381. <p>
  382. If the serial port is not showing up, your computer might be missing the
  383. drivers for the USB serial chip used in your ESP device. These drivers
  384. work for most ESP devices:
  385. </p>
  386. <ul>
  387. <li>
  388. CP2102 (square chip):
  389. <a
  390. href="https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers"
  391. >driver</a
  392. >
  393. </li>
  394. <li>
  395. CH341:
  396. <a
  397. href="https://github.com/nodemcu/nodemcu-devkit/tree/master/Drivers"
  398. >driver</a
  399. >
  400. </li>
  401. </ul>
  402. <div class="footer">
  403. <div>
  404. ESP Web Tools –
  405. <a href="https://github.com/esphome/esp-web-tools">GitHub</a>
  406. </div>
  407. <div class="initiative">
  408. ESP Web Tools is a project by
  409. <a href="https://esphome.io">ESPHome</a>.<br />
  410. Development is funded by
  411. <a href="https://www.nabucasa.com">Nabu Casa</a>.
  412. </div>
  413. </div>
  414. </div>
  415. </body>
  416. </html>