<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[What I Made Today]]></title><description><![CDATA[A true makers blog.]]></description><link>http://www.whatimade.today/</link><generator>Ghost 0.11</generator><lastBuildDate>Thu, 23 Apr 2026 20:00:20 GMT</lastBuildDate><atom:link href="http://www.whatimade.today/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Reseting HIKVISION DS-2CD1021 IP Camera Password]]></title><description><![CDATA[<h1 id="seefargofurther">See Far, Go Further</h1>

<p>(HIKVISION's slogan. Me likey)</p>

<p><situation> <br>
I've been running my <em>truenas</em> server at home for a couple of years now. Initially, I used it for media streaming and peer-to-peer file sharing :). Later on, I learned about this app - <a href="https://frigate.video/">Frigate NVR</a>, and learned that I can easily connect</situation></p>]]></description><link>http://www.whatimade.today/reseting-hikvision-ds-2cd1021-ip-camera-password/</link><guid isPermaLink="false">c897af69-dcf0-47a7-a975-d4a4db0adb22</guid><category><![CDATA[camera from pc]]></category><category><![CDATA[hikvision]]></category><category><![CDATA[Frigate]]></category><category><![CDATA[Truenas]]></category><dc:creator><![CDATA[GalBrandwine]]></dc:creator><pubDate>Fri, 07 Nov 2025 11:19:24 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2025/11/Screenshot-2025-11-07-120035-1.png" medium="image"/><content:encoded><![CDATA[<h1 id="seefargofurther">See Far, Go Further</h1>

<img src="http://www.whatimade.today/content/images/2025/11/Screenshot-2025-11-07-120035-1.png" alt="Reseting HIKVISION DS-2CD1021 IP Camera Password"><p>(HIKVISION's slogan. Me likey)</p>

<p><situation> <br>
I've been running my <em>truenas</em> server at home for a couple of years now. Initially, I used it for media streaming and peer-to-peer file sharing :). Later on, I learned about this app - <a href="https://frigate.video/">Frigate NVR</a>, and learned that I can easily connect my Google-Coral TPU to it, streaming video to models like YOLO, enjoying local high-level AI detections without choking my server's CPU. Like many NVR's Frigate tags and creates clips of captured interesting things; it runs inference both on video and audio streamed from the camera (So I could be alerted if there's a crying baby, or get a <code>fire-alarm</code> detection). Although applications that come with off-the-shelf cameras can do the same (usually for the price of some online storage), the privacy of running it locally is a relief.</situation></p>

<p>A few months back, I bought an IP camera and started tinkering with Frigate. <br>
Quickly learning that it is really powerful open-source software!</p>

<p><task> <br>
Having just 1 IP camera doesn't suffice. Wanted more coverage, I got this old IP camera - <strong>HIKVISION DS-2CD1021</strong> from a friend. <br>
These cameras's designed to work with a DVR, which creates a local network, with a fixed IP. <br>
Connecting it to my network did nothing since the camera is configured to have a static IP. <br>
I can configure it to DHCP through the camera's login page, but first I needed to access it...</task></p>

<hr>

<p><actions>  </actions></p>

<h2 id="step1readinghikvisionds2cd1021specshttpswwwhikvisioncomeuropeproductsipproductsnetworkcamerasvalueseriesds2cd1021i">Step 1 - <a href="https://www.hikvision.com/europe/products/IP-Products/Network-Cameras/value-series/ds-2cd1021-i/">Reading HIKVISION DS-2CD1021 specs</a></h2>

<p>Frigate can be configured to work with many streaming protocols. <br>
This camera supports many:</p>

<pre><code class="language-text">TCP/IP, ICMP, HTTP, HTTPS, FTP, DHCP, DNS, DDNS, RTP, RTSP, RTCP,  
NTP, UPnP, SMTP, SNMP, IGMP, QoS, IPv6, Bonjour, IPv4, UDP, SSL/TLS  
</code></pre>

<p>I will use the <strong>RSTP</strong>.</p>

<p>According to the specs, the default IP address is <code>192.168.1.64</code>. I need to create a static IP network with subnet <code>192.168.1.1</code>. Luckily, I have an <a href="https://www.omadanetworks.com/in/business-networking/omada-controller-cloud-software/omada-software-controller/">Omada</a> controller running on my TrueNAS server, which made this procedure rather easy:</p>

<p><img src="http://www.whatimade.today/content/images/2025/11/Screenshot-from-2025-11-05-10-45-19.png" alt="Reseting HIKVISION DS-2CD1021 IP Camera Password"></p>

<p>Also, I need to set my PC to have a static IP network connection: <br>
<img src="http://www.whatimade.today/content/images/2025/11/Screenshot-from-2025-11-05-10-54-55.png" alt="Reseting HIKVISION DS-2CD1021 IP Camera Password"></p>

<p>Now, I <em>should just</em> enter <code>192.168.1.64</code> in the browser and get a login screen of the camera. <br>
<strong>Sadly, and expectedly, it didn't work.</strong>, well, this camera is used and was connected to a DVR before, so my guess is that the default IP changed.</p>

<p>In their user guide, there's a Windows-only program called <a href="https://www.hikvision.com/en/support/tools/hitools/clea8b3e4ea7da90a9/">SADP</a> that automatically detects the connected camera's IP address. </p>

<p><strong>Switching to a Windows machine.</strong>: The SADP software surprisingly worked, figured out that the camera's IP is - <code>192.168.254.3</code>:</p>

<p><img src="http://www.whatimade.today/content/images/2025/11/Screenshot-2025-11-05-083426.png" alt="Reseting HIKVISION DS-2CD1021 IP Camera Password"></p>

<p>Once I've configured a static IP wired-network connection, I've managed to access <code>http://192.168.254.3/doc/page/login.asp</code> yey! Yet it was password-protected (and the obvious <code>admin</code> <code>admin</code> didn't work).</p>

<p>After some reading online:</p>

<ol>
<li>I need to use the SADP; select the problematic camera from the list, press the forget password, and export a code.  </li>
<li>Then send this code to the local HIKVISION vendor's tech support (In my case <code>tech@hviil.co.il</code>).  </li>
<li>They will return a generated XML file containing the temporary password.  </li>
<li>Using the SADP tool - I need to import this XML and insert a new password.  </li>
<li>I've successfully reset the password! Now we can start tinkering with it :)</li>
</ol>

<p>One last thing before integrating with Frigate - have a sanity test, and stream video-feed to VLC.</p>

<p><results> <br>
Using this URL  <code>rtsp://admin:anIPCamera1!@192.168.0.143:554/Streaming/Channels/101</code>, and voila!:</results></p>

<p><img src="http://www.whatimade.today/content/images/2025/11/Screenshot-2025-11-07-120035.png" alt="Reseting HIKVISION DS-2CD1021 IP Camera Password"></p>

<p>This camera will come in handy. <br>
It has two streaming channels. <br>
It supports up to 1080p, enough for object detection. <br>
It can be powered with PoE, which is generally a good thing <br>
Most importantly, adding it to should be straightforward, just expand my Frigate camera's config JSON file with this:</p>

<pre><code class="language-json">cameras:  
  hikvision_ds_2cd1021:
    ffmpeg:
      inputs:
        - path: rtsp://admin:anIPCamera1!@192.168.0.143:554/Streaming/Channels/101
          roles:
            - detect
        - path: rtsp://admin:anIPCamera1!@192.168.0.143:554/Streaming/Channels/102            
          roles:        
            - record # Changed to record for this camera, assuming it's the higher res for 510a
            - audio # Add this if you want to enable audio detection later   
    audio:
      enabled: True # &lt;- enable audio events for the upstairs camera         
      listen:
      - bark
      - fire_alarm
      - scream
      - speech
      - yell
    detect:
      width: 1280
      height: 720
      fps: 10
    objects:
      track:
        - person
        # - car
        - dog
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
    record:
      enabled: true
      retain:
        days: 7
        mode: motion
</code></pre>

<h4 id="yupplugandplay">Yup - plug and play :)</h4>

<p>In the image below, Frigate's UI, with 2 cameras. The left one is this HIKVISION</p>

<p><img src="http://www.whatimade.today/content/images/2025/11/Screenshot-2025-11-07-121457.png" alt="Reseting HIKVISION DS-2CD1021 IP Camera Password"></p>

<h4 id="finalthoughts">Final thoughts</h4>

<p>I must confess, HIKVISION's security is tight. <br>
Also, I was sceptical they would help me with this old 2018 IP camera that a friend gave me. <br>
Playing with Frigate is fun. But it's a fraction of what I plan:</p>

<p>Every frigate detection can be published over MQTT... (food for thought)</p>

<p>Cheers, Gal</p>]]></content:encoded></item><item><title><![CDATA[Flash Tasmota Firmware to a Sonoff Smart Socket]]></title><description><![CDATA[Learn how to flash Tasmota Firmware to a Sonoff Smart Socket, allowing you to control it through to your local network.]]></description><link>http://www.whatimade.today/flash-tasmota-firmware-to-a-sonoff-smart-socket/</link><guid isPermaLink="false">0f07c347-295e-44de-a7c6-435cc3bcd5bb</guid><category><![CDATA[ESP8266]]></category><category><![CDATA[esp32]]></category><category><![CDATA[tasmota]]></category><category><![CDATA[sonoff]]></category><category><![CDATA[smart plug]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Tue, 22 Jul 2025 12:28:22 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2025/07/4-1.jpeg" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2025/07/4-1.jpeg" alt="Flash Tasmota Firmware to a Sonoff Smart Socket"><p>As a vintage IOT enthusiast I used to flash my own ESPs with code I patched together in the Arduino IDE. My sketch would include WiFi and MQTT credentials along with a few "if then" instructions. I'd attach the ESP to a relay and configure things in Node Red running on a Raspi.</p>

<p>This was well and good at the dawn of IOT, but as commercial companies entered the field, things got more complicated.</p>

<p>Attempting to draw customers into their ecosystems, companies developed apps and protocols to work with <strong>only their</strong> devices. The result was that if you bought devices from several companies, not only would you need a specific app, but one company's devices wouldn't talk to another. Many of us ended up with entire panels of IOT apps just to control a few switches and lights around the house. To make matters worse, we'd end up using nefarious Chinese web servers that nobody really trusted.</p>

<p>The answer was to use Home Assistant or Node Red, but in each case, you needed an interface to make everything communicate.</p>

<h3 id="sonoff">Sonoff</h3>

<p><a href="https://sonoff.tech/">Sonoff</a> was among the first to produce useful commerical IOT devices. Using an ESP8266, their smarts were cheap, reasonable quality, and easily available. Eventually they developed <a href="https://www.aliexpress.com/item/1005007744935874.html?spm=a2g0o.productlist.main.10.37d4hr9Vhr9V5N&amp;algo_pvid=19806197-1521-43b5-aaa2-5b84846bf486&amp;algo_exp_id=19806197-1521-43b5-aaa2-5b84846bf486-9&amp;pdp_ext_f=%7B%22order%22%3A%22181%22%2C%22eval%22%3A%221%22%7D&amp;pdp_npi=4%40dis%21ILS%219.28%219.28%21%21%2119.44%2119.44%21%402140f54217531738513381534e4c25%2112000042067656247%21sea%21IL%21762050826%21X&amp;curPageLogUid=LeCf7EHltrTl&amp;utparam-url=scene%3Asearch%7Cquery_from%3A">Ewelink</a>, their cloud system to take control.</p>

<p>As they were among the first, and because the ESPs had started in the hobbyist realm, developers were quick to create Open Source firmware to enhance control of Sonoff devices. Hence <strong>Tasmota</strong> was born.</p>

<h3 id="tasmota">Tasmota</h3>

<p><a href="https://tasmota.github.io/docs/">Tasmota</a>, originally developed by Dutch Developer, Theo Arends, in January 2016, was designed to replace the factory firmware on Sonoff's ESP8266 devices. It was local, would allow simple menu-based configuration, and remove dependency on Sonoff's cloud-based services.</p>

<p>By logging into the web page broadcast by the ESP, the user can set Wifi credentials, MQTT, sensor pins, and a host of other parameters. It runs on anything from the  basic ESP8266 01 to the ESP32. It is OTA (Over The Air) and after nearly a decade of development, it is extremely stable and reliable. </p>

<p><img src="http://www.whatimade.today/content/images/2025/07/Screenshot-2025-07-21-at-19.46.30.png" alt="Flash Tasmota Firmware to a Sonoff Smart Socket"></p>

<p>Many Sonoff devices can happily run Tasmota firmware, and when they do, control is much more extensive, absent reliance on external Chinese servers.</p>

<h3 id="flashingtasmotatosonoffsmartplug">Flashing Tasmota to Sonoff Smart Plug</h3>

<p>These instructions relate to the Sonoff S26R2TPH Smart Plug.</p>

<p><img src="http://www.whatimade.today/content/images/2025/07/IMG_20250722_121715.jpg" alt="Flash Tasmota Firmware to a Sonoff Smart Socket"></p>

<p>Opening it up, look around the ESP chip to find the four pins V, RX, TX, and GND.</p>

<p><img src="http://www.whatimade.today/content/images/2025/07/WhatsApp-Image-2025-07-18-at-13.43.31.jpeg" alt="Flash Tasmota Firmware to a Sonoff Smart Socket"></p>

<p>On my particular board, I don't have the ESP8266, but the ESP8285 - a very similar chip but with 2MB of SPI flash built in. Tasmota can be flashed to the 8285 in  exactly the same way as the 8266.</p>

<p><img src="http://www.whatimade.today/content/images/2025/07/IMG_20250718_134408.jpg" alt="Flash Tasmota Firmware to a Sonoff Smart Socket"></p>

<p>Solder wires onto the four pads. I suggest Dupont wires as the other end will need to go to your <a href="https://www.aliexpress.com/item/1005007744935874.html?spm=a2g0o.productlist.main.10.37d4hr9Vhr9V5N&amp;algo_pvid=19806197-1521-43b5-aaa2-5b84846bf486&amp;algo_exp_id=19806197-1521-43b5-aaa2-5b84846bf486-9&amp;pdp_ext_f=%7B%22order%22%3A%22181%22%2C%22eval%22%3A%221%22%7D&amp;pdp_npi=4%40dis%21ILS%219.28%219.28%21%21%2119.44%2119.44%21%402140f54217531738513381534e4c25%2112000042067656247%21sea%21IL%21762050826%21X&amp;curPageLogUid=LeCf7EHltrTl&amp;utparam-url=scene%3Asearch%7Cquery_from%3A">FTDI USB To TTL Serial Adapter.</a></p>

<p>The ESP is exclusively 3.3v so don't use a 5v dongle. (I've used 5v on ESP Development Boards, but this is not a Dev Board and won't be 5v-tolerant.)</p>

<p>Make sure to connect the TX pad to the RX pin and the RX pad to the TX pin. Of course, V and GND go to the 3.3v pin and GND.</p>

<p><img src="http://www.whatimade.today/content/images/2025/07/4.jpeg" alt="Flash Tasmota Firmware to a Sonoff Smart Socket"></p>

<h3 id="webbasedtasmotabinariesandinstaller">Web-based Tasmota Binaries and Installer</h3>

<p>Fortunately, to flash the firmware, we no longer need to use Arduino IDE. It can be done directly from a web page. Personally, I use a Raspberry Pi for flashing because I find linux reliable, and the RasPi Chromium browser is devoid of bloatware and complications. </p>

<p><img src="http://www.whatimade.today/content/images/2025/07/Screenshot-2025-07-22-at-11.33.15.png" alt="Flash Tasmota Firmware to a Sonoff Smart Socket"></p>

<p>From <a href="https://ota.tasmota.com/tasmota/">this link</a>, download the binaries that are best suited to your needs. As I am using a simple on-off switch, tasmota-lite.bin is sufficient and ensures that I won't run out of memory as I'm flashing.</p>

<p>Use <a href="https://tasmota.github.io/install/">this link</a> to access the Tasmota flashing tool. </p>

<p><img src="http://www.whatimade.today/content/images/2025/07/Screenshot-2025-07-22-at-11.33.53.png" alt="Flash Tasmota Firmware to a Sonoff Smart Socket"></p>

<p>First, upload your factory.bin, then click Connect. Select your USB port.</p>

<h3 id="gpio0tognd">GPIO 0 to GND</h3>

<p>Instructions say that GPIO 0 needs to be grounded, so I spent half an hour trying to find a microscopic breakout pad for GPIO 0. After several failures, I realized that my smart switch had a button - could it be this simple?</p>

<p><img src="http://www.whatimade.today/content/images/2025/07/2-1.jpeg" alt="Flash Tasmota Firmware to a Sonoff Smart Socket"></p>

<p>So, I powered up the ESP with the button pressed, then released it. To my amazement, it worked.</p>

<h3 id="configuringwifi">Configuring WiFi</h3>

<p>At the end of the flashing process one of two things will happen. Either the flasher will ask if you want to set up WiFi, or it won't. If it doesn't, restart your ESP and search for a Tasmota SSID on your WiFi. It will automatically open a form for you to input your WiFi credentials. Once this is done, you should be able to access your Tasmota smart plug at its IP address on your local network.</p>]]></content:encoded></item><item><title><![CDATA[Today I used Oscilloscope]]></title><description><![CDATA[<p><img src="http://www.whatimade.today/content/images/2025/07/Gemini_Generated_Image_w3pz0lw3pz0lw3pz.png" width="50%" alt="Funny circuit board"></p>

<p>Recently, I got a new board at work, with a new sensor (STM's latest). <br>
I've been tasked to write a driver for it to expose its needed capabilities to our application running on Zephyr. </p>

<p>A decent task, not too <em>shabby</em>.</p>

<hr>

<p>When bringing up a board, one must first ensure that</p>]]></description><link>http://www.whatimade.today/today-i-used-oscilloscope-2/</link><guid isPermaLink="false">d4b942e6-3f95-4596-a97c-25ff300209f4</guid><category><![CDATA[oscilloscope]]></category><category><![CDATA[board bring-up]]></category><category><![CDATA[Zephyr]]></category><category><![CDATA[RTOS]]></category><category><![CDATA[ISM330BX]]></category><dc:creator><![CDATA[GalBrandwine]]></dc:creator><pubDate>Mon, 21 Jul 2025 08:00:20 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2025/07/Screenshot-from-2025-07-21-10-34-14-1.png" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2025/07/Screenshot-from-2025-07-21-10-34-14-1.png" alt="Today I used Oscilloscope"><p><img src="http://www.whatimade.today/content/images/2025/07/Gemini_Generated_Image_w3pz0lw3pz0lw3pz.png" width="50%" alt="Today I used Oscilloscope"></p>

<p>Recently, I got a new board at work, with a new sensor (STM's latest). <br>
I've been tasked to write a driver for it to expose its needed capabilities to our application running on Zephyr. </p>

<p>A decent task, not too <em>shabby</em>.</p>

<hr>

<p>When bringing up a board, one must first ensure that all pins and lines are connected according to the data sheet. One way to do it is with a small program that toggles all the CPU pins, and a fluke - measuring the expected pin gets turned on (in my case: changed from ~0 to 1.8v ).</p>

<p>Next, implement a minimal program that reads the <strong>HWO<em>_AM</em>_I</strong> register of the sensor. <br>
This register contains the sensor ID, ensuring we are communicating with the expected sensor. The ISM330BX is embedded in the new board with a SPI communication layout. So, this minimal program we'll need to support SPI communications.</p>

<p>The dataset provides the <strong>HWO<em>_AM</em>_I</strong> address; reading it is straightforward.</p>

<p><strong>If I succeed</strong>, it means I have correctly configured the SPI, i.e:
* Bit order is as expected (LSB/MSB)
* Communication frequency is acceptable
* The MISO/MOSI wires are connected correctly.</p>

<p>This also confirms that I'm communicating with the correct sensor, and we can proceed with writing the driver. <strong>yey!</strong></p>

<p><strong>But if things are not working</strong>, here's why I used an Oscilloscope :(</p>

<p><img src="http://www.whatimade.today/content/images/2025/07/WhatsApp-Image-2025-07-19-at-12.07.36-PM.jpeg" alt="Today I used Oscilloscope">
[Wires are a mess; suggestions for better organizing the wires are welcome.]</p>

<hr>

<p>I already know things are configured as expected:</p>

<ul>
<li>I've checked the wires - V.</li>
<li>I've checked the register address - V.</li>
</ul>

<p>Yet when reading the <strong>HWO<em>_AM</em>_I</strong> register over SPI, I get either <strong>0x00</strong>. Connecting an Oscilloscope will help "sniff" the SPI wires and understand the bits that flow over the MISO and MOSI wires. <br>
I use PicoScope 4000 Series (<em>borrowed it</em> from work, they cost too much to have one of my own).</p>

<h4 id="getting0x00">Getting <strong>0x00</strong></h4>

<p>0x00 means there's no feedback from the sensor:</p>

<ol>
<li>Either it doesn't get any power.  </li>
<li>Or is there an issue with the probe wires?  </li>
<li>Or (if using Zephyr RTOS like me) the <a href="https://docs.zephyrproject.org/latest/build/dts/index.html">DTS (<em>A devicetree is a hierarchical data structure primarily used to describe hardware</em>)</a> is not configured correctly.</li>
</ol>

<p>Investigating:</p>

<p>I've set up trigger events on the PicoScope to watch the ChipSelect (CS). <br>
Usually, when communicating over SPI, when CS falls to ~0 it means 'start SPI communication'.</p>

<p>In the image below, the CS line (black) didn't fall to ~0 as the others did: <br>
<img src="http://www.whatimade.today/content/images/2025/07/Screenshot-from-2025-07-19-12-33-29.png" alt="Today I used Oscilloscope"></p>

<p>Knowing the wires are connected correctly on the hardware side, I overlooked the <em>firmware side</em> - finding out the DTS wasn't configured correctly:</p>

<pre><code class="language-dts">&amp;spi0 {
    status = "okay";
    compatible = "nordic,nrf-spim";
    cs-gpios = &lt;&amp;gpio0 07 GPIO_ACTIVE_LOW&gt;; &lt;-------- Actually, the CS is connected to gpio1 07
    pinctrl-0 = &lt;&amp;spi0_default&gt;;
    bme280@0 {
        compatible = "bosch,bme280";
        reg = &lt;0&gt;;
        spi-max-frequency = &lt;1000000&gt;; /* conservatively set to 1MHz */
    };
};
</code></pre>

<p>Another iteration - fixing the DTS, building, flashing, and <em>voila</em>! <br>
You can see the CS line (black) falls to ~0 along other lines:</p>

<p><img src="http://www.whatimade.today/content/images/2025/07/Screenshot-from-2025-07-21-09-20-09.png" alt="Today I used Oscilloscope"></p>

<p><strong>Yet</strong>, the result of the <strong>WHO<em>_AM</em>_I</strong> is still <strong>0x00</strong> (also in the image above - the communication is not presented as SPI's digital waves, but rather messi). It means the MISO and MOSI wires are not behaving as expected!</p>

<p>From the DTS snippet above, the MOSI/MISO and clock are defined here - <code>pinctrl-0 = &lt;&amp;spi0_default&gt;;</code>. <br>
Looking at the <code>spi0_default</code> definition:  </p>

<pre><code class="language-dts">    spi0_default: spi0_default {
        group1 {
            psels = &lt;NRF_PSEL(SPIM_SCK, 0, 27)&gt;, &lt;--- Actually I need &lt;0 31&gt;
                &lt;NRF_PSEL(SPIM_MOSI, 0, 26)&gt;, &lt;--- Actually I need &lt;0 30&gt;
                &lt;NRF_PSEL(SPIM_MISO, 0, 29)&gt;; &lt;--- Actually I need &lt;1 08&gt;
        };
    };
</code></pre>

<p>Another iteration - fixing the DTS, building, flashing, and <em>voila</em> (hopefully)! <br>
In the image below, we can see the SPI communication! <br>
<img src="http://www.whatimade.today/content/images/2025/07/Screenshot-from-2025-07-21-10-05-22.png" alt="Today I used Oscilloscope"></p>

<p>Zooming in, looking at this image from left to right:</p>

<ol>
<li>MOSI (master-out-slave-in) command "read register <strong>WHO<em>_AM</em>_I</strong> register (from the data sheet address <strong>0xD0</strong>)  </li>
<li>MISI (Master-in-slave-out) response from the MISO line:  value <strong>0xEF</strong> - <strong>not the expected response value :(</strong></li>
</ol>

<p><img src="http://www.whatimade.today/content/images/2025/07/Screenshot-from-2025-07-21-10-08-32.png" alt="Today I used Oscilloscope"></p>

<p>Replacing the MISO wire on my setup did the trick! <strong>Now it is visible - MISO responds with the expected value</strong> <strong>0x58</strong>:</p>

<p>The red line is the clock, so we can see where there are 8 ticks (which means 8 bits, 1 byte) <br>
The yellow line is the MISO wire; when it is low, it is 0, and 1 when high. <br>
So, from left to right, we get:</p>

<p><strong>01011000b = 58h</strong></p>

<p>The expected response when reading the <strong>WHO<em>_AM</em>_I</strong> register yey!</p>

<p><img src="http://www.whatimade.today/content/images/2025/07/Screenshot-from-2025-07-21-10-38-17.png" alt="Today I used Oscilloscope"></p>

<h6 id="wearecommunicatingoverspiwithournewsensorhazzah">We are communicating over SPI with our new sensor, Hazzah!</h6>

<p>Now the <strong>real</strong> project can begin!</p>

<hr>

<h3 id="thoughts">Thoughts</h3>

<p>Using an Oscilloscope is something super helpful; it helps debug digital communication. <br>
And makes board-bring-up shorter</p>

<p>Cheers Gal.</p>]]></content:encoded></item><item><title><![CDATA[How to Make the "Tip the Balance" Bathroom Scale]]></title><description><![CDATA[Instructions for making an amazing bathroom scale that lets you lose weight in seconds.]]></description><link>http://www.whatimade.today/how-to-make-the-tip-the-balance-bathroom-scale-2/</link><guid isPermaLink="false">d6f23d9a-53de-4d0d-be47-7bf28e40b50e</guid><category><![CDATA[bathroom scale]]></category><category><![CDATA[ESP8266]]></category><category><![CDATA[Wemos D1 Mini]]></category><category><![CDATA[hx711]]></category><category><![CDATA[load sensor]]></category><category><![CDATA[lcd screen]]></category><category><![CDATA[I2C]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Tue, 01 Apr 2025 08:03:21 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2024/04/Screenshot-2024-04-18-at-13.21.33.png" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2024/04/Screenshot-2024-04-18-at-13.21.33.png" alt="How to Make the "Tip the Balance" Bathroom Scale"><p>If you've decided to make the <strong>Tip the Balance</strong> Bathroom Scale, you won't find instructions here! (If you insist on making it, you can find the code here.) This post, on the other hand, will tell you how to make a working bathroom scale.</p>

<h3 id="listofrecommendedcomponents">List of recommended components</h3>

<ul>
<li>ESP8266 microcontroller - I recommend the <a href="https://www.aliexpress.com/item/1005006246625522.html?spm=a2g0o.productlist.main.5.28d48Emh8Emhvs&amp;algo_pvid=28433c67-32a5-4dee-bc2d-2428b0d4d0c0&amp;algo_exp_id=28433c67-32a5-4dee-bc2d-2428b0d4d0c0-2&amp;pdp_npi=4%40dis%21USD%216.72%212.22%21%21%2148.49%2115.99%21%402103205217130333468475497ea9ff%2112000036485497613%21sea%21IL%21762050826%21&amp;curPageLogUid=ozVO3rwUYkC0&amp;utparam-url=scene%3Asearch%7Cquery_from%3A">wemos D1 mini</a> - about $2
<img src="http://www.whatimade.today/content/images/2024/04/Screenshot-2024-04-14-at-15.10.45.png" alt="How to Make the "Tip the Balance" Bathroom Scale"></li>
<li>Four generic 50 kg <a href="https://www.aliexpress.com/item/1005003634897674.html?spm=a2g0o.productlist.main.1.56eb1b39SojQ7h&amp;algo_pvid=8055b1d6-3e3a-4315-8c97-394e6dc30ad3&amp;algo_exp_id=8055b1d6-3e3a-4315-8c97-394e6dc30ad3-0&amp;pdp_npi=4%40dis%21USD%212.28%212.05%21%21%2116.45%2114.80%21%402101fb0f17130336220083131e23a4%2112000028144089073%21sea%21IL%21762050826%21&amp;curPageLogUid=A75Vz0ZoAbuE&amp;utparam-url=scene%3Asearch%7Cquery_from%3A">load sensors with HX711 Module </a> - about $3 for the entire set.
<img src="http://www.whatimade.today/content/images/2024/04/Screenshot-2024-04-14-at-15.12.27.png" alt="How to Make the "Tip the Balance" Bathroom Scale"></li>
<li><a href="https://www.aliexpress.com/item/1005006140674321.html?spm=a2g0o.detail.pcDetailTopMoreOtherSeller.1.e8babduNbduNHb&amp;gps-id=pcDetailTopMoreOtherSeller&amp;scm=1007.40050.354490.0&amp;scm_id=1007.40050.354490.0&amp;scm-url=1007.40050.354490.0&amp;pvid=64cc570c-f2be-46a9-ad6a-5aed6a4850c9&amp;_t=gps-id:pcDetailTopMoreOtherSeller,scm-url:1007.40050.354490.0,pvid:64cc570c-f2be-46a9-ad6a-5aed6a4850c9,tpp_buckets:668%232846%238111%231996&amp;pdp_npi=4%40dis%21USD%211.12%211.12%21%21%218.06%218.06%21%40210324bf17130337471838439e01d2%2112000035941542549%21rec%21IL%21762050826%21&amp;utparam-url=scene%3ApcDetailTopMoreOtherSeller%7Cquery_from%3A">16 x 2 LCD screen with I2C adapter</a>. $2
<img src="http://www.whatimade.today/content/images/2024/04/Screenshot-2024-04-14-at-15.13.26.png" alt="How to Make the "Tip the Balance" Bathroom Scale"></li>
<li>A base of wood or equivalent, about a 30cm (1 ft) square. </li>
<li>Access to a 3d printer.</li>
</ul>

<h3 id="puttingitalltogether">Putting it all together</h3>

<p>The hardest part of the build is constructing an assembly that allows the load sensor free movement under the base of the scale. To do this I used this frame produced by <a href="https://www.thingiverse.com/thing:4594801">ThomDietrich</a>. <br>
<img src="http://www.whatimade.today/content/images/2024/04/Screenshot-2024-04-14-at-15.28.50.png" alt="How to Make the "Tip the Balance" Bathroom Scale"></p>

<p>To that I added my own parts that are available on onshape <a href="https://cad.onshape.com/documents/ac851e4031b81b8ace476e33/w/481183634f6b5bdf7c82d45d/e/47b5f69ba6b89327f8800aa0?renderMode=0&amp;uiState=661bcb229849bb38e72c24ed">at this link</a>, and <a href="https://cad.onshape.com/documents/6a9e954bf2d87a18f5ce0b30/w/81e48a3a9a69c9919833d9cc/e/05747e6ff91f165ba493f39b?renderMode=0&amp;uiState=661bcb8bf01d416be1523270">this one</a>. <br>
<img src="http://www.whatimade.today/content/images/2024/04/Screenshot-2024-04-26-at-18.45.54.png" alt="How to Make the "Tip the Balance" Bathroom Scale"></p>

<p>When placed together, they form a solid foundation that allows pressure to be placed evenly over the load sensors.</p>

<p><img src="http://www.whatimade.today/content/images/2024/04/IMG_20240414_150327.jpg" alt="How to Make the "Tip the Balance" Bathroom Scale"></p>

<h3 id="wiring">Wiring</h3>

<h4 id="loadsensors">Load Sensors</h4>

<p>Each of the four load sensors has three wires, usually black, red and white. Black and red are usually 5v and GND - and should be connected in a loop to the 5v and GND pins on the wemos D1 mini. The white wire of each of the sensor is connected to one of the pins of the HX711. (For more details, see <a href="https://learn.sparkfun.com/tutorials/load-cell-amplifier-hx711-breakout-hookup-guide/all">Sparkfun instructions here.</a>)</p>

<p>The HX711 connects to the Arduino with only four pins. Naturally, 5v and GND go where you expect, and in my code below you'll see that the Data Pin (OUT) connects to wemos pin 0, and the Clock Pin (CLK) to pin 2. (See this pinout.)</p>

<p><img src="http://www.whatimade.today/content/images/2024/04/Screenshot-2024-04-16-at-13.34.45.png" alt="How to Make the "Tip the Balance" Bathroom Scale"></p>

<h4 id="thelcdscreen">The LCD Screen</h4>

<p>The screen has four wires emerging from the I2C adapter on the back. 5v and GND go to the usual places. SCL goes to GPIO5 on the wemos, and SDA connects to GPIO4. (See pinout below.)</p>

<h3 id="thewemoscode">The Wemos Code</h3>

<p>I need to alert you to three things: </p>

<ul>
<li>This is the code that will allow you to weigh yourself. The device works as a regular bathroom scale.</li>
<li>I have never formally studied coding. I generally pluck bits of code from other projects and fiddle with it until it does what I want it to do. Thus, the code below, is probably appalling. If anyone wants to volunteer to tidy it up, I'll be the first to accept.</li>
<li>The code defines the ESP32, yet it works on the wemos D1 mini. It's not a mistake.</li>
</ul>

<pre><code>#include "HX711.h" // library to read load sensors
#include &lt;LiquidCrystal_I2C.h&gt; // Library for LCD screen
LiquidCrystal_I2C lcd(0x27, 16, 2);

#define calibration_factor 23000.0
#define LOADCELL_DOUT_PIN  0
#define LOADCELL_SCK_PIN   2

HX711 scale;

// Code to set up web page on ESP
#ifdef ESP32
#include &lt;Arduino.h&gt;
  #include &lt;WiFi.h&gt;
  #include &lt;AsyncTCP.h&gt;
#else
  #include &lt;ESP8266WiFi.h&gt;
  #include &lt;ESPAsyncTCP.h&gt;
#endif
#include &lt;ESPAsyncWebServer.h&gt;

AsyncWebServer server(80);

const char* ssid = "your_ssid";  
const char* password = "your_password";

const char* PARAM_INPUT_1 = "input1";

String inputMessage;  // Inputs from the web page  
String inputParam;

//Web page that asks for input
const char index_html[] PROGMEM = R"rawliteral(  
&lt;!DOCTYPE HTML&gt;&lt;html&gt;&lt;head&gt;  
  &lt;title&gt;ESP Input Form&lt;/title&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;/head&gt;&lt;body&gt;
  &lt;form action="/get"&gt;
    Desired Weight in Kg: &lt;input type="text" name="input1"&gt;
    &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;&lt;br&gt;
&lt;/body&gt;&lt;/html&gt;)rawliteral";

void notFound(AsyncWebServerRequest *request) {  
  request-&gt;send(404, "text/plain", "Not found");
}

void setup() {  
  Serial.begin(9600);
  lcd.init();
  lcd.backlight();

// Load cell stuff
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
  scale.set_scale(calibration_factor);
  scale.tare();

  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  if (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("WiFi Failed!");
    return;
  }
  Serial.println();
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP());

  server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
    request-&gt;send_P(200, "text/html", index_html);
  });

  server.on("/get", HTTP_GET, [] (AsyncWebServerRequest *request) {
    // Remove the String declarations here

    if (request-&gt;hasParam(PARAM_INPUT_1)) {
      inputMessage = request-&gt;getParam(PARAM_INPUT_1)-&gt;value();
      inputParam = PARAM_INPUT_1;
    }
    else {
      inputMessage = "No message sent";
      inputParam = "none";
    }
    Serial.println(inputMessage);
    request-&gt;send(200, "text/html", "HTTP GET request sent to your ESP on input field (" 
                                     + inputParam + ") with value: " + inputMessage +
                                     "&lt;br&gt;&lt;a href=\"/\"&gt;Return to Home Page&lt;/a&gt;");
  });

  server.onNotFound(notFound);
  server.begin();
}

void loop() {  
  Serial.print(scale.get_units(), 1);

  Serial.print(inputParam + inputMessage + " kg"); // change to lb for pounds
  lcd.print(scale.get_units(), 0);
  lcd.clear();
  lcd.setCursor(6, 0);
  lcd.print(inputMessage + " kg"); // change to lb for pounds
  delay(2000);

}
</code></pre>]]></content:encoded></item><item><title><![CDATA[Garage Hobbyist Invents Device to let you Lose Weight in an Instant]]></title><description><![CDATA[This amazing invention sets new standards in weight loss and control.]]></description><link>http://www.whatimade.today/garage-hobbyist-invents-device-to-let-you-lose-weight-in-an-instant/</link><guid isPermaLink="false">00f42050-3110-44c1-8606-25764b451eff</guid><category><![CDATA[weight loss]]></category><category><![CDATA[hobbyist]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Tue, 01 Apr 2025 07:59:45 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2024/04/IMG_20240416_174728--1--1.jpg" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2024/04/IMG_20240416_174728--1--1.jpg" alt="Garage Hobbyist Invents Device to let you Lose Weight in an Instant"><p>Yes, you read the title right. No more arduous diets or cutting out snacks. No more exhausting exercises, or battling with feeble willpower. This amazing new device will take pounds (or kilos) off your weight at the literal blink of an eye.</p>

<p>How many times have you stepped gingerly onto your bathroom scales, dreading to peer down at the ascending numbers between your feet? Let’s be honest, how often have you dodged the scales altogether, eager to get out of the house before weight-depression pulls you down?</p>

<h3 id="dietaryexperts">Dietary Experts</h3>

<p>We all know about diets offered by “experts” that promise weight loss with minimum effort. Some work, some don’t, but to keep your weight down, they mostly rely on willpower to permanently change your lifestyle. These so-called "experts" ultimately want you to eat less junk food, exercise, and follow their strict regime of deprivation. </p>

<p>Come on, who really wants that?</p>

<h3 id="amateurhobbyist">Amateur Hobbyist</h3>

<p>At last, an amateur hobbyist working alone in his garage has created the perfect solution for instant weight loss, and without the drudgery of starvation diets and exhausting workouts! It’s a cutting-edge device that’s about to revolutionize the entire weight-loss industry.</p>

<p>Introducing the <strong>Tip the Balance</strong> Bathroom Scales. Instead of letting the scales lie about your weight, with a simple app on your phone, YOU get to tell the scales precisely what you want to weigh! </p>

<p>Yes, at last, internet-connected programmable bathroom scales using advanced AI technology that lets <strong>you</strong> decide <strong>your</strong> weight. Leave your house with a spring in your step, lively and refreshed, vitalized for the day ahead. No more dragging yourself to work, worrying what people think, or what your doctor says about your blood-sugar levels. A simple app and scales puts you in charge. You can weigh anything from 50 pounds to 200 - whatever you want!</p>

<h3 id="howitworks">How it works</h3>

<p>Operation couldn't be simpler. Step on the scales then launch the app or your phone. Punch in your desired weight - and voila... your new weight will instantly appear on the scale's screen!</p>

<h3 id="amazingfeatures">Amazing Features</h3>

<ul>
<li>Easily adjustable for Pounds or Kgs. </li>
<li>The <strong>Tip the Balance Bathroom</strong> Scale App can be accessed by any device on your home network.</li>
<li>Works with any browser on any phone, tablet, or computer.</li>
<li>With the right networking skills, you can broadcast your weight to the internet so that the whole world can watch you weigh in!</li>
<li>Can easily be used as a kitchen scale - but the inventor takes no responsibility for outcomes.</li>
</ul>

<h3 id="incrediblyinexpensive">Incredibly Inexpensive</h3>

<p>The <strong>Tip the Balance</strong> Bathroom Scales can be made for less than $10. Yes, <strong>less than $10,</strong> and you have instant relief from weight worries for the rest of your life.</p>

<h3 id="opensourceblueprints">Open Source Blueprints</h3>

<p>Not only is this amazing device now available, but its inventor has shared the entire blueprints. Now anyone with a bit of DIY knowledge, some soldering skills, a plank of wood, and a few dollars, can make their own <strong>Tip the Balance</strong> Bathroom Scales in a single afternoon.</p>

<p>For detailed instructions click <a href="http://www.whatimade.today/how-to-make-the-tip-the-balance-bathroom-scale-2/">here</a>.</p>]]></content:encoded></item><item><title><![CDATA[The Essential Breadboard Tool that Nobody Has]]></title><description><![CDATA[Solve the annoying problem of faulty Dupont wires before you place them.]]></description><link>http://www.whatimade.today/the-essential-breadboard-tool-that-nobody-has/</link><guid isPermaLink="false">ac07c790-c43f-42a9-953b-d8898ef740e5</guid><category><![CDATA[breadboard]]></category><category><![CDATA[Dupont]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Wed, 05 Feb 2025 13:25:37 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2025/02/IMG_20250205_151637.jpg" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2025/02/IMG_20250205_151637.jpg" alt="The Essential Breadboard Tool that Nobody Has"><p>How many hours in your life have you spent troubleshooting a project? </p>

<h3 id="knowingyouri2cfromyourspi">Knowing your I2C from your SPI</h3>

<p>You've spent ages connecting a bolognese of wires on your breadboard, making sure to distinguish your MISO from your MOSI, your SDA from your SCK, your DIN from your SDA, and your VCC from GND. You've already flashed your sketch to your ESP or pasted your python to your Pi. </p>

<p>Eagerly, you want to see your little display show the temperature of your sensor, or the stepper motor turn its gear. </p>

<p>You attach your power and....</p>

<p>Nothing.</p>

<p>You check your code and pinouts. </p>

<p>Power up again...</p>

<p>Nothing.</p>

<p>You check again.</p>

<p>Still nothing.</p>

<p>A loose connection obviously. Right? A faulty Dupont wire?</p>

<p>So you change the wires one at a time, laboriously disconnecting your spaghetti, making sure to place each new wire into precisely the right breadboard hole. As you do so, it disconnects from the other end, then you laboriously do the same with your device's pins.</p>

<p>How many times have you discovered that it was, in fact, a faulty wire? I know I have. Dozens of times. I must have spent scores of hours fault-finding, only to find that some stupid wire was invisibly disconnected from its little pin.</p>

<h3 id="thepianistwithinusall">The Pianist within us all</h3>

<p><img src="http://www.whatimade.today/content/images/2025/02/IMG_20250205_151353.jpg" alt="The Essential Breadboard Tool that Nobody Has">
You check your Duponts with your multimeter, right? You grip the pin against the probe, then fidget with your unfree hand to find the other pin, and press it to the other probe. Which works fine if it's a male to male. But what do you do with the females? The probe won't go in the hole, so you need to find the little metal tab at the side. Of course, you need to do it at both ends simultaneously - requiring the dexterity of a concert pianist. </p>

<p>It's just all one big mess</p>

<h3 id="thetoolyouneed">The Tool you Need</h3>

<p>Wouldn't it be wonderful if we had an easy way to check our Dupont wires for faults <strong><em>before</em></strong> we put then on the breadboard?</p>

<p>Surely such a tool exists, right? </p>

<p>Where else to look but Aliexpress - that has tools for problems that don't even exist.</p>

<p>Nada.</p>

<p>Nope, no Dupont wire tester.</p>

<h3 id="diy">DIY</h3>

<p>How hard can it be? Well, suffice to say, finding the parts in my bins of bits took longer than it took to build the tool. </p>

<p>And what a tool it is!</p>

<p>A buzzer, a breadboard, an LED and some headers. That's it. Designed to cater for male,  female, transgender, and other types of politically incorrect Dupont wires. This thing checks my wires - visually and audibly - in an instant, and I'm sure it's going to save me decades of troubleshooting.</p>

<p>I won't insult you with a circuit diagram.</p>

<p>If anyone comments about my missing LED resistor, I'll just ignore you; I have a million of them lying around and a split-second three volts isn't about to fry its little crown.</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/PMEuL1Iu4xM?si=Bfob2ZRT_u9hHXnA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>]]></content:encoded></item><item><title><![CDATA[Hack together a dirt-cheap LoRa transmitter/receiver dev board]]></title><description><![CDATA[Use an old ESP8266-12 dev board on an RFM98 LoRa transmitter/receiver.]]></description><link>http://www.whatimade.today/hack-together-a-dirt-cheap-lora-dev-board/</link><guid isPermaLink="false">b7a2bc9b-a1bb-4adb-b8bd-4da9b818af5c</guid><category><![CDATA[ESP8266]]></category><category><![CDATA[ESP8266-12]]></category><category><![CDATA[Arduino]]></category><category><![CDATA[LoRa]]></category><category><![CDATA[dronebotworkshop]]></category><category><![CDATA[RFM98]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Fri, 03 May 2024 15:10:04 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2024/05/Screenshot-2024-05-03-at-18.03.06.png" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2024/05/Screenshot-2024-05-03-at-18.03.06.png" alt="Hack together a dirt-cheap LoRa transmitter/receiver dev board"><p>LoRa is relatively new in IoT. (Actually, not that new, but it's taking time to percolate into the ecosphere.)</p>

<p>For those that don't know, LoRa stands for "Long Range."</p>

<p>We all know the problem of putting a great little sensor at the foot of our garden, then finding our WiFi is too weak. We've spent hours soldering the sensor to an ESP, installing a voltage regulator and resistors, writing the code, and incorporating everything into HA - only to find the WiFi just doesn't reach far enough.</p>

<p>And if we want the same sensor in the neighbour's garden 15 houses down the road, catching the data is just a pipe dream.</p>

<h3 id="longrangedatatransmission">Long Range Data Transmission</h3>

<p>This is where LoRa steps in. Not only does it transmit and receive over hundreds (even thousands) of meters, it's low power, and easily runs on a battery. You could read your temperature sensor from the other end of your farm, and if you have several LoRa boards, they can mesh together, extending their coverage further. </p>

<p>There are a few commercial dev boards available, starting around $20. If you're an Arduino jockey like me, you'll need two, to get them talking. </p>

<h3 id="rfm98">RFM98</h3>

<p>I hesitated to fork out for two more dev boards that would gather dust, waiting for my next inspiration. So I bought the cheapest LoRa board I could find - the $5 RFM98.</p>

<p><img src="http://www.whatimade.today/content/images/2024/05/Screenshot-2024-05-02-at-19.17.35.png" alt="Hack together a dirt-cheap LoRa transmitter/receiver dev board"></p>

<p>When my tiny parcel arrived from China, I looked at the boards with trepidation; they were far too small for a breadboard, and soldered wires would be a spaghetti nightmare.</p>

<p>So I threw them in a box with my ESPs and forgot all about them.</p>

<h3 id="esp826612">ESP8266-12</h3>

<p>Until last week, when I had a brainstorm. I had just desoldered an old ESP8266-12 from a broken device, when I noticed the board it was on. </p>

<p><img src="http://www.whatimade.today/content/images/2024/05/IMG_20240502_184852.jpg" alt="Hack together a dirt-cheap LoRa transmitter/receiver dev board"></p>

<p>I remembered the RFM98s and wondered if they would fit.</p>

<p>When I placed them on a spare board, I discovered they fit pefectly.</p>

<p><img src="http://www.whatimade.today/content/images/2024/05/IMG_20240502_184727.jpg" alt="Hack together a dirt-cheap LoRa transmitter/receiver dev board"></p>

<p>Of course, the pin numbers are wrong, and I had to remove the resistors, but the size and number of pins was identical.</p>

<p>Within half an hour I had two RFM98s soldered to boards, and hooked up to two Arduinos using dronebotworkshop's <a href="https://dronebotworkshop.com/lora/">excellent guide</a>. Everything was up and running in no time. </p>

<h3 id="200meterswithease">200 Meters with Ease</h3>

<p>These little boards are about 2cm sq. and I was excited to test their coverage. At night, I put the receiver on my balcony with its tiny white LED. I marched off to the end of the street, about 200 meters distant, and repeatedly pressed the transmitter button. Amazed I was to see the LED instantly turn on and off. </p>

<p>My next attempt will involve a friend with a phone who can report from a much further distance. </p>

<p>I haven't thought of a project yet, but the potential is huge and as I discovered, you never know when old stuff will come in handy.</p>]]></content:encoded></item><item><title><![CDATA[Make an Astonishingly Minimalistic Multicolor LED Display for Pennies]]></title><description><![CDATA[For less than $5 you can make a terrific portable WLED display with a old ESP8266 01.]]></description><link>http://www.whatimade.today/make-an-astonishingly-minimalistic-multicolor-led-display-for-pennies/</link><guid isPermaLink="false">f9235484-cbbb-483b-99f5-6110e16d6f94</guid><category><![CDATA[ESP8266]]></category><category><![CDATA[esp32]]></category><category><![CDATA[WS2812]]></category><category><![CDATA[WLED]]></category><category><![CDATA[QuinLED]]></category><category><![CDATA[TP4056]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Mon, 29 Jan 2024 09:05:50 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2024/01/IMG_20240129_100932-2.jpg" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2024/01/IMG_20240129_100932-2.jpg" alt="Make an Astonishingly Minimalistic Multicolor LED Display for Pennies"><p>A few months before Christmas, social media channels start filling with instructions about LEDs for home decoration. Popular software is <a href="https://kno.wled.ge/">WLED,</a> a program that describes itself as:  </p>

<blockquote>
  <p>A fast and feature-rich implementation of an ESP8266/ESP32 webserver to control NeoPixel (WS2812B, WS2811, SK6812) LEDs or also SPI based chipsets like the WS2801 and APA102!</p>
</blockquote>

<p>In layman's terms, WLED is a wonderful piece of open source software that allows users to remotely control and pre-progam amazing displays of LEDS of any length. It does this through a web interface that's accessible to any browser on the same network - and can be implemented with components costing almost no money at all.</p>

<p><img src="http://www.whatimade.today/content/images/2024/01/Screenshot-2024-01-29-at-10.43.11.png" alt="Make an Astonishingly Minimalistic Multicolor LED Display for Pennies"></p>

<h3 id="thehardware">The Hardware</h3>

<p>Most descriptions of hardware needed will be:</p>

<ul>
<li>an ESP32 or ESP8266 onto which the WLED code is flashed</li>
<li>appropriate LEDs</li>
<li>a power source. </li>
</ul>

<p>If you're just running a short strip, power is not really a problem, but if you're extending to many hundreds (or thousands) of LEDS, wiring can be challenging. Voltage injection may be required somewhere along your strips, your project may draw heavy currents, and you always have to be wary of the 3.3v logic limitation of your ESP - compared to higher voltages of your LEDs.</p>

<p>To circumvent the complexity, a few companies offer pre-constructed controllers. Just add power to one side, LEDs to the other, and off you go. A popular one is the <a href="https://quinled.info/">QuinLED LED Controller</a> that comes in several varieties to run anything from a single strip, to a multichannel sound &amp; light extravaganza. I started my own odyssey with the <a href="https://quinled.info/pre-assembled-quinled-dig-uno/">QuinLED-Dig-Uno</a> when I got fed up with wires trailing all over my workbench.</p>

<h3 id="flashingwled">Flashing WLED</h3>

<p>You can buy controllers with WLED pre-flashed, but if you have ESPs lying around, you may want to go DIY. Today, it couldn't be easier - no longer do you need the Arduino IDE. Through a browser <a href="https://install.wled.me/">you can flash straight to your ESP in less than a minute.</a>.</p>

<h3 id="thisiswhereitgetsinteresting">This is where it gets interesting</h3>

<p>If you're like me, you'll have some ESP8266s lying around the house, left over from the days before commercial companies entered the IoT arena. My board of choice is usually the <a href="https://www.wemos.cc/en/latest/d1/d1_mini.html">Wemos D1 Mini</a> because it's small, dirt cheap, and contains everything you need to get the job done. But before the dawn of the Wemos D1 and its ilk, I'd been using the <a href="https://www.microchip.ua/wireless/esp01.pdf">ESP8266 01</a>, that 8-legged temperamental little monster that's impossible to power, and offers a measly two GPIOs.</p>

<p><img src="http://www.whatimade.today/content/images/2024/01/esp8266-01.png" alt="Make an Astonishingly Minimalistic Multicolor LED Display for Pennies"></p>

<h3 id="chinesetreasure">Chinese Treasure</h3>

<p>Then I came across <a href="https://www.aliexpress.com/item/32894565049.html?spm=a2g0o.order_list.order_list_main.11.4b87180258DGCH">this</a> on AliExpress; a $1 device that purports to control WS2812 addressable LEDS straight from a ESP8266 01. Could it actually work?</p>

<p><img src="http://www.whatimade.today/content/images/2024/01/IMG_20240124_121813.jpg" alt="Make an Astonishingly Minimalistic Multicolor LED Display for Pennies"></p>

<p>I ordered a couple for $2 and waited on the Slow Boat from China.</p>

<p>While waiting, I got started on flashing WLED onto the ESP, using <a href="https://www.aliexpress.com/item/32980592935.html?src=google&amp;src=google&amp;albch=shopping&amp;acnt=494-037-6276&amp;slnk=&amp;plac=&amp;mtctp=&amp;albbt=Google_7_shopping&amp;albagn=888888&amp;isSmbAutoCall=false&amp;needSmbHouyi=false&amp;albcp=19366651860&amp;albag=&amp;trgt=&amp;crea=he32980592935&amp;netw=x&amp;device=c&amp;albpg=&amp;albpd=he32980592935&amp;gad_source=1&amp;aff_fcid=4bd360713d7f401da85435bf12a10fb4-1706202691286-00709-UneMJZVf&amp;aff_fsk=UneMJZVf&amp;aff_platform=aaf&amp;sk=UneMJZVf&amp;aff_trace_key=4bd360713d7f401da85435bf12a10fb4-1706202691286-00709-UneMJZVf&amp;terminal_id=2a0d9bca7121410891fddd69f7a5fd68&amp;afSmartRedirect=y">this</a> very-convenient $2 programming board. <br>
<img src="http://www.whatimade.today/content/images/2024/01/USB-ESP01-PROG--5--500x500.jpg" alt="Make an Astonishingly Minimalistic Multicolor LED Display for Pennies"></p>

<p>At the time, I wasn't aware that older (blue) ESP 01s have 512kB flash memory, and newer ones (black) have 1MB. I just plugged in what came to hand, and set the flasher running.</p>

<p>To cut a long story short, I couldn't get the 512kB to flash. Or rather, it flashed, but it wouldn't broadcast a WiFi access point.</p>

<p>This is the procedure that finally worked for me:</p>

<p>First I found a 1MB ESP in my old component box. </p>

<ul>
<li>I used <a href="https://github.com/Aircoookie/WLED/releases">WLED<em>0.14.1</em>ESP01.bin</a> with the ESP in programming mode. </li>
<li>Once flashed, get <strong>out</strong> of programing mode and searched for the ESP's WiFI access point.</li>
<li>Once connected, a window will open to input WiFi credentials. </li>
<li>I checked <strong>Force 802.11g</strong> because it's an old ESP 01, but don't know if it's necessary</li>
<li>The ESP should restart with WLED on your network.</li>
</ul>

<p>When the little boards arrived from Aliexpress, I checked their input voltage. Could I feed the board 5v without frying the ESP's 3.3v logic? Would the 5v board input drive the LEDs?</p>

<p>With both affirmed, I connected everything up and sat back in amazement. Here I was controlling a 120-LED strip of WS2812s on an ESP8266 01 through WLED. Excluding the strip, the components cost about $3!</p>

<p><img src="http://www.whatimade.today/content/images/2024/01/IMG_20240124_121829.jpg" alt="Make an Astonishingly Minimalistic Multicolor LED Display for Pennies"></p>

<h3 id="makingitportable">Making it Portable</h3>

<p>My next step was to see if it would work with a regular LiPo battery. As most readers know, their maximum voltage is generally 4.2v, a bit short of the needed 5v.</p>

<p>Here, I used one of the most useful boards I've come across. <a href="https://www.aliexpress.com/item/1005004847791346.html?src=google&amp;src=google&amp;albch=shopping&amp;acnt=494-037-6276&amp;slnk=&amp;plac=&amp;mtctp=&amp;albbt=Google_7_shopping&amp;albagn=888888&amp;isSmbAutoCall=false&amp;needSmbHouyi=false&amp;albcp=19366651860&amp;albag=&amp;trgt=&amp;crea=he1005004847791346&amp;netw=x&amp;device=c&amp;albpg=&amp;albpd=he1005004847791346&amp;gad_source=1&amp;aff_fcid=e1b0a5c3b2f14d94a80c6f204b7301e8-1706205076035-00790-UneMJZVf&amp;aff_fsk=UneMJZVf&amp;aff_platform=aaf&amp;sk=UneMJZVf&amp;aff_trace_key=e1b0a5c3b2f14d94a80c6f204b7301e8-1706205076035-00790-UneMJZVf&amp;terminal_id=2a0d9bca7121410891fddd69f7a5fd68&amp;afSmartRedirect=y">This TP4056 boost board</a> not only controls the charge and discharge of your LiPos through a convenient micro USB, but also boosts output up to a purported 27 volts.</p>

<p><img src="http://www.whatimade.today/content/images/2024/01/Screenshot-2024-01-29-at-9.21.24.png" alt="Make an Astonishingly Minimalistic Multicolor LED Display for Pennies"></p>

<p>I harvested an 18330 battery out an e-cigarette and stuck the rechargeable battery, booster, and ESP inside a small project box. I now have a fully-portable WLED-controlled 120-LED strip that cost pennies to construct.</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/HTQQvmymLRM?si=tloz4u-VG0lKBFNv" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>]]></content:encoded></item><item><title><![CDATA[Make a Raspberry Pi Pico Oscilloscope with 3d Printed Case]]></title><description><![CDATA[The Scoppy Oscilloscope is a great application for the RasPi Pico. This post points you to the necessary files - including a 3D printed case/stand.]]></description><link>http://www.whatimade.today/make-a-raspberry-pi-pico-oscilloscope-with-3d-printed-case/</link><guid isPermaLink="false">72573266-3964-454a-b3f4-84915dec34f7</guid><category><![CDATA[raspberry pi pico]]></category><category><![CDATA[scoppy]]></category><category><![CDATA[3d printing]]></category><category><![CDATA[prusa]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Mon, 24 Apr 2023 08:45:46 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2023/04/img_20230318_122237-copy.jpg" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2023/04/img_20230318_122237-copy.jpg" alt="Make a Raspberry Pi Pico Oscilloscope with 3d Printed Case"><p>Many readers of this blog will know that it's possible to make an oscilloscope/logic analyzer from the Raspberry Pi Pico. </p>

<p>Called <strong>Scoppy</strong>, full details are <a href="https://github.com/fhdm-dev/scoppy">on github</a>.</p>

<p>When I made a Scoppy with two resistors and a small breadboard a few weeks ago, I went looking for a case to put it in. Coming up empty-handed, I enquired on Reddit if anyone had an stl file to 3d print a suitable stand/case. </p>

<p><img src="http://www.whatimade.today/content/images/2023/04/img_20230318_122313-copy.jpg" alt="Make a Raspberry Pi Pico Oscilloscope with 3d Printed Case"></p>

<p>I received just a single response - from a Redditor who simply said, "I'll design one for you."</p>

<h3 id="precision">Precision</h3>

<p>Over the next couple of weeks we sent messages to one another, and eventually, he/she sent me an stl to try on my printer. I'm not so great at measuring dimensions, but somehow he/she got it all spot-on first time around. When I say it was "spot-on" I mean the USB socket sat <strong>exactly</strong> in the middle of the case's hole. It was unbelievable for a first attempt so I enquired how he/she had done it with such precision. The response was: </p>

<blockquote>
  <p><em>"I found an image online of a pico sitting on a breadboard so i tried to pixel-count it with the dimensions I had off the micro-usb port."</em></p>
</blockquote>

<p>Seriously... <strong>a pixel count?</strong> </p>

<p><img src="http://www.whatimade.today/content/images/2023/04/iddts2vtxkna1-1.jpeg" alt="Make a Raspberry Pi Pico Oscilloscope with 3d Printed Case"></p>

<p><img src="http://www.whatimade.today/content/images/2023/04/spgkyh5txkna1.jpeg" alt="Make a Raspberry Pi Pico Oscilloscope with 3d Printed Case"></p>

<h3 id="humiliation">Humiliation</h3>

<p>My favorite Redditor then went on to amuse me when he/she apologized for taking so long. (2 weeks!)</p>

<p>"I had exams," he/she said. </p>

<p>Assuming I was dealing with a student of Industrial Design I enquired, "what are you studying?"</p>

<p>"I'm still at school," came the humiliating reply.</p>

<h3 id="bananas">Bananas</h3>

<p>Anyway, once I'd printed the case, I ordered a few <a href="https://www.aliexpress.com/item/1005004131358473.html">banana sockets from Aliexpress</a> and when they arrived, I put it all together with an old Nexus 6P I had lying around the house.</p>

<p>If you're interested in the stand/case, he/she posted the files <a href="https://www.printables.com/de/model/428044-scoppy-oscilloscope-casing/comments">on the Prusa 3d Printer Site</a>.</p>

<p><img src="http://www.whatimade.today/content/images/2023/04/IMG_20230424_112914-1.jpg" alt="Make a Raspberry Pi Pico Oscilloscope with 3d Printed Case"></p>

<p>From the Prusa site, I now know I've had the pleasure of working with DerKipo @DerKipo_693686 - who, it would seem, is in Germany. </p>

<p>Thank you DerKipo. And good luck with your exams!</p>]]></content:encoded></item><item><title><![CDATA[Make a Weather Station with an ESP32 and a WeAct 2.13 inch EPaper Screen]]></title><description><![CDATA[This post explains how to get a popular github weather station sketch to work with the WeAct 2.13in Epaper screen.]]></description><link>http://www.whatimade.today/make-an-openweathermap-display-with-an-esp32-and-a-weact-2-13-inch-epaper-screen/</link><guid isPermaLink="false">6bb53428-e549-401e-bf2b-d0f82a9c49f3</guid><category><![CDATA[esp32]]></category><category><![CDATA[NTP Server]]></category><category><![CDATA[WeAct 2.13]]></category><category><![CDATA[Epaper]]></category><category><![CDATA[Openweathermap]]></category><category><![CDATA[Openweathermap.org]]></category><category><![CDATA[WeAct]]></category><category><![CDATA[G6EJD]]></category><category><![CDATA[Wemos D1 32]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Sat, 11 Mar 2023 16:03:53 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2023/03/IMG_20230311_121303.jpg" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2023/03/IMG_20230311_121303.jpg" alt="Make a Weather Station with an ESP32 and a WeAct 2.13 inch EPaper Screen"><p>This post is more of a Public Service Announcement that a real "how to" explanation.</p>

<p>A couple of weeks ago I acquired a <a href="https://www.aliexpress.com/item/1005004644515880.html">WeAct 2.13 inch epaper screen from Aliexpress</a>. The price of such screens is falling continually, so they are now within easy reach of almost any maker.</p>

<p>When it arrived, I set about making a weather station. A search of the internet revealed <a href="https://github.com/G6EJD/ESP32-e-Paper-Weather-Display">this excellent piece of coding</a>  that not only displays the weather on the screen, but questions <a href="http://www.whatimade.today/make-an-openweathermap-display-with-an-esp32-and-a-weact-2-13-inch-epaper-screen/openweathermap.org">openweathermap.org</a> for regular updates. It also plucks the correct time from an NTP Server, then draws a beautiful rendering on the screen.</p>

<p>I won't go into a lot of detail as G6EJD's Github is self-explanatory and comprehensive.</p>

<p>However, when I got my arduino code to compile for the Wemos D1 32 mini microcontroller I intended to use, all I could get was the border around the screen. Nothing else showed up at all.</p>

<p>After several hours of research, I finally found the problem.</p>

<p><img src="http://www.whatimade.today/content/images/2023/03/IMG_20230311_121303--1--1.jpg" alt="Make a Weather Station with an ESP32 and a WeAct 2.13 inch EPaper Screen"></p>

<p>If you are using the WeAct 2.13 B&amp;W screen, you need to change this:  </p>

<pre><code>GxEPD2_BW&lt;GxEPD2_213_B73, GxEPD2_213_B73::HEIGHT&gt; display(GxEPD2_213_B73(/*CS=D8*/ EPD_CS, /*DC=D3*/ EPD_DC, /*RST=D4*/ EPD_RST, /*BUSY=D2*/ EPD_BUSY));  
</code></pre>

<p>to this:</p>

<pre><code>GxEPD2_BW&lt;GxEPD2_213_B74, GxEPD2_213_B74::HEIGHT&gt; display(GxEPD2_213_B74(/*CS=D8*/ EPD_CS, /*DC=D3*/ EPD_DC, /*RST=D4*/ EPD_RST, /*BUSY=D2*/ EPD_BUSY));  
</code></pre>

<p>You need to change the screen to GxEPD2<em>213</em>B7<strong>3</strong> to GxEPD2<em>213</em>B7<strong>4</strong>.</p>

<p>Once you've done that, the rest should work.</p>]]></content:encoded></item><item><title><![CDATA[Getting an IKEA Motion Sensor to work in Node Red]]></title><description><![CDATA[I struggled to get an IKEA (zigbee) motion sensor working with Node Red. This is how I finally got them talking.]]></description><link>http://www.whatimade.today/making-an-ikea-motion-sensor-work-in-node-red-2/</link><guid isPermaLink="false">3f84e993-6493-4869-ac27-43c9c848dc3f</guid><category><![CDATA[IKEA]]></category><category><![CDATA[Raspberry-pi]]></category><category><![CDATA[node red]]></category><category><![CDATA[PIR]]></category><category><![CDATA[home automation]]></category><category><![CDATA[raspberry pi]]></category><category><![CDATA[zigbee]]></category><category><![CDATA[zigbee2mqtt]]></category><category><![CDATA[cc2532]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Sat, 02 Jul 2022 11:34:20 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2022/07/IMG_20220630_131750.jpeg" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2022/07/IMG_20220630_131750.jpeg" alt="Getting an IKEA Motion Sensor to work in Node Red"><p>I usually start my posts by warning readers that I'm an amateur with no background in coding or electronics. I write these blogs because while I'm figuring out how to do things, I'm working at ground level and my descriptions are generally simple enough for others like myself to follow. There are few complicated tech terms - just idiot-proof directions. That said, this post assumes a working knowledge of Raspberry Pi and Node Red.</p>

<p>This particular project was one of the most challenging I've encountered. I slogged for days trying to figure out why is wasn't working. Hopefully this post will save others some trouble.</p>

<h3 id="homeautomationwithnodered">Home Automation with Node Red</h3>

<p>My entire home automation is controlled by Node Red running on a RasPi. I tried Home Assistant a long time ago, but I found it much more complicated than NR. Dragging wires around is much easier for me than deciphering yaml scrips. </p>

<p>My Node Red incorporates MQTT.</p>

<h3 id="rfirandwifi">RF, IR and WiFi</h3>

<p>Node Red communicates with devices all over the house. Until now, everything was either RF, IR or WiFi. The WiFi devices I built myself with ESP8266s, and Raspberry Pis. A connected Broadlink hub does most of the IR and RF work. Searching whatimade.today will turn up dozens of examples.</p>

<h3 id="motionsensorpir">Motion Sensor (PIR)</h3>

<p>One of the devices I've always wanted for my arsenal is a motion (PIR) sensor. I've built several of them, but always faced the same problems. First, I could never make them stable - the WiFi signal somehow interfered and gave me repeated false positives. I tried all sorts of shielding, but nothing worked - I just couldn't trust the output. </p>

<p>The second thing was power. Both the ESP and the PIR sensor need constant voltage - and no small amount of current. Even 18650s couldn't be relied on for long.</p>

<p>So, all my PIR attempts were eventually abandoned.</p>

<h3 id="ikea">IKEA</h3>

<p>I began my Home Automation odyssey around 2016, a couple of years before commercial gadgets flooded the market. I started by flashing ESP8266s and connecting them to relays. It was about two years later that Sonoff entered the field - then all the rest piled on.</p>

<p>IKEA joined the fray (at least in my part of the world) around 2019. By then, my house was automated with WiFi, RF and IR. IKEA used Zigbee, which wasn't on my radar.</p>

<h3 id="goodqualitylowcost">Good Quality, Low Cost</h3>

<p>During a recent saunter around IKEA I came across their smart bulbs and switches and realized they're well priced and pretty good quality. Maybe there <em>was</em> place for them in my home automation after all? The Motion Sensor intrigued me most  - it operates on a couple of CR2032s and claims to work for months. </p>

<p>I put one into my basket along with a dimmable smart bulb. My intention was to get it all working with Node Red without an IKEA hub. (At the time I wasn't even aware that I could pair the bulb to the sensor directly, without the need for anything in between.)</p>

<h3 id="connectingtonodered">Connecting to Node Red</h3>

<p>Zigbee needs its own controller and I'm pleased to say they can be <a href="https://www.aliexpress.com/item/1005002353625526.html?spm=a2g0o.order_list.0.0.1d211802dVXBm6">acquired from Aliexpress</a> for a few dollars. The CC2531 can be purchased without firmware, but this requires you to flash it yourself. As I was unfamiliar with the whole process, I bought one already flashed with "SONOFF Zigbee for Zigbee2mqtt." <br>
<img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-30-at-17.32.41.png" alt="Getting an IKEA Motion Sensor to work in Node Red">
When I bought it, I had no idea how it would work. Indeed, with it being a "Sonoff" I didn't know if it would work at all with an IKEA device. (To be honest, I still don't know. I tried to find out if there's a difference between regular CC2532 zigbee2mqtt firmware and that of Sonoff, but I never found the answer. If anyone knows, maybe you can leave a comment).</p>

<p>My CC2531 device arrived and then I set about understanding how to make it work.</p>

<h3 id="settingupthecc2531">Setting up the CC2531</h3>

<p>The first thing you need to do is get your RasPi communicating with the dongle. It's a USB device but Raspberry Pi OS doesn't know what to do with it without the necessary firmware.</p>

<p>Most of the instructions you'll need can be found at <a href="http://www.whatimade.today/making-an-ikea-motion-sensor-work-in-node-red-2/zigbee2mqtt.io">zigbee2mqtt.io</a>. It's a terrific place for information, but for those lacking experience, you'll need to read it carefully.</p>

<p>Here's an example. If you hit the "Getting Started" page, it takes you to <a href="https://www.zigbee2mqtt.io/guide/getting-started/#installation">this page</a>:</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-30-at-17.50.23.png" alt="Getting an IKEA Motion Sensor to work in Node Red"></p>

<p>I immediately started typing commands... until, half way down the page I noticed the sentence, <em>"It's assumed, that you've a recent version of Docker and Docker-Compose is installed."</em> </p>

<p>Of course I didn't, so all my typing and running commands had already filled up my pi with redundant crap that I didn't know how to get rid of!</p>

<p>After a bit more clicking around the site, I found the <a href="https://www.zigbee2mqtt.io/guide/installation/01_linux.html">Linux instructions page</a>.</p>

<p>I followed the instructions to the letter and the dongle was quickly installed.</p>

<h3 id="zigbee2mqttio">zigbee2mqtt.io</h3>

<p>Next step is to install zigbee2mqtt in Node Red. This is also pretty simple. Go to <em>Manage Palette</em> and install this: <br>
<code>
node-red-contrib-zigbee2mqtt <br>
</code></p>

<p>Once that's done, you need to get the zigbee2mqtt bridge node to recognize your zigbee devices. For me, this meant putting my IKEA bulb and Motion Sensor into pairing mode and waiting for my dongle to find them. At zigbee2mqtt.io there's <a href="https://www.zigbee2mqtt.io/supported-devices/">a detailed page with instructions</a> for all the devices that are known to pair with it. </p>

<p>Once your devices are in pairing mode tell your bridge to search.</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-30-at-18.15.22.png" alt="Getting an IKEA Motion Sensor to work in Node Red"></p>

<p>For me, that too, went without a hitch. Within five minutes my bulb and sensor were neatly registered.</p>

<p>So far, so good, I hear you say. What's so complicated about that? Everything went smoothly until now.</p>

<p>Yes, it did. But it's from this point on that I got tied in knots <strong>for six solid days</strong>.</p>

<p>My Bulb worked fine; with simple commands from an Input Node, I could switch it on and set its brightness without a problem.</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-30-at-18.25.52.png" alt="Getting an IKEA Motion Sensor to work in Node Red">
<img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-30-at-18.25.16.png" alt="Getting an IKEA Motion Sensor to work in Node Red"></p>

<p>But the Motion Sensor was another story altogether. Although it was recognized by the Bridge, it detected nothing. Zilch. I jumped up and down in front of it for hours, waving my arms, and it paid no attention. I brought Significant Other to join me, but our combined bulk did nothing to attract its attention. At first I thought it was faulty, but along the way I paired it directly with the bulb - and it worked perfectly.</p>

<p>To be honest, I wasn't sure how to get zigbee2mqtt to talk to mqtt. Yes, it's written in technical gobbledegook everywhere, but no matter what I did, it didn't work, so I assumed it was my ignorance. I spent days searching forums (fora?), quizzing Google, and trying to understand what I didn't understand.</p>

<p>No videos on youtube covered my very specific problem with the Motion Sensor and I couldn't find a blog post anywhere that dealt with the issue. (Which is one of the reasons I'm writing this.)</p>

<p>I even posted on a Node Red Facebook group. Of the two answers I got, one recommended I migrate to Home Assistant, and the other that "you don't need a hub with IKEA devices" - which kind of missed the point.</p>

<p>It literally took me days and days, looking everywhere and trying everything and I was getting really, really frustrated. <a href="https://notenoughtech.com/home-automation/adding-devices-to-zigbee2mqtt-the-easy-way/">This page</a> confirmed that I was doing everything right, but for the life of me, no matter what I did, <strong>I could not get the Motion Sensor to activate. It simply ignored all movement.</strong> It was supposed to be, simple, but nothing worked.</p>

<p>Each day I'd arrive with another idea. Each day, I tried something else. I even set everything up on another experimental RasPi, away from my daily Node Red. </p>

<p>Still nothing.</p>

<h3 id="daysixandeureka">Day Six and Eureka!</h3>

<p>The attentive reader will have noticed, that at the top of this post, I wrote <em>"I had no idea how it would work. Indeed, with it being a "Sonoff" I didn't know if it would work at all with an IKEA device."</em></p>

<p>It had been niggling at me for days. Was it possible that the Dongle Firmware is the problem? Even if the Sonoff firmware <em>IS</em> compatible with IKEA, (which I still don't know) I <em>did</em> buy the thing for pennies from Aliexpress so I couldn't really expect top quality.</p>

<p>I had nothing to lose. If the thing only worked with the bulb, it wasn't much use for all my other automation ideas. </p>

<p>But, how could I update the Dongle? I don't have the necessary <a href="https://www.aliexpress.com/item/1005002008671236.html?spm=a2g0o.productlist.0.0.4db375ffM4OFie&amp;algo_pvid=4e0ab9d2-57d1-49bd-9b89-4bea786c7c97&amp;algo_exp_id=4e0ab9d2-57d1-49bd-9b89-4bea786c7c97-0&amp;pdp_ext_f=%7B%22sku_id%22%3A%2212000018394717771%22%7D&amp;pdp_npi=2%40dis%21ILS%21%2126.49%21%21%21%21%21%400b0a119a16566056208568506e4e8d%2112000018394717771%21sea">CC Debugger</a> and I didn't want to wait weeks for it to arrive from Aliexpress - let alone fork out for something I'd only use once. <br>
<img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-30-at-19.13.56.png" alt="Getting an IKEA Motion Sensor to work in Node Red"></p>

<p>Then I discovered <a href="https://www.zigbee2mqtt.io/guide/adapters/flashing/alternative_flashing_methods.html">this page</a>. that showed me how I could do it with a RasPi.  </p>

<p><img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-30-at-19.20.20.png" alt="Getting an IKEA Motion Sensor to work in Node Red"></p>

<p>The biggest problem was the microscopic connector on the CC2532. I have quite a collection of JST connectors, but nothing as tiny as this guy.</p>

<p>Fortunately, I'm quite a whiz at micro-soldering and this was an appropriate challenge.</p>

<p>Following the wiring diagram very closely, I soldered one end of a JST cable onto the designated pins of the dongle connector.</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/IMG_20220630_131741.jpeg" alt="Getting an IKEA Motion Sensor to work in Node Red"></p>

<p>It's not a very neat job, but I only need it to run once.</p>

<p>Into the other side of the cable, I plugged Dupont wires. This made it easy to plug the appropriate wires into the RasPi pins. (Note, when I did the flashing, the dongle was NOT plugged into the Pi USB. Instead it gets its power from the 3.3v pin of the RasPi.)</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/IMG_20220630_131750.jpeg" alt="Getting an IKEA Motion Sensor to work in Node Red"></p>

<p>It's imperative to get the wiring right, so in my case, I had to pay very close attention to the fact the Dupont wires were a different colour from the JST wires. With a continuity meter I also checked that the wires were connected ONLY to the correct pins on the dongle. (The pins are so small, it's easy to bridge between them). I also had to make sure I was looking at my RasPi pins the right way up.</p>

<p>The only problem I had was that WiringPi was not in my RasPi and I had to get it from somewhere. If you run the script as it appears <a href="https://www.zigbee2mqtt.io/guide/adapters/flashing/alternative_flashing_methods.html">on the page</a>, it won't work because WiringPi has been abandoned by its creator. However, following instructions <a href="https://learn.sparkfun.com/tutorials/raspberry-gpio/c-wiringpi-setup">on this page</a> will get you what you need.</p>

<h3 id="imnolongerinvisible">I'm no longer invisible</h3>

<p>When I plugged my re-flashed dongle back into my Pi, nothing worked. Even the bulb wouldn't light. Then I realized that I'd wiped everything clean, so I did the pairing business again and reconfigured the Node Red Bridge. Immediately, without a moment's delay, my motion sensor spotted me! Within two minutes, I had it ringing a bell, then turning on my irrigation. At last it's working and I'm a very satisfied blogger.</p>]]></content:encoded></item><item><title><![CDATA[Today I made WALK UP! - The alarm clock that will walk you off the bed]]></title><description><![CDATA[<p>Hi there! my name is Elad and I recently joined the crew here on <a href="http://www.whatimade.today/today-i-made-walk-up-the-alarm-clock-that-will-walk-you-off-the-bed-2/Whatimade.today">Whatimade.today</a>. I'm happy to be here and I hope you'll enjoy reading :) </p>

<p>I am an early riser and usually have no problem waking up in the morning. Yet sometimes, especially during long periods of not</p>]]></description><link>http://www.whatimade.today/today-i-made-walk-up-the-alarm-clock-that-will-walk-you-off-the-bed-2/</link><guid isPermaLink="false">d770eb16-32ce-41c5-a72f-fe4d43dd5d60</guid><dc:creator><![CDATA[Elad Yifrah]]></dc:creator><pubDate>Wed, 15 Jun 2022 22:29:29 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2022/06/20220616_004233-min.jpg" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2022/06/20220616_004233-min.jpg" alt="Today I made WALK UP! - The alarm clock that will walk you off the bed"><p>Hi there! my name is Elad and I recently joined the crew here on <a href="http://www.whatimade.today/today-i-made-walk-up-the-alarm-clock-that-will-walk-you-off-the-bed-2/Whatimade.today">Whatimade.today</a>. I'm happy to be here and I hope you'll enjoy reading :) </p>

<p>I am an early riser and usually have no problem waking up in the morning. Yet sometimes, especially during long periods of not enough sleep, I find the everyday smartphone alarm clock isn't doing the trick... I just don't hear it. Another thing I noticed is that once I get off the bed and take a few steps - I'm good to go - its just getting to those few steps that may require... some special measures 🤔</p>

<p>I have a Garmin hand watch that's on me all the time, even when I sleep. <strong>MAYBE I could do something with it?</strong> I found the <a href="https://developer.garmin.com/connect-iq/overview/">Connect IQ SDK</a> and at first glance considered developing an application for my watch, only to later find out the specific model I'm using is not supported. <br>
I went through a few other design alternatives, and eventually decided to create a hybrid of few of them: I will use my Garmin as a sensor, and build a "waking up mechanism" around it. I named the project  <strong>" Walk Up! "</strong> and it took me a few evenings/nights to complete.  </p>

<p><img src="http://www.whatimade.today/content/images/2022/06/walk_up.drawio-1.png" alt="Today I made WALK UP! - The alarm clock that will walk you off the bed"></p>

<p>In this post I will briefly go through the moving parts of the project, and talk about the main features of each. This will not be a full code review, but an abstract overview. For the Full code, please refer to the <a href="https://bit.ly/3mS8t9j">Git repository</a>.</p>

<h3 id="thealarmclockside">The Alarm-clock side:</h3>

<p>The Physical unit to actually play the the alarm consists of the following: </p>

<ul>
<li>ESP32  </li>
<li>Amplifier module (pam8403) </li>
<li>40mm loudspeaker. </li>
<li>0.96" OLED</li>
</ul>

<p>This Unit is merely an alarm clock that can be turned on and off over MQTT. All the logic is implemented in the Python3 code that runs on the RPi. </p>

<p>To control the amplifier module and play sound I used XTronical's <a href="https://www.xtronical.com/the-dacaudio-library-download-and-installation/">XT_DAC_Audio</a> library. The library is generally great to use, but a bit hard to set up. I got it to work using an old version of the ESP32 board manager (V1.0.5) on the Arduino IDE. I could not get it to work properly on my usual PlatformIO over Visual Studio Code settings. A few hours of writing code without code-completion and proper syntax highlighting, and a few of tweaking the WAV file with <a href="https://www.audacityteam.org/">Audacity</a> and I had the speaker roaring my childhood's theme song (comment if you recognize it :D). </p>

<p>This was an interesting experience since I never tinkered with audio before. It was rather thought provoking too: two semesters ago I took a course in signal processing. One of the main themes in the course was the sampling error vs the quantization error tradeoff, the meaning and origin of the two and the mathematical means of minimizing them. Those ideas, Despite being fundamental (and rather simple, maybe) left a strong impression on me. When dealing with audio relying on MCUs and 8Bit mechanisms, adding to that the limited memory in the ESP, and those two mathematical objects hit you right in the face. In a good way though. </p>

<p>For the MQTT aspect of the code I used the popular PubSubClient library. </p>

<p>The OLED shows some messages, indicating the current state of the system. <br>
<img src="http://www.whatimade.today/content/images/2022/06/20220613_190311.jpg" alt="Today I made WALK UP! - The alarm clock that will walk you off the bed"></p>

<h3 id="theraspberrypisside">The Raspberry Pi's side:</h3>

<p>The Pi has a double role here really.  <strong>First,</strong> it runs (constantly) the scheduling daemon that allows me to set new alarms anytime I wish, using my phone or laptop over my home network. <strong>Second,</strong> when the previously set alarm time comes, it runs the program that turns the ESP32-based alarm clock on, and then continuously polls Garmin's server to check whether the set number of steps is reached, turning the alarm off when it is. Let's dive deeper. </p>

<h5 id="alarmschedulingdaemon">Alarm scheduling daemon:</h5>

<p>The daemon is implemented in Python3 and mainly uses the time package, and the paho.MQTT module that is an MQTT driver for python. The Daemon "listens" for alarm requests (Over a dedicated MQTT Topic), and upon receiving a new alarm request, It invokes a Built-in scheduling mechanism in Linux to actually set the alarm-routine. I chose to use the already existing Linux's <a href="https://linux.die.net/man/1/at">"at" utility</a> (a less popular sibling of the Cron utility) as the actual scheduling mechanism. The main benefit is, well...  that it's there already,and works well. Furthermore, it is reboot proof(thus power outage proof), and with it I can trigger any other program I wish, in any set time. The at utility is invoked from within the python code. I created a cron job for the daemon program, thus the Raspberry Pi invokes it right after booting. <br>
<img src="http://www.whatimade.today/content/images/2022/06/daeomn.drawio.png" alt="Today I made WALK UP! - The alarm clock that will walk you off the bed"></p>

<h5 id="alarmroutine">Alarm-routine:</h5>

<p>This is the program that actually triggers the alarm. As previously mentioned, it is invoked at the destined time and sends an "alarm_on" message to the ESP32 unit. After turning the alarm on, it continuously polls Garmin's servers using a dedicated <a href="https://github.com/cyberjunky/python-garminconnect">API wrapper</a>. This wrapper works flawlessly, and is worth checking if you have any Garmin device. It is simple and intuitive to use. <br>
When the desired number of steps is reached-The routine sends "alarm_off", and exits. <br>
<img src="http://www.whatimade.today/content/images/2022/06/alarm-routine.drawio.png" alt="Today I made WALK UP! - The alarm clock that will walk you off the bed"></p>

<h3 id="someimages">Some images:</h3>

<p><img src="http://www.whatimade.today/content/images/2022/06/20220615_105005.jpg" alt="Today I made WALK UP! - The alarm clock that will walk you off the bed">
<img src="http://www.whatimade.today/content/images/2022/06/20220615_233025.jpg" alt="Today I made WALK UP! - The alarm clock that will walk you off the bed">
<img src="http://www.whatimade.today/content/images/2022/06/WhatsApp-Image-2022-06-15-at-17.22.43.jpeg" alt="Today I made WALK UP! - The alarm clock that will walk you off the bed"></p>

<p>A video:  </p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/T9q2LnzJcRc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

<h3 id="finalthoughts">Final thoughts:</h3>

<p>This one was fun. It was relatively quick to make and I gained some new skills and knowledge working on it. It is sub-optimal in some ways, mainly since I decided to utilize already-existing tools, at the expense of a simpler, minimalist architecture and fewer moving parts. Some future improvements I may add are on device alarm setting, alarm canceling ability, improved audio and maybe other "wake-up" goals: Rope jumping, Heart rate levels etc. All in all, I'm happy with the way it came out, and it definitely works- and that's what it's all about for me.</p>

<p>Thanks for reading.</p>

<p>Elad   </p>]]></content:encoded></item><item><title><![CDATA[The Idiot's guide to making Volos Project's Beautiful Smart Watch]]></title><description><![CDATA[Troubleshooting construction of Volos Project's Smart watch]]></description><link>http://www.whatimade.today/the-idiots-guide-to-making-volos-projects-beautiful-smart-watch/</link><guid isPermaLink="false">cc8e1af7-034d-4cda-a38b-5f9632183db6</guid><category><![CDATA[esp32]]></category><category><![CDATA[ESP8266]]></category><category><![CDATA[DS3231]]></category><category><![CDATA[raspberry pi pico]]></category><category><![CDATA[GC9A01]]></category><category><![CDATA[volosprojects]]></category><category><![CDATA[smart watch]]></category><category><![CDATA[CH34XSER driver]]></category><category><![CDATA[CH9102X driver]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Fri, 10 Jun 2022 08:59:16 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2022/06/What-1.jpg" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2022/06/What-1.jpg" alt="The Idiot's guide to making Volos Project's Beautiful Smart Watch"><p>As I've mentioned so many times in my blog posts, I've never studied electronics or engineering. Consequently, I come at my projects entirely as an amateur - which means that when I finally figure out how to do something, I'm able to guide others like myself through the technical complexities, explaining step-by-step how to get things working.</p>

<p>For about a year I've been a keen follower of <a href="https://www.youtube.com/c/VolosProjects">Volos Projects</a> on Youtube. His work is outstanding and he makes really attractive gadgets. More than once I've found myself ordering parts simply so that I could build one of his projects.</p>

<p>This happened last month when I came across his <a href="https://www.youtube.com/watch?v=y_H7HM0oyoo&amp;t=400s">GC9A01 240x240 display video</a>. It just looked so good, I immediately ordered one from <a href="https://www.aliexpress.com/wholesale?catId=0&amp;initiative_id=SB_20220609051857&amp;SearchText=GC9A01&amp;spm=a2g0o.home.1000002.0">Aliexpress</a>.</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-11-at-11.46.02.png" alt="The Idiot's guide to making Volos Project's Beautiful Smart Watch"></p>

<p>When I was ordering it, I was aware that I didn't have an ESP32, but I assumed that my trusty old ESP8266 Dev Boards would suffice.</p>

<h3 id="lessononebewareofmyfirstmistake">Lesson One: Beware of my first mistake</h3>

<p>The screen arrived in a surprisingly short time, and I set about scouring Google for instructions. </p>

<p>First, I thought I'd get the screen up and running with an Arduino Uno - just to see that it works. I connected everything up, and only after I'd failed repeatedly did I realize that my version of the GC9A01 <strong>is not 5v tolerant</strong>. Of course, in my amateur stupidity, I believed that connecting the VCC pin on the screen to 3.3v on the Arduino was sufficient. It was only afterwards that I realized that the <strong>Arduino Digital Pins are 5v</strong> - and I could have ruined the screen before I even got started.</p>

<h3 id="esp8266">ESP8266</h3>

<p>Worried now that I'd damaged the GC9A01, I was desperate to see any image at all. As I knew that the ESP8266 is 3.3v, I searched for a script to get it working. I tried various libraries and Youtube videos, but still I couldn't get an image. I was convinced I'd destroyed it with over-voltage.</p>

<h3 id="raspberrypipico">Raspberry Pi Pico</h3>

<p>In a last-ditch effort, I pulled out a Raspberry Pi Pico and after some searching, I found concise <a href="https://www.pcbway.com/project/shareproject/Raspberry_Pi_Pico_with_GC9A01_Round_Display_using_Arduino_IDE_and_TFT_eSPI_Library.html">instructions on the PCBWay</a> website. After connecting all my wires, I finally got the GC9A01 working with the excellent Arduino <a href="https://github.com/Bodmer/TFT_eSPI">TFT-eSPI library</a>. At this stage, all I could do was view the library's examples (of which there are many), but at least I confirmed that the screen hadn't been damaged.</p>

<h3 id="esp32">ESP32</h3>

<p>But I was still determined to make Volos's watch, and the only way I could do that would be to acquire an ESP32.</p>

<p>So I waited for China Post to bring it. I <a href="https://www.aliexpress.com/item/1005004230550198.html?spm=a2g0o.order_list.0.0.40451802Rl5b2i">ordered a cheapie</a>, assuming they're all basically the same. It arrived about two weeks later.</p>

<p>In preparation, I plugged the ESP32 into my Mac and fired up Arduino, intent on flashing blink.</p>

<p>Of course, the serial port was nowhere to be seen. Nothing. I tried various permutations of pushing the ESP's buttons, both while it was powered and during power-up. Nothing at all. Dead as a doorpost. </p>

<p>So then I Googled it.</p>

<h4 id="serialchip">Serial Chip</h4>

<p>Turns out the cheap versions of the latest ESP32's come with a different serial programming chip. So, first I looked at the specs on the Alixexpress page. It authoritatively informed me that the chip is a CH9102X. So, off I went in search of a the Mac driver for the CH9102X. A quick search revealed <a href="http://www.whatimade.today/the-idiots-guide-to-making-volos-projects-beautiful-smart-watch/(https://arduino.stackexchange.com/questions/88522/drivers-for-ch9102x-serial-port-chip)">this post.</a> Now, if you look carefully, you'll notice something that I didn't - which gave me another hour of confusion and frustration. </p>

<p>While the question asked in stackexchange refers to the CH9102X, the link that's given is for a driver for the CH34XSER chip. I didn't notice, and simply <a href="http://www.wch.cn/downloads/CH34XSER_MAC_ZIP.html">downloaded the CH34XSER</a> driver. I then went through the extremely nerve-wracking procedure of installing it into my Mac while ignoring progressively-hysterical security warnings as I went along.</p>

<p>As instructed, I restarted my Mac, entered Arduino, and plugged in my ESP32.</p>

<p>It was there! I could see it!</p>

<p>I loaded up the blink example, changed my board to ESP32, and hit upload. It compiled the code and went into upload, and .... <strong>ERROR!</strong> </p>

<p>I tried again.... </p>

<p><strong>ERROR!</strong> </p>

<p>I couldn't figure it out and being the amateur that I am, assumed it was still a driver problem. I tried all sorts of things and nothing worked. </p>

<p>Fortunately, with the driver, comes a small instruction manual. Even more fortunately - unlike the site itself - the manual is in English. It contains a wee bit of troubleshooting so I diligently followed the instructions.</p>

<p>To see if my driver was installed properly, within Mac Terminal:</p>

<p><code>cd /dev
ls tty.wch*</code></p>

<p>If the result is something like <strong>tty.wchusbserial21311</strong> the driver is properly installed.</p>

<p>I did this, and yes, my driver was properly installed.</p>

<p>I tried again - but still it Errored on the upload. At this stage, I still hadn't noticed that the driver I'd installed wasn't the driver mentioned on the Aliexpress specs page.</p>

<p>After some more fiddling, I suddenly noticed - I'd installed the wrong driver. I went looking for the CH9102X driver - but I kept coming back to the CH34XSER page. </p>

<p>Aha, I thought, why not look at the chip itself! </p>

<p>I took a closeup with my phone and expanded the photo on my screen. The chip was clearly a CH340G!</p>

<h4 id="lessontwodontrelyonaliexpressspecs">Lesson Two - don't rely on Aliexpress specs</h4>

<p>So, in the end, I HAD installed the correct driver - and the specs on Aliexpress were wrong.  Hence, my second Public Service Announcement: if Ali's specs say it's a CH9102X chip, check to see if it is, in fact, a CH3400.</p>

<p>So why wouldn't the damned thing upload?</p>

<p>I spent another couple of hours trying it on another computer, pressing buttons, searching Google, and scratching my head. I even tried another cable.</p>

<h4 id="itsthecableagainidiot">It's the cable again, Idiot!</h4>

<p>I <a href="http://www.whatimade.today/your-cable-may-be-cutting-your-power-supplys-output-by-more-than-half-heres-why/">learned a long time ago</a> that we should always use the shortest cable possible. Most of mine are 15cm. </p>

<p>So, I tried another cable - but it still didn't work. I was about to give up for the night when I had a brainstorm.</p>

<p>I looked down at my Mac. For convenience purposes, I have a USB extension cable permanently attached. It's so much easier to plug and unplug that way, rather than reaching to the back of my Mac Mini. Aware that long USB cables sap power, I connected my 15cm cable to the ESP32 and plugged it <strong>directly</strong> into the Mac.</p>

<p>Blink uploaded in a blink and my little LED starting flashing!</p>

<p>This had never happened before with an ESP8266 or a RasPi Pico. There wasn't enough power getting to the ESP32 to flash it.</p>

<h3 id="gettingtovolos">Getting to Volos</h3>

<p>Now that I was successfully flashing my ESP, it was time to get back to the Volos watch.  I opened up <a href="https://www.youtube.com/watch?v=XM_6qEAdFnM">VolosProject's video</a> and went looking for the wiring diagram. First I searched at his <a href="https://github.com/VolosR/watchESP">GitHub page</a> but it only contained the code. So then I just looked at his amazing video. It was pretty clear where each wire should go, so I wired mine the same.</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-09-at-18.05.39.png" alt="The Idiot's guide to making Volos Project's Beautiful Smart Watch"></p>

<p>With my new-found skills of ESP32 flashing, I downloaded his excellent code, stuck it in the Arduino IDE, and hit UPLOAD. The sketch flashed in an instant.</p>

<p>Nothing. Blank screen. Not a cheep.</p>

<h4 id="yetanotherwildgoosechase">Yet another wild goose chase</h4>

<p>So now I thought it was my wiring. My first assumption was that my ESP wasn't configured the same as the one in the video. I looked closely and noticed that his RX2 and TX2 pins are labeled D16 and D17 on my board. Everything else looked fine, but this particular observation sent me on a pointless quest for the pinout of my precise ESP32 board. I must have looked at hundreds of them, but I couldn't find my exact board. Fortunately, more than one photo indicated that D16 and D17 can be RX2 and TX2 - so I was making progress, but still nothing would work.</p>

<p>By this time, I was just jumping around from point to point on his video, looking for something I'd missed. On one such jump, at minute 4:12, he mentions his previous video that explains how to set up the display.</p>

<p>So back I go to his <a href="https://www.youtube.com/watch?v=y_H7HM0oyoo&amp;t=0s">previous video</a> and there at the bottom of his description is the pin setup!</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-09-at-18.19.44.png" alt="The Idiot's guide to making Volos Project's Beautiful Smart Watch"></p>

<h4 id="itssohardwhenyouveneverbeentrained">It's so hard when you've never been trained...</h4>

<p>So there I had it, the MISO pin, the MOSI pin, the SCLK pin - everything you could want.  Except that my screen was labeled:</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-11-at-11.44.44-1.png" alt="The Idiot's guide to making Volos Project's Beautiful Smart Watch"></p>

<p>So which pin was MOSI? Which was MISO, and SCLK - is that the same as SCL?</p>

<p>More Googling. More searching. What's the difference between MISO and MOSI and how do they relate to SCL and SDA? Around in circles I went, getting more and more confused.</p>

<p>Come on, Dear Reader, you've got to admire my perseverance. I've been at this for hours and I refuse to give up.</p>

<h3 id="nearlythere">Nearly there</h3>

<p>I must have spent about two hours on MISO and MOSI, SPI and I2C and about every other electronics acronym in the book. I was still searching for my wiring problem, and getting nowhere at all.</p>

<h4 id="whatstheequivalentofrtfmforvideowtfv">What's the equivalent of RTFM for video? WTFV?</h4>

<p>In the end, I did what I should have done at the outset: watch the F..ing video! In it, Mr. Volos tells his viewers specifically what to do. This includes, among other things, going into the TFT.eSPI library and adjusting the Setup200_GC9A01.h file.</p>

<p>Obedient as I am, I opened the file and saw this pinout defined:</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/pinout.jpg" alt="The Idiot's guide to making Volos Project's Beautiful Smart Watch"></p>

<p>Always looking to do it the hard way, I then tried to figure out with pins to change. Which of them is MISO? - it's not mentioned there at all. It does say, <em>"In some display driver board, (sic) it might be written as "SDA" and so on."</em> - but to the amateur this doesn't help me very much.</p>

<p>In the end, and in despair, I just decided to comment out all existing pins, and simply copy the new ones exactly as Mr. Volos had written them. I was skeptical because I couldn't see how the LED back-light could be the MISO pin.</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-09-at-18.34.21.png" alt="The Idiot's guide to making Volos Project's Beautiful Smart Watch"></p>

<p>I watched through to the end of the video then powered up the ESP32.</p>

<p>I couldn't believe my eyes. After several hours of struggling, a very unstable Volos Watch appeared on the screen. It has lines all over it, but at least I was one step closer.</p>

<p>Power, I thought. The RTC - which requires 5v - is draining power from the screen. I turned it all off and looked for the VIN pin on the ESP. I then attached it to the RTC's VCC. I powered up again, and finally I had a perfect picture!</p>

<h3 id="settingthetime">Setting the time</h3>

<p>Of course, that wasn't the end of it. The time showed 3:49 and it was 11pm. It was also about seven months ahead of me and it certainly wasn't Wednesday!</p>

<p>My Volos Watch was showing the time it got from the RTC, so I needed to set the latter's time. I'd had experience before of the <a href="https://www.adafruit.com/product/3013">DS3231 Real Time Clock (RTC).</a> In the past I'd found some obscure library to do this, but as usual, it wasn't simple; it required manually setting the time and date, and predicting what time it would be when the sketch had finished uploading! I knew there must be an easier way.</p>

<p>Fortunately, I found it in <a href="https://registry.platformio.org/libraries/adafruit/RTClib">Adafruit's RTC Library</a>. All I needed to do was load up the DS3231 example and the library read my system time, then set it precisely on the RTC.</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/Screen-Shot-2022-06-09-at-19.02.37.png" alt="The Idiot's guide to making Volos Project's Beautiful Smart Watch"></p>

<h3 id="staplesareyourfriend">Staples are your friend</h3>

<p>I love the way Volos presents his projects. It's always so neat, compact and tidy. I wanted to emulate this as best I could, so I utilized one of my favourite wiring techniques. As you'll see from the photo, by using regular staples, you can cut down wiring considerably and it makes for a very neat package.</p>

<p><img src="http://www.whatimade.today/content/images/2022/06/IMG_20220610_100918.jpg" alt="The Idiot's guide to making Volos Project's Beautiful Smart Watch"></p>

<h3 id="whoisgoingtocreatea3dprintablecase">Who is going to create a 3d printable case?</h3>

<p>Now I have a beautiful, compact watch attached to a mini breadboard, but obviously it needs a case. I tried to make something in Tinkercad but like everything else I design, it was just circles and squares and looked like a 7 year-old's creation. Anyone ready to design something wonderful?</p>]]></content:encoded></item><item><title><![CDATA[Make a Remote Temp Sensor with Permanent Display inside your House]]></title><description><![CDATA[<p>Most of us use a phone app to see the temperature outside - which is fine if you don't mind receiving a reading from a sensor located at a meteorological station somewhere nearby. </p>

<p>And when we finally <em>do</em> set up our own IoT sensors, to see them, we need to</p>]]></description><link>http://www.whatimade.today/make-a-remote-temp-sensor-with-permanent-display-inside-your-house/</link><guid isPermaLink="false">db3b67d4-8026-4a31-919d-5a2cf54f0dc5</guid><category><![CDATA[ESP8266]]></category><category><![CDATA[raspberry pi]]></category><category><![CDATA[mqtt]]></category><category><![CDATA[node red]]></category><category><![CDATA[DS18B20]]></category><category><![CDATA[Wemos D1 Mini]]></category><category><![CDATA[ssd1306]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Sat, 05 Feb 2022 11:42:26 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2022/01/IMG_20220128_122920-1.jpg" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2022/01/IMG_20220128_122920-1.jpg" alt="Make a Remote Temp Sensor with Permanent Display inside your House"><p>Most of us use a phone app to see the temperature outside - which is fine if you don't mind receiving a reading from a sensor located at a meteorological station somewhere nearby. </p>

<p>And when we finally <em>do</em> set up our own IoT sensors, to see them, we need to open an app, or log onto a webpage.</p>

<h3 id="nodeviceneeded">No device needed</h3>

<p>But what if you want to know the temperate outside your own house without opening a device? You want your outside temperature to be displayed permanently <em>inside</em> your house so that it's visible whenever you want, and anywhere you want to see it. (Even in multiple rooms...)</p>

<p>This post explains how to do it. A temp sensor outside sends its reading to a screen inside the house. It's all done with inexpensive components and a few wires and connections. If you already have a Raspberry Pi, you're already nearly there.</p>

<h3 id="components">Components</h3>

<ul>
<li><a href="https://www.aliexpress.com/wholesale?catId=0&amp;initiative_id=AS_20220127050109&amp;SearchText=wemos+d1+mini">Two Wemos D1 minis - about $2 each.</a></li>
<li><a href="https://www.aliexpress.com/wholesale?catId=0&amp;initiative_id=SB_20220127050227&amp;SearchText=SSD1306+0.96">One SSD1306 0.96 inch screen - about $2.</a></li>
<li><a href="https://www.aliexpress.com/wholesale?catId=0&amp;initiative_id=SB_20220127050410&amp;SearchText=DS18B20+waterproof+sensor">DS18B20 waterproof temp sensor - $1.</a> </li>
<li>4.7k resistor</li>
<li>Raspberry Pi running Node Red and MQTT (Any model RasPi will do, but if you're running a full Home Automation System, better a Pi 3+ or 4).</li>
<li>Power supply for both Wemos chips. (I use an 18650 battery and solar panel for the outside sensor. More about that below.)</li>
</ul>

<h3 id="theprinciple">The Principle</h3>

<p>Every half an hour, (or other user-defined period) the outside Wemos D1 wakes from deepsleep, reads the temperature from the DS18B20, then transmits the data to the Raspberry Pi using the MQTT <em>Publish</em> protocol.</p>

<p>The RasPi MQTT server receives the data, then sends it to the MQTT <em>Subscribed</em> devices - in this case the other Wemos D1 mini(s). The latter then displays the temperature on the SSD1306 screen. </p>

<p>As it costs only about $3 for the Wemos/Screen setup, any number of these devices can be placed around your house and they'll all update simultaneously.</p>

<h3 id="settinguptheraspi">Setting up the RasPi</h3>

<p>I won't explain here how to install Node Red and MQTT onto a RasPi. <a href="https://randomnerdtutorials.com/how-to-install-mosquitto-broker-on-raspberry-pi/">Rui Santos over at Random Nerd Tutorials does it much better than me.</a>. </p>

<p>Two things I'd emphasize: </p>

<ul>
<li>Understand the concepts of <em>Subscribing</em> and <em>Publishing</em> in MQTT as we'll be using them when programming our Wemos D1 minis.</li>
<li>In the MQTT server, if you give yourself a username and password you'll need to use them in your Wemos sketch. You place them under "Security" in the MQTT node in Node Red.</li>
</ul>

<p><img src="http://www.whatimade.today/content/images/2022/01/Screen-Shot-2022-01-31-at-13.22.04.png" alt="Make a Remote Temp Sensor with Permanent Display inside your House"></p>

<h3 id="settingupthewemosd1miniwiththeds18b20tempsensor">Setting up the Wemos D1 mini with the DS18B20 temp sensor</h3>

<p>The DS18B20 is a really simple sensor to work with. When you buy it, make sure you get the waterproof version as the indoor version won't last long exposed to the elements. Connect the sensor to the Wemos as follows: <br>
<img src="http://www.whatimade.today/content/images/2022/01/Screen-Shot-2022-01-27-at-17.47.15.png" alt="Make a Remote Temp Sensor with Permanent Display inside your House">
(This is a NodeMCU, but it's the same principle as the Wemos. Connect the 4.7k resistor as a pull-up for the sensor pin. Make sure you use the correct pin numbers in your own script below.)</p>

<h3 id="settingupthewemosd1miniwiththessd1306screen">Setting up the Wemos D1 mini with the SSD1306 screen</h3>

<p><img src="http://www.whatimade.today/content/images/2022/01/WemosSSD1306.jpeg" alt="Make a Remote Temp Sensor with Permanent Display inside your House">
In my setup, I have the SSD1306 connected the the Wemos 3.3v output. Check before connecting. Wiring diagram courtesy of <a href="https://bitsnblobs.com/">Bits and Bobs</a></p>

<h3 id="theoutsidesensorscript">The Outside Sensor Script</h3>

<p>This script wakes up from deepsleep every 30 minutes, reads the DS18B20, connects to Wifi, and <em>Publishes</em> the MQTT data to a <em>topic</em> on the Raspberry Pi Node Red/MQTT server.</p>

<p>You need to write your WiFi credentials in the script, as well as your username and password for your MQTT server, and the <em>topic</em> you've chosen. </p>

<pre><code>// Michael Diamond and Allan Shwartz

#include &lt;OneWire.h&gt;            // to connect to the OneWire temp. sensor
#include &lt;DallasTemperature.h&gt;  // temperature sensor driver
#include &lt;ESP8266WiFi.h&gt;        // for WiFi Client class
#include &lt;PubSubClient.h&gt;       // for MQTT PubSubClient class

// Update these with values suitable for your network.

const char *ssid = "Your_WiFi_Name_Here";       // your WiFi name goes here  
const char *password = "Your_WiFi_Password_Here";    // your WiFi password goes here  
const char *mqtt_server = "192.168.x.x"; // IP address of the MQTT server/Raspberry PI  
// Declaration of (instantiation of) a WiFiClient called espClient
WiFiClient espClient;

// Declaration of (instantiation of) a PubSubClient called client
PubSubClient client(espClient);

// GPIO where the DS18B20 temperature sensor is connected to
const int oneWireBus = 2;

// Setup a OneWire instance to communicate with any OneWire devices
OneWire oneWire(oneWireBus);

// Pass our OneWire reference to Dallas Temperature sensor
DallasTemperature sensors(&amp;oneWire);

// constants needed for millisecond timing
const unsigned long SECOND = 1000;  
const unsigned long MINUTE = (60 * SECOND);  
// Push data at this interval
const unsigned long deepSleep_ms = 30 * MINUTE;


//----------------------------------------------------------------------
//  setup() function
//
//  ... setup the Serial class, the Wifi, and the Publish-Subscribe Client
//----------------------------------------------------------------------
void setup()  
{
    // start the Serial Monitor
    Serial.begin(115200);
    // setup the temperature probe
    pinMode(2, OUTPUT);
    // setup the networking functions
    setup_wifi();
    client.setServer(mqtt_server, 1883);
    // Start the DS18B20 temperature sensor
    sensors.begin();
}


// ----------------------------------------------------------------------
//  setup_wifi() function
//
//  ... connect this ESP node to the House WiFi network
//      we only call this once at "setup-time"
//----------------------------------------------------------------------
void setup_wifi() {

    delay(10);
    // We start by connecting to a WiFi network
    Serial.println();
    Serial.print("Connecting to ");
    Serial.println(ssid);

    WiFi.mode(WIFI_STA);
    WiFi.begin(ssid, password);

    while (WiFi.status() != WL_CONNECTED)
    {
        delay(500);
        Serial.print(".");
    }

    randomSeed(micros());

    // networking is successfully up
    Serial.println("");
    Serial.println("WiFi connected");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());
}


//----------------------------------------------------------------------
//  reconnect() function
//
//  ... The connection to the MQTT server must constantly be checked
//      if it is down, reconnect
//----------------------------------------------------------------------
void reconnect()  
{
    // Loop until we're reconnected
    while (!client.connected())
    {
        Serial.print("Attempting MQTT connection...");
        // Give each ESP its own client name. If they are all the same, it'll repeatedly connect.
        String clientId = "RemoteTempSensor";

        // Attempt to connect
        if (client.connect("Your_topic", "your_MQTT_user", "you_MQTT_PW"))
        {
            Serial.println("connected");
            // Once connected, publish an announcement...
            //     client.publish("Your_topic", tempString, "ºC");
        }
        else
        {
            // if our connection attempt fails, print some debugging to the Arduino console
            Serial.print("failed, rc=");
            Serial.print(client.state());
            Serial.println(" try again in 5 seconds");
            // Wait 5 seconds before retrying
            delay(5 * SECOND);
        }
    }
}


//----------------------------------------------------------------------
//  loop() function
//
//  ... actually the most important function here.
//----------------------------------------------------------------------
void loop()  
{
    // we must be vigilant in keeping our MQTT connection up
    if (!client.connected())
    {
        reconnect();
    }

    // call the loop function of the Publish-Subscribe client
    client.loop();

    // now read the temperatures
    sensors.requestTemperatures();
    float temperatureC = sensors.getTempCByIndex(0);

    // display on the Arduio console ... just as a debugging tool
    Serial.print(temperatureC);
    Serial.println("ºC");

    // we need to convert this into a text string to transmit
    char text[8];
    dtostrf(temperatureC, 1, 1, text);

    // publish this text to our MQTT server
    client.publish("Your_topic", text, "ºC");
    delay(SECOND);   // to insure the packet gets out

    // now go into a power-saving deep sleep for 30 minutes
    ESP.deepSleep(deepSleep_ms);
}
</code></pre>

<h3 id="theinsidesensorscript">The Inside Sensor Script</h3>

<p>This script is <em>Subscribed</em> to the <em>topic</em> of the outside sensor on the Node Red/MQTT server. When the outside sensor Publishes, the server on the Pi sends the data to this (and all other Subscribed devices on this topic). Once the data is received, the sketch displays the result to the attached SSD1306 screen.</p>

<p>Here too you need to write your WiFi credentials in the script, as well as your username and password for your MQTT server, and the <em>topic</em> you've chosen. </p>

<pre><code>// Michael Diamond and Allan Shwartz

#include &lt;Wire.h&gt;             // to connect to I2C screen
#include &lt;Adafruit_GFX.h&gt;     // for screen graphics
#include &lt;Adafruit_SSD1306.h&gt; // for Adafruit_SSD2306 class
#include &lt;ESP8266WiFi.h&gt;      // for WiFiClient class
#include &lt;PubSubClient.h&gt;     // for MQTT PubSubClient class
#define SCREEN_WIDTH 128      // OLED display width, in pixels
#define SCREEN_HEIGHT 64      // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &amp;Wire, -1);

// Update these with values suitable for your network.

const char *ssid = "Your_WiFi_Name_Here";       // your WiFi name goes here  
const char *password = "Your_WiFi_Password_Here";    // your WiFi password goes here  
const char *mqtt_server = "192.168.x.x"; // IP address of the MQTT server/Raspberry PI

// Declaration of (instantiation of) a WiFiClient called espClient
WiFiClient espClient;

// Declaration of (instantiation of) a PubSubClient called client
PubSubClient client(espClient);

// constants needed for millisecond timing
const unsigned long SECOND = 1000;  
const unsigned long MINUTE = (60 * SECOND);

//----------------------------------------------------------------------
//  setup() function
//
//  ... setup the Serial class, the Wifi, and the Publish-Subscribe Client
//----------------------------------------------------------------------
void setup()  
{
    // start the Serial Monitor
    Serial.begin(115200);
    // setup the networking functions
    setup_wifi();
    client.setServer(mqtt_server, 1883);
    // set the callback function ... to be called when we get a message
    client.setCallback(callback);
}


//----------------------------------------------------------------------
//  setup_wifi() function
//
//  ... connect this ESP node to the House WiFi network
//      we only call this once at "setup-time"
//----------------------------------------------------------------------
void setup_wifi()  
{
    delay(10);
    // We start by connecting to a WiFi network
    Serial.println();
    Serial.print("Connecting to ");
    Serial.println(ssid);

    WiFi.mode(WIFI_STA);
    WiFi.begin(ssid, password);

    // continue to try to connect to the WiFi, showing connection attempts
    while (WiFi.status() != WL_CONNECTED)
    {
        delay(500);
        Serial.print(".");
    }

    // networking is successfully up
    Serial.println("");
    Serial.println("WiFi connected");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());
}


//----------------------------------------------------------------------
//  callback() function
//
//  ... we have received a message from the MQTT server
//      display it.  repaint the SSD1306 screen
//----------------------------------------------------------------------
void callback(String topic, byte *payload, unsigned int length)  
{

    Serial.print("Message arrived on topic: ");
    Serial.print(topic);
    Serial.print(". Message: ");

    // the payload is a "byte-stream".  Convert this to a printable String object
    String message;
    for (int i = 0; i &lt; length; i++)
    {
        message += (char)payload[i];
    }
    Serial.println(message); // debug print on our Arduino console

    // We have our RemoteTemp MQTT message, we want to display

    if (topic == "Your_topic")
    {

        // restart the SSD1306 screen with a call to .begin()
        if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C))
        {   // Address 0x3D for 128x64
            Serial.println(F("SSD1306 allocation failed"));
            for (;;)
                ; // infinite loop on failure
        }

        // repaint the SSD1306 OLED screen using various Adafruit_SSD1306 functions
        delay(50000); // delay 50 seconds (otherwise is blinks too much)
        display.clearDisplay();
        display.setTextColor(WHITE);
        display.setTextSize(1);
        display.setCursor(2, 0);
        display.println("Temperature Celcius");
        display.setTextSize(4);
        display.setCursor(10, 20);
        // Display static text
        display.println(message); // This is the content to display
        display.display();
    }
}


//----------------------------------------------------------------------
//  reconnect() function
//
//  ... The connection to the MQTT server must constantly be checked
//      if it is down, reconnect
//----------------------------------------------------------------------
void reconnect()  
{

    // Loop until we're reconnected
    while (!client.connected())
    {
        Serial.print("Attempting MQTT connection...");
        // Give each ESP its own client name. If they are all the same, it'll repeatedly connect.
        String clientId = "Your_topic";

        // Attempt to connect
        if (client.connect("TopicName", "Your_MQTT_User", "Your_MQTT_Password"))
        {
            Serial.println("connected");
            client.subscribe("Your_topic");
        }
        else
        {
            // if our connection attempt fails, print some debugging to the Arduino console
            Serial.print("failed, rc=");
            Serial.print(client.state());
            Serial.println(" try again in 5 seconds");
            // Wait 5 seconds before retrying
            delay(5 * SECOND);
        }
    }
}


//----------------------------------------------------------------------
//  loop() function
//
//  ... actually the most important function here.
//----------------------------------------------------------------------
void loop()  
{
    unsigned long loopTime_ms = millis();

    // we must be vigilant in keeping our MQTT connection up
    if (!client.connected())
    {
        reconnect();
    }

    // call the loop function of the Publish-Subscribe client
    client.loop();

    // we want to do this "loop" function once a minute
    while ((unsigned long)(millis() - loopTime_ms) &lt; (1 * SECOND))
        ;   // wait for the minute to be over
}
</code></pre>

<p>I 3d-printed a neat little box for the screen. You can download the stl files <a href="https://www.thingiverse.com/thing:3548757">here</a>.</p>

<p><img src="http://www.whatimade.today/content/images/2022/01/IMG_20220128_122634-1.jpg" alt="Make a Remote Temp Sensor with Permanent Display inside your House"></p>

<h3 id="triggeringotherthings">Triggering other things</h3>

<p>As I'm sure most readers are aware, with the outside sensor connecting to Node Red, it's very simple to use the incoming data to trigger anything else in your network. For example, if it gets too hot, the AC will come on. If it gets too cold, the heater will come on.</p>

<h3 id="poweringtheoutsidewemoswithsolarpanel">Powering the Outside Wemos with Solar Panel</h3>

<p>Due to its relatively high current drain during WiFi activation, the ESP8266 is notoriously difficult to power remotely. I got around this relatively easily.</p>

<p>First, by bridging pins RST and D0 on the Wemos, the board can enter full deepsleep. This means there is negligible power consumption between each wakeup.</p>

<p><img src="http://www.whatimade.today/content/images/2022/01/wemos-d1-mini-activate-deep-sleep-mode-esp8266.jpeg" alt="Make a Remote Temp Sensor with Permanent Display inside your House"></p>

<p>Second, I've used an inexpensive 18650 board that powers the Wemos through the USB output - and also controls battery charge and discharge.</p>

<p><img src="http://www.whatimade.today/content/images/2022/01/IMG_20220128_122846.jpg" alt="Make a Remote Temp Sensor with Permanent Display inside your House"></p>

<p>Third, I used a <a href="https://www.aliexpress.com/item/1005003257430374.html?spm=a2g0o.productlist.0.0.797138c3SBBBoW&amp;algo_pvid=213ffa55-53bd-41de-b6b8-d25f5d467fb2&amp;aem_p4p_detail=202201310347291647497942820066745927&amp;algo_exp_id=213ffa55-53bd-41de-b6b8-d25f5d467fb2-2&amp;pdp_ext_f=%7B%22sku_id%22%3A%2212000024907612056%22%7D&amp;pdp_pi=-1%3B37.62%3B-1%3B127%40salePrice%3BILS%3Bsearch-mainSearch">small solar panel from Aliexpress</a> that outputs 5v from its USB. This plugs into the 18650 board above. My system has run for nearly two years without a problem. <br>
<img src="http://www.whatimade.today/content/images/2022/01/Screen-Shot-2022-01-31-at-13.48.19.png" alt="Make a Remote Temp Sensor with Permanent Display inside your House" title=""> </p>

<h3 id="allaroundthehouse">All Around the House</h3>

<p>I placed little screens all around the house making it easy for me to keep track of the outside temperature without fiddling with my phone. I find myself looking at it regularly. I also added a flow to Node Red that records the incoming data in a text file. Another flow displays a graph of the last 48 hours.</p>

<p><img src="http://www.whatimade.today/content/images/2022/02/Screen-Shot-2022-02-05-at-13.36.43.png" alt="Make a Remote Temp Sensor with Permanent Display inside your House"></p>

<p><img src="http://www.whatimade.today/content/images/2022/02/Screen-Shot-2022-02-05-at-13.34.54.png" alt="Make a Remote Temp Sensor with Permanent Display inside your House"></p>]]></content:encoded></item><item><title><![CDATA[Connecting Switcher Devices to Node Red]]></title><description><![CDATA[Tutorial to connect Switcher Smart Home Boiler Switch to Node Red.]]></description><link>http://www.whatimade.today/connecting-switcher-devices-to-node-red/</link><guid isPermaLink="false">43977c9a-5beb-44e4-9830-5e737ecc4672</guid><category><![CDATA[node red]]></category><category><![CDATA[node.js]]></category><category><![CDATA[raspberry pi]]></category><category><![CDATA[github]]></category><category><![CDATA[switcher-js]]></category><category><![CDATA[switcher.py]]></category><dc:creator><![CDATA[Mike Diamond]]></dc:creator><pubDate>Thu, 21 Oct 2021 07:47:23 GMT</pubDate><media:content url="http://www.whatimade.today/content/images/2021/10/Screen-Shot-2021-10-21-at-10.33.54.png" medium="image"/><content:encoded><![CDATA[<img src="http://www.whatimade.today/content/images/2021/10/Screen-Shot-2021-10-21-at-10.33.54.png" alt="Connecting Switcher Devices to Node Red"><p>One of the first commercial home automation devices I bought was a hot water boiler switch from <a href="https://switcher.co.il/">Switcher</a>. Like most remote devices, it came with its own app. At the time - about 5-6 years ago - it was nigh-on impossible to hack into the protocol to connect to it in any other way.</p>

<p>For years, as my house became smarter and smarter, the boiler remained a conundrum. Our blinds would lower if the sun got bright, and our AC automatically kept us cool. Lights would turn off at bed time, and garden sprinklers would work only on dry days. </p>

<p>But the boiler was stuck to rigid rules, completely unconnected to climatic conditions. I prayed that one day I could make it turn on when clouds obscured our solar panels, or when the temperature fell below a set threshold.</p>

<p>Today, after much sweat, trial and effort, that changed. Today, for the first time, my Node Red commanded my Switcher to turn on, then turn off - and I danced around the hallway with glee.</p>

<h3 id="thisishowididit">This is how I did it</h3>

<p>A couple of notes first:</p>

<ul>
<li>I run my Node Red on a Raspberry Pi 3+ - which makes things a little easier for this tutorial. I'm sure it can be done on other platforms but that's beyond my current scope.</li>
<li>My Switcher is Version 2 (35DA), running Firmware version 72.36. The library I used has only been tested on Switcher <strong>Version 3</strong> (and now V2!) - so there's hope if you have a different version.
<img src="http://www.whatimade.today/content/images/2021/10/4172772841.png" alt="Connecting Switcher Devices to Node Red"></li>
<li>Make sure you're running your Node Red and Switcher on the same Wifi network. I don't know if it works between the 5gHz and 2.4 bands, but mine is all running on 2.4. </li>
</ul>

<h3 id="gettingswitchersidentity">Getting Switcher's Identity</h3>

<p>This part uses the Python script written by Aviad Golan (@AviadGolan) and Shai rod (@NightRang3r) on <a href="https://github.com/NightRang3r/Switcher-V2-Python">this github</a>. On their page, they have a really long description, most of it irrelevant if you don't use Home Assistant. All you really need to do is copy switcher.py to your Raspberry Pi, then move to the directory you copied it to. </p>

<p>Once there, run the following command:</p>

<p><code>sudo python switcher.py discover
</code></p>

<p>This should give you a screen that looks something like this:</p>

<p><img src="http://www.whatimade.today/content/images/2021/10/Screen-Shot-2021-10-21-at-9.31.43-1.png" alt="Connecting Switcher Devices to Node Red"></p>

<p>From this screen, note down the Device ID and the IP address for later.</p>

<h3 id="usingnodejslibrary">Using Nodejs Library</h3>

<p>Now that you have the Device ID and IP address, we move over to johnathanvidu's github <a href="https://github.com/johnathanvidu/switcher-js">here</a>.</p>

<p><strong>Step 1:</strong> </p>

<p>On the Raspberry Pi running your Node Red, go to the Node Red directory. This is usually acquired by </p>

<p><code>cd .node-red/
</code></p>

<p>Once there, type:</p>

<p><code>npm install switcher-js
</code></p>

<p>You may need "sudo" to run this.</p>

<p>This will install the necessary nodejs library in the appropriate place in your Node Red setup.</p>

<p><strong>Step 2:</strong></p>

<p>We're about to change the "settings" file of Node Red. As this is crucial to its operation, you might want to make a backup before you do anything. </p>

<p>While still inside the .node-red directory, type</p>

<p><code>cp settings.js settings.bkup</code></p>

<p>Then edit the "settings" file with this:</p>

<p><code>sudo nano settings.js
</code></p>

<p>Inside the settings file, look for the line <strong>functionGlobalContext</strong>. (It's a long way down).</p>

<p>Directly below functionGlobalContext type:</p>

<p><code>switcher: require('switcher-js').Switcher
</code> </p>

<p>Once this is done, it should look like this:</p>

<p><img src="http://www.whatimade.today/content/images/2021/10/Screen-Shot-2021-10-21-at-9.51.16.png" alt="Connecting Switcher Devices to Node Red"></p>

<p>Syntax is hugely important so make sure all your commas and cases are right. Close and save.</p>

<p><strong>Step 3:</strong></p>

<p>Now we're going to set up Node Red, but before we do so, I suggest rebooting your pi so that the above changes are implemented.</p>

<p>We're about to use a Function Node. The nodejs code for importing is at the foot of this page.</p>

<p>In Node Red, open a new Function Node and use this code for <strong>turning on</strong>:</p>

<pre><code>const Switcher = global.get('switcher');  
//complete with your data
var switcher = new Switcher('yourDeviceID', 'yourIP','0000','00000000', console);

switcher.on('state', (state) =&gt; { // state is the new switcher state 

});
switcher.on('error', (error) =&gt; {  
    msg.payload = error;
    console.log(error)
});

switcher.turn_on();

return msg;  
</code></pre>

<p>and this one for <strong>turning off</strong></p>

<pre><code>const Switcher = global.get('switcher');  
//complete with your data
var switcher = new Switcher('yourDeviceID', 'yourIP','0000','00000000', console);

switcher.on('state', (state) =&gt; { // state is the new switcher state 

});
switcher.on('error', (error) =&gt; {  
    msg.payload = error;
    console.log(error)
});

switcher.turn_off();

return msg;  
</code></pre>

<p>Use a regular Inject Node to activate.</p>

<h3 id="errormessage">Error Message</h3>

<p>Your Switcher should now be working with Node Red. For reasons I don't understand, I still get this error message on a debug node:</p>

<p>"Error: status report failed. error: bind EADDRINUSE 0.0.0.0:20002"</p>

<p>Google says it's an authorization problem, but with everything working as it should, I just ignore it.</p>

<h3 id="connectingtoweather">Connecting to Weather</h3>

<p>My Node Red follows the weather for my location. Now that I can control my boiler, my weekend project will be to set it up to turn on the water heater only when inclement weather dictates.</p>

<p>Good luck!</p>

<h3 id="update2weekslater">Update - 2 weeks later</h3>

<p>Not only is my hot water boiler now weather-dependent, but the nodes worked so well that I connected my drip irrigation too. (Irrigation isn't connected to Switcher, but once I'd worked out how to make the boiler weather-dependent, it was very simple to apply the same nodes.) Now the irrigation won't come on if it has rained in the last six hours.</p>

<h3 id="update4weekslater">Update - 4 weeks later</h3>

<p>We had a power outage and suddenly Switcher stopped working in Node Red. After a bit of fiddling, I realized that its IP address must have changed. I used "switcher.py discover" again, and found it had moved. This time I noted down the device's MAC address, and gave it a static IP address in my router. Once I updated the flow, it came back to life.</p>

<h3 id="nodejsforimporting">Nodejs for importing:</h3>

<p><code>
[{"id":"59c46b3.2b3fb94","type":"function","z":"67d04cec.e90134","name":"Turn on","func":"const Switcher = global.get('switcher');\n//complete with your data\nvar switcher = new Switcher('yourDeviceID', 'yourIP','0000','00000000', console);\n\nswitcher.on('state', (state) =&gt; { // state is the new switcher state \n    \n});\nswitcher.on('error', (error) =&gt; {\n    msg.payload = error;\n    console.log(error)\n});\n\nswitcher.turn_on();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":180,"wires":[[]]},{"id":"7a008aa2.8411a4","type":"inject","z":"67d04cec.e90134","name":"Turn on Switcher","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 07 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":730,"y":180,"wires":[["59c46b3.2b3fb94"]]},{"id":"acd82843.d6b578","type":"function","z":"67d04cec.e90134","name":"Turn off","func":"const Switcher = global.get('switcher');\n//complete with your data\nvar switcher = new Switcher('yourDeviceID', 'yourIP','0000','00000000', console);\n\nswitcher.on('state', (state) =&gt; { // state is the new switcher state \n    \n});\nswitcher.on('error', (error) =&gt; {\n    msg.payload = error;\n    console.log(error)\n});\n\nswitcher.turn_off();\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":240,"wires":[[]]},{"id":"1732c821.3bb2d8","type":"inject","z":"67d04cec.e90134","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"30 07 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":750,"y":240,"wires":[["acd82843.d6b578"]]}]</code></p>]]></content:encoded></item></channel></rss>