{"id":1506,"date":"2022-02-07T20:33:07","date_gmt":"2022-02-08T02:33:07","guid":{"rendered":"https:\/\/lab.rapternet.us\/?p=1506"},"modified":"2023-11-02T17:06:09","modified_gmt":"2023-11-02T22:06:09","slug":"espdeck-generation-2","status":"publish","type":"post","link":"https:\/\/lab.rapternet.us\/?p=1506","title":{"rendered":"EspDeck Generation 2"},"content":{"rendered":"\n<p>When I started into the EspDeck project, I had enough parts on hand to build two units. I had two sampler packs of switches and two ESP8266 boards to use. So once I had the gen1 unit built, I started working on generation 2 of the EspDeck. Gen2 has a well designed case that holds the board in place, allows easier plugging in of USB, and a cleaner wiring design.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/lab.rapternet.us\/?p=1397\">EspDeck Version 1<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/lab.rapternet.us\/?p=1506\">EspDeck Version 2<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/lab.rapternet.us\/?p=2811\">EspDeck Version 3<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/lab.rapternet.us\/?p=1616\">EspDeck Automations<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"hardware\">Hardware<\/h2>\n\n\n\n<p>The hardware need to assemble the EspDeck is similar to earlier. It requires far fewer resistors from earlier, and this time around has customizable keycaps.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.amazon.com\/gp\/product\/B07L8W9SP3\/ref=ox_sc_act_title_5?smid=A2EX2NNY5B3RUB&amp;psc=1\">ESP-8266<\/a><\/li>\n\n\n\n<li>9 x Mechanical key switches<\/li>\n\n\n\n<li>9 x <a rel=\"noreferrer noopener\" href=\"https:\/\/www.adafruit.com\/product\/5039\" target=\"_blank\">Relegendable key caps<\/a> or water slide decal paper<\/li>\n\n\n\n<li>1 x 10k Resistor<\/li>\n\n\n\n<li>Hot glue<\/li>\n\n\n\n<li>3d printer filament<\/li>\n\n\n\n<li>Wire<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"upgrades-from-gen1\">Upgrades from Generation 1<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Better case design\n<ul class=\"wp-block-list\">\n<li>Supports the ESP board<\/li>\n\n\n\n<li>Allows for easier plugging in of USB cables<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Simpler wiring design\n<ul class=\"wp-block-list\">\n<li>No proto board<\/li>\n\n\n\n<li>Only one resistor<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Relegendable key caps<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"wiring\">Wiring<\/h2>\n\n\n\n<p>Using input pullup to avoid needing resistors in the design. This simplifies the wiring and makes assembly take less time. The two oddball inputs (GPIO15 and GPIO16) are covered later as to why they need special treatment, but I made sure my main wiring diagrams here were the final diagrams.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"380\" height=\"460\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/circuit-gen2-simplified.png\" alt=\"\" class=\"wp-image-1589\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/circuit-gen2-simplified.png 380w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/circuit-gen2-simplified-248x300.png 248w\" sizes=\"auto, (max-width: 380px) 100vw, 380px\" \/><figcaption class=\"wp-element-caption\">Complete Circuit with Provisions Mentioned Later<\/figcaption><\/figure>\n\n\n\n<p>Since the circuit is so simple, we can just simplify the diagram for easy viewing, each switch being the same as the next. This of course is for all switches but GPIO15 and GPIO16.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"240\" height=\"220\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/circuit3.png\" alt=\"\" class=\"wp-image-1541\"\/><figcaption class=\"wp-element-caption\">Simplified Circuit<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"case\">Case<\/h2>\n\n\n\n<p>The main drawback of the first case was that it didn&#8217;t support the ESP8266 at all in the case, the controller was just free floating. The new case fixes that by having screw mount points for the control board and better support to hold onto it. It also positions the board better for the USB port to be utilized (I hot glued in the cable on gen1 to avoid the free floating board plug in problem).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1920\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015051057-scaled.jpg\" alt=\"\" class=\"wp-image-1547\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015051057-scaled.jpg 2560w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015051057-300x225.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015051057-1024x768.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015051057-768x576.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015051057-1536x1152.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015051057-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Second Generation Case Including ESP Mount<\/figcaption><\/figure>\n\n\n\n<p>The new case design holds the ESP in place and supports bolting it in place. This will make it easier to plug and unplug unlike gen1 (which might be hot glued in place).<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1920\" data-id=\"1545\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015121878-scaled.jpg\" alt=\"\" class=\"wp-image-1545\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015121878-scaled.jpg 2560w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015121878-300x225.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015121878-1024x768.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015121878-768x576.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015121878-1536x1152.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015121878-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">ESP8266 in Place<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1920\" data-id=\"1546\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015117736-scaled.jpg\" alt=\"\" class=\"wp-image-1546\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015117736-scaled.jpg 2560w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015117736-300x225.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015117736-1024x768.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015117736-768x576.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015117736-1536x1152.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_015117736-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"assembly\">Assembly<\/h2>\n\n\n\n<p>The assembly process is very similar to the generation 1 deck. To start out with, we go to the key switches and the top plate, hot gluing them into place.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1920\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220129_184352469-1-scaled.jpg\" alt=\"\" class=\"wp-image-1552\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220129_184352469-1-scaled.jpg 2560w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220129_184352469-1-300x225.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220129_184352469-1-1024x768.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220129_184352469-1-768x576.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220129_184352469-1-1536x1152.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220129_184352469-1-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Switches Glued into Place<\/figcaption><\/figure>\n\n\n\n<p>Next up, wiring up all the keys to the ESP. This step is far quicker now that the protoboard and resistors aren&#8217;t need.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1920\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024329161-scaled.jpg\" alt=\"\" class=\"wp-image-1543\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024329161-scaled.jpg 2560w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024329161-300x225.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024329161-1024x768.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024329161-768x576.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024329161-1536x1152.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024329161-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Fully Soldered (Note, not the final wiring, hadn&#8217;t found the problems with GPIO15 and 16 yet)<\/figcaption><\/figure>\n\n\n\n<p>Test fitting everything into the case. I also included the protoboard for scale which isn&#8217;t needed anymore in the new design for scale.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1920\" data-id=\"1544\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024503951-scaled.jpg\" alt=\"\" class=\"wp-image-1544\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024503951-scaled.jpg 2560w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024503951-300x225.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024503951-1024x768.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024503951-768x576.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024503951-1536x1152.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024503951-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Mocked in Place in the Case<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1920\" data-id=\"1549\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024453376-scaled.jpg\" alt=\"\" class=\"wp-image-1549\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024453376-scaled.jpg 2560w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024453376-300x225.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024453376-1024x768.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024453376-768x576.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024453376-1536x1152.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/PXL_20220201_024453376-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Mocked up in the Case with Unused Circuit<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"using-windows-this-time-round\">Using Windows this Time Round<\/h2>\n\n\n\n<p>Running into a hardware failure on the Linux machine I used for development on the first generation, I had to fall back on my windows workstation. So setting up a brand new development environment.<\/p>\n\n\n\n<p>Following the basic instructions from ESPHome worked. I installed python 3 and used pip to install esphome and wheels following the directions. Once I had that ready, I needed to <a href=\"https:\/\/www.silabs.com\/documents\/public\/software\/CP210x_Windows_Drivers.zip\">install the driver for the ESP board<\/a>. Once the driver was installed, I could start flashing firmwares.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"debugging\">Debugging<\/h2>\n\n\n\n<p>Once I had the development environment up and running, I loaded the initial configuration into the ESP and found that I had a few problems to work out. The first is that GPIO 16 doesn&#8217;t support a pull-up resistor in the configuration.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1000\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image-1-1024x1000.png\" alt=\"\" class=\"wp-image-1561\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image-1-1024x1000.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image-1-300x293.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image-1-768x750.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image-1.png 1085w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">GPIO pin 16 \/ Keypad 1<\/figcaption><\/figure>\n\n\n\n<p>So I had to change keypad one to use an external pull-up resistor which I soldered to the bottom of the ESP8266. This let keypad 1 work, however I did run into a second issue as well.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"499\" height=\"565\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image.png\" alt=\"\" class=\"wp-image-1560\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image.png 499w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image-265x300.png 265w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><figcaption class=\"wp-element-caption\">This Time Around it was Keypad 1 and 9<\/figcaption><\/figure>\n\n\n\n<p>To get GPIO 15 working, I tried adding an external pull-up resistor, however this kept the ESP from booting since it tried to <a href=\"https:\/\/www.forward.com.au\/pfod\/ESP8266\/GPIOpins\/index.html\">boot from SD<\/a> (which there is none). Since the internal pull-up and external pull-up both fail for the basis, the input has to be opposite the others. GPIO 15 needs to be normally low with the button pulling it up.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.forward.com.au\/pfod\/ESP8266\/GPIOpins\/ESP8266BootOptions.jpg\" alt=\"\"\/><figcaption class=\"wp-element-caption\">GPIO 0, 2, 15 Special Modes<\/figcaption><\/figure>\n\n\n\n<p>With both of these fixes in place and wired, we can finally see the final layout.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"2560\" data-id=\"1566\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220202_0052533713022447864535716012-scaled.jpg\" alt=\"\" class=\"wp-image-1566\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220202_0052533713022447864535716012-scaled.jpg 1920w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220202_0052533713022447864535716012-225x300.jpg 225w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220202_0052533713022447864535716012-768x1024.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220202_0052533713022447864535716012-1152x1536.jpg 1152w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220202_0052533713022447864535716012-1536x2048.jpg 1536w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">GPIO16 and 15 Taken Care of<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1920\" data-id=\"1567\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_005257595-scaled.jpg\" alt=\"\" class=\"wp-image-1567\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_005257595-scaled.jpg 2560w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_005257595-300x225.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_005257595-1024x768.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_005257595-768x576.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_005257595-1536x1152.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_005257595-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">It Doesn&#8217;t Count if there&#8217;s no Hacks<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p>With the wiring completed, it was time to mount it in the case. I found a few screws that fit the holes and ESP board. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1920\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_010251989-scaled.jpg\" alt=\"\" class=\"wp-image-1568\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_010251989-scaled.jpg 2560w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_010251989-300x225.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_010251989-1024x768.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_010251989-768x576.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_010251989-1536x1152.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/PXL_20220202_010251989-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">ESP8266 Screwed into the Case<\/figcaption><\/figure>\n\n\n\n<p>One final step to make it easier to identify which keys are for which function, some relegendable key caps. I&#8217;ve only put 3 functions on it so far, so those are the ones with the custom keys, home mode, away mode, and toggle Christmas lights.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"2560\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220203_23072038191662339262889415-scaled.jpg\" alt=\"\" class=\"wp-image-1581\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220203_23072038191662339262889415-scaled.jpg 1920w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220203_23072038191662339262889415-225x300.jpg 225w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220203_23072038191662339262889415-768x1024.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220203_23072038191662339262889415-1152x1536.jpg 1152w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/pxl_20220203_23072038191662339262889415-1536x2048.jpg 1536w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Complete with 3 Keys Labeled<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configuration\">Configuration<\/h2>\n\n\n\n<p>With all the switches now pulling down the input IO, the configuration can be the same for all switches, however there are a few extra pieces to handle the normally high input now. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  - platform: gpio<br>    name: \"Keypad 1\"<br>    pin:<br>      number: 16<br>      mode:<br>        input: true<br>      inverted: true<br>    on_multi_click:<br>      - timing:<br>        - ON for at most 950ms<br>        - OFF for at least 500ms<br>        then:<br>          - lambda: !lambda |-<br>              id(key_1_click_state).publish_state(true);<br>          - delay: 500ms<br>          - lambda: !lambda |-<br>              id(key_1_click_state).publish_state(false);<br>      - timing:<br>        - ON for at least 1s<br>        then:<br>          - logger.log: \"Key 1 MultiHeld\"<br>          - lambda: !lambda |-<br>              id(key_1_held_state).publish_state(true);<br>          - delay: 1s<br>          - lambda: !lambda |-<br>              id(key_1_held_state).publish_state(false);<br>    on_double_click:<br>      min_length: 25ms<br>      max_length: 350ms<br>      then:<br>        - logger.log: \"Key 1 Double Click\"<br>        - lambda: !lambda |-<br>              id(key_1_double_click_state).publish_state(true);<br>        - delay: 1s<br>        - lambda: !lambda |-<br>              id(key_1_double_click_state).publish_state(false);<\/pre>\n\n\n\n<p>We just have to GPIO pins that need custom configuration from the rest. Starting with GPIO 16 which doesn&#8217;t have an internal pull-up.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  - platform: gpio<br>    name: \"Keypad 1\"<br>    pin:<br>      number: 16<br>      mode:<br>        input: true<br>      inverted: true<br>    on_multi_click:<br>.................................<\/pre>\n\n\n\n<p>The last pin is GPIO 15 which can&#8217;t use the default high and pull-down switches. This instead is defaulting low with the switch pulling up the value.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  - platform: gpio<br>    name: \"Keypad 9\"<br>    pin:<br>      number: 15<br>      mode:<br>        input: true<br>        pullup: false<br>      inverted: false<br>    on_multi_click:<br>........................<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"gen3-and-onwards\">Gen3 and Onwards<\/h2>\n\n\n\n<p>I&#8217;ve been given some ideas and added some of my own as well to the list. For now I&#8217;ll be sticking with the two keypads I&#8217;ve made so far until I see a need to start making more, in which case I&#8217;ll start working on more advanced designs.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>StreamDeck \/ FreeDeck style LCD screens on each key<\/li>\n\n\n\n<li>Battery powered<\/li>\n\n\n\n<li>Zigbee based<\/li>\n<\/ul>\n\n\n\n<p>Though in reality, generation 3 will probably just be optimizations to the design, especially to the case and installation, and I will likely look into a better way to handle my YAML without copying \/ pasting things 9 times.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>I&#8217;m very happy with the outcome of the second generation EspDeck. The quicker, simpler build combined with the nicer case made the entire experience much better. Integrating the a unit into home assistant was also smooth though now I have quite a few binary sensors all named similarly, so maybe I&#8217;ll need to dig into making those more unique for next time as well. I still have a lot of ideas I could use to make these better, but I&#8217;ve certainly scratched the itch I had.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">EspDeck Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/lab.rapternet.us\/?p=1616\">EspDeck Automations<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/lab.rapternet.us\/?p=1633\">Creating Icons for Relegendable Keycaps<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"resources\">Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/AeroSteveO\/EspDeck\" target=\"_blank\">EspDeck on GitHub<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/www.thingiverse.com\/thing:5223223\" target=\"_blank\">EspDeck on Thingiverse<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/www.youmagine.com\/designs\/espdeck\" target=\"_blank\">EspDeck on YouMagine<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/esphome.io\/\">EspHome<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/lab.rapternet.us\/?p=1397\">Generation 1 EspDeck Writeup<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>When I started into the EspDeck project, I had enough parts on hand to build two units. I had two sampler packs of switches and two ESP8266 boards to use. So once I had the gen1 unit built, I started working on generation 2 of the EspDeck. Gen2 has a well designed case that holds &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lab.rapternet.us\/?p=1506\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;EspDeck Generation 2&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1582,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,4],"tags":[90,76,74,38,39,75,49],"class_list":["post-1506","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-builds","category-how-to","tag-electronics","tag-espdeck","tag-esphome","tag-hardware","tag-home-assistant","tag-macropad","tag-smart-home"],"_links":{"self":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/1506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1506"}],"version-history":[{"count":52,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/1506\/revisions"}],"predecessor-version":[{"id":3532,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/1506\/revisions\/3532"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/media\/1582"}],"wp:attachment":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}