<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title></title>
	<atom:link href="https://kaspars.net/feed" rel="self" type="application/rss+xml" />
	<link>https://kaspars.net</link>
	<description>WordPress, Electronics &#38; Home Automation</description>
	<lastBuildDate>Sat, 28 Mar 2026 19:54:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://kaspars.net/wp-content/uploads/2025/08/cropped-kaspars-dambis-2025-sq-scaled-1-32x32.jpeg</url>
	<title>Kaspars Dambis</title>
	<link>https://kaspars.net</link>
	<width>32</width>
	<height>32</height>
</image> 
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/>
<atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/>
<atom:link rel="self" href="https://kaspars.net/feed"/>
	<item>
		<title>Notes on Umami Analytics</title>
		<link>https://kaspars.net/blog/umami-analytics</link>
					<comments>https://kaspars.net/blog/umami-analytics#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Mon, 29 Dec 2025 11:50:31 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tool]]></category>
		<category><![CDATA[Web]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=11153</guid>

					<description><![CDATA[I recently tried out the self-hosted version of the Umami analytics (v2 specifically). It is a breath of fresh air for anyone used to Google Analytics. Features like individual user session drill-downs and other context related explorations are super simple and straight forward. Here are my notes on the implementation details and reasons for why [&#8230;] <a href="https://kaspars.net/blog/umami-analytics" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>I recently tried out the self-hosted version of the <a href="https://umami.is/">Umami analytics</a> (v2 specifically). It is a breath of fresh air for anyone used to Google Analytics. Features like individual user session drill-downs and other context related explorations are super simple and straight forward.</p>



<p>Here are my notes on the implementation details and reasons for why I eventually decided to not use it:</p>



<ol class="wp-block-list">
<li>It relies on <code>data</code> attributes on the script tag for <a href="https://v2.umami.is/docs/tracker-configuration">passing the configuration</a> (script ID, delayed loading, etc.) instead of using a global array collector like <code>window.dataLayer = []</code> for configuration and impression/event context (<a href="https://github.com/umami-software/umami/blob/860e6390f14e7572b27d3ea1230258cff8c9bc96/src/tracker/index.js#L22-L31">see source code</a>). This complicates the setup and will not be flexible in the long-run (can&#8217;t inline the tracker JS, values can be only strings).</li>



<li>You can&#8217;t attach additional context or meta data about the initial page view event (<a href="https://github.com/umami-software/umami/blob/860e6390f14e7572b27d3ea1230258cff8c9bc96/src/tracker/index.js#L185-L199">view source code</a>). The only option is to completely disable the default impression tracking (which can only be done using the <code>data-auto-track="false"</code> attribute and then configure a custom one.</li>



<li><a href="https://v2.umami.is/docs/track-outbound-links">Tracking outbound link clicks</a> is really complicated &#8212; you have to add <code></code><code>data-umami-event</code> attribute to all external links to use the built-in tracking (<a href="https://github.com/umami-software/umami/blob/860e6390f14e7572b27d3ea1230258cff8c9bc96/src/tracker/index.js#L113-L139">source code</a>) or implement a custom solution that captures all link events, accounts for all the modifier logic (new tab, mouse up) and sends a custom event. </li>
</ol>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/umami-analytics/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2025/12/umami-session-scaled.png" length="264066" type="image/png" />	</item>
		<item>
		<title>Setup Huawei MA5671A SFP GPON for Your Fiber ISP</title>
		<link>https://kaspars.net/blog/setup-huawei-ma5671a</link>
					<comments>https://kaspars.net/blog/setup-huawei-ma5671a#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Wed, 26 Nov 2025 10:27:26 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[1]]></category>
		<category><![CDATA[Homelab]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[MikroTik]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=10962</guid>

					<description><![CDATA[Did you know that you can replace the fiber optic modem/router supplied by your internet service provider (ISP) with a simple SFP stick that runs Linux and does the mapping of light into Ethernet packets directly into your router? Hack GPON is the ultimate resource with tutorials and guides for doing that. In many countries [&#8230;] <a href="https://kaspars.net/blog/setup-huawei-ma5671a" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>Did you know that you can replace the fiber optic modem/router supplied by your internet service provider (ISP) with a simple SFP stick that runs Linux and does the mapping of light into Ethernet packets directly into your router? <a href="https://hack-gpon.org/">Hack GPON</a> is the ultimate resource with tutorials and guides for doing that. </p>



<figure class="wp-block-image alignwide size-large"><img fetchpriority="high" decoding="async" width="1920" height="1360" src="https://kaspars.net/wp-content/uploads/2025/11/huawei-olt-replace-MA5671A-mikrotik.png?strip=all&#038;quality=90&#038;resize=1920,1360" alt="Replace Huawei ONT with MA5671 and Mikrotik" class="wp-image-10986" srcset="https://kaspars.net/wp-content/uploads/2025/11/huawei-olt-replace-MA5671A-mikrotik.png?strip=all&amp;quality=90&amp;resize=1920%2C1360 1920w, https://kaspars.net/wp-content/uploads/2025/11/huawei-olt-replace-MA5671A-mikrotik.png?strip=all&amp;quality=90&amp;resize=1280%2C907 1280w, https://kaspars.net/wp-content/uploads/2025/11/huawei-olt-replace-MA5671A-mikrotik.png?strip=all&amp;quality=90&amp;resize=1536%2C1088 1536w, https://kaspars.net/wp-content/uploads/2025/11/huawei-olt-replace-MA5671A-mikrotik.png?strip=all&amp;quality=90&amp;resize=2048%2C1451 2048w, https://kaspars.net/wp-content/uploads/2025/11/huawei-olt-replace-MA5671A-mikrotik.png?strip=all&amp;quality=90&amp;resize=384%2C272 384w, https://kaspars.net/wp-content/uploads/2025/11/huawei-olt-replace-MA5671A-mikrotik.png?strip=all&amp;quality=90&amp;resize=768%2C544 768w, https://kaspars.net/wp-content/uploads/2025/11/huawei-olt-replace-MA5671A-mikrotik.png?strip=all&amp;quality=90&amp;resize=1024%2C725 1024w" sizes="(max-width: 1920px) 100vw, 1920px" /></figure>



<p>In many countries the fiber connections to homes are shared resource that can be used by multiple ISPs (to encourage competition) so this is often very legal and within your rights. However, the fiber signaling is shared between dozens of users (your neighbors) so doing things incorrectly will impact everyone using the same connection.</p>



<p>Up until recently I was using <a href="https://hack-gpon.org/ont-odi-realtek-dfp-34x-2c2/">ODI Realtek DFP-34X-2C2</a> (<a href="https://kaspars.net/go/odi-realtek-dfp-34x-2c2-onu-stick" data-type="surl" data-id="8539">AliExpress</a>) to replace the Huawei HG8145V5 terminal supplied by the ISP but it stopped working after software upgrades to ONT on the ISP side (which distribute the fiber signal) in the early 2025.</p>



<h2 class="wp-block-heading">Huawei SmartAX MA5671A</h2>



<p>So I decided to try out an official Huawei SFP which would hopefully match the behavior of the original terminal. After a bit of research I ordered <strong>Huawei MA5671A</strong> on eBay for around $20 (probably used) which appeared to be <a href="https://hack-gpon.org/ont-huawei-ma5671a/">documented extensively on the wiki.</a></p>



<p>Turns out <strong>it is the same hardware</strong> as Nokia G-010S-P, SourcePhotonics SPS-34-24T-HP-TDFO, Hilink HL23446, Dasan H650SFP and probably many more which all use the same Intel Lantiq PEB98035 chip (no longer manufactured) and run a custom build of OpenWRT. The configuration for each vendor is stored in a flash chip while the operating system is exactly the same. </p>



<p>The original manufacturer of this SFP stick appears to be SourcePhotonics SPS-34-24T-HP-TDFO based <a href="https://forum.openwrt.org/t/support-ma5671a-sfp-gpon/48042/201">on this comment from a person</a> who apparently worked on it. That particular module also has full root access over SSH which allows you to skip the soldering and rooting over the UART on the SFP connector.</p>



<h2 class="wp-block-heading">Configuring GPON Serial Number</h2>



<p>All of the GPON client equipment comes pre-configured with a unique identifier which is used to enable your internet access and to set the connection speed. Some ISPs also use PLOAM password and/or Software IDs reported by the device for additional verification.</p>



<p>We must fake the identify of the original modem to authenticate with the ISP and keep using the internet. Normally these parameters shouldn&#8217;t be configured by users (they are serving as identify after all) so we must find a way to do that anyway. Generic modules like that <a href="https://hack-gpon.org/ont-odi-realtek-dfp-34x-2c2/">DFP-34X-2C2</a> (which I was using before) provide completely unlocked SSH interface and tools to configure the GPON parameters.</p>



<p>However, Huawei MA5671A is completely locked down and it only has a very limited &#8220;minishell&#8221; available over SSH which <em>can&#8217;t</em> be used to override any of these parameters. That is not the case for the <a href="https://hack-gpon.org/ont-fs-com-gpon-onu-stick-with-mac/">SourcePhotonics SPS-34-24T-HP-TDFO</a> version of this, though.</p>



<h3 class="wp-block-heading">Unlock Root Access</h3>



<p>Luckily, there is an UART connection (baud 115200) exposed on the SFP pins (non-standard) so we can use those to connect to the device and:</p>



<ol class="wp-block-list">
<li>unlock it&#8217;s U-boot bootloader and</li>



<li>change the shell for the <code>root</code> user in <code>/rom/etc/passwd</code> from <code>/opt/lantiq/bin/minishell</code> to <code>/bin/ash</code> which has full permissions.</li>
</ol>



<p>Unfortunately, <strong>connecting to those UART pins on the SFP connector is really hard</strong>. You&#8217;ll need to buy a <a href="https://www.tme.eu/lv/en/details/ue75-a20-3000t/rj-connectors/amphenol-communications-solutions/ue75a203000t/">20-pin surface mount SFP connector</a> (which has only 0.8mm spacing between the pins), pull out the unnecessary pins with pliers (to avoid soldering together neighboring pins) and solder four wires for the UART to USB connection (ensure it has 3.3V output instead of 5V):</p>



<figure class="wp-block-image alignwide size-large"><img decoding="async" width="1920" height="1280" src="https://kaspars.net/wp-content/uploads/2025/11/huawei-MA5671A-lantiq-PEB98035-uart-scaled.jpg?strip=all&#038;quality=90&#038;resize=1920,1280" alt="Huawei MA5671A serial UART on SFP pins" class="wp-image-10969" srcset="https://kaspars.net/wp-content/uploads/2025/11/huawei-MA5671A-lantiq-PEB98035-uart-scaled.jpg?strip=all&amp;quality=90&amp;resize=1920%2C1280 1920w, https://kaspars.net/wp-content/uploads/2025/11/huawei-MA5671A-lantiq-PEB98035-uart-scaled.jpg?strip=all&amp;quality=90&amp;resize=1280%2C853 1280w, https://kaspars.net/wp-content/uploads/2025/11/huawei-MA5671A-lantiq-PEB98035-uart-scaled.jpg?strip=all&amp;quality=90&amp;resize=1536%2C1024 1536w, https://kaspars.net/wp-content/uploads/2025/11/huawei-MA5671A-lantiq-PEB98035-uart-scaled.jpg?strip=all&amp;quality=90&amp;resize=2048%2C1365 2048w, https://kaspars.net/wp-content/uploads/2025/11/huawei-MA5671A-lantiq-PEB98035-uart-scaled.jpg?strip=all&amp;quality=90&amp;resize=384%2C256 384w, https://kaspars.net/wp-content/uploads/2025/11/huawei-MA5671A-lantiq-PEB98035-uart-scaled.jpg?strip=all&amp;quality=90&amp;resize=768%2C512 768w, https://kaspars.net/wp-content/uploads/2025/11/huawei-MA5671A-lantiq-PEB98035-uart-scaled.jpg?strip=all&amp;quality=90&amp;resize=1024%2C683 1024w" sizes="(max-width: 1920px) 100vw, 1920px" /></figure>



<p>This was the hardest part in addition to these fails:</p>



<ul class="wp-block-list">
<li>one hour lost because TX was connected to PIN8 instead of PIN7 (because 10 minus 7 is actually four pins instead of three).</li>



<li>two hours lost due to a loose connection of the TX pin which prevented all outgoing messages to the device. I eventually used a multimeter to verify the continuity between the the solder points and the pads on the PCB.</li>
</ul>



<p>I was able to confirm the RX connection by seeing this UART output during the boot:</p>



<pre class="wp-block-code"><code>ROM: V1.1.4
ROM: CFG 0x00000006
ROM: SFLASH-4
hw fuse format 1

U-Boot 2011.12-lantiq-gpon-1.2.24 (Nov 03 2014 - 22:46:28), Build: falcon_sfp_linux

Board: SFP
DRAM:  64 MiB
Now running in RAM - U-Boot at: 83fc8000
SF: Detected MX25L12805D with page size 64 KiB, total 16 MiB</code></pre>



<p>This is where the output stops because the U-boot has the <code>bootdelay</code> set to <code>0</code> seconds and serial output disabled. Luckily they didn&#8217;t lock the user input completely and hitting Ctrl+C (or <code>0x03</code> in ASCII) immediately after the <code>U-Boot 2011.12...</code> header is printed will actually enable user input.</p>



<p>This is what the <a href="https://hack-gpon.org/ont-huawei-ma5671a-root-web/">&#8220;Start Root&#8221; script does</a>:</p>



<ol class="wp-block-list">
<li>waits for <code>U-Boot</code> string in the UART output and immediately starts sending Ctrl+C every 10ms for 2 seconds.</li>



<li>It assumes that keyboard input is now enabled and sends various <code>setenv</code> commands that introduce the boot delay and enable serial output (persistently).</li>
</ol>



<p>Here the commands sent after unlocking input:</p>



<pre class="wp-block-code"><code>setenv bootdelay 5
setenv asc0 0
setenv preboot "gpio set 3;gpio input 2;gpio input 105;gpio input 106;gpio input 107;gpio input 108
saveenv
reset</code></pre>



<p>Afterwards it sends the <em>second part of commands</em> that swap out the default shell for the <code>root</code> user:</p>



<pre class="wp-block-code"><code>mount_root &amp;&amp; mkdir -p /overlay/etc &amp;&amp; sed "s|/opt/lantiq/bin/minishell|/bin/ash|g" /rom/etc/passwd &gt; /overlay/etc/passwd
umount /overlay &amp;&amp; umount -a</code></pre>



<p>Now, after rebooting the device you should see the full boot sequence printed to UART and the <code>root</code> user over SSH (password: <code>admin123</code>) should have full access to the system:</p>



<pre class="wp-block-code"><code>ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -oCiphers=+3des-cbc -o HostKeyAlgorithms=ssh-rsa root@192.168.1.10

root@192.168.1.10's password: 

BusyBox v1.22.1 (2017-05-20 08:54:30 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

 OpenWrt - (14.07_ltq) --- Lantiq Edition for GPON
 ----------------------------------------------
root@SFP:~# </code></pre>



<p>And here is the <code>dmesg</code> output:</p>



<pre class="wp-block-code"><code>&#91;    0.000000] Linux version 3.10.49 (sean@Lantiq-DEV) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 14.07_ltq) ) #1 Sat May 20 09:01:27 CST 2017
&#91;    0.000000] SoC: Falcon rev A22
&#91;    0.000000] bootconsole &#91;early0] enabled
&#91;    0.000000] CPU revision is: 00019556 (MIPS 34Kc)
&#91;    0.000000] MIPS: machine is SFP - Lantiq Falcon SFP Stick</code></pre>



<h2 class="wp-block-heading">Actually Configuring GPON Serial Number</h2>



<p>After getting root access to the device we can use the <code>fw_printenv</code> and <code>fw_setenv</code> commands to adjust the necessary parameters for our device identity <a href="https://hack-gpon.org/ont-huawei-ma5671a-rooted/#gponomci-settings">as explained in this guide</a>. </p>



<p>Be sure to copy and save the default configuration returned by <code>fw_printenv sfp_a2_info</code> before making any changes.</p>



<p>In my case it was enough to clone the serial number and PLOAM values from the original equipment. After rebooting I was able confirm the values:</p>



<pre class="wp-block-code"><code>fw_printenv nPassword
fw_printenv gSerial</code></pre>



<p>and also the <code>O5</code> status of the connection:</p>



<pre class="wp-block-code"><code>onu ploamsg
errorcode=0 curr_state=5 previous_state=4 elapsed_msec=4294714448</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/setup-huawei-ma5671a/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2025/11/huawei-MA5671A-lantiq-PEB98035-uart-scaled.jpg" length="803276" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/11/huawei-olt-replace-MA5671A-mikrotik.png" length="126852" type="image/png" />	</item>
		<item>
		<title>Setup Local Development Domain with Public DNS</title>
		<link>https://kaspars.net/blog/public-dns-local-development-url</link>
					<comments>https://kaspars.net/blog/public-dns-local-development-url#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Wed, 12 Nov 2025 16:19:35 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Web]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=10750</guid>

					<description><![CDATA[Did you know that you can point any domain to 127.0.0.1 and it will happily resolve to your local development environment? No more edits to /etc/hosts or complex NS server setups. For example, if the domain of your project is example.com then you could set the A record of local.example.com to 127.0.0.1. But wait &#8212; [&#8230;] <a href="https://kaspars.net/blog/public-dns-local-development-url" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>Did you know that you can point any domain to <code>127.0.0.1</code> and it will happily resolve to your local development environment? No more edits to <code>/etc/hosts</code> or complex NS server setups.</p>



<p>For example, if the domain of your project is <code>example.com</code> then you could set the A record of <code>local.example.com</code> to <code>127.0.0.1</code>. But wait &#8212; there is more &#8212; you can have unlimited subdomains such as <code>*.local.example.com</code> if your DNS provider supports wildcard A records.</p>



<span id="more-10750"></span>



<p>Here is a screenshot of the DNS setup in DigitalOcean that I use for <a href="https://github.com/kasparsd/wp-env-domains"><code>*.wpenv.net</code> domains</a>:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1920" height="1186" src="https://kaspars.net/wp-content/uploads/2025/11/wpenv-net-dns-setup.png?strip=all&#038;quality=90&#038;resize=1920,1186" alt="Name server records for local development environment URLs using public DNS" class="wp-image-10751" srcset="https://kaspars.net/wp-content/uploads/2025/11/wpenv-net-dns-setup.png?strip=all&amp;quality=90&amp;resize=1920%2C1186 1920w, https://kaspars.net/wp-content/uploads/2025/11/wpenv-net-dns-setup.png?strip=all&amp;quality=90&amp;resize=1280%2C791 1280w, https://kaspars.net/wp-content/uploads/2025/11/wpenv-net-dns-setup.png?strip=all&amp;quality=90&amp;resize=1536%2C949 1536w, https://kaspars.net/wp-content/uploads/2025/11/wpenv-net-dns-setup.png?strip=all&amp;quality=90&amp;resize=2048%2C1265 2048w, https://kaspars.net/wp-content/uploads/2025/11/wpenv-net-dns-setup.png?strip=all&amp;quality=90&amp;resize=384%2C237 384w, https://kaspars.net/wp-content/uploads/2025/11/wpenv-net-dns-setup.png?strip=all&amp;quality=90&amp;resize=768%2C474 768w, https://kaspars.net/wp-content/uploads/2025/11/wpenv-net-dns-setup.png?strip=all&amp;quality=90&amp;resize=1024%2C633 1024w" sizes="(max-width: 1920px) 100vw, 1920px" /></figure>



<p>The A record for the root level <code>wpenv.net</code> pointing to a GitHub IP for the repository which has the README about the domain. It is like a landing page for the service.</p>



<p>The important bit is the A record for <code>*.wpenv.net</code> pointing to <code>127.0.0.1</code>. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/public-dns-local-development-url/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2025/11/wpenv-net-dns-setup.png" length="97970" type="image/png" />	</item>
		<item>
		<title>Custom Email Address for Kids Google Account</title>
		<link>https://kaspars.net/blog/google-account-custom-email</link>
					<comments>https://kaspars.net/blog/google-account-custom-email#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sat, 08 Nov 2025 17:08:34 +0000</pubDate>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[How to]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=10715</guid>

					<description><![CDATA[Turns out you can&#8217;t specify a custom email address for a new Google Account if the birthday specified during registration is for an underage person. This is due to the parental controls they enforce for kids&#8217; accounts and how that functionality requires a @gmail.com account email address. During registration you&#8217;re asked for name and date [&#8230;] <a href="https://kaspars.net/blog/google-account-custom-email" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>Turns out you can&#8217;t specify a custom email address for a new Google Account <em>if the birthday specified during registration</em> is for an underage person. This is due to the parental controls they enforce for kids&#8217; accounts and how that functionality requires a <code>@gmail.com</code> account email address.</p>



<span id="more-10715"></span>



<p>During registration you&#8217;re asked for name and date of birth:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1920" height="987" src="https://kaspars.net/wp-content/uploads/2025/11/google-account-create-birthday-options.png?strip=all&#038;quality=90&#038;resize=1920,987" alt="Birthday and gender input fields during Google Account registration" class="wp-image-10716" srcset="https://kaspars.net/wp-content/uploads/2025/11/google-account-create-birthday-options.png?strip=all&amp;quality=90&amp;resize=1920%2C987 1920w, https://kaspars.net/wp-content/uploads/2025/11/google-account-create-birthday-options.png?strip=all&amp;quality=90&amp;resize=1280%2C658 1280w, https://kaspars.net/wp-content/uploads/2025/11/google-account-create-birthday-options.png?strip=all&amp;quality=90&amp;resize=1536%2C790 1536w, https://kaspars.net/wp-content/uploads/2025/11/google-account-create-birthday-options.png?strip=all&amp;quality=90&amp;resize=2048%2C1053 2048w, https://kaspars.net/wp-content/uploads/2025/11/google-account-create-birthday-options.png?strip=all&amp;quality=90&amp;resize=384%2C197 384w, https://kaspars.net/wp-content/uploads/2025/11/google-account-create-birthday-options.png?strip=all&amp;quality=90&amp;resize=768%2C395 768w, https://kaspars.net/wp-content/uploads/2025/11/google-account-create-birthday-options.png?strip=all&amp;quality=90&amp;resize=1024%2C526 1024w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></figure>



<p>Entering a birthday for an underage person (younger than 18 years old) will only show a picker for <code>@gmail.com</code> addresses:</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://kaspars.net/wp-content/uploads/2025/11/google-account-registration-missing-custom-email-options-1920x1113.png" alt="Only @gmail.com email options available for underage kids Google Accounts" class="wp-image-10717"/></figure>



<p>However, entering a birthday of 18+ will show a custom email input field:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1920" height="927" src="https://kaspars.net/wp-content/uploads/2025/11/google-account-custom-email-option.png?strip=all&#038;quality=90&#038;resize=1920,927" alt="Custom email option during Google Account registration" class="wp-image-10718" srcset="https://kaspars.net/wp-content/uploads/2025/11/google-account-custom-email-option.png?strip=all&amp;quality=90&amp;resize=1920%2C927 1920w, https://kaspars.net/wp-content/uploads/2025/11/google-account-custom-email-option.png?strip=all&amp;quality=90&amp;resize=1280%2C618 1280w, https://kaspars.net/wp-content/uploads/2025/11/google-account-custom-email-option.png?strip=all&amp;quality=90&amp;resize=1536%2C742 1536w, https://kaspars.net/wp-content/uploads/2025/11/google-account-custom-email-option.png?strip=all&amp;quality=90&amp;resize=2048%2C989 2048w, https://kaspars.net/wp-content/uploads/2025/11/google-account-custom-email-option.png?strip=all&amp;quality=90&amp;resize=384%2C185 384w, https://kaspars.net/wp-content/uploads/2025/11/google-account-custom-email-option.png?strip=all&amp;quality=90&amp;resize=768%2C371 768w, https://kaspars.net/wp-content/uploads/2025/11/google-account-custom-email-option.png?strip=all&amp;quality=90&amp;resize=1024%2C494 1024w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/google-account-custom-email/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2025/11/google-account-custom-email-option.png" length="63624" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/11/google-account-create-birthday-options.png" length="45795" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/11/google-account-registration-missing-custom-email-options-e1762621424681.png" length="77954" type="image/png" />	</item>
		<item>
		<title>Fix Dell Monitor Flickering and Ghosting on Mac</title>
		<link>https://kaspars.net/blog/fix-dell-monitor-flickering-mac</link>
					<comments>https://kaspars.net/blog/fix-dell-monitor-flickering-mac#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sat, 01 Nov 2025 08:48:38 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[How to]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=10622</guid>

					<description><![CDATA[Learn how to switch to RGB input mode or disable macOS GPU temporal dithering. <a href="https://kaspars.net/blog/fix-dell-monitor-flickering-mac" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>Turns out that macOS uses <a href="https://en.wikipedia.org/wiki/Frame_rate_control">temporal dithering</a> to achieve additional color depth when connected to external displays and <strong>most of the Dell monitors are &#8220;sensitive&#8221; to level 16 of gray</strong> (which actually fluctuates between levels 15 and 17) as it happens at the threshold of the monitor&#8217;s Image Compensation Algorithm (ICA) causing it to turn on/off rapidly.</p>



<p>So a feature designed to prevent image retention and uneven brightness ends up causing the flickering and retention of image (ghosting) <a href="https://www.dell.com/support/kbdoc/en-us/000331897/apple-m-processors-might-cause-dell-monitors-to-flicker">as confirmed by Dell</a> after years of users complaining and trying every possible workaround.</p>



<span id="more-10622"></span>



<p>Here is an approximate visualization of that range of gray:</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="1920" height="1080" src="https://kaspars.net/wp-content/uploads/2025/11/16gray-dell.png?strip=all&#038;quality=90&#038;resize=1920,1080" alt="15Gray, 16Gray and 17Gray in YCbCr luminance" class="wp-image-10636" srcset="https://kaspars.net/wp-content/uploads/2025/11/16gray-dell.png?strip=all&amp;quality=90&amp;resize=1280%2C720 1280w, https://kaspars.net/wp-content/uploads/2025/11/16gray-dell.png?strip=all&amp;quality=90&amp;resize=1536%2C864 1536w, https://kaspars.net/wp-content/uploads/2025/11/16gray-dell.png?strip=all&amp;quality=90&amp;resize=384%2C216 384w, https://kaspars.net/wp-content/uploads/2025/11/16gray-dell.png?strip=all&amp;quality=90&amp;resize=768%2C432 768w, https://kaspars.net/wp-content/uploads/2025/11/16gray-dell.png?strip=all&amp;quality=90&amp;resize=1024%2C576 1024w, https://kaspars.net/wp-content/uploads/2025/11/16gray-dell.png?strip=all&amp;quality=90&amp;resize=1920%2C1080 1920w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /><figcaption class="wp-element-caption">Approximate RGB colors for 15Gray, 16Gray and 17Gray in YCbCr luminance (Y component).</figcaption></figure>



<p>The root of the problem is the advertised &#8220;1.07 billion colors&#8221; (10-bit color depth) even though the panel only supports 8-bit color range which it reports to macOS over EDID, which then triggers the YCbCr dithering on macOS GPU output, which in turn triggers the monitor&#8217;s Image Compensation Algorithm (ICA) threshold bug.</p>



<p>It might be possible to resolve this with a firmware update for the monitor but none of the recent updates (such as M3F102) have fixed the issue for me. </p>



<h2 class="wp-block-heading">How to Fix it?</h2>



<p>There are two ways to fix this &#8212; <strong>enforce RGB mode for the monitor video signal input</strong> (instead of the default YCbCr) <em>or</em> disable the temporal dithering on the macOS output.</p>



<h3 class="wp-block-heading">1. Set RGB Input Color Format in Monitor Settings</h3>



<p>Use the button at the back to open the monitor settings and set the &#8220;Input Color Format&#8221; under &#8220;Color&#8221; to RGB (instead of YCbCr):</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="1600" height="1200" src="https://kaspars.net/wp-content/uploads/2025/11/dell-settings-color-rgb-ycbcr.jpg?strip=all&#038;quality=90&#038;resize=1600,1200" alt="Dell monitor output settings: RGB or YCbCr" class="wp-image-10649" srcset="https://kaspars.net/wp-content/uploads/2025/11/dell-settings-color-rgb-ycbcr.jpg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2025/11/dell-settings-color-rgb-ycbcr.jpg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2025/11/dell-settings-color-rgb-ycbcr.jpg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2025/11/dell-settings-color-rgb-ycbcr.jpg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2025/11/dell-settings-color-rgb-ycbcr.jpg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2025/11/dell-settings-color-rgb-ycbcr.jpg?strip=all&amp;quality=90&amp;resize=1600%2C1200 1600w" sizes="auto, (max-width: 1600px) 100vw, 1600px" /><figcaption class="wp-element-caption">Default input color format set to YCbCr. <strong>Change it to RGB.</strong></figcaption></figure>



<p>Unplug and reconnect the USB-C cable after making the change to enforce a fresh EDID handshake. Consider resetting all settings to factory defaults before making the change.</p>



<p>This will make macOS send a full 10-bit RGB color data on the output instead of the capped 8-bit stream with temporal dithering. </p>



<h3 class="wp-block-heading">2. Disable macOS Temporal Dithering</h3>



<p>Use the <a href="https://github.com/aiaf/Stillcolor">Stillcolor app</a> to disable the macOS temporal dithering if you want to keep using the YCbCr mode for some reason. Importantly, the app will not affect the built-in display color rendering (since it supports the full color range) so it can be left enabled at all times.</p>



<h2 class="wp-block-heading">Impacted Dell Monitor Models</h2>



<p>This fix is needed for the following Dell monitor models (I&#8217;m using <a href="https://www.amazon.de/dp/B09TQZP9CL?tag=drlwl-21">U2723QE from Amazon</a>):</p>



<ul class="wp-block-list">
<li><strong>G series: </strong>G3223D</li>



<li><strong>C series:</strong> C1422H, C2422HE, C2722DE, C3422WE</li>



<li><strong>S series:</strong> S2422HZ, S2722DZ, S2722QC, S2723HC, S3423DWC</li>



<li><strong>P series:</strong> P2421DC, P2721Q, P3221D, P2422HE, P2722HE, P3222QE, P2423DE, P2723DE, P2723QE, P3223DE, P3223QE, P1424H, P2424HEB, P2724DEB, P3424WE, P5524QT, P6524QT, P8624QT</li>



<li><strong>U series:</strong> U2421E, U2421HE, U2721DE, U3421WE, U3821DW, U4021QW, U2722D, U2722DE, U2722DX, U2723QE, U2723QX, U3023E, U3223QE, U3223QZ, U3423WE, U4323QE, U2424H, U2424HE, U2724D, U2724DE, U3224KB, U3824DW, U4924DW</li>
</ul>



<h2 class="wp-block-heading">Best Dell Monitor for Mac</h2>



<p>Having a monitor that can also charge your computer and serve as a USB hub over a single USB-C cable is really convenient. If buying today, I would get the <a href="https://www.amazon.de/dp/B09RSTWVTP?tag=drlwl-21">27-inch Dell U2725QE which is also Amazon best-seller</a> and an updated model of what I have currently:</p>



<ul class="wp-block-list">
<li>same 3840×2160 resolution</li>



<li>higher refresh rate at 120Hz (previously 60Hz)</li>



<li>higher contrast of 3000:1 (previously 2000:1)</li>



<li>higher USB-PD output power of 140W (previously 90W)</li>
</ul>



<figure class="wp-block-image alignwide size-large"><img loading="lazy" decoding="async" width="1920" height="1440" src="https://kaspars.net/wp-content/uploads/2025/11/dell-usb-c-monitor-best-mac-27.jpg?strip=all&#038;quality=90&#038;resize=1920,1440" alt="Dell UltraSharp U2725QE" class="wp-image-10695" srcset="https://kaspars.net/wp-content/uploads/2025/11/dell-usb-c-monitor-best-mac-27.jpg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2025/11/dell-usb-c-monitor-best-mac-27.jpg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2025/11/dell-usb-c-monitor-best-mac-27.jpg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2025/11/dell-usb-c-monitor-best-mac-27.jpg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2025/11/dell-usb-c-monitor-best-mac-27.jpg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2025/11/dell-usb-c-monitor-best-mac-27.jpg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2025/11/dell-usb-c-monitor-best-mac-27.jpg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></figure>



<p>Using the available downstream USB-C port you can also power a charging station/stand for your iPhone, Apple Watch and AirPods such as this <a href="https://www.amazon.de/dp/B0FMBLT5RL?tag=drlwl-21">Belkin 25W 3-in-1 charger</a> (foldable and great for travel). Note that there are a lot of cheaper options available but all of them have slower charging speeds (7W vs. 15W or 25W) and most are not Apple MFi-certified which will cause your phone to show a warning message every time you put it down for charging.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/fix-dell-monitor-flickering-mac/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2025/11/16gray-dell.png" length="13146" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/11/dell-settings-color-rgb-ycbcr.jpg" length="499924" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/11/dell-usb-c-monitor-best-mac-27.jpg" length="469474" type="image/jpeg" />	</item>
		<item>
		<title>Notes on Iron Sulphate for Graying Wood</title>
		<link>https://kaspars.net/blog/iron-sulphate-wood-silver</link>
					<comments>https://kaspars.net/blog/iron-sulphate-wood-silver#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sun, 14 Sep 2025 17:29:37 +0000</pubDate>
				<category><![CDATA[Passive House]]></category>
		<category><![CDATA[Building Science]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=10437</guid>

					<description><![CDATA[A DIY mineralizing solution of silicates, iron sulphate and borax (enhanced with lime, soap, and alcohol for better fixation and penetration) can harden the wood surface, provide natural protection against fungi and insects, and accelerate the development of a consistent silver-grey patina. <a href="https://kaspars.net/blog/iron-sulphate-wood-silver" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>The ideal wood siding is one that doesn&#8217;t need maintenance and looks consistent for the duration of its lifetime. The only look that will stay consistent is the natural gray or silver patina (everything else gets knocked out by the ultraviolet radiation from the sun) so that&#8217;s what I was after when researching the options for the siding of our passive house.</p>



<span id="more-10437"></span>



<p>Ideally, the treatment would:</p>



<ol class="wp-block-list">
<li>achieve the desired look and</li>



<li>preserve the wood as much as possible. </li>
</ol>



<p><strong>The best option is thermally modified wood</strong> where the boards are literally heated in large ovens to remove all moisture and then cooled down while using steam to re-introduce water in a controlled way.</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Thermal Modification Process - Lunawood" width="650" height="366" src="https://www.youtube.com/embed/_Ukiztow9vs?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>I wanted to find an alternative which would be cheaper and could be applied to the most basic wood available locally.</p>



<h2 class="wp-block-heading">The Magic of Iron (II) Sulphate</h2>



<p>Iron (II) sulphate (FeSO<sub>4</sub>) can be used to accelerate the natural greying of wood to create a nice weathered patina look way faster than waiting for years. It works by removing with the tannins, lignin and the natural sugars in the wood (see <a href="https://www.mdpi.com/1999-4907/11/6/658">this research paper on Staining Effect of Iron (II) Sulfate on Nine Different Wooden Substrates</a>). <em>It doesn&#8217;t help with preserving the wood or protecting it against weather, UV radiation or fungi, though</em>.</p>



<p>Iron (ii) sulphate is a green powder which available in most gardening stores (usually known as Iron Vitriol) as a fertilizer for grass and loans, and to get rid of moss:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="800" height="800" src="https://kaspars.net/wp-content/uploads/2025/09/dzelzs-sulfats-dzelzs-vitriols-augu-meslojumi.jpg?strip=all&#038;quality=90&#038;resize=800,800" alt="Iron Sulfate (vitriol) for gardening" class="wp-image-10445" srcset="https://kaspars.net/wp-content/uploads/2025/09/dzelzs-sulfats-dzelzs-vitriols-augu-meslojumi.jpg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2025/09/dzelzs-sulfats-dzelzs-vitriols-augu-meslojumi.jpg?strip=all&amp;quality=90&amp;resize=300%2C300 300w, https://kaspars.net/wp-content/uploads/2025/09/dzelzs-sulfats-dzelzs-vitriols-augu-meslojumi.jpg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2025/09/dzelzs-sulfats-dzelzs-vitriols-augu-meslojumi.jpg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2025/09/dzelzs-sulfats-dzelzs-vitriols-augu-meslojumi.jpg?strip=all&amp;quality=90&amp;resize=800%2C800 800w" sizes="auto, (max-width: 800px) 100vw, 800px" /></figure>



<h3 class="wp-block-heading">Our Experiment with 4% Iron Sulphate Solution</h3>



<p>Here are photos of spruce siding being treated with a 4% solution of iron sulphate using a garden sprayer. It is important to note that the siding was installed 8 month earlier so the effect of treatment is faster and more visible than if it was applied right after the installation (when the boards were recently sawn).</p>



<figure class="wp-block-image size-large"><a href="https://kaspars.net/wp-content/uploads/2025/09/before-applying-iron-sulphate.jpeg"><img loading="lazy" decoding="async" width="1920" height="1440" src="https://kaspars.net/wp-content/uploads/2025/09/before-applying-iron-sulphate.jpeg?strip=all&#038;quality=90&#038;resize=1920,1440" alt="Spruce siding before applying iron (ii) sulphate" class="wp-image-10441" srcset="https://kaspars.net/wp-content/uploads/2025/09/before-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2025/09/before-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2025/09/before-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2025/09/before-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2025/09/before-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2025/09/before-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2025/09/before-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></a><figcaption class="wp-element-caption">Spruce siding before applying iron (ii) sulphate.</figcaption></figure>



<figure class="wp-block-image size-large"><a href="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet.jpeg"><img loading="lazy" decoding="async" width="1920" height="1440" src="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet.jpeg?strip=all&#038;quality=90&#038;resize=1920,1440" alt="Right after applying the iron (ii) sulphate solution" class="wp-image-10440" srcset="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></a><figcaption class="wp-element-caption">Immediately after applying the iron (ii) sulphate solution.</figcaption></figure>



<figure class="wp-block-image size-large"><a href="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet-closeup-scaled.jpeg"><img loading="lazy" decoding="async" width="1920" height="1440" src="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet-closeup-scaled.jpeg?strip=all&#038;quality=90&#038;resize=1920,1440" alt="Closeup of spruce siding immediately after applying the iron (ii) sulphate solution" class="wp-image-10438" srcset="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></a><figcaption class="wp-element-caption">Immediately after applying the iron (ii) sulphate solution (closeup).</figcaption></figure>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2025/09/24h-after-applying-iron-sulphate.jpeg"><img loading="lazy" decoding="async" width="1838" height="1378" src="https://kaspars.net/wp-content/uploads/2025/09/24h-after-applying-iron-sulphate.jpeg?strip=all&#038;quality=90&#038;resize=1838,1378" alt="One day after applying the iron (ii) sulphate 4% solution" class="wp-image-10439" srcset="https://kaspars.net/wp-content/uploads/2025/09/24h-after-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2025/09/24h-after-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2025/09/24h-after-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2025/09/24h-after-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2025/09/24h-after-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2025/09/24h-after-applying-iron-sulphate.jpeg?strip=all&amp;quality=90&amp;resize=1838%2C1378 1838w" sizes="auto, (max-width: 1838px) 100vw, 1838px" /></a><figcaption class="wp-element-caption">24 hours after applying the iron (ii) sulphate 4% solution.</figcaption></figure>



<figure class="wp-block-image size-large"><a href="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-ii-sulphate-siding-closeup-scaled.jpeg"><img loading="lazy" decoding="async" width="1920" height="1440" src="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-ii-sulphate-siding-closeup-scaled.jpeg?strip=all&#038;quality=90&#038;resize=1920,1440" alt="Closeup of siding 24h after applying the iron (ii) sulphate 4% solution" class="wp-image-10442" srcset="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-ii-sulphate-siding-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-ii-sulphate-siding-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-ii-sulphate-siding-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-ii-sulphate-siding-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-ii-sulphate-siding-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-ii-sulphate-siding-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-ii-sulphate-siding-closeup-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></a><figcaption class="wp-element-caption">Closeup of spruce siding 24h after applying the iron (ii) sulphate 4% solution.</figcaption></figure>



<h3 class="wp-block-heading">Conclusions</h3>



<p><strong>The 4% solution is ideal for soft woods like spruce and pine.</strong> The color change is visible right away as long as the wood has been exposed to light for 3 to 6 month. Other spices of wood might require different amounts to achieve the same result.</p>



<p><strong>Important:</strong> using 10% and 20% solution leaves behind unreacted salts (iron compounds and sulfates) which migrate to the wood surface with moisture and crystalize as white residue:</p>



<figure class="wp-block-image size-large"><a href="https://kaspars.net/wp-content/uploads/2025/09/too-much-iron-suphate-scaled.jpeg"><img loading="lazy" decoding="async" width="1920" height="1440" src="https://kaspars.net/wp-content/uploads/2025/09/too-much-iron-suphate-scaled.jpeg?strip=all&#038;quality=90&#038;resize=1920,1440" alt="Unreacted salts crystallize as white residue on the wood surface" class="wp-image-10444" srcset="https://kaspars.net/wp-content/uploads/2025/09/too-much-iron-suphate-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2025/09/too-much-iron-suphate-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2025/09/too-much-iron-suphate-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2025/09/too-much-iron-suphate-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2025/09/too-much-iron-suphate-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2025/09/too-much-iron-suphate-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2025/09/too-much-iron-suphate-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></a><figcaption class="wp-element-caption">Unreacted salts crystallize as white residue on the wood surface because of too much iron sulphate.</figcaption></figure>



<h2 class="wp-block-heading">Improving Wood Resistance</h2>



<p>Could we mix the iron sulphate with additional components to actually help preserve the wood? Turns out there a bunch of other readily available components that can help with that:</p>



<ul class="wp-block-list">
<li><strong>Sodium silicate</strong> or liquid glass is used to seal concrete and does something similar to wood.</li>



<li><strong>Potassium silicate</strong> is used to harden wood when making violins.</li>



<li><strong>Calcium hydroxide</strong> or &#8220;slaked lime&#8221; to help lock silica inside the wood. </li>



<li><strong>Borax</strong> protects against fungi growth and insects.</li>
</ul>



<p>I&#8217;m planning to experiment with the following solution (for 1 liter):</p>



<ul class="wp-block-list">
<li>600ml warm water at 40C.</li>



<li>100ml sodium silicate solution (30%).</li>



<li>50ml potassium silicate solution (30%), if available (or use more sodium silicate).</li>



<li>10g iron sulphate.</li>



<li>10g borax.</li>



<li>1-2g of calcium hydroxide (if available).</li>



<li>0.5g or a pinch of lime as citric acid. </li>



<li>3 drops of mild dish soap.</li>
</ul>



<p>This blend integrates:</p>



<ul class="wp-block-list">
<li><strong>Silicate blend (sodium + potassium)</strong> penetrates the wood and forms a silica network within the cell walls. As the solution dries the silicates polymerize into insoluble silica gels, creating a mineralized surface layer that hardens the wood and makes it less attractive to fungi.</li>



<li><strong>Catalyst (iron sulphate)</strong>&nbsp;helps fix the silicates by crosslinking them into less soluble forms while also reacting with lignin and tannins to form iron–tannate complexes that give the characteristic grey patina.</li>



<li><strong>Bioprotection (borax)</strong>&nbsp;provides long-term resistance against fungi and insects by diffusing into the wood and disrupting their metabolic processes.</li>



<li><strong>Fixation control (lime or citric acid)</strong>&nbsp;adjusts the highly alkaline silicate solution to a more favorable pH. A small addition of lime encourages the formation of calcium silicate hydrates, while a touch of citric acid can guide gelation and precipitation inside the fibers, preventing salts from crystallizing on the surface.</li>



<li><strong>Wetting agent (soap)</strong>&nbsp;reduces surface tension, allowing the solution to spread and absorb more evenly into the wood instead of beading or leaving untreated patches.</li>
</ul>



<p>AI is suggesting the following additions which I might consider as well:</p>



<ul class="wp-block-list">
<li><strong>Colloidal silica (10ml of 30% solution) or a concrete densifier</strong> contains ultra-fine silica particles that penetrate more deeply into the wood and bond with the silicate network, improving hardness and reducing surface bloom.</li>



<li><strong>Isopropyl alcohol (200ml, 70–99%)</strong> as a partial water replacement to lower surface tension. This helps the treatment wet the fibers more effectively, improves penetration in resinous pine, and speeds up drying.</li>
</ul>



<p><strong>This kind of treatment is expected to increase the lifetime of wood siding by 100% taking it from approximately 12 years to 25 years.</strong></p>



<h2 class="wp-block-heading">Related Resources</h2>



<ul class="wp-block-list">
<li><a href="https://www.mdpi.com/1999-4907/11/6/658">The Staining Effect of Iron (II) Sulfate on Nine Different Wooden Substrates</a>&nbsp;(<a href="https://kaspars.net/wp-content/uploads/2025/09/the-staining-effect-of-iron-ii-sulfate-on-nine-different-wooden-substrates.pdf" data-type="attachment" data-id="10459">PDF</a>)</li>



<li><a href="https://www.swst.org/wp/meetings/AM10/pdfs/WS-59%20Peng%20Yucheng%20Paper.pdf">Sodium silicate coated wood</a>&nbsp;(<a href="https://kaspars.net/wp-content/uploads/2025/09/sodium-silicate-coated-wood.pdf" data-type="attachment" data-id="10458">PDF</a>)</li>
</ul>



<h2 class="wp-block-heading">Comments and Suggestions</h2>



<p>Have you done any experiments with this? Please share them in the comments!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/iron-sulphate-wood-silver/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-ii-sulphate-siding-closeup-scaled.jpeg" length="1528777" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/09/dzelzs-sulfats-dzelzs-vitriols-augu-meslojumi.jpg" length="184411" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/09/before-applying-iron-sulphate.jpeg" length="999268" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet.jpeg" length="1217848" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/09/after-applying-iron-sulphate-wet-closeup-scaled.jpeg" length="1246067" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/09/24h-after-applying-iron-sulphate.jpeg" length="715271" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/09/too-much-iron-suphate-scaled.jpeg" length="1138870" type="image/jpeg" />	</item>
		<item>
		<title>Notes on FAIR Package Manager</title>
		<link>https://kaspars.net/blog/notes-fair-package-manager</link>
					<comments>https://kaspars.net/blog/notes-fair-package-manager#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sat, 23 Aug 2025 18:15:08 +0000</pubDate>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=10293</guid>

					<description><![CDATA[Had a deeper look at the FAIR package manager today. Version 1.0 of the WordPress integration plugin introduced package signatures verification (in this pull request). That means that WordPress sites can now cryptographically confirm that a downloaded plugin or theme really came from the claimed publisher (as long as you trust the keys reported by [&#8230;] <a href="https://kaspars.net/blog/notes-fair-package-manager" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>Had a deeper look at the <a href="https://github.com/fairpm">FAIR package manager</a> today.</p>



<p>Version 1.0 of the <a href="https://github.com/fairpm/fair-plugin">WordPress integration plugin</a> introduced package signatures verification (<a href="https://github.com/fairpm/fair-plugin/pull/247">in this pull request</a>). That means that WordPress sites can now cryptographically confirm that a downloaded plugin or theme really came from the claimed publisher (as long as you trust the keys reported by <a href="https://web.plc.directory">plc.directory</a>).</p>



<p>Full signature verification isn&#8217;t trivial. To check a <a href="https://web.plc.directory/spec/v0.1/did-plc">did:plc identity properly</a> you have to walk the entire chain of signed operations all the way back to the genesis operation where the DID is anchored.</p>



<span id="more-10293"></span>



<p>That requires some pretty heavy crypto for a WordPress host (where the client plugin is installed):</p>



<ul class="wp-block-list">
<li>multibase / base58 decoding</li>



<li>DAG-CBOR + CID recomputation</li>



<li>ECDSA (secp256k1, P-256) signature checks</li>
</ul>



<p>Not every shared host is going to have PHP extensions for all of that.&nbsp;The protocol does elegantly handle key rotation but the burden of verification falls entirely on the consumer.</p>



<p>Just &#8220;trusting&#8221; whatever keys come back from <a href="https://plc.directory">plc.directory</a> for each package DID identifier isn&#8217;t secure. You have to validate the full audit log yourself because otherwise you&#8217;re open to tampering.&nbsp;</p>



<p>So the standard is promising but until FAIR bakes in real signature checks, WordPress users aren&#8217;t getting the security guarantees this model could deliver.&nbsp;</p>



<p>The rest of plugin features are really nice for privacy and general data protection &#8212; you no longer report all published content to <a href="https://pingomatic.com" rel="nofollow">Ping-o-Matic</a> or send <a href="https://github.com/WordPress/WordPress/blob/a8af90bcd1c323cf792c156f355db87767b9f7ab/wp-admin/includes/dashboard.php#L1814">every admin dashboard request to WP-org servers</a>. Here is a report of <a href="https://wpelevator.com/guides/replace-wordpress-update-apis">all external calls made by standard WordPress installs</a>.</p>



<h2 class="wp-block-heading">How FAIR Works?</h2>



<p>A plugin author publishes a WordPress plugin with a <a href="https://web.plc.directory/spec/v0.1/did-plc">PLC:DID identifier</a> such as:</p>



<pre class="wp-block-code"><code>did:plc:deoui6ztyx6paqajconl67rz</code></pre>



<p>The FAIR client plugin fetches the JSON metadata for the DID from the <a href="https://plc.directory/did:plc:deoui6ztyx6paqajconl67rz">plc.directory</a> URL:</p>



<pre class="wp-block-code"><code>https:&#47;&#47;plc.directory/did:plc:deoui6ztyx6paqajconl67rz</code></pre>



<p>which returns:</p>



<pre class="wp-block-code"><code>{
	"@context": &#91;
		"https://www.w3.org/ns/did/v1",
		"https://w3id.org/security/multikey/v1",
		"https://w3id.org/security/suites/secp256k1-2019/v1"
	],
	"id": "did:plc:deoui6ztyx6paqajconl67rz",
	"alsoKnownAs": &#91;],
	"verificationMethod": &#91;
		{
			"id": "did:plc:deoui6ztyx6paqajconl67rz#fairpm",
			"type": "Multikey",
			"controller": "did:plc:deoui6ztyx6paqajconl67rz",
			"publicKeyMultibase": "zQ3shjiQmfcvNg5ExJuCcX8Bfzaa77y3yxD9iPMYmeRYbk4Vf"
		}
	],
	"service": &#91;
		{
			"id": "#fairpm_repo",
			"type": "FairPackageManagementRepo",
			"serviceEndpoint": "https://fair.git-updater.com/wp-json/minifair/v1/packages/did:plc:deoui6ztyx6paqajconl67rz"
		}
	]
}</code></pre>



<p>where the key parts are:</p>



<ol class="wp-block-list">
<li>the public keys defined under <code>verificationMethod</code> with <code>type</code> equal to <code>Multikey</code> and the <code>id</code> containing <code>#fairpm</code>.</li>



<li>the package URL under <code>serviceEndpoint</code> with type <code>FairPackageManagementRepo</code> and <code>id</code> containing <code>#fairpm_</code>.</li>
</ol>



<p>In order to ensure that the <code>publicKeyMultibase</code> value is actually <strong>a valid public key belonging to the DID</strong>, you need to parse the full <a href="https://web.plc.directory/api/redoc#operation/GetPlcAuditLog">DID activity log</a> and verify that each operation is signed and derived from the previous one, including the DID itself at the genesis operation.</p>



<p>It then fetches the <a href="https://fair.git-updater.com/wp-json/minifair/v1/packages/did:plc:deoui6ztyx6paqajconl67rz">resolved <code>serviceEndpoint</code> URL</a> with the <code>Accept: application/json</code> request header:</p>



<pre class="wp-block-code"><code>https:&#47;&#47;fair.git-updater.com/wp-json/minifair/v1/packages/did:plc:deoui6ztyx6paqajconl67rz</code></pre>



<p>which returns:</p>



<pre class="wp-block-code"><code>{
    "@context": "https://fair.pm/ns/metadata/v1",
    "id": "did:plc:deoui6ztyx6paqajconl67rz",
    "type": "wp-plugin",
    "name": "Handbook Callout Blocks",
    "slug": "handbook-callout-blocks",
    "filename": "handbook-callout-blocks/handbook.php",
    "description": "The make.wordpress.org blog has wonderful callout blocks but they seem to be baked in as part of the WP.org Handbook plugin.\nI was able to \u2026",
    "authors": &#91;
        {
            "name": "WordPress.org, Andy Fragen",
            "url": ""
        }
    ],
    "license": "GPL-2.0-or-later",
    "security": &#91;],
    "keywords": &#91;
        "wporg",
        "handbook",
        "callout"
    ],
    "sections": {
        "description": "&lt;p&gt;The make.wordpress.org blog has wonderful callout blocks but they seem to be baked in as part of the WP.org &lt;a href=\"https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook\"&gt;Handbook plugin&lt;/a&gt;.&lt;/p&gt;\n&lt;p&gt;I was able to strip out the relevant parts of the Handbook plugin retaining only the callout blocks.&lt;/p&gt;\n&lt;h3&gt;Special Thanks&lt;/h3&gt;\n&lt;ul&gt;\n&lt;li&gt;&lt;a href=\"https://profiles.wordpress.org/ipstenu/\"&gt;@Ipstenu&lt;/a&gt; for her terrific sleuthing skills.&lt;/li&gt;\n&lt;li&gt;&lt;a href=\"https://profiles.wordpress.org/Clorith\"&gt;@Clorith&lt;/a&gt; for bringing code up to current standards and best practices.&lt;/li&gt;\n&lt;/ul&gt;",
        "changelog": "&lt;p&gt;&#91;unreleased]&lt;/p&gt;\n&lt;ul&gt;\n&lt;li&gt;add support for &lt;code&gt;core/list&lt;/code&gt;&lt;/li&gt;\n&lt;li&gt;refactor for current standards and practices courtesy of @Clorith&lt;/li&gt;\n&lt;li&gt;make editor padding match&lt;/li&gt;\n&lt;li&gt;load dashicons for non-logged in users&lt;/li&gt;\n&lt;li&gt;initial release&lt;/li&gt;\n&lt;li&gt;add composer.json&lt;/li&gt;\n&lt;/ul&gt;"
    },
    "releases": &#91;
        {
            "version": "1.0.3",
            "requires": {
                "env:php": "&gt;=7.4",
                "env:wp": "&gt;=5.9"
            },
            "suggests": {
                "env:wp": "&gt;=6.7.2"
            },
            "provides": &#91;],
            "artifacts": {
                "icon": &#91;
                    {
                        "url": "https://s.w.org/plugins/geopattern-icon/handbook-callout-blocks.svg",
                        "content-type": "image/svg+xml",
                        "height": null,
                        "width": null
                    }
                ],
                "package": &#91;
                    {
                        "url": "https://api.github.com/repos/afragen/handbook-callout-blocks/releases/assets/274184925",
                        "content-type": "application/octet-stream",
                        "signature": "AcKSOVp2EHQCSWBO5LZCDv4puOpvJILsovIynQkf-hcpBOGpkuc4aaLi5NC9Gd4s3IBNzbqFzM75a6lcx4kk_w",
                        "checksum": "sha256:bb2f21d4f5b3e6a8daa361abb75b366d90059a7e1a15c18100ca3492cdb252af"
                    }
                ]
            }
        }
    ]
}</code></pre>



<p>which is now used to render all the information about the plugin in the WP admin before the installation and during upgrades. The signature of the package ZIP file can now be verified using the public key extracted from the first step. </p>



<h2 class="wp-block-heading">FAIR Branding</h2>



<p>While researching this, I also did some exploration for the possible FAIR project and package manager logo/icon. Since the FAIR branding needs to apply to multiple initiatives, it would be easy to go with a shared icon + wordmark for each project. The isolated FAIR letters represent the distributed and decoupled nature of this project.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1800" height="1200" src="https://kaspars.net/wp-content/uploads/2025/08/55cb02e56d8a6db9.png?strip=all&#038;quality=90&#038;resize=1800,1200" alt="FAIR acronym" class="wp-image-10334" srcset="https://kaspars.net/wp-content/uploads/2025/08/55cb02e56d8a6db9.png?strip=all&amp;quality=90&amp;resize=1280%2C853 1280w, https://kaspars.net/wp-content/uploads/2025/08/55cb02e56d8a6db9.png?strip=all&amp;quality=90&amp;resize=1536%2C1024 1536w, https://kaspars.net/wp-content/uploads/2025/08/55cb02e56d8a6db9.png?strip=all&amp;quality=90&amp;resize=384%2C256 384w, https://kaspars.net/wp-content/uploads/2025/08/55cb02e56d8a6db9.png?strip=all&amp;quality=90&amp;resize=768%2C512 768w, https://kaspars.net/wp-content/uploads/2025/08/55cb02e56d8a6db9.png?strip=all&amp;quality=90&amp;resize=1024%2C683 1024w, https://kaspars.net/wp-content/uploads/2025/08/55cb02e56d8a6db9.png?strip=all&amp;quality=90&amp;resize=1800%2C1200 1800w" sizes="auto, (max-width: 1800px) 100vw, 1800px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1800" height="1200" src="https://kaspars.net/wp-content/uploads/2025/08/af43397f29d7ebe8.png?strip=all&#038;quality=90&#038;resize=1800,1200" alt="" class="wp-image-10333" srcset="https://kaspars.net/wp-content/uploads/2025/08/af43397f29d7ebe8.png?strip=all&amp;quality=90&amp;resize=1280%2C853 1280w, https://kaspars.net/wp-content/uploads/2025/08/af43397f29d7ebe8.png?strip=all&amp;quality=90&amp;resize=1536%2C1024 1536w, https://kaspars.net/wp-content/uploads/2025/08/af43397f29d7ebe8.png?strip=all&amp;quality=90&amp;resize=384%2C256 384w, https://kaspars.net/wp-content/uploads/2025/08/af43397f29d7ebe8.png?strip=all&amp;quality=90&amp;resize=768%2C512 768w, https://kaspars.net/wp-content/uploads/2025/08/af43397f29d7ebe8.png?strip=all&amp;quality=90&amp;resize=1024%2C683 1024w, https://kaspars.net/wp-content/uploads/2025/08/af43397f29d7ebe8.png?strip=all&amp;quality=90&amp;resize=1800%2C1200 1800w" sizes="auto, (max-width: 1800px) 100vw, 1800px" /></figure>



<h2 class="wp-block-heading">Contributions</h2>



<p>As part of this research I also create the following issues and suggestions:</p>



<ul class="wp-block-list">
<li><a href="https://github.com/fairpm/fair-protocol/issues/50">Protocol clarification: <code>verificationMethod</code> type MUST be <code>Multikey</code> or <code>Multibase</code></a></li>



<li><a href="https://github.com/fairpm/fair-plugin/issues/231">Missing signature verification for did:&#8230; packages</a></li>



<li><a href="https://github.com/fairpm/fair-plugin/issues/233">Diagrams explaining the DID package install and upgrade workflow</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/notes-fair-package-manager/feed</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2025/08/fair.png" length="11621" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/08/55cb02e56d8a6db9.png" length="15639" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/08/af43397f29d7ebe8.png" length="16420" type="image/png" />	</item>
		<item>
		<title>The Potential of WordPress Comments</title>
		<link>https://kaspars.net/blog/wordpress-comments-potential</link>
					<comments>https://kaspars.net/blog/wordpress-comments-potential#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Fri, 20 Jun 2025 09:33:01 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[Web]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=10183</guid>

					<description><![CDATA[WordPress comments are missing critical functionality to really embrace engagement and community &#8212; there are no notifications when your comment is approved or gets a reply, which prevents any kind of continued discussion. In this video I&#8217;m demonstrating an update to the Comment Approval Notifications plugin (which hasn&#8217;t been touched in 10 years) to extend [&#8230;] <a href="https://kaspars.net/blog/wordpress-comments-potential" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-video alignwide"><video height="1080" style="aspect-ratio: 1440 / 1080;" width="1440" controls data-src="https://kaspars.net/wp-content/uploads/2025/06/comment-pilot-min.mp4"></video></figure>



<p>WordPress comments are missing critical functionality to really embrace engagement and community &#8212; there are no notifications when your comment is approved or gets a reply, which prevents any kind of continued discussion.</p>



<p>In this video I&#8217;m demonstrating an update to the <a href="https://github.com/kasparsd/comment-approved-notify">Comment Approval Notifications</a> plugin (which hasn&#8217;t been touched in 10 years) to extend the notifications to comment approvals, replies and new comments in general.</p>



<span id="more-10183"></span>



<p><a href="https://jetpack.com/support/comments/">Jetpack comments</a> has some of these features but I wonder if there is a place for a decentralized solution? </p>



<p>An alternative to email is the <a href="https://wordpress.org/plugins/activitypub/">Fediverse</a> which supports replies across WordPress sites and other ActivityPub clients. In addition, it also handles notifications nicely in the mobile apps.</p>



<p>What do you think? </p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/wordpress-comments-potential/feed</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2025/06/comment-pilot-min.mp4" length="28835537" type="video/mp4" />

			</item>
		<item>
		<title>Remote Logging for Mikrotik RouterOS</title>
		<link>https://kaspars.net/blog/remote-logging-mikrotik-routeros</link>
					<comments>https://kaspars.net/blog/remote-logging-mikrotik-routeros#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sat, 22 Mar 2025 08:14:11 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Homelab]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[MikroTik]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=9994</guid>

					<description><![CDATA[How to configure remote syslog in Mikrotik RouterOS for logging to Grafana Promtail and Alloy? <a href="https://kaspars.net/blog/remote-logging-mikrotik-routeros" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>Since versions 7.18 of RouterOS I&#8217;ve been having trouble with the LTE connection on <a href="https://mikrotik.com/product/wap_lte_kit_2024">Mikrotik wAP LTE kit</a> (<a href="https://www.amazon.de/dp/B074WCRY35?tag=drlwl-21">Amazon</a>) with <a href="https://mikrotik.com/product/r11e_lte6">R11e-LTE6</a> modem (firmware V038) where it would randomly go into an infinite loop of <code>lte1 link up</code> and <code>lte1 link down</code> every few days. <strong>Update (November 2025):</strong> this appears to have been fixed in one of the recent Router OS 7.20 versions.</p>



<p>So I configured remote logging to capture the events that happen in the lead up to the issue since the logs on the disk get rotated very quickly due to the shear volume of the messages. Turns out that setting up the remote logging in RouterOS is way more involved so I wrote this guide to note some of the undocumented behaviors and features.</p>



<span id="more-9994"></span>



<h2 class="wp-block-heading">Logging in RouterOS</h2>



<p>Logging can be configured under &#8220;System → Logging&#8221; where you define Rules about which log events (topics) trigger which log Actions:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2132" height="1336" src="https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rules.png?strip=all&#038;quality=90&#038;resize=2132,1336" alt="Logging rules for event topics in Mikrotik RouterOS" class="wp-image-9999" srcset="https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rules.png?strip=all&amp;quality=90&amp;resize=1280%2C802 1280w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rules.png?strip=all&amp;quality=90&amp;resize=1920%2C1203 1920w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rules.png?strip=all&amp;quality=90&amp;resize=1536%2C963 1536w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rules.png?strip=all&amp;quality=90&amp;resize=2048%2C1283 2048w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rules.png?strip=all&amp;quality=90&amp;resize=384%2C241 384w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rules.png?strip=all&amp;quality=90&amp;resize=768%2C481 768w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rules.png?strip=all&amp;quality=90&amp;resize=1024%2C642 1024w" sizes="auto, (max-width: 2132px) 100vw, 2132px" /></figure>



<p>Most of these rules are pre-configured by default.</p>



<p>Each rule has two parts:</p>



<ol class="wp-block-list">
<li><strong>Topics</strong> which is either log severity &#8212; <code>critical</code>, <code>error</code>, <code>warning</code>, <code>info</code>, <code>debug</code> or a specific component targeting &#8212; <code>lte</code>, <code>firewall</code>, etc.</li>



<li><strong>Action</strong> for where the log entry is sent &#8212; <code>echo</code> for terminal output, <code>memory</code> for RAM, <code>disk</code> for writing to flash, <code>email</code> for email and <code>remote</code> for what we&#8217;re after.</li>
</ol>



<p>And here is the individual rule configuration:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1920" height="1203" src="https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rule-action.png?strip=all&#038;quality=90&#038;resize=1920,1203" alt="Logging rule in Mikrotik RouterOS" class="wp-image-9998" srcset="https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rule-action.png?strip=all&amp;quality=90&amp;resize=1920%2C1203 1920w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rule-action.png?strip=all&amp;quality=90&amp;resize=1280%2C802 1280w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rule-action.png?strip=all&amp;quality=90&amp;resize=1536%2C962 1536w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rule-action.png?strip=all&amp;quality=90&amp;resize=2048%2C1283 2048w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rule-action.png?strip=all&amp;quality=90&amp;resize=384%2C241 384w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rule-action.png?strip=all&amp;quality=90&amp;resize=768%2C481 768w, https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rule-action.png?strip=all&amp;quality=90&amp;resize=1024%2C642 1024w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></figure>



<p><strong>Important:</strong> the topic selection is <em>ANDed</em> together &#8212; specifying multiple topics will make the rule apply only <em>if the log event belongs to all of the selected topics</em>!</p>



<p>The Regex filtering can be applied to the log string contents to narrow down the selected events even further. Each rule can have only one action!</p>



<p>Funny how RouterOS is glass half-empty with the &#8220;NOT INVALID&#8221; flag.</p>



<h2 class="wp-block-heading">Remote Log Action</h2>



<p>We need to configure the <code>remote</code> log action which is enabled by default but without the remote address defined. Here are the available configuration options:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2132" height="1336" src="https://kaspars.net/wp-content/uploads/2025/03/routeros-remote-logging-action-settings.png?strip=all&#038;quality=90&#038;resize=2132,1336" alt="Remote logging action in Mikrotik RouterOS" class="wp-image-9997" srcset="https://kaspars.net/wp-content/uploads/2025/03/routeros-remote-logging-action-settings.png?strip=all&amp;quality=90&amp;resize=1280%2C802 1280w, https://kaspars.net/wp-content/uploads/2025/03/routeros-remote-logging-action-settings.png?strip=all&amp;quality=90&amp;resize=1920%2C1203 1920w, https://kaspars.net/wp-content/uploads/2025/03/routeros-remote-logging-action-settings.png?strip=all&amp;quality=90&amp;resize=1536%2C963 1536w, https://kaspars.net/wp-content/uploads/2025/03/routeros-remote-logging-action-settings.png?strip=all&amp;quality=90&amp;resize=2048%2C1283 2048w, https://kaspars.net/wp-content/uploads/2025/03/routeros-remote-logging-action-settings.png?strip=all&amp;quality=90&amp;resize=384%2C241 384w, https://kaspars.net/wp-content/uploads/2025/03/routeros-remote-logging-action-settings.png?strip=all&amp;quality=90&amp;resize=768%2C481 768w, https://kaspars.net/wp-content/uploads/2025/03/routeros-remote-logging-action-settings.png?strip=all&amp;quality=90&amp;resize=1024%2C642 1024w" sizes="auto, (max-width: 2132px) 100vw, 2132px" /></figure>



<p>It supports three remote log formats:</p>



<ul class="wp-block-list">
<li><strong>default</strong> &#8212; a custom Mikrotik format that matches the RouterOS log strings.</li>



<li><strong>BSD syslog</strong> &#8212; which is actually the legacy <a href="https://datatracker.ietf.org/doc/html/rfc3164">RFC 3164</a> standard (replaced with <a href="https://datatracker.ietf.org/doc/html/rfc5424">RFC 5424</a>).</li>



<li><strong>CEF</strong> or Common Event Format with pipe-delimited fields with syslog prefix.</li>
</ul>



<p>which can be transported over UDP or TCP with additional customization for the timestamp format:</p>



<ul class="wp-block-list">
<li><strong>BSD</strong> (example: <code>Mar 16 17:43:09</code>)</li>



<li><strong>ISO8610</strong> (example: <code>2025-03-16T17:48:26.0000+0200</code>)</li>
</ul>



<p>Here are examples of a log messages in each format:</p>



<h3 class="wp-block-heading">Default Format</h3>



<p>Note how it doesn&#8217;t include the event timestamp:</p>



<pre class="wp-block-code"><code>system,info log action changed by macintosh-intel-mac-os-x/web:admin@10.200.200.16 (/system logging action set "" remote=192.168.88.113 remote-log-format=default remote-port=9514 remote-protocol=udp src-address=0.0.0.0 syslog-facility=daemon syslog-severity=auto syslog-time-format=bsd-syslog target=remote)</code></pre>



<h3 class="wp-block-heading">BSD syslog Format</h3>



<p>Note the priority prefix <code>&lt;30&gt;</code> follow by the <a href="https://datatracker.ietf.org/doc/html/rfc3164#section-4.1.2">timestamp in the header</a>.</p>



<pre class="wp-block-code"><code>&lt;30&gt;Mar 16 17:43:09 mt-hap-capsman log action changed by macintosh-intel-mac-os-x/web:admin@10.200.200.16 (/system logging action set "" remote=192.168.88.113 remote-log-format=syslog remote-port=9514 remote-protocol=udp src-address=0.0.0.0 syslog-facility=daemon syslog-severity=auto syslog-time-format=bsd-syslog target=remote)</code></pre>



<p>BSD syslog with ISO8610 timestamp:</p>



<pre class="wp-block-code"><code>&lt;30&gt;2025-03-16T17:48:26.0000+0200 mt-hap-capsman log action changed by macintosh-intel-mac-os-x/web:admin@10.200.200.16 (/system logging action set "" remote=192.168.88.113 remote-log-format=syslog remote-port=9514 remote-protocol=udp src-address=0.0.0.0 syslog-facility=daemon syslog-severity=auto syslog-time-format=iso8601 target=remote)</code></pre>



<h3 class="wp-block-heading">CEF Format</h3>



<p>Note how this appears to be the most verbose and include additional information about the system config:</p>



<pre class="wp-block-code"><code>Mar 16 17:43:38 mt-hap-capsman CEF:0|MikroTik|hAP ac^2|7.18.2 (stable)|10|system,info|Low|dvchost=mt-hap-capsman dvc=192.168.88.2 msg=log action changed by macintosh-intel-mac-os-x/web:admin@10.200.200.16 (/system logging action set "" cef-event-delimiter\="" remote\=192.168.88.113 remote-log-format\=cef remote-port\=9514 remote-protocol\=udp src-address\=0.0.0.0 syslog-facility\=daemon syslog-severity\=auto syslog-time-format\=bsd-syslog target\=remote)</code></pre>



<h2 class="wp-block-heading">Syslog Server with Grafana Promtail and Loki</h2>



<figure class="wp-block-image alignwide size-medium"><img loading="lazy" decoding="async" width="1280" height="706" src="https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-promtail-loki-grafana.png?strip=all&#038;quality=90&#038;resize=1280,706" alt="Mikrotik RouterOS syslog remote logging to Promtail, Loki and Grafana" class="wp-image-11176" srcset="https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-promtail-loki-grafana.png?strip=all&amp;quality=90&amp;resize=1280%2C706 1280w, https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-promtail-loki-grafana.png?strip=all&amp;quality=90&amp;resize=1536%2C847 1536w, https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-promtail-loki-grafana.png?strip=all&amp;quality=90&amp;resize=384%2C212 384w, https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-promtail-loki-grafana.png?strip=all&amp;quality=90&amp;resize=768%2C424 768w, https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-promtail-loki-grafana.png?strip=all&amp;quality=90&amp;resize=1024%2C565 1024w, https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-promtail-loki-grafana.png?strip=all&amp;quality=90&amp;resize=1810%2C998 1810w" sizes="auto, (max-width: 1280px) 100vw, 1280px" /><figcaption class="wp-element-caption">Mikrotik RouterOS remote logging using syslog to Promtail which pushes them to Loki while Grafana can be used to parse and visualize the logs.</figcaption></figure>



<p>Here is a minimal <code>docker-compose.yml</code> for a Grafana Promtail listening on port 5514 for UDP traffic (and labeling the logs by hostname and severity) and pushing them to a Grafana Loki server on port 3100 for storage:</p>



<pre class="wp-block-code"><code>services:
  loki:
    image: grafana/loki:3.6
    ports:
      - 3100:3100

  promtail:
    image: grafana/promtail:3.4.2
    ports:
      - 5514:5514/udp
    volumes:
      - etc-promtail:/etc/promtail
    command: -config.file=/etc/promtail/promtail-config.yml

volumes:
  etc-promtail:</code></pre>



<p>and the <code>promtail-config.yml</code> contents:</p>



<pre class="wp-block-code"><code>server:
  disable: true

positions:
  filename: /tmp/positions.yaml

clients:
  - url: http://loki:3100/loki/api/v1/push

scrape_configs:
  - job_name: syslog
    syslog:
      listen_address: 0.0.0.0:5514
      listen_protocol: udp
      syslog_format: rfc3164
      labels:
        job: syslog
    relabel_configs:
      - source_labels: &#91;'__syslog_message_hostname']
        target_label: host
      - source_labels: &#91;'__syslog_message_hostname']
        target_label: instance
      - source_labels: &#91;'__syslog_message_app_name']
        target_label: application
      - source_labels: &#91;'__syslog_message_severity']
        target_label: level</code></pre>



<p>Although Grafana Promtail is being replaced with Grafana Alloy, I found the new configuration format much harder to work with so I&#8217;m sticking with Promtail as something well tested and reliable.</p>



<p>Importantly, we&#8217;re using Promtail here only for labeling the syslog messages by their hostname, message context and severity which isn&#8217;t supported by the loki built-in syslog integration.</p>



<h3 class="wp-block-heading">Logs in Grafana</h3>



<p>You can then add Loki as a data source in Grafana and display the logs as needed:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2664" height="1620" src="https://kaspars.net/wp-content/uploads/2025/03/grafana-logs-mikrotik-routeros-syslog.png?strip=all&#038;quality=90&#038;resize=2664,1620" alt="Mikrotik RouterOS syslog in Grafana" class="wp-image-10036" srcset="https://kaspars.net/wp-content/uploads/2025/03/grafana-logs-mikrotik-routeros-syslog.png?strip=all&amp;quality=90&amp;resize=1280%2C778 1280w, https://kaspars.net/wp-content/uploads/2025/03/grafana-logs-mikrotik-routeros-syslog.png?strip=all&amp;quality=90&amp;resize=1920%2C1168 1920w, https://kaspars.net/wp-content/uploads/2025/03/grafana-logs-mikrotik-routeros-syslog.png?strip=all&amp;quality=90&amp;resize=1536%2C934 1536w, https://kaspars.net/wp-content/uploads/2025/03/grafana-logs-mikrotik-routeros-syslog.png?strip=all&amp;quality=90&amp;resize=2048%2C1245 2048w, https://kaspars.net/wp-content/uploads/2025/03/grafana-logs-mikrotik-routeros-syslog.png?strip=all&amp;quality=90&amp;resize=384%2C234 384w, https://kaspars.net/wp-content/uploads/2025/03/grafana-logs-mikrotik-routeros-syslog.png?strip=all&amp;quality=90&amp;resize=768%2C467 768w, https://kaspars.net/wp-content/uploads/2025/03/grafana-logs-mikrotik-routeros-syslog.png?strip=all&amp;quality=90&amp;resize=1024%2C623 1024w" sizes="auto, (max-width: 2664px) 100vw, 2664px" /></figure>



<h2 class="wp-block-heading">Debug Syslog UDP and TCP Traffic</h2>



<p>You can use netcat (nc) to capture the messages sent by RouterOS on the remote host:</p>



<ul class="wp-block-list">
<li><code>nc -k -v -l -p 9514</code> to capture TCP traffic on port 9514.</li>



<li><code>nc -k -v -l -u -p 5514</code> to capture UDP traffic on port 5514.</li>
</ul>



<p>where:</p>



<ul class="wp-block-list">
<li><code>-k</code> keeps the connection alive and listening,</li>



<li><code>-v</code> prints verbose information,</li>



<li><code>-l</code> makes it listen for incoming connections instead of making one, </li>



<li><code>-p</code> for port to listen on.</li>



<li><code>-u</code> for UDP traffic (defaults to TCP without the flag).</li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1460" height="1076" src="https://kaspars.net/wp-content/uploads/2025/03/nc-syslog-logging-routeros.png?strip=all&#038;quality=90&#038;resize=1460,1076" alt="Using nc (netcat) to debug Mikrotik RouterOS remote syslog" class="wp-image-10001" srcset="https://kaspars.net/wp-content/uploads/2025/03/nc-syslog-logging-routeros.png?strip=all&amp;quality=90&amp;resize=1280%2C943 1280w, https://kaspars.net/wp-content/uploads/2025/03/nc-syslog-logging-routeros.png?strip=all&amp;quality=90&amp;resize=384%2C283 384w, https://kaspars.net/wp-content/uploads/2025/03/nc-syslog-logging-routeros.png?strip=all&amp;quality=90&amp;resize=768%2C566 768w, https://kaspars.net/wp-content/uploads/2025/03/nc-syslog-logging-routeros.png?strip=all&amp;quality=90&amp;resize=1024%2C755 1024w, https://kaspars.net/wp-content/uploads/2025/03/nc-syslog-logging-routeros.png?strip=all&amp;quality=90&amp;resize=1460%2C1076 1460w" sizes="auto, (max-width: 1460px) 100vw, 1460px" /></figure>



<p>Or tcpdump to capture both TCP and UDP traffic in a PCAP file for viewing in Wireshark:</p>



<pre class="wp-block-code"><code>tcpdump -i any port 6514 -w dump-tcp.pcap</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2596" height="1816" src="https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-bsd-packet-udp.png?strip=all&#038;quality=90&#038;resize=2596,1816" alt="Remote syslog traffic from Mikrotik RouterOS in Wireshark" class="wp-image-10000" srcset="https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-bsd-packet-udp.png?strip=all&amp;quality=90&amp;resize=1280%2C895 1280w, https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-bsd-packet-udp.png?strip=all&amp;quality=90&amp;resize=1920%2C1343 1920w, https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-bsd-packet-udp.png?strip=all&amp;quality=90&amp;resize=1536%2C1074 1536w, https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-bsd-packet-udp.png?strip=all&amp;quality=90&amp;resize=2048%2C1433 2048w, https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-bsd-packet-udp.png?strip=all&amp;quality=90&amp;resize=384%2C269 384w, https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-bsd-packet-udp.png?strip=all&amp;quality=90&amp;resize=768%2C537 768w, https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-bsd-packet-udp.png?strip=all&amp;quality=90&amp;resize=1024%2C716 1024w" sizes="auto, (max-width: 2596px) 100vw, 2596px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/remote-logging-mikrotik-routeros/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-promtail-loki-grafana.png" length="56604" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rules.png" length="70777" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/03/routeros-logging-rule-action.png" length="68437" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/03/routeros-remote-logging-action-settings.png" length="83463" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/03/grafana-logs-mikrotik-routeros-syslog.png" length="108665" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/03/nc-syslog-logging-routeros.png" length="73270" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2025/03/mikrotik-syslog-bsd-packet-udp.png" length="218046" type="image/png" />	</item>
		<item>
		<title>Customizing the Seriously Simple Podcasting Plugin</title>
		<link>https://kaspars.net/blog/seriously-simple-podcasting-setup</link>
					<comments>https://kaspars.net/blog/seriously-simple-podcasting-setup#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sun, 01 Dec 2024 19:28:16 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snippet]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=9723</guid>

					<description><![CDATA[When setting up the podcast for my wife&#8217;s business, I applied the following customizations to the Seriously Simple Podcasting plugin for WordPress: Disable Podcast Feed Stylesheet By default the plugin applies an XSL stylesheet to the podcast RSS feeds which make them look like the podcast landing page which might confuse some users. The following [&#8230;] <a href="https://kaspars.net/blog/seriously-simple-podcasting-setup" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>When setting up the podcast for my wife&#8217;s business, I applied the following customizations to the <a href="https://wordpress.org/plugins/seriously-simple-podcasting/">Seriously Simple Podcasting plugin</a> for WordPress:</p>



<span id="more-9723"></span>



<h2 class="wp-block-heading">Disable Podcast Feed Stylesheet</h2>



<p>By default the plugin <a href="https://plugins.trac.wordpress.org/browser/seriously-simple-podcasting/tags/3.7.0/templates/feed-podcast.php#L67">applies an XSL stylesheet</a> to the podcast RSS feeds which make them look like the podcast landing page which might confuse some users. The following filter can be used to disable the stylesheet:</p>



<pre class="wp-block-code"><code>// Disable the podcast RSS XSL stylesheet.
add_filter( 'ssp_enable_rss_stylesheet', '__return_false' );</code></pre>



<h2 class="wp-block-heading">Remove Permalink Prefix from Podcast Post Type</h2>



<p>By default the <code>podcast</code> post type used for episodes (which is linked to the <code>series</code> taxonomy) includes the <code>front</code> prefix of your permalinks. For example, if the permalinks are set to <code>/blog/%postname%</code> then the podcast episode permalinks would be <code>/blog/podcast/%postname%</code> which might not be desirable.</p>



<p>Use the following filter to remove the prefix (by setting the <code>with_front</code> to <code>false</code>) and also adjust permalink slug to something custom:</p>



<pre class="wp-block-code"><code>add_filter( 
	'register_podcast_post_type_args', 
	function ( $args ) {
		$args&#91;'rewrite'] = &#91;
			'slug' =&gt; 'show', // Change `podcast` to `show` in episode URLs.
			'with_front' =&gt; false, // Remove the default prefix.
		];

		// Optional: Disable the post type archive.
		// $args&#91;'has_archive'] = false;

		return $args;
	}, 
	100
);</code></pre>



<p>Uncomment the line with <code>has_archive</code> to disable the post type archive (showing all episodes across all registered podcasts) since we already have the dedicated archives for each podcast series.</p>



<h2 class="wp-block-heading">Adjust the Podcast Series Permalink</h2>



<p>As mentioned above, each podcast series is represented by the <code>series</code> taxonomy (which appears as <code>podcasts</code> in the URLs) so the default landing page for the podcast series is <code>/blog/podcasts/podcast-title</code> where <code>/blog</code> is the permalink prefix (if any), <code>podcasts</code> is the label of the <code>series</code> taxonomy and <code>podcast-title</code> is the series term slug.</p>



<p>Most sites use a dedicated page for their podcast landing page such as <code>/podcast</code> so you can adjust the permalink of the specific term ID to point to your custom page instead:</p>



<pre class="wp-block-code"><code>add_filter( 
	'term_link', 
	function ( $url, $term, $tax ) {
		// Redirect the `podcast-series-slug` term to the `podcast` page.
		if ( 'series' === $tax &amp;&amp; 'podcast-series-slug' === $term-&gt;name ) {
				return get_permalink( get_page_by_path( 'podcast' ) );
		}

		return $url;
	}, 
	10, 
	3 
);</code></pre>



<p>Note that the example above is very fragile as it would break whenever somebody changes either the podcast series slug or the corresponding page slug. It would be better to expose this as a term meta setting that stores the corresponding post ID.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/seriously-simple-podcasting-setup/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2024/12/podcast-feed.png" length="152459" type="image/png" />	</item>
		<item>
		<title>How to Allow Unfiltered HTML to Editors on WordPress Multisite</title>
		<link>https://kaspars.net/blog/allow-unfiltered-html-multisite</link>
					<comments>https://kaspars.net/blog/allow-unfiltered-html-multisite#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Fri, 29 Nov 2024 08:20:45 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snippet]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=9708</guid>

					<description><![CDATA[WordPress multisite prevents everybody but super-admins from adding HTML blocks with &#60;script&#62; and &#60;iframe&#62; tags &#8212; also known as unfiltered_html capability which adds the following restrictions (enabled here). This is done for security reasons on sites where anyone could register and post content that could do nasty things with shared cookies (on subdomain and sub-directory [&#8230;] <a href="https://kaspars.net/blog/allow-unfiltered-html-multisite" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>WordPress multisite <a href="https://github.com/WordPress/WordPress/blob/dd967e2a2ea96e3a93b05a887477a0d487aa7d79/wp-includes/capabilities.php#L592-L601">prevents everybody but super-admins</a> from adding HTML blocks with <code>&lt;script&gt;</code> and <code>&lt;iframe&gt;</code> tags &#8212; also known as <code>unfiltered_html</code> capability which adds <a href="https://github.com/WordPress/WordPress/blob/dd967e2a2ea96e3a93b05a887477a0d487aa7d79/wp-includes/kses.php#L2264-L2294">the following restrictions</a> (<a href="https://github.com/WordPress/WordPress/blob/dd967e2a2ea96e3a93b05a887477a0d487aa7d79/wp-includes/kses.php#L2338-L2340">enabled here</a>). This is done for security reasons on sites where anyone could register and post content that could do nasty things with shared cookies (on subdomain and sub-directory setups). </p>



<span id="more-9708"></span>



<p>However, most multisite setups are actually private where you trust the content creators. On non-multisite setups this capability is enabled for <em>all users</em>. Here is a filter to <a href="https://github.com/WordPress/WordPress/blob/dd967e2a2ea96e3a93b05a887477a0d487aa7d79/wp-includes/capabilities.php#L592-L601">disable this limitation</a> for all users with the <code>editor</code> capability, for example:</p>



<pre class="wp-block-code"><code>add_filter( 
	'map_meta_cap', 
	function ( $caps, $cap, $user_id ) {
		if ( 'unfiltered_html' === $cap &amp;&amp; user_can( $user_id, 'editor' ) ) {
			return &#91; 'unfiltered_html' ];
		}

		return $caps;
	}, 
	10, 
	3 
);</code></pre>



<p>It works by &#8220;enabling&#8221; the requested capability <code>$cap</code> by including it in the requested capabilities <code>$caps</code> for the requested action. You can change <code>editor</code> to <a href="https://wordpress.org/documentation/article/roles-and-capabilities/#capabilities">any other capability</a>. Consider if you should still honour the <code>DISALLOW_UNFILTERED_HTML</code> constant which should prevent all unfiltered HTML.</p>



<p>Note that any content edits by users without this capability will simply remove the restricted HTML so you should ensure that everyone who can edit the respective content has the necessary capability.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/allow-unfiltered-html-multisite/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2024/11/unfiltered-html-cap-wp.png" length="19139" type="image/png" />	</item>
		<item>
		<title>How to Rate Limit Requests to Specific PHP Files with Nginx</title>
		<link>https://kaspars.net/blog/nginx-rate-limit-php</link>
					<comments>https://kaspars.net/blog/nginx-rate-limit-php#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sat, 14 Sep 2024 11:01:20 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snippet]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=9472</guid>

					<description><![CDATA[WordPress login and XML-RPC endpoints at wp-login.php and xmlrpc.php respectively are the mostly widely abused targets for bots scanning the web for sites with weak passwords. Here is a simple Nginx configuration snippet that allows you to set the limit_req depending on the request path and method. First, define the limit_req_zone at the http {} [&#8230;] <a href="https://kaspars.net/blog/nginx-rate-limit-php" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>WordPress login and XML-RPC endpoints at <code>wp-login.php</code> and <code>xmlrpc.php</code> respectively are the mostly widely abused targets for bots scanning the web for sites with weak passwords. Here is a simple Nginx configuration snippet that allows you to set the <code>limit_req</code> depending on the request path and method.</p>



<span id="more-9472"></span>



<p>First, define the <code><a href="https://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_req_zone">limit_req_zone</a></code> at the <code>http {}</code> level and conditionally enable it <strong>only for <code>POST</code> requests to the desired request URIs</strong> by setting the limit request zone input to <code><a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#var_binary_remote_addr">$binary_remote_addr</a></code> while keeping it undefined for all the un-mapped requests:</p>



<pre class="wp-block-code"><code>map "$request_method:$uri" $wp_post_limit_key {
	POST:/wp-login.php $binary_remote_addr;
	POST:/xmlrpc.php $binary_remote_addr;
}

limit_req_zone $wp_post_limit_key zone=wp_post_limit_zone:10m rate=5r/m;</code></pre>



<p>where:</p>



<ul class="wp-block-list">
<li><code>$wp_post_limit_key</code> is our custom variable name that is either unset by default or equal to <code>$binary_remote_addr</code> when the current request should be rate-limited.</li>



<li><code>wp_post_limit_zone</code> is our custom zone name that must be referenced in <code>limit_req</code> of each <code>server {}</code> block.</li>



<li><code>rate=5r/m</code> sets the allowed request rate from the same IP to one request per 12 seconds (60/5). <strong>Importantly, as mentioned by Igor in the comments, this is the allowed interval between requests instead of total amount of allowed requests per interval.</strong>  </li>
</ul>



<p>And then add it to the PHP location in each of your <code>server {}</code>  blocks:</p>



<pre class="wp-block-code"><code>location ~ \.php$ {
	try_files $uri =404;
        limit_req zone=wp_post_limit_zone;
	// ...
}</code></pre>



<p>You can define multiple <code>limit_req_zone</code> configurations for different request mapping logic and apply them all to the same PHP location block. </p>



<h2 class="wp-block-heading">Adjust the HTTP Response Code</h2>



<p>By default Nginx responds with HTTP <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503">503 Service Unavailable</a> status code to all throttled requests. Use the <code>limit_req_status</code> directive to change it to <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429">429 Too Many Requests</a> in either <code>http {}</code> or <code>server {}</code> block:</p>



<pre class="wp-block-code"><code>limit_req_status 429; </code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/nginx-rate-limit-php/feed</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2024/09/nginx-rate-limit-php.png" length="19999" type="image/png" />	</item>
		<item>
		<title>Use AppleScript to Resize All Windows for Screen Recording</title>
		<link>https://kaspars.net/blog/applescript-resize-all-windows</link>
					<comments>https://kaspars.net/blog/applescript-resize-all-windows#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Wed, 04 Sep 2024 09:47:40 +0000</pubDate>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[Video Blog]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=9360</guid>

					<description><![CDATA[I wasn&#8217;t able to find a tool to resize and center all open windows to a specific size for screen recording, so I came up with this AppleScript: set windowWidth to 1024set windowHeight to 768tell application "Finder" set {0, 0, screenWidth, screenHeight} to bounds of window of desktopend telltell application "System Events" set position of [&#8230;] <a href="https://kaspars.net/blog/applescript-resize-all-windows" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-video alignwide"><video height="480" style="aspect-ratio: 640 / 480;" width="640" controls data-src="https://kaspars.net/wp-content/uploads/2024/09/with-chapters.mp4"></video></figure>



<p>I wasn&#8217;t able to find a tool to <strong>resize and center all open windows</strong> to a specific size for screen recording, so I came up with this AppleScript:</p>



<pre class="wp-block-preformatted">set windowWidth to 1024<br />set windowHeight to 768<br /><br />tell application "Finder"<br />	set {0, 0, screenWidth, screenHeight} to bounds of window of desktop<br />end tell<br /><br />tell application "System Events"<br />	set position of windows of (application processes whose visible is true) to {(screenWidth - windowWidth) / 2, (screenHeight - windowHeight) / 2}<br />	set size of windows of (application processes whose visible is true) to {windowWidth, windowHeight}<br />end tell</pre>



<p>which you can save as an &#8220;Application&#8221; via Automator (built-in macOS app):</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2048" height="1536" src="https://kaspars.net/wp-content/uploads/2024/09/create-as-application.png?strip=all&#038;quality=90&#038;resize=2048,1536" alt="Automator create an application with AppleScript" class="wp-image-9373" srcset="https://kaspars.net/wp-content/uploads/2024/09/create-as-application.png?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/09/create-as-application.png?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/09/create-as-application.png?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/09/create-as-application.png?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/09/create-as-application.png?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/09/create-as-application.png?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2024/09/create-as-application.png?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w" sizes="auto, (max-width: 2048px) 100vw, 2048px" /><figcaption class="wp-element-caption">Select &#8220;Application&#8221; document type in Automator.</figcaption></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2048" height="1536" src="https://kaspars.net/wp-content/uploads/2024/09/run-applescript.png?strip=all&#038;quality=90&#038;resize=2048,1536" alt="Run AppleScript to resize the application windows" class="wp-image-9372" srcset="https://kaspars.net/wp-content/uploads/2024/09/run-applescript.png?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/09/run-applescript.png?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/09/run-applescript.png?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/09/run-applescript.png?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/09/run-applescript.png?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/09/run-applescript.png?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2024/09/run-applescript.png?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w" sizes="auto, (max-width: 2048px) 100vw, 2048px" /><figcaption class="wp-element-caption">Add &#8220;Run AppleScript&#8221; action from the Utilities section and paste in the code from above.</figcaption></figure>



<p>Save it to your desktop or any other convenient location. Double-click the app to run it. </p>



<p>Approve the permissions requests for Finder and System Events. In addition, open the &#8220;Settings&#8221; app and enable the newly created app under the &#8220;Accessibility&#8221; section:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1430" height="1536" src="https://kaspars.net/wp-content/uploads/2024/09/settings-accessibility-enable.png?strip=all&#038;quality=90&#038;resize=1430,1536" alt="Enable Automator app permissions under Settings &gt; Accessibility" class="wp-image-9375" srcset="https://kaspars.net/wp-content/uploads/2024/09/settings-accessibility-enable.png?strip=all&amp;quality=90&amp;resize=1280%2C1375 1280w, https://kaspars.net/wp-content/uploads/2024/09/settings-accessibility-enable.png?strip=all&amp;quality=90&amp;resize=384%2C412 384w, https://kaspars.net/wp-content/uploads/2024/09/settings-accessibility-enable.png?strip=all&amp;quality=90&amp;resize=768%2C825 768w, https://kaspars.net/wp-content/uploads/2024/09/settings-accessibility-enable.png?strip=all&amp;quality=90&amp;resize=1024%2C1100 1024w, https://kaspars.net/wp-content/uploads/2024/09/settings-accessibility-enable.png?strip=all&amp;quality=90&amp;resize=1430%2C1536 1430w" sizes="auto, (max-width: 1430px) 100vw, 1430px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/applescript-resize-all-windows/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2024/09/with-chapters.mp4" length="24127566" type="video/mp4" />

		<enclosure url="https://kaspars.net/wp-content/uploads/2024/09/run-applescript.png" length="147285" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/09/create-as-application.png" length="146180" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/09/settings-accessibility-enable.png" length="82214" type="image/png" />	</item>
		<item>
		<title>Airbank D13 Puffer Pro Review and Teardown</title>
		<link>https://kaspars.net/blog/airbank-d13-pro-teardown</link>
					<comments>https://kaspars.net/blog/airbank-d13-pro-teardown#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sun, 07 Jul 2024 11:53:18 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=9169</guid>

					<description><![CDATA[Available for around $130 on AliExpress (including shipping) or from the manufacturer store, Airbank D13 Puffer Pro is a battery powered two-stage pump that delivers up to 20 psi (1.4 bar) of pressure. Note that there is also a cheaper version without the battery that requires a 12V power supply. Contrary to the manufacturer specification [&#8230;] <a href="https://kaspars.net/blog/airbank-d13-pro-teardown" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>Available for around <a href="https://kaspars.net/go/buy-airbank-d13-puffer-pro" data-type="surl" data-id="9181">$130 on AliExpress</a> (including shipping) or from the <a href="https://kaspars.net/go/airbank-puffer-pro-manufacturer-store" data-type="surl" data-id="9238">manufacturer store</a>, <strong>Airbank D13 Puffer Pro</strong> is a battery powered two-stage pump that delivers up to 20 psi (1.4 bar) of pressure. Note that there is also a cheaper version without the battery that requires a 12V power supply.</p>



<p>Contrary to the manufacturer specification on the web, this pump actually <strong>does support USB-C PD3.0 and </strong><strong>QC3.0</strong> power output and charging up to 30W. The included paper manual correctly states the supported USB-C voltage and power levels.</p>



<figure class="wp-block-image alignwide size-full"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-teardown-review-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-teardown-review-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="" class="wp-image-9189" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-teardown-review-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-teardown-review-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-teardown-review-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-teardown-review-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-teardown-review-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-teardown-review-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-teardown-review-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a><figcaption class="wp-element-caption">Two compressor motors, battery pack and the control board.</figcaption></figure>



<span id="more-9169"></span>



<p>Opening the pump is really easy with just six phillips screws at the back. Inside, everything is neatly laid out and with wires of the appropriate gauge and latching connectors for the pump and battery connections, along with some adhesive to keep them secure during transportation.</p>



<figure class="wp-block-image alignwide size-full"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-controller-top-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-controller-top-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Airbank D13 Pro controller board PCB with INJOINIC IP2366 power management chip and PY32F003 microcontoller" class="wp-image-9175" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-controller-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-controller-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-controller-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-controller-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-controller-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-controller-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-controller-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a><figcaption class="wp-element-caption">Control board with <a href="http://www.injoinic.com/product_detail/id/25.html?lang=en-us">INJOINIC IP2366</a> power management chip (below the USB-C port), <a href="https://py32.org/en/mcu/PY32F003xx.html">PY32F003</a> ARM Cortex M0 microcontoller (bottom right), and Maplesemi mosfets (SLM60P03T and SLM100N03T).</figcaption></figure>



<figure class="wp-block-image alignwide size-full"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pcb-controller-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pcb-controller-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Airbank D13Pro V1.3 2023 1120 PCB" class="wp-image-9178" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pcb-controller-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pcb-controller-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pcb-controller-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pcb-controller-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pcb-controller-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pcb-controller-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pcb-controller-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a><figcaption class="wp-element-caption">Other side of the PCB (marked <code>D13Pro__V1.3_2023_1120</code>) with the display and control buttons, and programming or debug pin connections.</figcaption></figure>



<h2 class="wp-block-heading">Pump and Compressor</h2>



<p>There are two motors inside &#8212; one for a simple fan and another one for driving a piston pump for the high-pressure stage (above 0.8 psi). Interestingly, the fan mode uses 8A at 11V compared to just 4A in the high-pressure mode as shown in this video (be aware of the loud audio):</p>



<figure class="wp-block-video"><video height="1080" style="aspect-ratio: 1080 / 1080;" width="1080" controls muted data-src="https://kaspars.net/wp-content/uploads/2024/07/airbank-puffer-pro-power-draw.mp4"></video><figcaption class="wp-element-caption">Current draw at 11V battery when running the compressor and the fan mode. </figcaption></figure>



<h2 class="wp-block-heading">Battery</h2>



<p>It features a pack of six 18650 Li-ion batteries in 3S2P configuration (3 in series, 2 in parallel) with the combined capacity of 57.72Wh (5200mAh at nominal voltage of 11.1V).</p>



<figure class="wp-block-image size-full is-resized"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-18650-li-ion-battery-5200mah-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-18650-li-ion-battery-5200mah-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="18650 Li-ion batteries in 3S2P configuration with capacity of 57.72Wh (5200mAh at nominal voltage of 11.1V)" class="wp-image-9183" style="width:840px;height:auto" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-18650-li-ion-battery-5200mah-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-18650-li-ion-battery-5200mah-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-18650-li-ion-battery-5200mah-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-18650-li-ion-battery-5200mah-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-18650-li-ion-battery-5200mah-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-18650-li-ion-battery-5200mah-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-18650-li-ion-battery-5200mah-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a><figcaption class="wp-element-caption">Battery capacity 57.72Wh (5200mAh at 11.1V).</figcaption></figure>



<h2 class="wp-block-heading">USB-C Output</h2>



<p>Turns out it actually does support USB-C PD 3.0 charging and output up to 30W at 20V in addition to Quick Charge 3.0 (QC3) with up to 12V and 3A (36W) output thanks to the <a href="https://www.lcsc.com/product-detail/Power-Management-Specialized-PMIC_INJOINIC-IP2366-I2C-version_C20415848.html">INJOINIC IP2366 power management chip</a>.</p>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="2560" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,2560" alt="USB-C PD3.0 output up to 20V and 1.5A" class="wp-image-9219" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C1280 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1920 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg?strip=all&amp;quality=90&amp;resize=300%2C300 300w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1536 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C2048 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1024 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a><figcaption class="wp-element-caption">AVHzY CT-3 showing the supported USB-C PD3.0 modes up to 30W (20V at 1.5A).</figcaption></figure>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="2560" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,2560" alt="USB-C PD3.0 mode 20V at 1.5A activated" class="wp-image-9220" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C1280 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1920 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg?strip=all&amp;quality=90&amp;resize=300%2C300 300w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1536 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C2048 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1024 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a></figure>



<h2 class="wp-block-heading">Charging</h2>



<p>Charging over USB-C supports PD3.0 30W input while the included charger GQ20PD02-ZG can only deliver QC3.0 20W at 12V/1.67A. It would take either 2 or 3 hours respectively to fully charge the battery.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="2560" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-charging-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,2560" alt="Charging Airbank D13 Puffer Pro via USB-C QC3 at 30W (20V)" class="wp-image-9173" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-charging-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-charging-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C1280 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-charging-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1920 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-charging-scaled.jpeg?strip=all&amp;quality=90&amp;resize=300%2C300 300w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-charging-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1536 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-charging-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C2048 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-charging-scaled.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-charging-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-charging-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1024 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></figure>



<h3 class="wp-block-heading">Charging Error EE3</h3>



<p>Having played with the supported USB mode enumeration, I tested the pump performance with an actual 10&#8217;4&#8243; (317cm) SUP and was able to bring it to 18 psi twice, including the deflation.</p>



<p>When attempting to charge it with the supplied USB-C charger and cable, I was now suddenly getting a message EE3 on the screen and it wouldn&#8217;t charge when left over night. I was able to fix the issue by removing and re-attaching the battery which presumably reset the controller state. Since this is not an easy operation for an average user, I&#8217;ve reached out to the manufacturer to confirm alternative solutions for resetting the device.   </p>



<h2 class="wp-block-heading">Photos</h2>



<figure class="wp-block-gallery has-nested-images columns-2 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-scaled-e1732378746203.jpeg"><img loading="lazy" decoding="async" width="1920" height="1920" data-id="9681" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-scaled-e1732378746203.jpeg?strip=all&#038;quality=90&#038;resize=1920,1920" alt="Airbank D13 Puffer Pro with Sup board near lake" class="wp-image-9681" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-scaled-e1732378746203.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-scaled-e1732378746203.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C1280 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-scaled-e1732378746203.jpeg?strip=all&amp;quality=90&amp;resize=300%2C300 300w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-scaled-e1732378746203.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1536 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-scaled-e1732378746203.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-scaled-e1732378746203.jpeg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-scaled-e1732378746203.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1024 1024w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-scaled-e1732378746203.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1920 1920w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-lake-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="1920" data-id="9682" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-lake-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Airbank D13 Puffer Pro with Sup board near lake" class="wp-image-9682" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-lake-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-lake-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-lake-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-lake-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-lake-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-lake-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-lake-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="2560" data-id="9188" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,2560" alt="Top of Airbank D13 Pro pump" class="wp-image-9188" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C1280 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1920 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg?strip=all&amp;quality=90&amp;resize=300%2C300 300w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1536 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C2048 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1024 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="2560" data-id="9185" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,2560" alt="Handle of the Airbank D13 Pro pump" class="wp-image-9185" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C1280 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1920 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg?strip=all&amp;quality=90&amp;resize=300%2C300 300w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1536 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C2048 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1024 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="2560" data-id="9186" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,2560" alt="Airbank D13 Pro USB-C and 12V power ports" class="wp-image-9186" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C1280 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1920 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg?strip=all&amp;quality=90&amp;resize=300%2C300 300w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1536 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C2048 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1024 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="2560" data-id="9184" src="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,2560" alt="Back of the Airbank D13 Pro pump" class="wp-image-9184" srcset="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C1280 1280w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1920 1920w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg?strip=all&amp;quality=90&amp;resize=300%2C300 300w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1536 1536w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C2048 2048w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1024 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a></figure>
</figure>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/airbank-d13-pro-teardown/feed</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-puffer-pro-power-draw.mp4" length="7542765" type="video/mp4" />

		<enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-components-teardown-scaled.jpeg" length="597326" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-teardown-review-scaled.jpeg" length="495172" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-controller-top-scaled.jpeg" length="786142" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pcb-controller-scaled.jpeg" length="655008" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-18650-li-ion-battery-5200mah-scaled.jpeg" length="515165" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-output-scaled.jpeg" length="876284" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-usb-c-pd-30w-scaled.jpeg" length="874102" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-charging-scaled.jpeg" length="781624" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-scaled-e1732378746203.jpeg" length="1009474" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-puffer-pro-sup-lake-scaled.jpeg" length="1639327" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-sup-pump-scaled.jpeg" length="1324182" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-scaled.jpeg" length="1130009" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-charge-pump-ports-scaled.jpeg" length="981012" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/07/airbank-d13-pro-back-label-scaled.jpeg" length="1195187" type="image/jpeg" />	</item>
		<item>
		<title>Bafang CAN Bus Programming</title>
		<link>https://kaspars.net/blog/bafang-canbus</link>
					<comments>https://kaspars.net/blog/bafang-canbus#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sun, 21 Apr 2024 20:54:56 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=9135</guid>

					<description><![CDATA[I got my wife this Accolmile Antelope 1S electric bicycle with Bafang components from their latest M-series lineup of mid-drive motors and displays which communicate over a CAN bus. It&#8217;s a great city bike and the price includes fast shipping from the warehouse in Poland. Their support was also quick to send a replacement wheel [&#8230;] <a href="https://kaspars.net/blog/bafang-canbus" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2024/04/bafang-m200-motor-connectors-scaled.jpg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Bafang M200 (M-series) mid-drive motor with CAN bus" class="wp-image-9137" srcset="https://kaspars.net/wp-content/uploads/2024/04/bafang-m200-motor-connectors-scaled.jpg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/04/bafang-m200-motor-connectors-scaled.jpg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/04/bafang-m200-motor-connectors-scaled.jpg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/04/bafang-m200-motor-connectors-scaled.jpg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/04/bafang-m200-motor-connectors-scaled.jpg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/04/bafang-m200-motor-connectors-scaled.jpg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/04/bafang-m200-motor-connectors-scaled.jpg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">Bafang M200 mid-drive motor (model <code>MM G210.250.C</code>) with 36V battery connector (yellow, from left), empty 6-pin electric break connector (purple), 8-pin rear light and wheel speed connector, and 8-pin front light and display connector.</figcaption></figure>



<p>I got my wife this <a href="https://accolmile.com/products/aantelope-1s">Accolmile Antelope 1S</a> electric bicycle with Bafang components from their latest <a href="https://www.bafang-e.com/en/products/motors/m-series/">M-series lineup of mid-drive motors</a> and <a href="https://www.bafang-e.com/en/oem-area/components/hmi/">displays</a> which communicate over a CAN bus. It&#8217;s a great city bike and the price includes fast shipping from the warehouse in Poland. Their support was also quick to send a replacement wheel for the original that got dented during transport (despite the thoughtful packaging).</p>



<h2 class="wp-block-heading">CAN over NodeJS</h2>



<p>The M500/M600 motors are particularly popular with MTB riders so the communication protocol has been discussed in <a href="https://endless-sphere.com/sphere/threads/bafang-m500-m600-thread.100777/">this forum thread</a> and documented in <a href="https://github.com/OpenSourceEBike/Bafang_M500_M600">this GitHub repository</a>. Importantly, the <a href="https://bafang-e.com/en/oem-area/service/besst/"><abbr title="Bafang E-mobility Sales &amp; Service Tool">BESST</abbr> software</a> for managing the configuration and firmware updates is <a href="https://www.electronjs.org">an Electron app</a> with all logic as plain HTML and JS files (and bundled <a href="https://developer.chrome.com/blog/sourcemaps">source maps</a> for all minified code), including the CAN frame specification. I&#8217;ve started documenting my research in <a href="https://github.com/kasparsd/besst-reference">this GitHub repository</a>.</p>



<span id="more-9135"></span>



<h2 class="wp-block-heading">Connecting to CAN Bus</h2>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69f8923c1192e&quot;}" data-wp-interactive="core/image" data-wp-key="69f8923c1192e" class="wp-block-image alignwide size-large wp-lightbox-container"><img loading="lazy" decoding="async" width="1920" height="1234" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://kaspars.net/wp-content/uploads/2024/04/bafang-canbus-canable-wiring.png?strip=all&#038;quality=90&#038;resize=1920,1234" alt="Wiring diagram for connecting to Bafang CAN-bus wiring between screen and motor controller" class="wp-image-11116" srcset="https://kaspars.net/wp-content/uploads/2024/04/bafang-canbus-canable-wiring.png?strip=all&amp;quality=90&amp;resize=1920%2C1234 1920w, https://kaspars.net/wp-content/uploads/2024/04/bafang-canbus-canable-wiring.png?strip=all&amp;quality=90&amp;resize=1280%2C823 1280w, https://kaspars.net/wp-content/uploads/2024/04/bafang-canbus-canable-wiring.png?strip=all&amp;quality=90&amp;resize=1536%2C987 1536w, https://kaspars.net/wp-content/uploads/2024/04/bafang-canbus-canable-wiring.png?strip=all&amp;quality=90&amp;resize=384%2C247 384w, https://kaspars.net/wp-content/uploads/2024/04/bafang-canbus-canable-wiring.png?strip=all&amp;quality=90&amp;resize=768%2C494 768w, https://kaspars.net/wp-content/uploads/2024/04/bafang-canbus-canable-wiring.png?strip=all&amp;quality=90&amp;resize=1024%2C658 1024w, https://kaspars.net/wp-content/uploads/2024/04/bafang-canbus-canable-wiring.png?strip=all&amp;quality=90&amp;resize=2040%2C1311 2040w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="Enlarge"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<p>The display connector at the wheel is the most convenient place to tap into the CAN bus. I purchased two HIGO 5-pin connectors B5-F and S5-F from <a href="https://shop.e-bike-technologies.de/de/">ETShop in Germany</a> for around €7 each (<a href="https://kaspars.net/go/bafang-5-pin-can-cable">AliExpress</a> / <a href="https://kaspars.net/go/amazon-bafang-5-pin-can-cable">Amazon</a>) and soldered the CAN high (green), CAN low (white) and ground (black) wires from each for a connection to (a copy of) the <a href="https://canable.io">CANable Pro 1.0 CAN-to-USB adapter</a> (<a href="https://kaspars.net/go/canable-pro">AliExpress</a> / <a href="https://kaspars.net/go/amazon-canable-pro">Amazon</a>). <strong>Be sure to test the wiring with a multimeter because one of the wires carries the full battery voltage!</strong></p>



<p>Technically <em>any CAN-to-USB adapter will work</em> (as long as it supports 250kbit transfer rate) and the choice depends more on the software you want to use for interacting with the bus. The CANable adapter runs the <a href="https://github.com/normaldotcom/canable-fw">slcan firmware</a> which implements the <a href="https://www.canusb.com/products/canusb/">Lawicel SLCAN protocol</a> (a basic ASCII serial) which is supported by various libraries, including SocketCAN.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2024/04/bafang-higo-s5-male-connector-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="HIGO S5-F connector wires for Bafang CAN bus" class="wp-image-9141" srcset="https://kaspars.net/wp-content/uploads/2024/04/bafang-higo-s5-male-connector-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/04/bafang-higo-s5-male-connector-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/04/bafang-higo-s5-male-connector-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/04/bafang-higo-s5-male-connector-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/04/bafang-higo-s5-male-connector-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/04/bafang-higo-s5-male-connector-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/04/bafang-higo-s5-male-connector-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">Pinout of the HIGO S5-F (female) connector.</figcaption></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="2560" src="https://kaspars.net/wp-content/uploads/2024/04/bafang-can-bus-higo-s5-b5-canable-pro-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,2560" alt="Bafang HIGO S5 and B5 connectors attached to CANable Pro" class="wp-image-9142" srcset="https://kaspars.net/wp-content/uploads/2024/04/bafang-can-bus-higo-s5-b5-canable-pro-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2024/04/bafang-can-bus-higo-s5-b5-canable-pro-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C1280 1280w, https://kaspars.net/wp-content/uploads/2024/04/bafang-can-bus-higo-s5-b5-canable-pro-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1920 1920w, https://kaspars.net/wp-content/uploads/2024/04/bafang-can-bus-higo-s5-b5-canable-pro-scaled.jpeg?strip=all&amp;quality=90&amp;resize=300%2C300 300w, https://kaspars.net/wp-content/uploads/2024/04/bafang-can-bus-higo-s5-b5-canable-pro-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1536 1536w, https://kaspars.net/wp-content/uploads/2024/04/bafang-can-bus-higo-s5-b5-canable-pro-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C2048 2048w, https://kaspars.net/wp-content/uploads/2024/04/bafang-can-bus-higo-s5-b5-canable-pro-scaled.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2024/04/bafang-can-bus-higo-s5-b5-canable-pro-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2024/04/bafang-can-bus-higo-s5-b5-canable-pro-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1024 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">HIGO 5-pin B5-F and S5-F connectors attached to CANable Pro 1.0 CAN-to-USB adaptor.</figcaption></figure>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2024/04/cangaroo-can-bus-bafang-m200-motor-dp-c245-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="CANbus traffic between Bafang M200 and DP C245 display." class="wp-image-9143" srcset="https://kaspars.net/wp-content/uploads/2024/04/cangaroo-can-bus-bafang-m200-motor-dp-c245-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/04/cangaroo-can-bus-bafang-m200-motor-dp-c245-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/04/cangaroo-can-bus-bafang-m200-motor-dp-c245-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/04/cangaroo-can-bus-bafang-m200-motor-dp-c245-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/04/cangaroo-can-bus-bafang-m200-motor-dp-c245-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/04/cangaroo-can-bus-bafang-m200-motor-dp-c245-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/04/cangaroo-can-bus-bafang-m200-motor-dp-c245-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">Logging CANbus traffic between Bafang M200 (G210.250.C) motor and DP C245 display.</figcaption></figure>



<h2 class="wp-block-heading">Update Controller Configuration Manually</h2>



<p>I was able to test the setup by increasing the assisted maximum speed to 60km/h from the original 25km/h by sending <a href="https://github.com/kasparsd/besst-reference/blob/47b3139c6dc672b90358e546abc30992b20d48c9/app/static/js/webpack/device/controller.js#L652-L663">a CAN message</a> composed of the following components:</p>



<ul class="wp-block-list">
<li><code>0x05</code> for the <a href="https://github.com/kasparsd/besst-reference/blob/47b3139c6dc672b90358e546abc30992b20d48c9/app/static/js/webpack/node_modules/besst-usb-sdk/src/usbClient/common.js#L41-L53">message source</a> (<code>0x01</code> &#8212; torque sensor, <code>0x02</code> &#8212; controller, <code>0x03</code> &#8212; display or HMI, <code>0x04</code> &#8212; battery, <code>0x05</code> &#8212; BESST),</li>



<li><code>0x02</code> for the message target (controller),</li>



<li><code>0x00</code> for a WRITE <a href="https://github.com/kasparsd/besst-reference/blob/47b3139c6dc672b90358e546abc30992b20d48c9/app/static/js/webpack/node_modules/besst-usb-sdk/src/usbClient/common.js#L55-L68">operation</a> (<code>0x01</code> for READ),</li>
</ul>



<p>which are transformed into a frame ID prefix for the <code>0x3203</code> code and subcode for &#8220;speed limit, wheel diameter and circumference&#8221; registry through <a href="https://github.com/kasparsd/besst-reference/blob/47b3139c6dc672b90358e546abc30992b20d48c9/app/static/js/webpack/node_modules/besst-usb-sdk/src/usbClient/common.js#L229-L237">this transformer function</a>:</p>



<pre class="wp-block-code"><code>buildHexStringCommand = (source, target, opt, anfn, nfn) =&gt; {
    const cmdPrefix = hexAllocToBinaryStr(source.toString(16), 5) + hexAllocToBinaryStr(target.toString(16), 5) + hexAllocToBinaryStr(opt.toString(16), 3);
    let cmdPrefixHex = parseInt(cmdPrefix, 2).toString(16);
    if (cmdPrefixHex.length % 2 !== 0) {
        cmdPrefixHex = '0' + cmdPrefixHex;
    }
    let cmdHexString = cmdPrefixHex + anfn + nfn;
    return hexReverse(cmdHexString);
};</code></pre>



<p>which returns:</p>



<pre class="wp-block-code"><code>05 10 32 03</code></pre>



<p>as the frame ID along with the payload:</p>



<pre class="wp-block-code"><code>70 17 C0 2B B6 08 </code></pre>



<p>where (with little-endian byte order):</p>



<ul class="wp-block-list">
<li><code>0x1770</code> is 6000 or 60km/h × 100,</li>



<li><code>0x2BC0</code> is 700 or 700c wheel diameter (29-inch), and</li>



<li><code>0x08B6</code> is 2230 or 2230mm wheel circumference.</li>
</ul>



<h2 class="wp-block-heading">Use Bafang CANable Pro Software</h2>



<p>There is now the <a href="https://github.com/mdi-9/bafang_canable_pro">Bafang CANable Pro open-source software</a> that allows you to configure all parameters using a desktop app (see <a href="https://endless-sphere.com/sphere/threads/bafang-canable-pro-master-discussion.128228/">related forum thread</a>). Importantly, this requires CANable to be running the <a href="https://github.com/candle-usb/candleLight_fw">candlelight firmware</a> since it uses the <a href="https://github.com/torvalds/linux/blob/9094662f6707d1d4b53d18baba459604e8bb0783/drivers/net/can/usb/gs_usb.c#L34-L35">GS_USB protocol</a> for talking directly to the USB device without the Serial/UART translation layer.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/bafang-canbus/feed</wfw:commentRss>
			<slash:comments>19</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2024/04/bafang-m200-motor-connectors-scaled.jpg" length="736377" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/04/bafang-canbus-canable-wiring.png" length="92265" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/04/bafang-higo-s5-male-connector-scaled.jpeg" length="381699" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/04/bafang-can-bus-higo-s5-b5-canable-pro-scaled.jpeg" length="536642" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/04/cangaroo-can-bus-bafang-m200-motor-dp-c245-scaled.jpeg" length="749461" type="image/jpeg" />	</item>
		<item>
		<title>USB-C PD65W Adapter and Charger for 18V and 20V Power Tool Batteries</title>
		<link>https://kaspars.net/blog/usb-c-pd65w-adapter-charger-18v-20v-batteries</link>
					<comments>https://kaspars.net/blog/usb-c-pd65w-adapter-charger-18v-20v-batteries#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Mon, 15 Apr 2024 10:29:26 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=9111</guid>

					<description><![CDATA[Makita doesn&#8217;t make an official USB-C PD (power delivery) adaptor (they only have ADP05 with two 5V/2A ports) so I found this UDCB094 on AliExpress (affiliate link) with PD65W output and with variants for 18V Makita, DeWalt, Milwaukee and Bosch power tool batteries. It appears to very well built &#8212; using 16AWG wires for the [&#8230;] <a href="https://kaspars.net/blog/usb-c-pd65w-adapter-charger-18v-20v-batteries" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2000" height="1500" src="https://kaspars.net/wp-content/uploads/2024/04/udcb094-charger-makita.jpeg?strip=all&#038;quality=90&#038;resize=2000,1500" alt="Adaptor supports PD 65W output via USB-C port. There is also a USB-A port." class="wp-image-9113" srcset="https://kaspars.net/wp-content/uploads/2024/04/udcb094-charger-makita.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/04/udcb094-charger-makita.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/04/udcb094-charger-makita.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/04/udcb094-charger-makita.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/04/udcb094-charger-makita.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/04/udcb094-charger-makita.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2024/04/udcb094-charger-makita.jpeg?strip=all&amp;quality=90&amp;resize=2000%2C1500 2000w" sizes="auto, (max-width: 2000px) 100vw, 2000px" /><figcaption class="wp-element-caption">UDCB094 adaptor with true PD 65W output via USB-C. A second USB-A port is also available.</figcaption></figure>



<p>Makita doesn&#8217;t make an official USB-C PD (power delivery) adaptor (they only have <a href="https://www.makitatools.com/products/details/ADP05">ADP05 with two 5V/2A ports</a>) so I found this <a href="https://kaspars.net/go/udcb094-usb-c-pd60w-adapter-18v-20v-makita-dewalt-milwaukee-bosch-batteries" data-type="surl" data-id="9110">UDCB094 on AliExpress</a> (affiliate link) with PD65W output and with variants for 18V Makita, DeWalt, Milwaukee and Bosch power tool batteries. It appears to very well built &#8212; using 16AWG wires for the DC connection and implements true PD65W standard via the <a href="https://en.chipsea.com/product/details/?id=980&amp;pid=96">CSU3AF10 charge controller</a>.</p>



<span id="more-9111"></span>



<h2 class="wp-block-heading">Teardown and Internal Photos</h2>



<figure class="wp-block-gallery alignwide has-nested-images columns-3 wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-4-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="1920" data-id="9117" src="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-4-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="16AWG wires for the DC connection of UDCB094 for 18V power tool batteries." class="wp-image-9117" srcset="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-4-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-4-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-4-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-4-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-4-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-4-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-4-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-2-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="1920" data-id="9116" src="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-2-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="YR-PD65W PCB with CSU3AF10 charge controller for 18V power tool batteries" class="wp-image-9116" srcset="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-2-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-2-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-2-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-2-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-2-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-2-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-2-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-3-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="1920" data-id="9115" src="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-3-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="" class="wp-image-9115" srcset="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-3-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-3-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-3-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-3-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-3-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-3-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-3-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-1-scaled.jpeg"><img loading="lazy" decoding="async" width="2560" height="1920" data-id="9114" src="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-1-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="" class="wp-image-9114" srcset="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-1-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-1-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-1-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-1-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-1-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-1-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-1-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a></figure>
</figure>



<p>The PCB is labeled &#8220;YR-PD65W&#8221;.</p>



<h2 class="wp-block-heading">Where to Get it?</h2>



<p>Buy it <a href="https://kaspars.net/go/udcb094-usb-c-pd60w-adapter-18v-20v-makita-dewalt-milwaukee-bosch-batteries">from this store on AliExpress</a> (affiliate link).</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/usb-c-pd65w-adapter-charger-18v-20v-batteries/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-2-scaled.jpeg" length="663963" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/04/udcb094-charger-makita.jpeg" length="267995" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-4-scaled.jpeg" length="672277" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-3-scaled.jpeg" length="649378" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2024/04/UDCB094-YR-PD65W-usb-c-charger-makita-dewalt-bosch-18v-20v-1-scaled.jpeg" length="648556" type="image/jpeg" />	</item>
		<item>
		<title>Building a Solar Powered Lora Meshtastic Community Network</title>
		<link>https://kaspars.net/blog/solar-lora-meshtastic</link>
					<comments>https://kaspars.net/blog/solar-lora-meshtastic#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sat, 16 Dec 2023 07:00:08 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Meshtastic]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8648</guid>

					<description><![CDATA[Meshtastic is a wonderful project for creating decentralised text-based communication networks for local communities using low power (and low cost) Lora radios. Fun fact &#8212; the Meshtastic logo appears to reference the chirp modulation used by Lora. The best way to learn about the project is to explore the forum, join the Discord server and [&#8230;] <a href="https://kaspars.net/blog/solar-lora-meshtastic" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p><a href="https://meshtastic.org/">Meshtastic</a> is a wonderful project for creating decentralised text-based communication networks for local communities using <a href="https://meshtastic.org/docs/hardware/devices/">low power (and low cost) Lora radios</a>. Fun fact &#8212; the Meshtastic logo appears to reference the <a href="https://www.sghoslya.com/p/lora-is-chirp-spread-spectrum.html">chirp modulation</a> used by Lora.</p>



<span id="more-8648"></span>



<p>The best way to learn about the project is to <a href="https://meshtastic.discourse.group/">explore the forum</a>, join <a href="https://discord.gg/ktMAKGBnBs">the Discord server</a> and <a href="https://www.reddit.com/r/meshtastic">the Reddit community</a>, follow <code>#meshtastic</code> <a href="https://twitter.com/hashtag/Meshtastic">on Twitter</a>, <a href="https://www.instagram.com/explore/tags/meshtastic/">Instagram</a> and on <a href="https://mastodon.social/tags/meshtastic">your ActivityPub network of choice</a>, and <a href="https://www.youtube.com/results?search_query=meshtastic">find recent videos on YouTube</a>.</p>



<p>There are various community efforts to build local networks already:</p>



<ul class="wp-block-list">
<li><a href="https://wikimesh.pp.ua/uk/home">Meshtastic Ukraine</a> with <a href="https://mesh.in.ua/grafana/">around 850 active nodes</a> in the 433 MHz range.</li>



<li><a href="https://austinmesh.org">Austin Mesh</a> in Texas, USA with weekly Friday check-ins (also available globally through the MQTT gateway).</li>



<li><a href="https://iffybooks.net/event/meshtastic-101-sept-10/">Iffy Books events</a> and <a href="https://iffybooks.net/solar-lora-circuit-diagram/">resources</a> (including <a href="https://github.com/iffybooks/meshtastic-zine">this incredible zine about Meshtastic</a>).</li>
</ul>



<h2 class="wp-block-heading">Network Map</h2>



<p>Here is a <a href="https://map.technicallyrural.com">map of all active nodes</a> connected to networks that relay messages <a href="https://meshtastic.org/docs/configuration/module/mqtt">to the official MQTT endpoint</a>. This map is created by a forum user and shared in <a href="https://meshtastic.discourse.group/t/where-is-the-world-map/6882/6">this thread</a>.</p>



<h2 class="wp-block-heading">How to Build a Network</h2>



<p>Following the learnings from the <a href="https://kaspars.net/blog/solar-raspberry-pi-camera" data-type="post" data-id="7205">solar-powered Raspberry Pi security camera project</a>, I want to build solar-powered repeat nodes (with <a href="https://meshtastic.org/docs/configuration/radio/device"><code>REPEATER</code> role</a>) to place in high enough places to enable coverage for everyone in the area. Since repeat nodes are invisible to the network and can&#8217;t send health or sensor data, another node with <code>SENSOR</code> role would be connected to the same battery and would broadcast the health of the repeater node along with temperature and humidity at very long intervals for maximum power savings.</p>



<p>I’ve decided to use <a href="https://heltec.org/project/wifi-lora-32-v3/">Heltec WiFi Lora 32 (v3)</a> ($20, <a href="https://kaspars.net/wp-content/uploads/2023/12/HTIT-WB32LAF_V3.1_Schematic_Diagram.pdf">schematic diagram</a>, from <a href="https://kaspars.net/go/heltec-wifi-lora-32">AliExpress</a> / <a href="https://kaspars.net/go/amazon-heltec-wifi-lora-32">Amazon</a>) for the repeater nodes as they use ESP32-S3FN8 for the main controller and SX1262 LoRa chip with an IPEX1.0 antenna connector. This type of connector is really practical for bringing the antenna outside of the enclosure as the larger SMA connector cables are usually harder to bend and require more space in the case.</p>



<p>It also features a TP4054 charge controller and a voltage divider connected to an ADC pin for monitoring the battery voltage which is useful for telemetry. I’ve yet to figure out if it has any over discharge protection.</p>



<p>It is reported that <a href="https://store.rakwireless.com/products/wisblock-meshtastic-starter-kit">RAK4631 WisBlock Core</a> (<a href="https://kaspars.net/go/wisblock-rak4631-kit">AliExpress</a> / <a href="https://kaspars.net/go/amazon-wisblock-rak4631-kit">Amazon</a>) with the nRF52840 microcontroller and the same SX1262 LoRa radio uses significantly less power compared to ESP32 devices so it is probably a better choice for pure repeater nodes. However, I wanted something that is more universal with a screen and a case for this prototyping phase.</p>



<h2 class="wp-block-heading">Power Requirements</h2>



<p>There is <a href="https://meshtastic.discourse.group/t/solar-charging-of-meshtastic-devices/870">a great thread on the forum</a> with several posts linking to the following resources that outline the effective power requirements:</p>



<ul class="wp-block-list">
<li><a href="https://docs.google.com/spreadsheets/d/1ft1bS3iXqFKU8SApU8ZLTq9r7QQEGESYnVgdtvdT67k/edit">Meshtastic ESP32 airtime and current draws (Google Sheets)</a></li>



<li><a href="https://docs.google.com/spreadsheets/d/1UMZRrFwL2QfyxEf_jnd2sIuZqrikItOxJ1EPNF5UBdU/edit">NRF52840DK+SX1262 Meshtastic airtime/current draws (Google Sheets)</a></li>



<li><a href="https://docs.google.com/spreadsheets/d/1wr6aqqmAICttwSqVga-WYILJpueYfDKX1ejSYZEfKY0/edit">Meshtastic Power Consumption Tests (Google Sheets)</a></li>



<li><a href="https://docs.google.com/document/d/12GIY24vLKLABg2RUTPP6yMzokr44GMzJOE4p7ngaCbI/edit">How To Calculate Solar Panel and Battery Size (Google Sheets)</a></li>
</ul>



<p>The general consensus appears to be that ESP32 powered devices without any bluetooth, screen or GPS attachments need 0.1W on average. I was also able to confirm this in real-life testing at the 10% air-time (maximum allowed in EU).</p>



<h2 class="wp-block-heading">Solar Power</h2>



<p>The size of the battery and the solar panel power should be matched to ensure that a typical period of sunshine can charge the battery. Consider the following parameters:</p>



<ul class="wp-block-list">
<li>Total battery capacity.</li>



<li>Maximum <em>charging current</em> supported by the cells.</li>



<li>Duration of a typical charging session (hours of peak solar panel output).</li>
</ul>



<p>For example, a typical 18650 cell with a capacity of 2500mAh or 9Wh (at 3.6V nominal voltage) recommends <strong>a maximum charging current of only 1A for cycle use</strong> which multiplied by the maximum charging voltage 4.2V gives us just <em>4.2W of maximum charging power</em>. So there is no reason to pick a 40Wp solar panel if only 4W of that can be used by the battery.</p>



<p>The maximum charging power of 4.2W also means that it requires at least 2.1 hours to fully recharge the battery. Accounting for the charging losses it would probably increase to 2.5h.</p>



<p><strong>As a rough guide you can pick a 10Wp solar panel for every 10Wh of battery capacity which requires 3h of full sunshine for a complete recharge.</strong></p>



<h3 class="wp-block-heading">Typical Charge Controllers</h3>



<ul class="wp-block-list">
<li><strong>CN3791</strong> (<a href="https://kaspars.net/wp-content/uploads/2023/12/CN3791.pdf" data-type="attachment" data-id="9857">datasheet PDF</a>) is a true MPPT charge controller with an input voltage of up to 28V and a charge current of 4A (at 4.2V). Batteries discharged below 66% are trickled charged with 17% of the maximum charge current.</li>



<li><strong>CN3163</strong> (<a href="https://kaspars.net/wp-content/uploads/2023/12/CN3163.pdf" data-type="attachment" data-id="9848">datasheet PDF</a>) is often called an MPPT controller but in reality it is only capable of reducing the charge current to maintain the minimum solar input of 4.4V (up to 6V). This controller can also adjust the charge rate based on the temperature to improve the battery life.</li>



<li><strong>TP4056</strong> and its clones like CL4056 are generic Li-Ion battery cell chargers that don&#8217;t have any special functionality related to the solar input.</li>
</ul>



<p>From the CN3163 datasheet:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>If the output capability of input power supply is less than the charging current set by the resistor at ISET pin, then <strong>the on-chip adaptive cell will begin to function to adjust the charging current based on the output capability of input power supply</strong>. In this case, the charging current may be less than the value set by the resistor at ISET pin, but it is <strong>maximized to the output capability of input power supply</strong> on the condition that the input voltage at VIN pin is no less than 4.4V, which is the minimum operating voltage of CN3163.</p>
</blockquote>



<h3 class="wp-block-heading">3.3V Voltage Regulators</h3>



<p>Microcontrollers require stable 3.3V input power so every Meshtastic device has a voltage regulator that creates this voltage either from the USB power or the battery. It is important that these devices are efficient and have a low voltage difference at which they can still do the conversion.</p>



<p>For example, the Heltec Lora 32 v3 uses CE6260 with a drop-out voltage of 0.120V at 100mA load which means that it will stop converting to 3.3V as soon as the battery voltage drops below 3.42V which leaves some of the battery capacity unusable. Importantly, the voltage difference increases with load so at 200mA (when transmitting a Lora packet) the drop-out voltage would increase to 0.25V requiring a battery voltage of 3.55V.</p>



<h3 class="wp-block-heading">Battery Protection</h3>



<ul class="wp-block-list">
<li>Most 18650 size batteries don&#8217;t have any undervoltage protection.</li>
</ul>



<h2 class="wp-block-heading">Solar Test Node</h2>



<p>For the initial prototype I found <a href="https://kaspars.net/go/4w-solar-panel-18650-battery" data-type="surl" data-id="8663">this 4W (D4W) solar panel</a> (<a href="https://kaspars.net/go/4w-solar-panel-18650-battery">AliExpress</a>) with an integrated case for six 18650 battery cells. Using only three cells provides plenty of room for additional electronics like the LoRa board.</p>



<p>In general it is best to oversize the photovoltaic panels significantly to ensure that required charging voltage is reached even when there is low solar radiation (such as during winter). </p>



<figure class="wp-block-image alignwide size-large"><img loading="lazy" decoding="async" width="1920" height="1440" src="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-scaled.jpeg?strip=all&#038;quality=90&#038;resize=1920,1440" alt="4W solar panel with 18650 batteries for Meshtastic Lora nodes" class="wp-image-8710" srcset="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 1920px) 100vw, 1920px" /><figcaption class="wp-element-caption">In winter the charging power didn&#8217;t exceed 1W, though.</figcaption></figure>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-battery-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Charging circuit of 4W solar panel with six 18650 batteries and CL4056 for charge control and FP6276B boost controller for 5V output" class="wp-image-8708" srcset="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-battery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-battery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-battery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-battery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-battery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-battery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-battery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">4W solar panel with space for six 18650 batteries and a charging circuit.</figcaption></figure>



<p>And here is a close-up of the circuitry:</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-circuit-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Charging circuit of 4W solar panel with 18650 batteries using CL4056 for charge control, FP6276B boost controller for 5V output and XB5352A for battery protection" class="wp-image-8709" srcset="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-circuit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C960 1280w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-circuit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1440 1920w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-circuit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-circuit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-circuit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-circuit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-circuit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">Charging circuit of 4W solar panel with 18650 batteries using CL4056 (<code>U3</code>) for charge control, FP6276B (<code>U4</code>) boost controller for 5V output and XB5352A (<code>U5</code>) batter protection chip <em>only</em> for the solar input.</figcaption></figure>



<h3 class="wp-block-heading">Battery Undervoltage Protection</h3>



<p>The board appears to use XySemi XB5352A (<a href="https://kaspars.net/wp-content/uploads/2024/01/xb5352a-battery-protection.pdf">datasheet PDF</a>) battery management chip <code>U5</code> (the SOT-23-5 component to the right of the &#8220;on&#8221; switch) which handles over-voltage (4.30V for VCU with 4.10V recovery VCL), over-discharge (2.40V VDL with 3.0V recovery VDL), over-current (3.2A IOV1), and over-temperature protection. However, this chip is placed <em>on the solar input</em> <strong>so there is no under-voltage or over-discharge protection <em>on the battery side</em></strong>. This makes this solar panel unusable without additional battery under-voltage protection.</p>



<h2 class="wp-block-heading">Configuring the Solar Powered Repeater </h2>



<p>And here is the case fitted with Heltec Lora 32 v3 with INA219 connected to pins 41 and 42 (confirmed this <a href="https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/blob/b9a9180f8ec5ff69b69bdaa31684583c4a5a5813/variants/wifi_lora_32_v3/pins_arduino.h#L34-L35">with the Arduino Core library</a> and the <a href="https://github.com/meshtastic/firmware/blob/486bf796906d6237e4d29f0bd7d90144979e2f9e/variants/heltec_v3/variant.h#L7-L9">usage in the Meshtastic firmware</a>) for measuring the battery voltage and current over time and reported over <a href="https://github.com/meshtastic/firmware/blob/486bf796906d6237e4d29f0bd7d90144979e2f9e/src/modules/Telemetry/PowerTelemetry.cpp">Power Telemetry</a>. Note that simply attaching the device to the board will make the firmware <a href="https://github.com/meshtastic/firmware/blob/486bf796906d6237e4d29f0bd7d90144979e2f9e/src/Power.cpp#L287-L318">use the INA219 bus voltage reading also for Device Telemetry</a> (which is not documented).</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1589" src="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-ina219-wemos-heltec-esp32-lora-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1589" alt="Heltec Lora 32 v3 with an INA219 power sensor inside a 4W solar panel case" class="wp-image-8703" srcset="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-ina219-wemos-heltec-esp32-lora-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1280%2C795 1280w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-ina219-wemos-heltec-esp32-lora-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1920%2C1192 1920w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-ina219-wemos-heltec-esp32-lora-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C953 1536w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-ina219-wemos-heltec-esp32-lora-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1271 2048w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-ina219-wemos-heltec-esp32-lora-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C238 384w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-ina219-wemos-heltec-esp32-lora-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C477 768w, https://kaspars.net/wp-content/uploads/2023/12/meshtastic-ina219-wemos-heltec-esp32-lora-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C636 1024w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></figure>



<h2 class="wp-block-heading">Power Measurements</h2>



<p>The test setup shown in the photo above was configured as a router node with a single 18650 cell (6.6Wh capacity verified with Liitokala Lii-M4S [<a href="https://kaspars.net/go/liitokala-lii-m4s">AliExpress</a> / <a href="https://kaspars.net/go/amazon-liitokala-lii-m4s">Amazon</a>]) at 5% air utilization rate (one telemetry message per minute). It ran for 6 days which amounts to an average power consumption of 0.046W (12mA@3.7V) at 5% utilization rate. Importantly, this node was also powering the INA219 sensor which was doing the power measurements every minute.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2434" height="1362" src="https://kaspars.net/wp-content/uploads/2023/12/heltec-lora-esp32-solar-power-measurements.png?strip=all&#038;quality=90&#038;resize=2434,1362" alt="Voltage of a single 18650 cell (6.6Wh capacity) powering Heltec WiFi Lora 32 v3 and INA219 current monitor while doing a single measurement and telemetry message as a Meshtastic router node" class="wp-image-9801" srcset="https://kaspars.net/wp-content/uploads/2023/12/heltec-lora-esp32-solar-power-measurements.png?strip=all&amp;quality=90&amp;resize=1280%2C716 1280w, https://kaspars.net/wp-content/uploads/2023/12/heltec-lora-esp32-solar-power-measurements.png?strip=all&amp;quality=90&amp;resize=1920%2C1074 1920w, https://kaspars.net/wp-content/uploads/2023/12/heltec-lora-esp32-solar-power-measurements.png?strip=all&amp;quality=90&amp;resize=1536%2C860 1536w, https://kaspars.net/wp-content/uploads/2023/12/heltec-lora-esp32-solar-power-measurements.png?strip=all&amp;quality=90&amp;resize=2048%2C1146 2048w, https://kaspars.net/wp-content/uploads/2023/12/heltec-lora-esp32-solar-power-measurements.png?strip=all&amp;quality=90&amp;resize=384%2C215 384w, https://kaspars.net/wp-content/uploads/2023/12/heltec-lora-esp32-solar-power-measurements.png?strip=all&amp;quality=90&amp;resize=768%2C430 768w, https://kaspars.net/wp-content/uploads/2023/12/heltec-lora-esp32-solar-power-measurements.png?strip=all&amp;quality=90&amp;resize=1024%2C573 1024w" sizes="auto, (max-width: 2434px) 100vw, 2434px" /><figcaption class="wp-element-caption">Voltage of a single 18650 cell (6.6Wh capacity) powering Heltec WiFi Lora 32 v3 and INA219 current monitor while doing a single measurement and telemetry message as a Meshtastic router node.</figcaption></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/solar-lora-meshtastic/feed</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-ina219-wemos-heltec-esp32-lora-scaled.jpeg" length="769543" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-scaled.jpeg" length="812357" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-battery-scaled.jpeg" length="585433" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/12/meshtastic-4w-solar-panel-circuit-scaled.jpeg" length="642579" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/12/heltec-lora-esp32-solar-power-measurements.png" length="25172" type="image/png" />	</item>
		<item>
		<title>Notes on PowerWalker VI 500 R1U UPS</title>
		<link>https://kaspars.net/blog/powerwalker-vi-500-r1u</link>
					<comments>https://kaspars.net/blog/powerwalker-vi-500-r1u#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sat, 30 Sep 2023 07:33:34 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8573</guid>

					<description><![CDATA[I&#8217;ve always wanted a rack mount UPS for all of our homelab gear, and PowerWalker VI 500 was pretty much the cheapest option at EUR 192 at the time. Here are my notes and observations after having used it for more than a year to power a QNAP TS-435XeU server. Power Consumption The unit draws [&#8230;] <a href="https://kaspars.net/blog/powerwalker-vi-500-r1u" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;ve always wanted a rack mount <abbr title="Uninterruptible Power Supply">UPS</abbr> for all of our homelab gear, and <a href="https://powerwalker.com/product/10121047/">PowerWalker VI 500</a> was pretty much the cheapest option at EUR 192 at the time. Here are my notes and observations after having used it for more than a year to power a <a href="https://www.qnap.com/en/product/ts-435xeu">QNAP TS-435XeU</a> server.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1440" src="https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-r1u-ups-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1440" alt="PowerWalker VI 500 R1U UPS" class="wp-image-8576" srcset="https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-r1u-ups-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C450 800w, https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-r1u-ups-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C576 1024w, https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-r1u-ups-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C864 1536w, https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-r1u-ups-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1152 2048w, https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-r1u-ups-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C216 384w, https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-r1u-ups-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C432 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></figure>



<span id="more-8573"></span>



<ul class="wp-block-list">
<li>Has only USB type B connection for management.</li>



<li>Is recognized by macOS and QNAP operating systems as UPS when connected over USB.</li>



<li>Relies on <a href="https://www.powermonitor.software/">PowerMaster+ management software</a> for configuration.</li>



<li>Has four IEC C13 output sockets.</li>



<li>Uses two 6V/7Ah batteries which gives it a theoretical maximum capacity of 84Wh.</li>



<li>Has audible transformer hissing when not loaded but is completely fan-less.</li>
</ul>



<h2 class="wp-block-heading">Power Consumption</h2>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2356" height="1050" src="https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-power-consumption.png?strip=all&#038;quality=90&#038;resize=2356,1050" alt="" class="wp-image-8579" srcset="https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-power-consumption.png?strip=all&amp;quality=90&amp;resize=800%2C357 800w, https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-power-consumption.png?strip=all&amp;quality=90&amp;resize=1024%2C456 1024w, https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-power-consumption.png?strip=all&amp;quality=90&amp;resize=1536%2C685 1536w, https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-power-consumption.png?strip=all&amp;quality=90&amp;resize=2048%2C913 2048w, https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-power-consumption.png?strip=all&amp;quality=90&amp;resize=384%2C171 384w, https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-power-consumption.png?strip=all&amp;quality=90&amp;resize=768%2C342 768w" sizes="auto, (max-width: 2356px) 100vw, 2356px" /><figcaption class="wp-element-caption">PowerWalker VI 500 R1U drawing 15W unloaded (during 6-8PM) and practically the same when powering a 30W server (during 10-11PM) when fully charged.</figcaption></figure>



<p>The unit draws an additional 15W when powering a 30W NAS (and connected to the mains) which explains why it gets pretty warm (still comfortable to touch). This is a pretty significant overhead for DC-based systems like routers and mini PC servers.</p>



<p>The specification mentions 95% efficiency under full load when connected to the mains and 78% efficiency when powered from the battery (also under full load) with a 0.60 power factor. The official full-load (300W) backup time is 0.8 minutes or 10.3 minutes for the half-load (150W).</p>



<p>After almost exactly a year of this kind of usage, the batteries were completely depleted and wouldn&#8217;t last even a few seconds during a blackout &#8212; dropping to 10V as soon as the mains power supply was removed.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/powerwalker-vi-500-r1u/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-r1u-ups-scaled.jpeg" length="582893" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/09/powerwalker-vi-500-power-consumption.png" length="25196" type="image/png" />	</item>
		<item>
		<title>Notes on Beelink U59 Pro (Intel N5105) as a Home Server</title>
		<link>https://kaspars.net/blog/beelink-u59-pro-n5105</link>
					<comments>https://kaspars.net/blog/beelink-u59-pro-n5105#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sun, 07 May 2023 07:55:19 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8490</guid>

					<description><![CDATA[Update (2025): Beelink now offers N5105 as part of their Mini S12 and Mini S13 line-up which also includes more recent Intel CPUs such as N95 and N150 (recommended). See the comparison table below ↓ For a home server hosting mostly Docker containers I&#8217;ve always wanted a computer with proper and multiple disk drives for [&#8230;] <a href="https://kaspars.net/blog/beelink-u59-pro-n5105" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p><strong>Update (2025):</strong> Beelink now offers N5105 as part of their Mini S12 and Mini S13 line-up which also includes more recent Intel CPUs such as N95 and N150 (recommended). See the <a href="#comparison">comparison table below ↓</a></p>



<p>For a home server hosting mostly Docker containers I&#8217;ve always wanted a computer with proper and multiple disk drives for data redundancy instead of SD cards used by most single-board computers. With the shortage of Raspberry Pi supply over the past years there has been an increased availability of mini PCs with all kinds of power-efficient Intel processors and extensive IO and storage options. Blogs such as <a href="https://www.cnx-software.com/">CNX Software</a>, <a href="https://linuxgizmos.com/">Linux Gizmos</a> and <a href="https://liliputing.com/">Liliputing</a> are amazing for research and deals which is how I discovered Beelink and their mini PCs.</p>



<span id="more-8490"></span>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2500" height="1875" src="https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpeg?strip=all&#038;quality=90&#038;resize=2500,1875" alt="Beelink U59 Pro power consumption" class="wp-image-8502" srcset="https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2500px) 100vw, 2500px" /><figcaption class="wp-element-caption">Beelink U59 Pro drawing 10W from Bluetti EB3A during idle with Ubuntu 22.04.2 and a few Docker containers. Note that the actual power consumption is around 5W while the other 5W are lost in conversion from DC to AC to DC.</figcaption></figure>



<p>In late 2022 I purchased <strong>Beelink U59 Pro</strong> with an <a href="https://www.intel.com/content/www/us/en/products/sku/212328/intel-celeron-processor-n5105-4m-cache-up-to-2-90-ghz/specifications.html">Intel N5105 processor</a>, 16GB RAM, 500GB M.2 drive and two network ports for around EUR 230 (including shipping). Here is <a href="https://www.cnx-software.com/2022/08/13/beelink-u59-pro-review-a-jasper-lake-mini-pc-with-improved-gpu-performance/">a great review of the device</a>.</p>



<h2 class="wp-block-heading">Hardware and Upgrades</h2>



<p>Overall, the build quality is great with nice and quiet cooling design and convenient placement for the extra SSD drive. It uses a 12V power supply so it can be easily attached to a battery-powered UPS.</p>



<p>For data redundancy I added <a href="https://www.westerndigital.com/en-ap/products/internal-drives/wd-blue-sa510-sata-2-5-ssd">a 1TB WD Blue SA510 2.5” SATA III drive</a> (<a href="https://kaspars.net/go/amazon-wd-blue-sa510-sata">Amazon</a>) and used LVM to distribute the filesystem logical volume across the two physical volumes as RAID1.</p>



<p>Below are my notes on getting the device up and running.</p>



<h2 class="wp-block-heading">Power Supply and Consumption</h2>



<p>It is powered by a 12V 3A power supply with a 5.5&#215;2.5mm DC jack. Note the diameter of the inner pin which is larger than the typical 2.1mm and won&#8217;t fit most of the low-power 12V power supplies or the POE adapters/splitters. </p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2000" height="1296" src="https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpg?strip=all&#038;quality=90&#038;resize=2000,1296" alt="Beelink U59 power consumption before and after applying powertop optimizations" class="wp-image-8521" srcset="https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpg?strip=all&amp;quality=90&amp;resize=800%2C518 800w, https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpg?strip=all&amp;quality=90&amp;resize=1024%2C664 1024w, https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpg?strip=all&amp;quality=90&amp;resize=1536%2C995 1536w, https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpg?strip=all&amp;quality=90&amp;resize=384%2C249 384w, https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpg?strip=all&amp;quality=90&amp;resize=768%2C498 768w, https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpg?strip=all&amp;quality=90&amp;resize=2000%2C1296 2000w" sizes="auto, (max-width: 2000px) 100vw, 2000px" /><figcaption class="wp-element-caption">Beelink U59 power consumption before and after applying powertop optimizations.</figcaption></figure>



<p>The power consumption ranges from 17W during the boot process to 5W when idling with ethernet connected and WiFi enabled but disconnected, using the default Ubuntu Server 22 LTS. It gets down to 3W after running <code>powertop --auto-tune</code> which applies the following optimizations:</p>



<figure class="wp-block-gallery alignwide has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-report-after-auto-tune.jpeg"><img loading="lazy" decoding="async" width="1415" height="1415" data-id="8523" src="https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-report-after-auto-tune.jpeg?strip=all&#038;quality=90&#038;resize=1415,1415" alt="Beelink U59 Pro powertop idle stats and C-states" class="wp-image-8523" srcset="https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-report-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-report-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=800%2C800 800w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-report-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1024 1024w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-report-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=150%2C150 150w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-report-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-report-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-report-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=1415%2C1415 1415w" sizes="auto, (max-width: 1415px) 100vw, 1415px" /></a><figcaption class="wp-element-caption">Beelink U59 Pro powertop idle stats and C-states.</figcaption></figure>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-optimizations-after-auto-tune.jpeg"><img loading="lazy" decoding="async" width="1493" height="1493" data-id="8522" src="https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-optimizations-after-auto-tune.jpeg?strip=all&#038;quality=90&#038;resize=1493,1493" alt="Beelink U59 Pro powertop optimizations" class="wp-image-8522" srcset="https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-optimizations-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-optimizations-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=800%2C800 800w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-optimizations-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1024 1024w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-optimizations-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=150%2C150 150w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-optimizations-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-optimizations-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=768%2C768 768w, https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-optimizations-after-auto-tune.jpeg?strip=all&amp;quality=90&amp;resize=1493%2C1493 1493w" sizes="auto, (max-width: 1493px) 100vw, 1493px" /></a><figcaption class="wp-element-caption">Beelink U59 Pro powertop optimizations.</figcaption></figure>
</figure>



<h2 class="wp-block-heading">BIOS Version and Errors</h2>



<p>The device comes with Windows 11 installed and activated. However, I wanted to install the Ubuntu server and that would never get pass one of the installation stages due to some memory errors. The device came with BIOS version JTKT001 X64 (build 05/05/2022 15:03:35) and produced the following errors during the boot (shown here with Debian install for testing):</p>



<figure class="wp-block-embed alignwide is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Beelink U59 Pro BIOS error (version 2.21.1278, build 05/05/2022 15:03:35)" width="650" height="366" src="https://www.youtube.com/embed/CYF94pJaoc4?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>I reached out to Beelink support and after providing the serial number for the hardware revision identification they sent a new version of the firmware <code>JTKT001_20230217_U59_sata.bin</code> along with the tooling to update it from a flash boot. This new version seems to have resolved the issue and I&#8217;ve been able to install Ubuntu Server 22.04.2 LTS without any problems.</p>



<p>It is unfortunate that this is not provided on their website and everyone needs to contact their support directly (apparently due to the potential of bricking the device with the wrong firmware).</p>



<h2 class="wp-block-heading">Enable Wake-Up after Power Loss</h2>



<p>This device can automatically restart after a power loss but that isn&#8217;t enabled by default. The option for &#8220;State After G3&#8221; is hidden under the &#8220;Chipset&#8221; tab and the &#8220;PCH-IO Configuration&#8221; section in the BIOS settings and needs to be set to &#8220;S0 State&#8221; (one of the <a href="https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/16_Waking_and_Sleeping/sleeping-states.html">ACPI Sleep States</a>).</p>



<p>This is an important feature for a homelab server!</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1813" src="https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1813" alt="Beelink U59 Pro BIOS settings for power failure restart" class="wp-image-8496" srcset="https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C567 800w, https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C725 1024w, https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1088 1536w, https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1450 2048w, https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C272 384w, https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C544 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></figure>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1496" src="https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-enable-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1496" alt="Set to S0 state in BIOS to boot Beelink U59 Pro after power loss" class="wp-image-8497" srcset="https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-enable-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C468 800w, https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-enable-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C598 1024w, https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-enable-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C898 1536w, https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-enable-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1197 2048w, https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-enable-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C224 384w, https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-enable-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C449 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">Set to S0 state (Working) in BIOS to boot the Beelink U59 Pro after a power loss.</figcaption></figure>



<h2 class="wp-block-heading">Usage</h2>



<p>This server is running in parallel to a dedicated <a href="https://www.qnap.com/en/product/ts-435xeu">QNAP TS-435XeU NAS</a> and hosts critical Docker containers for home automation to reduce the impact of NAS firmware upgrades and restarts while still backing up volume data to the NAS.</p>



<h2 class="wp-block-heading" id="comparison">Beelink Intel Mini S Comparison</h2>



<p><strong>Recommended</strong>: Mini S13 with N150 and 16GB RAM (<a href="https://kaspars.net/go/beelink-mini-s13">AliExpress</a> / <a href="https://kaspars.net/go/amazon-beelink-mini-s13-pro">Amazon</a>). For NAS application consider Beelink ME Mini NAS (<a href="https://kaspars.net/go/beelink-me-mini-nas">AliExpress</a> / <a href="https://kaspars.net/go/amazon-beelink-me-nas">Amazon</a>) with 16GB RAM, 64GB eMMC, dual 2.5Gbps and <em>6x M2 NVMe SSD slots (24TB max. capacity)</em>. </p>



<p>For the SSD storage you can estimate ~$50 per TB (up to 8TB).</p>



<figure class="wp-block-table is-style-regular"><table><thead><tr><th class="has-text-align-left" data-align="left">Model</th><th class="has-text-align-right" data-align="right">RAM</th><th class="has-text-align-right" data-align="right">Disk</th><th class="has-text-align-right" data-align="right">Price</th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left">Mini S with N5095</td><td class="has-text-align-right" data-align="right">8GB</td><td class="has-text-align-right" data-align="right">256GB</td><td class="has-text-align-right" data-align="right">$230</td></tr><tr><td class="has-text-align-left" data-align="left">Mini S12 with N95</td><td class="has-text-align-right" data-align="right">8GB</td><td class="has-text-align-right" data-align="right">256GB</td><td class="has-text-align-right" data-align="right">$235</td></tr><tr><td class="has-text-align-left" data-align="left">Mini S12 Pro with N100</td><td class="has-text-align-right" data-align="right">16GB</td><td class="has-text-align-right" data-align="right">512GB</td><td class="has-text-align-right" data-align="right">$295</td></tr><tr><td class="has-text-align-left" data-align="left">Mini S13 with N150</td><td class="has-text-align-right" data-align="right">16GB</td><td class="has-text-align-right" data-align="right">512GB</td><td class="has-text-align-right" data-align="right">$310</td></tr></tbody></table></figure>



<p>Note:</p>



<ul class="wp-block-list">
<li>All Mini S models contain one additional M2 NVMe <em>or</em> SATA SSD slot.</li>



<li>Amazon often has significant discounts for <a href="https://kaspars.net/go/amazon-beelink-mini-s13-pro" data-type="surl" data-id="10522">Beelink products</a>.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/beelink-u59-pro-n5105/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpeg" length="460138" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/05/beelink-u59-pro-power-consumption.jpg" length="400367" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-report-after-auto-tune.jpeg" length="73003" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/05/beelink-powertop-optimizations-after-auto-tune.jpeg" length="223414" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-scaled.jpeg" length="409002" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/05/beelink-bios-power-resume-g3-restart-enable-scaled.jpeg" length="296652" type="image/jpeg" />	</item>
		<item>
		<title>Notes on NEO Tuya Zigbee HomeKit Hub</title>
		<link>https://kaspars.net/blog/neo-nas-zw05b0-tuya-zigbee-homekit-hub</link>
					<comments>https://kaspars.net/blog/neo-nas-zw05b0-tuya-zigbee-homekit-hub#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Mon, 17 Apr 2023 09:09:35 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8458</guid>

					<description><![CDATA[Until recently Zemismart ZMHK-01 was the only Zigbee hub with Apple HomeKit integration. Now there is also NEO NAS-ZW05B0 Zigbee hub (affiliate link) with a HomeKit integration produced by Shenzhen NEO Electronic for around $25 with pretty much the same components. Note that only the wired version (with RJ45 ethernet connections instead of wi-fi) appears [&#8230;] <a href="https://kaspars.net/blog/neo-nas-zw05b0-tuya-zigbee-homekit-hub" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>Until recently <a href="https://kaspars.net/blog/zemismart-zigbee-homekit-hub" data-type="post" data-id="8147">Zemismart ZMHK-01</a> was the only Zigbee hub with Apple HomeKit integration. Now there is also <a href="https://kaspars.net/go/neo-tuya-zigbee-homekit-hub" data-type="surl" data-id="8461">NEO NAS-ZW05B0 Zigbee hub</a> (affiliate link) with a HomeKit integration produced by <a href="https://www.szneo.com/en/products/index.php?id=77">Shenzhen NEO Electronic</a> for around $25 with pretty much the same components. Note that only the wired version (with RJ45 ethernet connections instead of wi-fi) appears to have the HomeKit support!</p>



<span id="more-8458"></span>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1707" src="https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-tuya-zigbee-homekit-hub-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1707" alt="How to open NEO NAS-ZW05B0 Tuya Zigbee HomeKit hub" class="wp-image-8462" srcset="https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-tuya-zigbee-homekit-hub-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C533 800w, https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-tuya-zigbee-homekit-hub-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C683 1024w, https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-tuya-zigbee-homekit-hub-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1024 1536w, https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-tuya-zigbee-homekit-hub-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1366 2048w, https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-tuya-zigbee-homekit-hub-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C256 384w, https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-tuya-zigbee-homekit-hub-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C512 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">Use a pry tool to push open the four corners around the hub.</figcaption></figure>



<p>It is based on the <a href="https://developer.tuya.com/en/docs/iot/tyzs4ipex-zigbee-module-datasheet?id=K9m7tuum62gwb">Tuya TYZS4-IPEX module</a> for the Zigbee connectivity and <a href="https://www.realtek.com/en/products/communications-network-ics/item/rtl8196e">Realtek RTL8196E</a> controller for the USB and ethernet functionality similar to the <a href="https://kaspars.net/blog/zemismart-zigbee-homekit-hub" data-type="post" data-id="8147">Zemismart ZMHK-01 hub I reviewed earlier</a> and the <a href="https://paulbanks.org/projects/lidl-zigbee/">Lidl Silvercrest Zigbee hub</a>.</p>



<figure class="wp-block-image alignwide size-full is-style-default"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-with-tuya-TYZS4-IPEX-radio-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="NEO NAS-ZW05B0 Zigbee HomeKit Hub with Tuya TYZS4-IPEX radio controller" class="wp-image-8464" srcset="https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-with-tuya-TYZS4-IPEX-radio-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-with-tuya-TYZS4-IPEX-radio-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-with-tuya-TYZS4-IPEX-radio-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-with-tuya-TYZS4-IPEX-radio-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-with-tuya-TYZS4-IPEX-radio-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-with-tuya-TYZS4-IPEX-radio-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">NEO NAS-ZW05B0 Zigbee HomeKit Hub with Tuya TYZS4-IPEX radio and GD25Q127CSIG flash.</figcaption></figure>



<p>Considering the shared components, it should be possible to <a href="https://paulbanks.org/projects/lidl-zigbee/#gaining-initial-access">get root access to the device</a> by connecting directly to that UART pins on the PCB (see below) but the bootloader on this device <code>RealTek(RTL8196E) at 2022.01.10-18:12+0800 v3.4T-pre2</code> doesn&#8217;t support the <code>ESC</code> key sequence for entering the boot options as <a href="https://github.com/banksy-git/lidl-gateway-freedom/issues/31">described by this open issue</a>.</p>



<p>The pins at the bottom-left of the PCB (J1) are:</p>



<ul class="wp-block-list">
<li>Pin 1 (square): 3.3V</li>



<li>Pin 2: GND</li>



<li>Pin 3: RTL8196E U0_TX (B0)</li>



<li>Pin 4: RTL8196E U0_RX (A7)</li>



<li>Pin 5: Tuya TYZS4-IPEX SWDIO</li>



<li>Pin 6: Tuya TYZS4-IPEX SWCLK</li>
</ul>



<p>Connecting just the <code>GND</code>, <code>TX</code> and <code>RX</code> pins I was able to read the boot logs:</p>



<pre class="wp-block-code"><code>Booting...

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@
@ chip__no chip__id mfr___id dev___id cap___id size_sft dev_size chipSize
@ 0000000h 0c84018h 00000c8h 0000040h 0000018h 0000000h 0000018h 1000000h
@ blk_size blk__cnt sec_size sec__cnt pageSize page_cnt chip_clk chipName
@ 0010000h 0000100h 0001000h 0001000h 0000100h 0000010h 000004eh GD25Q128
@ 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
DDR1:32MB
 
---RealTek(RTL8196E)at 2022.01.10-18:12+0800 v3.4T-pre2 &#91;16bit](400MHz)
P0phymode=01, embedded phy
check_image_header  return_addr:05010000 bank_offset:00000000
no sys signature at 00010000!
P0phymode=01, embedded phy
---Ethernet init Okay!
tuya:start receive production test frame ...
Jump to image start=0x80c00000...
decompressing kernel:
Uncompressing Linux... done, booting the kernel.
done decompressing kernel.
start address: 0x80003780
Linux version 3.10.90 (root@WorkPC) (gcc version 4.6.4 (Realtek RSDK-4.6.4 Build 2080) ) #1 Mon Jan 10 18:14:44 CST 2022
CPU revision is: 0000cd01
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Zone ranges:
  Normal   &#91;mem 0x00000000-0x01ffffff]
Movable zone start for each node
Early memory node ranges
  node   0: &#91;mem 0x00000000-0x01ffffff]
icache: 16kB/16B, dcache: 8kB/16B, scache: 0kB/0B
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line:  console=ttyS0,38400 root=/dev/mtdblock2 
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 27344k/32768k available (2763k kernel code, 5424k reserved, 562k data, 192k init, 0k highmem)
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:128
console &#91;ttyS0] enabled
Calibrating delay loop... 398.13 BogoMIPS (lpj=1990656)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 512
reg e0=0
reg e1=0
reg e2=0
reg e3=0
reg e4=0
reg e5=0
reg e6=0
reg e7=0
reg f0=0
reg f1=0
reg f2=0
reg f3=0
reg f4=0
reg f5=0
reg f6=0
NET: Registered protocol family 16
bio: create slab &lt;bio-0> at 0
NET: Registered protocol family 2
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 53
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x18002000 (irq = 9) is a 16550A
serial8250: ttyS1 at MMIO 0x18002100 (irq = 13) is a 16550A
Realtek GPIO Driver for Flash Reload Default
tuya_gpio_init ok, scan expire time:50
SPI INIT
 ------------------------- Force into Single IO Mode ------------------------ 
|No chipID  Sft chipSize blkSize secSize pageSize sdCk opCk      chipName    |
| 0 c84018h  0h 1000000h  10000h  10000h     100h   84    0          GD25Q128|
 ---------------------------------------------------------------------------- 
SPI flash(GD25Q128) was found at CS0, size 0x1000000
boot+cfg offset=0x0 size=0x20000 erasesize=0x10000
linux offset=0x20000 size=0x1e0000 erasesize=0x10000
rootfs offset=0x200000 size=0x200000 erasesize=0x10000
tuya-label offset=0x400000 size=0x20000 erasesize=0x10000
jffs2-fs offset=0x420000 size=0xbe0000 erasesize=0x10000
5 rtkxxpart partitions found on MTD device flash_bank_1
Creating 5 MTD partitions on "flash_bank_1":
0x000000000000-0x000000020000 : "boot+cfg"
0x000000020000-0x000000200000 : "linux"
0x000000200000-0x000000400000 : "rootfs"
0x000000400000-0x000000420000 : "tuya-label"
0x000000420000-0x000001000000 : "jffs2-fs"
PPP generic driver version 2.4.2
nf_conntrack version 0.5.0 (427 buckets, 1708 max)
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP: cubic registered
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
l2tp_core: L2TP core driver, V2.0
8021q: 802.1Q VLAN Support v1.8
Realtek FastPath:v1.03
Probing RTL819X NIC-kenel stack size order&#91;1]...
eth0 added. vid=9 Member port 0x10f...
eth1 added. vid=8 Member port 0x10...
&#91;peth0] added, mapping to &#91;eth1]...
VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
Freeing unused kernel memory: 192K (80340000 - 80370000)
init started: BusyBox v1.13.4 (2022-01-10 18:11:37 CST)
Set power startcmd read
b8000038: 2794A104  0000000F    00000042  00000018    '��        B    
cmd write
Write memory 0xb8000038 dat 0x1794a104: 0x1794a104
Set power end
udhcpc (v1.13.4) started
Sending discover...
Please press Enter to activate this console. Tuya Gateway Application Normal Srart /tuya/tuya_start.sh UserAppRunDir:
set defult run_dir:/tuya
TY_ENV_APP_RUN_DIR=/tuya
get user cfg file error, load defult cfg file
load platform configure file:/tuya/def.cfg
start.conf is exist
udhcpc (v1.13.4) started
Normal mode.
current run dir:/tuya/tuya_user1
grep: /var/resolv.conf: No such file or directory
tuya_start_children.sh:UserAppRunDir:/tuya JsonFile Path:/tuya/def.cfg &#91;engineer_mode: ]
Sending discover...
killall: app_detect.sh: no process killed
killall: tyZ3Gw: no process killed
killall: log_detect.sh: no process killed
killall: process_monitor.sh: no process killed
killall: tyZ3Gw: no process killed
Sending discover...
cat: can't open '/tuya/eng_mode_upg': No such file or directory
cat: can't open '/tmp/eng_mode': No such file or directory
no eng file
Sending discover...
nameserver 114.114.114.114
nlRecvFromAppSock sg_netlinkKeyPid:239
nlRecvFromAppSock port link sg_netlinkPid:239
umw send to error.: Socket operation on non-socket
Jan  1 00:00:38 mDNSResponder: mDNSResponder (Engineering Build) (Jul 27 2021 20:15:30) starting
Jan  1 00:00:38 mDNSResponder: mDNS_AddDNSServer: Lock not held! mDNS_busy (0) mDNS_reentrancy (0)
Jan  1 00:00:38 mDNSResponder: mDNS_AddDNSServer: Lock not held! mDNS_busy (0) mDNS_reentrancy (0)
Jan  1 00:00:38 mDNSResponder: WARNING: mdnsd continuing as root because user "nobody" does not exist
Sending discover...</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/neo-nas-zw05b0-tuya-zigbee-homekit-hub/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-with-tuya-TYZS4-IPEX-radio-scaled.jpeg" length="765758" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/04/neo-NAS-ZW05B2-tuya-zigbee-homekit-hub-scaled.jpeg" length="643707" type="image/jpeg" />	</item>
		<item>
		<title>Nilan Compact P2 (GEO3 Polar) Review</title>
		<link>https://kaspars.net/blog/nilan-compact-p2-geo3-polar</link>
					<comments>https://kaspars.net/blog/nilan-compact-p2-geo3-polar#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sat, 04 Mar 2023 08:37:03 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[Passive House]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8405</guid>

					<description><![CDATA[It is a single unit for ventilation with heat recovery and a heat pump against the exhaust air for heating or cooling the incoming air and producing domestic hot water, and another heat pump against ground loop for additional heating or cooling. Components Here are the components for this particular unit (inspected manually or extracted [&#8230;] <a href="https://kaspars.net/blog/nilan-compact-p2-geo3-polar" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>It is <a href="https://www.en.nilan.dk/products/ventilation-with-heating/ventilation-hot-water-production-and-heating/compact-p2-geo3">a single unit</a> for ventilation with heat recovery and a heat pump against the exhaust air for heating or cooling the incoming air and producing domestic hot water, and another heat pump against ground loop for additional heating or cooling.</p>



<figure class="wp-block-image alignwide size-full"><a href="https://kaspars.net/wp-content/uploads/2023/03/nilan-compact-p2-ventilation-heat-recovery.jpeg"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2023/03/nilan-compact-p2-ventilation-heat-recovery-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Nilan Compact P2 ventilation crossflow heat exchanger" class="wp-image-8407" srcset="https://kaspars.net/wp-content/uploads/2023/03/nilan-compact-p2-ventilation-heat-recovery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2023/03/nilan-compact-p2-ventilation-heat-recovery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2023/03/nilan-compact-p2-ventilation-heat-recovery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2023/03/nilan-compact-p2-ventilation-heat-recovery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2023/03/nilan-compact-p2-ventilation-heat-recovery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2023/03/nilan-compact-p2-ventilation-heat-recovery-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></a><figcaption class="wp-element-caption"><a href="https://www.en.nilan.dk/products/ventilation-with-heating/ventilation-hot-water-production-and-heating/compact-p2-geo3">Nilan Compact P2</a> ventilation crossflow heat exchanger with a heat pump against the outgoing air for heating and hot water production.</figcaption></figure>



<span id="more-8405"></span>



<h2 class="wp-block-heading">Components</h2>



<p>Here are the components for this particular unit (inspected manually or extracted from <a href="https://www.en.nilan.dk/downloads">the available documentation</a>). Note that different production runs might be using different components.</p>



<h3 class="wp-block-heading">Air Filters</h3>



<p><a href="https://www.nilan.dk/produkter/tilbehoer/filtre/standardfilter-greencycle-iso-coarse-75-g4">Nilan Greencycle filter</a> (G4, ISO Coarse &gt; 75%).</p>



<h3 class="wp-block-heading">Supply and Extract Air Motors</h3>



<p>D190mm Not confirmed, yet.</p>



<h3 class="wp-block-heading">Pre-Heating Element (Polar)</h3>



<p>RDT TW3 1500W 240V resistive heater coil in the back of the top-left incoming air chamber.</p>



<h3 class="wp-block-heading">Counter-flow Air Heat Exchanger</h3>



<figure class="wp-block-image size-full"><a href="https://kaspars.net/wp-content/uploads/2023/03/holtop-3d-cross-flow-heat-exchanger.jpg"><img loading="lazy" decoding="async" width="1516" height="1304" src="https://kaspars.net/wp-content/uploads/2023/03/holtop-3d-cross-flow-heat-exchanger.jpg?strip=all&#038;quality=90&#038;resize=1516,1304" alt="Holtop 3D crossflow heat exchanger" class="wp-image-8429" srcset="https://kaspars.net/wp-content/uploads/2023/03/holtop-3d-cross-flow-heat-exchanger.jpg?strip=all&amp;quality=90&amp;resize=800%2C688 800w, https://kaspars.net/wp-content/uploads/2023/03/holtop-3d-cross-flow-heat-exchanger.jpg?strip=all&amp;quality=90&amp;resize=1024%2C881 1024w, https://kaspars.net/wp-content/uploads/2023/03/holtop-3d-cross-flow-heat-exchanger.jpg?strip=all&amp;quality=90&amp;resize=384%2C330 384w, https://kaspars.net/wp-content/uploads/2023/03/holtop-3d-cross-flow-heat-exchanger.jpg?strip=all&amp;quality=90&amp;resize=768%2C661 768w, https://kaspars.net/wp-content/uploads/2023/03/holtop-3d-cross-flow-heat-exchanger.jpg?strip=all&amp;quality=90&amp;resize=1516%2C1304 1516w" sizes="auto, (max-width: 1516px) 100vw, 1516px" /></a></figure>



<p>Polyethylene terephthalate (PET) counterflow heat exchanger. Potentially <a href="https://www.holtop.com/high-efficiency-3d-counter-flow-heat-exchanger.html">Holtop 3D</a> (<a href="https://kaspars.net/wp-content/uploads/2023/03/Holtop-3D-high-efficient-counterflow-heat-exchanger-202106.pdf">specification PDF</a>).</p>



<h3 class="wp-block-heading">Bypass Damper</h3>



<p><a href="https://www.belimo.com/pl/shop/en_GB/Actuators/Non-Fail-Safe-Actuators/CM230-F-L/p?code=CM230-F-L">Belimo CM230-F rotary actuator</a> (orange device in the middle of the photo) controls the bypass damper &#8212; the cover for the cross-flow heat exchanger (the aluminium plate covering the green cross-flow heat exchanger in the top-left) and the square opening (to the right of the actuator) in the middle of photo connecting the incoming and outgoing air chambers.</p>



<ul class="wp-block-list">
<li><a href="https://kaspars.net/wp-content/uploads/2023/03/belimo_CM230-F-L_datasheet_en-gb.pdf">Belimo CM230-F datasheet PDF</a></li>



<li><a href="https://kaspars.net/wp-content/uploads/2023/03/belimo_CM..-F_installation-instructions.pdf">Belimo CM230-F installation instructions PDF</a></li>
</ul>



<h3 class="wp-block-heading">Air-Source Heat Pump</h3>



<p><a href="https://store.danfoss.com/en/Climate-Solutions-for-cooling/Compressors/Compressors-for-refrigeration/Light-commercial-compressors/Light-commercial-compressors/Reciprocating-compressor%2C-SC15GHH/p/104G8571">Danfoss SC15GHH reciprocating compressor</a> pumps the heat from the exhaust air (bottom left) to either the hot water tank <em>or</em> the incoming air. It is a high back pressure (HBP) compressor with a high condenser temperature of 55C to ensure it can heat up the domestic water using the R134a refrigerant.</p>



<p>It&#8217;s heat output ranges from <strong>345W at -15C</strong> evaporator (is that the outgoing air <em>after</em> the counter-flow heat exchanger?) temperature (COP 1.26) to <strong>1731W at 15C</strong> evaporator temperature (COP 3.02) at EN12900/CECOMAF rating conditions:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Evaporator Temperature, C</th><th>Capacity, W</th><th>Power Consumption, W</th><th>COP</th></tr></thead><tbody><tr><td>15</td><td>1731</td><td>573</td><td>3.02</td></tr><tr><td>10</td><td>1405</td><td>544</td><td>2.59</td></tr><tr><td>7.2</td><td>1248</td><td>523</td><td>2.39</td></tr><tr><td>5</td><td>1135</td><td>505</td><td>2.25</td></tr><tr><td>0</td><td>911</td><td>461</td><td>1.98</td></tr><tr><td>-5</td><td>726</td><td>417</td><td>1.74</td></tr><tr><td>-6.7</td><td>670</td><td>403</td><td>1.66</td></tr><tr><td>-10</td><td>570</td><td>377</td><td>1.51</td></tr><tr><td>-15</td><td>435</td><td>345</td><td>1.26</td></tr></tbody></table></figure>



<p>which looks like this on a chart:</p>



<figure class="wp-block-image alignwide size-full"><img decoding="async" src="https://kaspars.net/wp-content/uploads/2023/03/SC15GHH-capacity-power-consumption-cop.svg" alt="SC15GHH heat pump capacity, power consumption and COP" class="wp-image-8447"/><figcaption class="wp-element-caption">SC15GHH heat pump capacity, power consumption (left axis) and COP (right axis).</figcaption></figure>



<p>Prices online range from EUR 150 to 900.</p>



<ul class="wp-block-list">
<li><a href="https://kaspars.net/wp-content/uploads/2023/03/SC15GHH-specification.pdf">SC15GHH specification PDF</a></li>



<li><a href="https://kaspars.net/wp-content/uploads/2023/03/SC15GHH-connections.pdf">SC15GHH connections PDF</a></li>



<li><a href="https://kaspars.net/wp-content/uploads/2023/03/SC15GHH-service-guide.pdf">SC15GHH service guide PDF</a></li>
</ul>



<h3 class="wp-block-heading">CO2 Sensor (Optional)</h3>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="700" height="468" src="https://kaspars.net/wp-content/uploads/2023/03/sensecube-kcd_an300-co2-sensor.jpeg?strip=all&#038;quality=90&#038;resize=700,468" alt="Korea Digital SenseCube KCD-AN300 CO2 sensor" class="wp-image-8418" srcset="https://kaspars.net/wp-content/uploads/2023/03/sensecube-kcd_an300-co2-sensor.jpeg?strip=all&amp;quality=90&amp;resize=384%2C257 384w, https://kaspars.net/wp-content/uploads/2023/03/sensecube-kcd_an300-co2-sensor.jpeg?strip=all&amp;quality=90&amp;resize=700%2C468 700w" sizes="auto, (max-width: 700px) 100vw, 700px" /></figure>
</div>


<p><a href="http://www.koreadigital.com/sensecube_product1?l=en">Korea Digital SenseCube KCD-AN300</a> (RS-15-spec) (<a href="https://www.en.nilan.dk/products/accessories/co2-sensors/co2-sensor">sold by Nilan</a>) with dual-wavelength NDIR sensor with 4-20mA / 0-10V analog or RS485 / PWM output.</p>



<ul class="wp-block-list">
<li><a href="https://kaspars.net/wp-content/uploads/2023/03/KCD-AN-300_en.pdf">KCD-AN300 specification PDF</a></li>



<li><a href="https://www.mb-systemtechnik.de/en/CO2-measurement/co2-meter-6-8-14-15.html">Available for purchase in EU</a> for EUR 94.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/nilan-compact-p2-geo3-polar/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2023/03/nilan-compact-p2-ventilation-heat-recovery-scaled.jpeg" length="644505" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/03/holtop-3d-cross-flow-heat-exchanger.jpg" length="62631" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/03/SC15GHH-capacity-power-consumption-cop.svg" length="30847" type="image/svg+xml" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/03/sensecube-kcd_an300-co2-sensor.jpeg" length="34138" type="image/jpeg" />	</item>
		<item>
		<title>How Much Insulation is Too Much?</title>
		<link>https://kaspars.net/blog/how-much-insulation-is-enough</link>
					<comments>https://kaspars.net/blog/how-much-insulation-is-enough#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sun, 19 Feb 2023 10:54:13 +0000</pubDate>
				<category><![CDATA[Passive House]]></category>
		<category><![CDATA[Building Science]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8351</guid>

					<description><![CDATA[The diminishing returns of insulation thickness is a legend referenced by many builders and architects which is actually incorrect. It is often paired with financial payback calculations that don&#8217;t consider the full range of insulation benefits. The legend states that any amount of insulation added after R-10,20,30,40&#8230; (pick your number but be aware of the [&#8230;] <a href="https://kaspars.net/blog/how-much-insulation-is-enough" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>The diminishing returns of insulation thickness is a legend referenced by many builders and architects which is actually incorrect. It is often paired with financial payback calculations that don&#8217;t consider the full range of insulation benefits.</p>



<p>The legend states that any amount of insulation added after R-10,20,30,40&#8230; (pick your number but <a href="https://en.wikipedia.org/wiki/R-value_(insulation)#Usage,_units">be aware of the units</a>) is a waste of money or unnecessary, or simply doesn&#8217;t make sense. I&#8217;ll explain why that is not the case.</p>



<span id="more-8351"></span>



<p><em>Note: I originally wrote this <a href="https://www.northernbuilt.pro/the-diminishing-return-of-insulation/">as a comment to this blog post</a> and decide to share it here with additional details and context.</em></p>



<h2 class="wp-block-heading">Why R-values and U-values Get Confusing</h2>



<p>Materials transfer heat at a rate that is proportional to the thickness and the temperature difference between both sides of the material. It is expressed as W/(mK) and a typical (and conservative) value for a blown-in cellulose, wood fibre or mineral wool is 0.04W/(mK).</p>



<p>Dividing this number by the width of the material we derive the rate of heat transfer per area of the material which is the U-value or W/(m<sup>2</sup>K). The inverse of that is the resistance to the heat conductivity or the R-value or m<sup>2</sup>K/W. </p>



<p><strong>Important:</strong> we&#8217;re referring <a href="https://en.wikipedia.org/wiki/R-value_(insulation)#Usage,_units">R-value in SI units</a> (also known as RSI) which need to be multiplied by 5.68 to arrive at the values typically used in the U.S.</p>



<figure class="wp-block-image alignwide size-full"><img decoding="async" src="https://kaspars.net/wp-content/uploads/2023/02/heat-flow-vs-thickness.svg" alt="Heat flow vs. material thickness" class="wp-image-8357"/><figcaption class="wp-element-caption">U-value and R-value relative to the material thickness in meters (0.1m is around 4 inches).</figcaption></figure>



<p><strong>It appears as if each additional layer of insulation <em>does less</em> to reduce the rate of heat transfer (U-value) while the R-value increases linearly. This is the source of confusion.</strong></p>



<p>Turns out that the amount of insulation added relative to the total amount of insulation is actually the same as the change in the rate of heat transfer or the U-value:</p>



<figure class="wp-block-table"><table><thead><tr><th>Thickness, m</th><th>Thickness Change</th><th>U-value Change</th></tr></thead><tbody><tr><td>0.1</td><td></td><td></td></tr><tr><td>0.2</td><td>+50% (0.1/0.2)</td><td>-50% (0.2/0.4)</td></tr><tr><td>0.3</td><td>+33% (0.1/0.3)</td><td>-33% (0.066/0.20)</td></tr><tr><td>0.4</td><td>+25% (0.1/0.4)</td><td>-25% (0.033/0.133)</td></tr><tr><td>0.5</td><td>+20% (0.1/0.5)</td><td>-20% (0.02/0.10)</td></tr></tbody></table></figure>



<p>This is similar to how a 50% drop in stock market requires an 100% increase afterwards to get to the original value. The reference point is what matters and creates the perceived difference.</p>



<p>Doubling the width of insulation at every step also halves the U-value but normally the increments are constant so the rate of change appears to slow down.</p>



<h2 class="wp-block-heading">How Much Insulation is Enough?</h2>



<p>After adding enough insulation for basic things like thermal comfort and avoiding condensation risk, it boils down to the cost of energy and its sustainability over the lifetime of the building. </p>



<p>The passive house limit of 15kWh/m2 of energy per year or 10W/m2 of heating/cooling load are great guidelines based on the <a href="https://kaspars.net/blog/ventilation-air-heat-cool-passive-house" data-type="post" data-id="8170">maximum amount of heat that can be transported with the ventilation air</a>. It is also low enough to require paying attention to thermal bridges and air tightness. Importantly, that amount of energy is easily available from photovoltaics during the summer and can be cheaply extracted from the ground via heat pumps during the winter.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/how-much-insulation-is-enough/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2023/02/heat-flow-vs-thickness.png" length="73130" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/02/heat-flow-vs-thickness.svg" length="77063" type="image/svg+xml" />	</item>
		<item>
		<title>Insulation Efficiency of Electric Hot Water Heaters</title>
		<link>https://kaspars.net/blog/electric-hot-water-heater-insulation-efficiency</link>
					<comments>https://kaspars.net/blog/electric-hot-water-heater-insulation-efficiency#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sat, 03 Dec 2022 20:11:07 +0000</pubDate>
				<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[Tuya]]></category>
		<category><![CDATA[Zigbee]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8274</guid>

					<description><![CDATA[With electric hot water heaters it is possible to use smart sockets with energy meter capabilities to measure the electricity consumption when the water is not actually used and is heated only to maintain the set temperature. It can be assumed that all of the added heat is equal to the heat lost to the [&#8230;] <a href="https://kaspars.net/blog/electric-hot-water-heater-insulation-efficiency" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>With electric hot water heaters it is possible to use <a href="https://www.zigbee2mqtt.io/supported-devices/#e=energy">smart sockets with energy meter capabilities</a> to measure the electricity consumption when the water is not actually used and is heated only to maintain the set temperature.</p>



<span id="more-8274"></span>



<p>It can be assumed that all of the added heat is equal to the heat lost to the room. This value might vary based on the set temperature and the hysteresis limits used by the device but over a period of a few days it should be possible to determine a reliable average (taking into account the weekly anti-legionella functionality).</p>



<p>Using <a href="https://www.zigbee2mqtt.io/devices/TS011F_plug_1.html">TuYa TS011F socket</a> with Home Assistant I was able to determine that <strong>our <a href="http://www.gorenje.com/heating-systems/en/water-heaters/medium-volume-water-heaters/gb-or-sm">80 liter Gorenje GBU</a> hot water heater looses about 1.3 kWh per day to the room</strong>. At average total of 7kWh per day that makes it 18% of energy lost to the room.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2482" height="1272" src="https://kaspars.net/wp-content/uploads/2022/12/electric-hot-water-heater-energy-loss.png?strip=all&#038;quality=90&#038;resize=2482,1272" alt="Gorenje electric hot water heater standby energy consumption" class="wp-image-8276" srcset="https://kaspars.net/wp-content/uploads/2022/12/electric-hot-water-heater-energy-loss.png?strip=all&amp;quality=90&amp;resize=800%2C410 800w, https://kaspars.net/wp-content/uploads/2022/12/electric-hot-water-heater-energy-loss.png?strip=all&amp;quality=90&amp;resize=1024%2C525 1024w, https://kaspars.net/wp-content/uploads/2022/12/electric-hot-water-heater-energy-loss.png?strip=all&amp;quality=90&amp;resize=1536%2C787 1536w, https://kaspars.net/wp-content/uploads/2022/12/electric-hot-water-heater-energy-loss.png?strip=all&amp;quality=90&amp;resize=2048%2C1050 2048w, https://kaspars.net/wp-content/uploads/2022/12/electric-hot-water-heater-energy-loss.png?strip=all&amp;quality=90&amp;resize=384%2C197 384w, https://kaspars.net/wp-content/uploads/2022/12/electric-hot-water-heater-energy-loss.png?strip=all&amp;quality=90&amp;resize=768%2C394 768w" sizes="auto, (max-width: 2482px) 100vw, 2482px" /><figcaption class="wp-element-caption">Idle energy consumption of Gorenje 80 liter hot water heater over two days.</figcaption></figure>



<p>Some of the manufacturers actually supply this value in the specification sheet and it is usually around 1kWh per day depending on the volume.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/electric-hot-water-heater-insulation-efficiency/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2022/12/electric-hot-water-heater-energy-loss.png" length="36554" type="image/png" />	</item>
		<item>
		<title>Notes on Tuya Air Quality Sensors</title>
		<link>https://kaspars.net/blog/tuya-smart-box-house-keeper-air-quality</link>
					<comments>https://kaspars.net/blog/tuya-smart-box-house-keeper-air-quality#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Fri, 29 Apr 2022 08:11:52 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[Teardown]]></category>
		<category><![CDATA[Tuya]]></category>
		<category><![CDATA[Zigbee]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8204</guid>

					<description><![CDATA[These are two devices (AliExpress) with identical PM2.5/PM10 sensors (boxes with the metal cover), temperature and humidity sensors (top center) which are connected to an STC 8G1K08 microcontroller which prepares the data for the Tuya controllers with either WiFi or Zigbee radio (bottom left). The 6in1 version has an additional VOC sensor (bottom right with [&#8230;] <a href="https://kaspars.net/blog/tuya-smart-box-house-keeper-air-quality" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2022/04/tuya-air-housekeeper-pm-box-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Tuya PM2.5, PM10, CO2, CH2O Air Quality sensors (Zigbee and WiFi))" class="wp-image-8205" srcset="https://kaspars.net/wp-content/uploads/2022/04/tuya-air-housekeeper-pm-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/04/tuya-air-housekeeper-pm-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/04/tuya-air-housekeeper-pm-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/04/tuya-air-housekeeper-pm-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/04/tuya-air-housekeeper-pm-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/04/tuya-air-housekeeper-pm-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">Tuya 4in1 PM Box (Smart Air box) with <a href="https://developer.tuya.com/en/docs/iot/cb3s?id=Kai94mec0s076">CB3S module</a> (Wi-Fi) on the left (blue case) and Tuya 6in1 Air House Keeper with <a href="https://developer.tuya.com/en/docs/iot/zt3l-module-datasheet?id=Ka438n1j8nuvu">ZT3L module</a> (Zigbee) on the right (white case).</figcaption></figure>



<p>These are two devices (<a href="https://kaspars.net/go/tuya-air-quality-sensor-box">AliExpress</a>) with identical PM2.5/PM10 sensors (boxes with the metal cover), temperature and humidity sensors (top center) which are connected to an <a href="http://www.stcmicro.com/stc/stc8g1k08.html">STC 8G1K08 microcontroller</a> which prepares the data for the Tuya controllers with either WiFi or Zigbee radio (bottom left). The 6in1 version has an additional VOC sensor (bottom right with the metal mesh) which provides VOC and <em>derived</em> or virtual formaldehyde and CO2 values.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2022/04/pa03v2-pm2.5-7420m-scaled.jpg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Tuya PM2.5 dust sensor PA03v2.0" class="wp-image-8237" srcset="https://kaspars.net/wp-content/uploads/2022/04/pa03v2-pm2.5-7420m-scaled.jpg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/04/pa03v2-pm2.5-7420m-scaled.jpg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/04/pa03v2-pm2.5-7420m-scaled.jpg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/04/pa03v2-pm2.5-7420m-scaled.jpg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/04/pa03v2-pm2.5-7420m-scaled.jpg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/04/pa03v2-pm2.5-7420m-scaled.jpg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">PM2.5 sensor board under the metal cover.</figcaption></figure>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2022/04/tuya-8G1K08-cb3s-scaled.jpg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Tuya PM2.5 sensor connected to 8G1K08" class="wp-image-8236" srcset="https://kaspars.net/wp-content/uploads/2022/04/tuya-8G1K08-cb3s-scaled.jpg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/04/tuya-8G1K08-cb3s-scaled.jpg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/04/tuya-8G1K08-cb3s-scaled.jpg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/04/tuya-8G1K08-cb3s-scaled.jpg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/04/tuya-8G1K08-cb3s-scaled.jpg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/04/tuya-8G1K08-cb3s-scaled.jpg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">Internals of the PM2.5 sensor.</figcaption></figure>



<p>The PM2.5 sensor is a primitive dust sensor with a pair of infrared (IR) source and receiver.</p>



<span id="more-8204"></span>



<p>They cost around $25 for the 4in1 version and $30 for the 6in1. I bought them <a href="https://kaspars.net/go/tuya-air-quality-sensor-box">here on AliExpress</a>.</p>



<h2 class="wp-block-heading">Home Assistant Compatability</h2>



<p>The Zigbee version is known as <a href="https://www.zigbee2mqtt.io/devices/TS0601_smart_air_house_keeper.html">TS0601 Smart Air House Keeper by Zigbee2MQTT</a> (<code>TZE200_dwcarsat</code>) and is supported by <a href="https://www.zigbee2mqtt.io/guide/configuration/homeassistant.html">their Home Assistant integration</a> as well as the <a href="https://github.com/zigpy/zha-device-handlers/issues/1313">ZHA integration</a> (except for <a href="https://github.com/zigpy/zha-device-handlers/issues/1406">this bug</a>). It is also supported by the <a href="https://kaspars.net/blog/zemismart-zigbee-homekit-hub" data-type="post" data-id="8147">Zemismart gateway</a> in the Smart Life app but it <em>does not</em> show up in the Apple Home app.</p>



<p>The WiFi version is supported only by the <a href="https://www.home-assistant.io/integrations/tuya/">Tuya cloud integration in Home Assistant</a> and the Smart Life app which detects the device via Bluetooth and then lets you configure the WiFi settings. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/tuya-smart-box-house-keeper-air-quality/feed</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2022/04/tuya-air-housekeeper-pm-box-scaled.jpeg" length="789821" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/04/pa03v2-pm2.5-7420m-scaled.jpg" length="601545" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/04/tuya-8G1K08-cb3s-scaled.jpg" length="646590" type="image/jpeg" />	</item>
		<item>
		<title>Use Ventilation Exhaust Air for Space Heating and Hot Water</title>
		<link>https://kaspars.net/blog/ventilation-air-heat-cool-passive-house</link>
					<comments>https://kaspars.net/blog/ventilation-air-heat-cool-passive-house#respond</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Wed, 27 Apr 2022 10:48:17 +0000</pubDate>
				<category><![CDATA[Passive House]]></category>
		<category><![CDATA[Building Science]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8170</guid>

					<description><![CDATA[The Passive House standard has two magic numbers related to the heating and cooling requirements for buildings &#8212; 15kWh is the maximum allowed heating and cooling demand per square meter per year and 10W maximum allowed instantaneous heating or cooling load per square meter. And the buildings need to match just one of these parameters. [&#8230;] <a href="https://kaspars.net/blog/ventilation-air-heat-cool-passive-house" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p>The Passive House standard <a href="https://passiv.de/en/02_informations/02_passive-house-requirements/02_passive-house-requirements.htm">has two magic numbers</a> related to the heating and cooling requirements for buildings &#8212; <strong>15kWh</strong> is the maximum allowed <strong>heating and cooling demand</strong> per square meter per year and <strong>10W</strong> maximum allowed <strong>instantaneous heating or cooling load</strong> per square meter. And the buildings need to match just one of these parameters.</p>



<span id="more-8170"></span>



<h2 class="wp-block-heading">What is 10W per square meter?</h2>



<p>It signifies the incredibly low heating or cooling power that is needed to keep a passive house comfortable. It signifies how little heat is lost through the building envelope and that is happens really slowly. For example, a 100m<sup>2</sup> house requires just 1000W or 1kW during the coldest winter nights or the hottest summer days to keep the indoor temperature steady.</p>



<p>It is easy to see how boiling water for tea, cooking food and running other household appliances could generate enough heat that is eventually absorbed by the building to keep the additional heating need even lower. That&#8217;s why it&#8217;s called &#8220;passive&#8221; house because it requires so little addition energy to what is already generated by the people just living in it.</p>



<h2 class="wp-block-heading">Ventilation with Heating and Cooling</h2>



<p>Ventilation is the only active process in a passive house as it needs to happen in a way that doesn&#8217;t transport any heat out of the house. The magic numbers for this is 30m<sup>3</sup> of fresh air per person per hour at a 90% heat recovery efficiency. </p>



<p>What if we used this air to transport heat around the house &#8212; add heat during the winter and remove it during the summer? Would it be possible to transport those 10Wh of heat per square meter every hour?</p>



<h2 class="wp-block-heading">Energy in Air</h2>



<p>The heat capacity of air is around 1000 joules or 0.28Wh per kg per degree and its density is around 1.2kg per m<sup>3</sup> which means that <strong>1m<sup>3</sup> of air is able to transport 0.28Wh/kg × 1.2kg = 0.33Wh</strong> of energy per each degree of air temperature change. Compare that to the same volumetric amount of water which has 4 times the heat capacity, 830 times the density and is able to carry 1151Wh energy per degree difference.</p>



<p>A four person household needs 4 × 30m<sup>3</sup>= 120m<sup>3</sup> of fresh air per hour which can transport 120 × 0.33Wh = 40Wh of heat per hour per degree change. So in order <strong>to add or remove 1000Wh of heat by transporting 120m<sup>3</sup> of air every hour we need a 1000Wh </strong>÷<strong> 40Wh = 25C degree hotter or colder air</strong> compared to the room temperature. Doubling the amount of air to 240m<sup>3</sup> would decrease that to a 12.5C degree difference.</p>



<p>This proves that in theory it is possible the heat or cool the whole house just by using the air that is already used for ventilation. Not only that &#8212; we can use a heat pump to extract even more heat from the air leaving the home.</p>



<h2 class="wp-block-heading">Heating Air and Water</h2>



<p>The ideal way to do this is by placing <strong>a heat pump on the exhaust side of the ventilation after the cross-flow heat exchanger to extract even more energy from the outgoing air</strong> &#8212; like a traditional air-source heat pump but with the evaporator placed inside the exhaust line of the ventilation unit and the condenser in the supply line (in the heating mode). It would also recover all the energy left over by the cross-flow heat exchanger!</p>



<p>There are <a href="https://database.passivehouse.com/en/components/list/heat_pump">several products</a> (filter by &#8220;Compact heat pump unit&#8221;) on the market that do this:</p>



<ul class="wp-block-list">
<li><a href="https://www.en.nilan.dk/products/ventilation-with-heating/ventilation-and-hot-water-production/compact-p">Nilan Compact P</a> (in <a href="https://database.passivehouse.com/en/components/details/heat_pump/nilan-as-compact-p-arbeitspunkt-172-m3h-0391ch03">component database</a>)</li>



<li><a href="https://www.stiebel-eltron.com/en/home/products-solutions/renewables/ventilation/central/lwz-cs-premium/lwz-8-cs-premium.html">Stiebel Eltron LWZ 8 CS Premium</a> (in <a href="https://database.passivehouse.com/en/components/details/heat_pump/stiebel-eltron-gmbh-co-kg-lwz-8-cs-premium-0873ch03">component database</a>)</li>



<li><a href="https://shop.systemair.com/en/genius--complete--unit/p403832">Systemair Genius</a> (in <a href="https://database.passivehouse.com/en/components/details/heat_pump/systemair-gmbh-systemair-genius-1398ch02">component database</a>)</li>



<li><a href="https://www.genvex.com/en/products/air-ventilation---water-heat-pump/combi-185-bp">Genvex Combi 185 BP</a> (in <a href="https://database.passivehouse.com/en/components/details/heat_pump/genvex-as-combi-185l-arbeistpunkt-150-m3h-0388ch03">component database</a>)</li>
</ul>



<p>Some of them have additional routes for the incoming air so that it can be used only for heating water and doesn&#8217;t need to be moved through the house when the ventilation needs are low.</p>



<p>They all look pretty much like this:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1144" height="724" src="https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p.jpg?strip=all&#038;quality=90&#038;resize=1144,724" alt="Nilan Compact P" class="wp-image-8174" srcset="https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p.jpg?strip=all&amp;quality=90&amp;resize=800%2C506 800w, https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p.jpg?strip=all&amp;quality=90&amp;resize=1024%2C648 1024w, https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p.jpg?strip=all&amp;quality=90&amp;resize=384%2C243 384w, https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p.jpg?strip=all&amp;quality=90&amp;resize=768%2C486 768w, https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p.jpg?strip=all&amp;quality=90&amp;resize=1144%2C724 1144w" sizes="auto, (max-width: 1144px) 100vw, 1144px" /><figcaption class="wp-element-caption">Nilan Compact P with ventilation and heat recovery at the top and hot water tank at the bottom.</figcaption></figure>
</div>


<p>and they all work like this:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="600" height="904" src="https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-diagram.jpg?strip=all&#038;quality=90&#038;resize=600,904" alt="Nilan Compact P working diagram" class="wp-image-8175" srcset="https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-diagram.jpg?strip=all&amp;quality=90&amp;resize=384%2C579 384w, https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-diagram.jpg?strip=all&amp;quality=90&amp;resize=600%2C904 600w" sizes="auto, (max-width: 600px) 100vw, 600px" /><figcaption class="wp-element-caption">The outgoing air at 22C first heats up the incoming air through a cross-flow heat exchanger and then passes by an even colder heat pump evaporator which on the condenser side heats up the air going to the rooms to 38C.</figcaption></figure>
</div>


<p>As you can imaging, the same system can also be used in hot climates to both cool the incoming ventilation air and heat up the water just by reversing a few valves.</p>



<p>Some of these units have support for ground-source heat pump additions which can further increase and optimize the available heating and cooling loads at amazing efficiencies.</p>



<p>Interestingly, the <a href="https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-product-data.pdf">Nilan Compact P datasheet</a> has the follow graph:</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="1057" height="592" src="https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-heat-output.png?strip=all&#038;quality=90&#038;resize=1057,592" alt="Nilan Compact P heating power" class="wp-image-8181" srcset="https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-heat-output.png?strip=all&amp;quality=90&amp;resize=800%2C448 800w, https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-heat-output.png?strip=all&amp;quality=90&amp;resize=1024%2C574 1024w, https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-heat-output.png?strip=all&amp;quality=90&amp;resize=384%2C215 384w, https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-heat-output.png?strip=all&amp;quality=90&amp;resize=768%2C430 768w, https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-heat-output.png?strip=all&amp;quality=90&amp;resize=1057%2C592 1057w" sizes="auto, (max-width: 1057px) 100vw, 1057px" /></figure>



<p>which confirms that a heat pump is able to extract 2200W of heat from 220m<sup>3</sup> of exhaust air every hour. The ventilation loss shown just below the heat output is confusing because my understanding is that the heat pump is placed <em>after</em> the cross-flow heat exchanger so it shouldn&#8217;t impact the heat recovery efficiency.</p>



<p>These units cost somewhere in the range of $12,000 to $25,000 and they reduce the utility room down to this one device which still needs to be hidden behind a well insulated walls due to noise, but the savings on piping and installation work should easily justify the cost.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/ventilation-air-heat-cool-passive-house/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p.jpg" length="55780" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-diagram.jpg" length="51477" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/04/nilan-compact-p-heat-output.png" length="25237" type="image/png" />	</item>
		<item>
		<title>Notes on Zemismart HomeKit Zigbee Hub</title>
		<link>https://kaspars.net/blog/zemismart-zigbee-homekit-hub</link>
					<comments>https://kaspars.net/blog/zemismart-zigbee-homekit-hub#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Mon, 25 Apr 2022 09:22:42 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[HomeKit]]></category>
		<category><![CDATA[Teardown]]></category>
		<category><![CDATA[Tuya]]></category>
		<category><![CDATA[Zigbee]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8147</guid>

					<description><![CDATA[Zemismart ZMHK-01 (AliExpress) is one of the few hubs that is compatible with Apple HomeKit and can expose non-HomeKit Zigbee devices in the Home app similar to the Aqara G2H camera hub. Behind the scenes it uses the Tuya TYZS4 radio module and is very similar to the Tuya reference designs used by many generic [&#8230;] <a href="https://kaspars.net/blog/zemismart-zigbee-homekit-hub" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p><a href="https://www.zemismart.com/products/zmhk-01">Zemismart ZMHK-01</a> (<a href="https://kaspars.net/go/zemismart-smart-home-bridge">AliExpress</a>) is one of the few hubs that is compatible with Apple HomeKit and can expose non-HomeKit Zigbee devices in the Home app similar to the <a href="https://kaspars.net/blog/aqara-g2h-homekit" data-type="post" data-id="8081">Aqara G2H camera hub</a>. Behind the scenes it uses the <a href="https://developer.tuya.com/en/docs/iot/zigbeetyzs4module?id=K989rhycrz23f">Tuya TYZS4 radio module</a> and is very similar to the Tuya reference designs used by many generic Tuya-compatible hubs.</p>



<span id="more-8147"></span>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-scaled.jpg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Zemismart Zigbee HomeKit Hub using the Tuya TYZS4 module " class="wp-image-8149" srcset="https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-scaled.jpg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-scaled.jpg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-scaled.jpg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-scaled.jpg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-scaled.jpg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-scaled.jpg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">Zemismart Zigbee HomeKit Hub using the Tuya TYZS4 module for radio and RTL8196E as the main controller.</figcaption></figure>



<p>Note: this device is very similar to <a href="https://kaspars.net/blog/neo-nas-zw05b0-tuya-zigbee-homekit-hub" data-type="post" data-id="8458">NEO NAS-ZW05B0</a>!</p>



<h2 class="wp-block-heading">Getting Root Access</h2>



<p>Turns out it is very similar to the first generation of the Lidl Silvercrest Smart Gateway <a href="https://paulbanks.org/projects/lidl-zigbee/root/">which allows extracting the <code>root</code> user password over the UART connection</a> exposed on the back of the PCB. The screws are hidden behind the rubber ring on the bottom:</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2000" height="1500" src="https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-teardown-screws.jpg?strip=all&#038;quality=90&#038;resize=2000,1500" alt="Screws for opening Zemismart Zigbee HomeKit Hub" class="wp-image-8150" srcset="https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-teardown-screws.jpg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-teardown-screws.jpg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-teardown-screws.jpg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-teardown-screws.jpg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-teardown-screws.jpg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-teardown-screws.jpg?strip=all&amp;quality=90&amp;resize=2000%2C1500 2000w" sizes="auto, (max-width: 2000px) 100vw, 2000px" /><figcaption class="wp-element-caption">Screws for opening Zemismart Zigbee HomeKit Hub.</figcaption></figure>



<p>And the UART pins <code>TX</code> and <code>RX</code> are clearly marked on the back of the PCB. Note that you must use 3.3V for power and logic when connecting to the device.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-back-scaled.jpg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="UART serial pins for Zemismart Zigbee HomeKit Hub" class="wp-image-8148" srcset="https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-back-scaled.jpg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-back-scaled.jpg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-back-scaled.jpg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-back-scaled.jpg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-back-scaled.jpg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-back-scaled.jpg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">UART serial pins for Zemismart Zigbee HomeKit Hub.</figcaption></figure>



<p>After extracting the password from the flash memory you&#8217;re able to connect to it over SSH running on port 2333:</p>



<pre class="wp-block-code"><code>$ ssh root@gateway.local -p 2333</code></pre>



<p>where <code>gateway.local</code> is the mDNS address of the device on your network. Alternatively, use the IP address of the device to connect.</p>



<p>The device runs Linux with <a href="https://busybox.net/">BusyBox</a> v1.13.4 (2021-08-26 11:01:27 CST) and it uses <a href="https://gist.github.com/kasparsd/1cb3919a238bc94b93ccc72324cab517">a bunch of bash scripts to configure and launch the software</a>. Most of the runtime logic is handled by the following process:</p>



<pre class="wp-block-code"><code>./tyZ3Gw /tuya/tuya_user2 /tuya/def.cfg</code></pre>



<p>where <code>tyZ3Gw</code> (sounds like short for &#8220;Tuya Zigbee3 Gateway&#8221;) is the binary in the <code>/tuya/tuya_user2</code> working directory using <code>/tuya/def.cfg</code> for config:</p>



<pre class="wp-block-code"><code>{
	"user_cfg_file":"/tuya/config/user.cfg",
	"platform":"RTL8196E",
	"product_key":"keyYOURUNIQUEKEY",
	"mode_id":"RTL8196E_TY01",
	"storage_dir":"./",
	"log_dir":"/tuya/log_dir/",
	"tmp_dir":"/tmp/",
	"bin_dir":"/tuya/",
	"backup_dir":"/tuya/",
	"net_led":"LED0",
	"status_led":"LED1",
	"reset_key":"KEY0",
	"wan_interface":"eth1",
	"wifi_interface":"wifi0",
	"serial_port":"/dev/ttyS1",
	"is_cts":true,
	"is_sync_systime":true,
	"is_hardward":true
}</code></pre>



<p>Note that there is no WiFi network interface on this device although it is mentioned in the config.</p>



<h2 class="wp-block-heading">Zigbee Communication</h2>



<p>The <code>zigbee_agent</code> binary talks to the <a href="https://www.nxp.com/products/wireless/thread/jn5189-88-t-high-performance-and-ultra-low-power-mcus-for-zigbee-and-thread-with-built-in-nfc-option:JN5189_88_T">NXP JN5189 Zigbee module</a> over UART at <code>/dev/ttyS2</code>. There is <a href="https://github.com/banksy-git/lidl-gateway-freedom/tree/master/gateway">a custom UART to TCP bridge software</a> <a href="https://paulbanks.org/projects/lidl-zigbee/ha/">developed by Paul Banks</a> that can be used to expose the Zigbee radio to the <a href="https://www.home-assistant.io/integrations/zha/">Home Assistant ZHA integration</a> over TCP. Note that this disables the Tuya and HomeKit integrations since they are no longer able to talk to the same UART device that is now used by the bridge.</p>



<h2 class="wp-block-heading">Compatible Devices</h2>



<p>I&#8217;ve successfully tested the following devices with the hub and they become available in the Home app:</p>



<ul class="wp-block-list">
<li><a href="https://kaspars.net/go/tuya-zigbee-3-0-switch-module">Tuya ZigBee 3.0 Switch Modules (both 1 and 2 channel)</a> with Tuya 2T3L radio.</li>



<li><a href="https://kaspars.net/go/girier-tuya-zigbee-3-0-smart-light-switch">GIRIER Tuya ZigBee 3.0 Smart Light Switch Module</a> with Tuya ZTU radio.</li>



<li><a href="https://sonoff.tech/product/smart-home-security/snzb-03/">Sonoff SNZB-03</a> PIR motion sensor.</li>
</ul>



<p>The following devices are recognized by the Smart Life app but they <em>don&#8217;t show</em> up in the Home app:</p>



<ul class="wp-block-list">
<li> <a href="https://kaspars.net/blog/tuya-smart-box-house-keeper-air-quality" data-type="post" data-id="8204">Tuya TS0601 Smart Air Box House Keeper 6in1 air quality monitor</a> with ZT3L module.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/zemismart-zigbee-homekit-hub/feed</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-scaled.jpg" length="748102" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-teardown-screws.jpg" length="172475" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/04/zemismart-zigbee-homekit-hub-tuya-back-scaled.jpg" length="597065" type="image/jpeg" />	</item>
		<item>
		<title>Use Hiking DDS238-2 ZN/S Energy Meter with Home Assistant</title>
		<link>https://kaspars.net/blog/hiking-dds238-2-modbus</link>
					<comments>https://kaspars.net/blog/hiking-dds238-2-modbus#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Mon, 18 Apr 2022 14:06:52 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8124</guid>

					<description><![CDATA[Hiking DDS238-2 ZN/S is a cheap €20 single phase energy meter which can measure import and export energy in addition to all the standard parameters, and has a Modbus interface over RS485. I used this Modbus registry information to create this device template for Home Assistant where the meter is attached to the Protoss PE11 [&#8230;] <a href="https://kaspars.net/blog/hiking-dds238-2-modbus" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p><a href="https://kaspars.net/go/hiking-dds238-2-zn-s" data-type="surl" data-id="9260">Hiking DDS238-2 ZN/S</a> is a cheap €20 single phase energy meter which can measure import and export energy in addition to all the standard parameters, and has a Modbus interface over RS485.</p>



<span id="more-8124"></span>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2702" height="1528" src="https://kaspars.net/wp-content/uploads/2022/04/home-assistant-hiking-dds238-2-zn-s-modbus-sensor.png?strip=all&#038;quality=90&#038;resize=2702,1528" alt="Home Assistant energy dashboard using Hiking DDS238-2 energy meter" class="wp-image-8134" srcset="https://kaspars.net/wp-content/uploads/2022/04/home-assistant-hiking-dds238-2-zn-s-modbus-sensor.png?strip=all&amp;quality=90&amp;resize=800%2C452 800w, https://kaspars.net/wp-content/uploads/2022/04/home-assistant-hiking-dds238-2-zn-s-modbus-sensor.png?strip=all&amp;quality=90&amp;resize=1024%2C579 1024w, https://kaspars.net/wp-content/uploads/2022/04/home-assistant-hiking-dds238-2-zn-s-modbus-sensor.png?strip=all&amp;quality=90&amp;resize=1536%2C869 1536w, https://kaspars.net/wp-content/uploads/2022/04/home-assistant-hiking-dds238-2-zn-s-modbus-sensor.png?strip=all&amp;quality=90&amp;resize=2048%2C1158 2048w, https://kaspars.net/wp-content/uploads/2022/04/home-assistant-hiking-dds238-2-zn-s-modbus-sensor.png?strip=all&amp;quality=90&amp;resize=384%2C217 384w, https://kaspars.net/wp-content/uploads/2022/04/home-assistant-hiking-dds238-2-zn-s-modbus-sensor.png?strip=all&amp;quality=90&amp;resize=768%2C434 768w" sizes="auto, (max-width: 2702px) 100vw, 2702px" /><figcaption class="wp-element-caption">Home Assistant energy dashboard using Hiking DDS238-2 energy meter.</figcaption></figure>



<p>I used this <a href="https://github.com/fawno/Modbus/blob/4871fe24a342eee4f0db33d28968e37483ad3f1d/DDS238-2%20ZN-S%20Modbus.md">Modbus registry information</a> to create this device <a href="https://www.home-assistant.io/integrations/modbus/">template for Home Assistant</a> where the meter is attached to the <a href="http://www.hi-flying.com/pe11">Protoss PE11 RS485 to TCP</a> gateway (<a href="https://kaspars.net/go/protoss-pe11-rs485-to-tcp">AliExpress</a>) available on IP <code>123.123.123.123</code> which must be adjusted for your setup or switched to a serial config:</p>



<pre class="wp-block-code"><code>modbus:
  - name: Protoss PE11
    type: tcp
    host: 123.123.123.123
    port: 502
    timeout: 0.5
    sensors:

      - name: DDS238-2 ZN-S Total Energy
        device_class: energy
        state_class: total
        unit_of_measurement: kWh
        address: 0
        count: 2
        data_type: uint32
        scale: 0.01
        precision: 2

      - name: DDS238-2 ZN-S Export Energy
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: kWh
        address: 8
        count: 2
        data_type: uint32
        scale: 0.01
        precision: 2
    
      - name: DDS238-2 ZN-S Import Energy
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: kWh
        address: 10
        count: 2
        data_type: uint32
        scale: 0.01
        precision: 2

      - name: DDS238-2 ZN-S Voltage
        device_class: voltage
        unit_of_measurement: V
        address: 12
        data_type: uint16
        scale: 0.1
        precision: 1

      - name: DDS238-2 ZN-S Current
        device_class: current
        unit_of_measurement: A
        address: 13
        data_type: uint16
        scale: 0.01
        precision: 2

      - name: DDS238-2 ZN-S Power
        device_class: power
        data_type: int16
        unit_of_measurement: W
        address: 14
        
      - name: DDS238-2 ZN-S Reactive Power
        device_class: apparent_power
        data_type: uint16
        unit_of_measurement: VAr
        address: 15
        
      - name: DDS238-2 ZN-S Power Factor
        device_class: power_factor
        unit_of_measurement: '%'
        data_type: uint16
        address: 16
        scale: 0.1
        precision: 1

      - name: DDS238-2 ZN-S Frequency
        device_class: frequency
        unit_of_measurement: Hz
        data_type: uint16
        address: 17
        scale: 0.01
        precision: 2</code></pre>



<h2 class="wp-block-heading">Modbus to TCP Alternatives</h2>



<p>The <a href="https://www.waveshare.com/wiki/RS485_TO_POE_ETH_(B)">Waveshare RS485 to ETH with PoE</a> (<a href="https://kaspars.net/go/waveshare-rs485-to-tcp-with-poe">AliExpress</a>) is another great and tested alternative. Note that is has versions with and without the PoE support so be sure to get the right one.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/hiking-dds238-2-modbus/feed</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2022/04/home-assistant-hiking-dds238-2-zn-s-modbus-sensor.png" length="198908" type="image/png" />	</item>
		<item>
		<title>Use Aqara G2H Zigbee Camera Hub with Home Assistant</title>
		<link>https://kaspars.net/blog/aqara-g2h-homekit</link>
					<comments>https://kaspars.net/blog/aqara-g2h-homekit#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sun, 17 Apr 2022 16:38:36 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[HomeKit]]></category>
		<category><![CDATA[Zigbee]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=8081</guid>

					<description><![CDATA[Aqara G2H (ZNSXJ12LM) is a really nice Zigbee hub and indoor camera with official HomeKit support. Of course it runs Linux so people have discovered ways to connect it to Home Assistant which exposes most of your HomeKit devices to Home Assistant over MQTT without impacting the original Apple Home and Aqara app integrations. Getting [&#8230;] <a href="https://kaspars.net/blog/aqara-g2h-homekit" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p><a href="https://kaspars.net/go/aqara-g2h" data-type="surl" data-id="8083">Aqara G2H</a> (<code>ZNSXJ12LM</code>) is a really nice Zigbee hub and indoor camera with official HomeKit support. Of course it runs Linux so people <a href="https://github.com/niceboygithub/AqaraGateway">have discovered ways to connect it to Home Assistant</a> which exposes most of your HomeKit devices to Home Assistant over MQTT without impacting the original Apple Home and Aqara app integrations.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="1857" height="1153" src="https://kaspars.net/wp-content/uploads/2022/04/aqara-hub-g2h-home-assistant.png?strip=all&#038;quality=90&#038;resize=1857,1153" alt="AqaraGateway Integration in Home Assistant with Aqara Hub G2H" class="wp-image-8094" srcset="https://kaspars.net/wp-content/uploads/2022/04/aqara-hub-g2h-home-assistant.png?strip=all&amp;quality=90&amp;resize=800%2C497 800w, https://kaspars.net/wp-content/uploads/2022/04/aqara-hub-g2h-home-assistant.png?strip=all&amp;quality=90&amp;resize=1024%2C636 1024w, https://kaspars.net/wp-content/uploads/2022/04/aqara-hub-g2h-home-assistant.png?strip=all&amp;quality=90&amp;resize=1536%2C954 1536w, https://kaspars.net/wp-content/uploads/2022/04/aqara-hub-g2h-home-assistant.png?strip=all&amp;quality=90&amp;resize=384%2C238 384w, https://kaspars.net/wp-content/uploads/2022/04/aqara-hub-g2h-home-assistant.png?strip=all&amp;quality=90&amp;resize=768%2C477 768w, https://kaspars.net/wp-content/uploads/2022/04/aqara-hub-g2h-home-assistant.png?strip=all&amp;quality=90&amp;resize=1857%2C1153 1857w" sizes="auto, (max-width: 1857px) 100vw, 1857px" /><figcaption>Aqara G2H Zigbee hub sensors exposed in Home Assistant via the AqaraGateway integration.</figcaption></figure>



<span id="more-8081"></span>



<h2 class="wp-block-heading">Getting Access</h2>



<p><a href="https://github.com/mcchas/g2h-camera-mods">Turns out</a> you can put a file named <code>hostname</code> (without any file extension) in the root of the SD card of the device and it will be executed as a bash script during the boot process. The following contents will set the password for the user <code>root</code> to <code>password</code> and set the <code>WITH_TELNET</code> environment variable to <code>y</code> which enables the <code>telnetd</code> service for remote access:</p>



<pre class="wp-block-code"><code>#!/bin/sh
echo "root:password" | chpasswd
export WITH_TELNET="y"</code></pre>



<p>After inserting the SD card and restarting the camera you should be able to connect to it using telnet:</p>



<pre class="wp-block-code"><code>telnet camera-hub-g2h.local</code></pre>



<p>which opens the telnet prompt:</p>



<pre class="wp-block-code"><code>Trying 123.123.123.123...
Connected to camera-hub-g2h.local.
Escape character is '^]'.

Camera-Hub-G2H login: root
Password:</code></pre>



<p>and you now have full root access to the filesystem!</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="730" height="548" src="https://kaspars.net/wp-content/uploads/2022/04/processes-aqara-hub-g2h-top-root-access.png?strip=all&#038;quality=90&#038;resize=730,548" alt="Aqara G2H root access processes" class="wp-image-8118" srcset="https://kaspars.net/wp-content/uploads/2022/04/processes-aqara-hub-g2h-top-root-access.png?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/04/processes-aqara-hub-g2h-top-root-access.png?strip=all&amp;quality=90&amp;resize=730%2C548 730w" sizes="auto, (max-width: 730px) 100vw, 730px" /><figcaption>All processes running on the camera.</figcaption></figure></div>



<h2 class="wp-block-heading">Setup Aqara Gateway</h2>



<p>The <a href="https://github.com/niceboygithub/AqaraGateway">AqaraGateway project</a> is a set of custom binaries and python scripts that enable access to all the connected Zigbee devices over MQTT while keeping the Aqara app and the HomeKit integration working as before. </p>



<p>It does it in the following way:</p>



<ol class="wp-block-list"><li>You replace the <code>mosquitto</code> MQTT broker binary on the device <a href="https://github.com/niceboygithub/AqaraGateway/tree/72561429919dcb542e9d2e065a07c38b076ee4e8#not-flash-custom-firmware-method-for-g2h">with a custom one</a> (which appears to be closed source?) which exposes the MQTT service on a public port on your local network and removes the authentication for the MQTT service.</li><li>You install the Aqara Gateway Home Assistant integration via <a href="https://hacs.xyz/">HACS (Home Assistant Community Store)</a> which then talks to the device over <code>telnet</code> to <a href="https://github.com/niceboygithub/AqaraGateway/blob/b13c2cf0f3150fc5ec3230206119aeab68fdeff0/custom_components/aqara_gateway/config_flow.py#L61-L63">validate the <code>mosquitto</code> binary</a>, to <a href="https://github.com/niceboygithub/AqaraGateway/blob/72561429919dcb542e9d2e065a07c38b076ee4e8/custom_components/aqara_gateway/core/gateway.py#L175-L217">fetch the available Zigbee devices</a> and <a href="https://github.com/niceboygithub/AqaraGateway/blob/72561429919dcb542e9d2e065a07c38b076ee4e8/custom_components/aqara_gateway/core/gateway.py#L444-L480">to establish an MQTT subscription with the broker on the device</a>.</li><li>The Aqara Gateway in your Home Assistant <a href="https://github.com/niceboygithub/AqaraGateway/blob/b13c2cf0f3150fc5ec3230206119aeab68fdeff0/custom_components/aqara_gateway/core/gateway.py#L467-L478">maps the MQTT messages</a> to different devices supported by the gateway such as <a href="https://github.com/niceboygithub/AqaraGateway/blob/f6e06be8f1e96a541eb5bfcc7d91d4689f1fb760/custom_components/aqara_gateway/binary_sensor.py">binary sensors</a> and <a href="https://github.com/niceboygithub/AqaraGateway/blob/f6e06be8f1e96a541eb5bfcc7d91d4689f1fb760/custom_components/aqara_gateway/sensor.py">general sensors</a> similar to <a href="https://www.zigbee2mqtt.io/">Zigbee2MQTT</a>.</li></ol>



<p>Initially the gateway integration <a href="https://github.com/niceboygithub/AqaraGateway/issues/93">wasn&#8217;t recognizing my camera</a> but this was resolved in <a href="https://github.com/niceboygithub/AqaraGateway/commit/8c81decd56b654cb58359d4a84fab31513adef79">one of the recent updates</a>.</p>



<p>Support for new Aqara Zigbee devices requires updates to the AqaraGateway library and it appears that <a href="https://github.com/niceboygithub/AqaraGateway/issues">new issues are being opened on GitHub</a> and they are also addressed.</p>



<h2 class="wp-block-heading">Conclusions</h2>



<p>Aqara hubs that support Aqara Gateway software are the only option on the market with local, no-cloud and open source API which supports HomeKit and Home Assistant integration <em>at the same time</em>. Another alternative is the <a href="https://kaspars.net/blog/zemismart-zigbee-homekit-hub" data-type="post" data-id="8147">Zemismart Zigbee Gateway</a> which adds HomeKit support for many of the Tuya Zigbee devices, and <a href="https://zigbee.blakadder.com/Lidl_TYGWZ-01.html">can be rooted too</a>.</p>



<figure class="wp-block-embed is-type-rich is-provider-twitter wp-block-embed-twitter"><div class="wp-block-embed__wrapper">
<blockquote class="twitter-tweet" data-width="550" data-dnt="true"><p lang="en" dir="ltr">Here is a teardown of the Zemismart Zigbee hub with HomeKit support. It uses TYZS4 Zigbee <br>module from Tuya and it doesn&#39;t actually support WiFi. The internals look very similar to SilverCrest Zigbee Gateway <a href="https://t.co/2w8l7lsQGZ">https://t.co/2w8l7lsQGZ</a> <a href="https://t.co/hCaw40BNKJ">pic.twitter.com/hCaw40BNKJ</a></p>&mdash; Kaspars (@konstruktors) <a href="https://twitter.com/konstruktors/status/1493199750442663946?ref_src=twsrc%5Etfw">February 14, 2022</a></blockquote><script type="application/vnd.embed-optimizer.javascript" async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div></figure>



<p>However, the Zemismart gateway looses the HomeKit support if you replace the Tuya integration with the <a href="https://paulbanks.org/projects/lidl-zigbee/ha/">a ZHA serial gateway</a> supported by Home Assistant because it takes over the UART connection with <code>/dev/ttyS2</code> which is used by the Tuya <code>zigbee_agent</code> to talk to the <a href="https://www.nxp.com/products/wireless/thread/jn5189-88-t-high-performance-and-ultra-low-power-mcus-for-zigbee-and-thread-with-built-in-nfc-option:JN5189_88_T">NXP JN5189 Zigbee module</a>.</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/aqara-g2h-homekit/feed</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2022/04/aqara-hub-g2h-home-assistant.png" length="150123" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/04/processes-aqara-hub-g2h-top-root-access.png" length="75949" type="image/png" />	</item>
		<item>
		<title>Notes on Gree Amber Nordic / Prestige GWH09YD-S6DBA2A Heat Pump</title>
		<link>https://kaspars.net/blog/gree-amber-nordic-gwh09yd-s6dba1</link>
					<comments>https://kaspars.net/blog/gree-amber-nordic-gwh09yd-s6dba1#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sun, 13 Feb 2022 11:58:16 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=7959</guid>

					<description><![CDATA[As part of an experiment to add domestic water heating capabilities to conventional mini-split ACs, I purchased an air-source heat pump Gree GWH09YD-S6DBA2A which has an inverter controlled compressor and an electronic expansion valve that allows it to work efficiently even down to -30℃ (-22℉). Service Manual Most of the technical information in this post [&#8230;] <a href="https://kaspars.net/blog/gree-amber-nordic-gwh09yd-s6dba1" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2000" height="1500" src="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1.jpeg?strip=all&#038;quality=90&#038;resize=2000,1500" alt="Gree GWH09YD-S6DBA1 indoor PCB with IR and WiFi modules" class="wp-image-8011" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1.jpeg?strip=all&amp;quality=90&amp;resize=2000%2C1500 2000w" sizes="auto, (max-width: 2000px) 100vw, 2000px" /><figcaption class="wp-element-caption">Gree GWH09YD-S6DBA1A indoor heat exchanger power connectors, PCB with IR and WiFi modules.</figcaption></figure>



<p>As part of <a href="https://kaspars.net/blog/mini-split-space-hot-water-heating" data-type="post" data-id="7897">an experiment to add domestic water heating capabilities to conventional mini-split ACs</a>, I purchased an air-source heat pump <strong>Gree GWH09YD-S6DBA2A</strong> which has an inverter controlled compressor and an electronic expansion valve that allows it to work efficiently even down to -30℃ (-22℉).</p>



<span id="more-7959"></span>



<ul class="wp-block-list">
<li>Model: GWH09YD-S6DBA2A (outdoor), S6DBA1A (indoor)</li>



<li>Product code: CB466000100/CB466000102</li>



<li>Cooling capacity: 2.7kW</li>



<li>Heating capacity: 3.5kW</li>



<li>Refrigerant: R32</li>



<li>Remote model: YAG1FB3</li>
</ul>



<h2 class="wp-block-heading" id="service-manual">Service Manual</h2>



<p>Most of the technical information in this post has been retrieved from the official service manual:</p>



<div class="wp-block-file"><a id="wp-block-file--media-5d6ce814-9b05-4b14-91f0-463de15a1317" href="https://kaspars.net/wp-content/uploads/2022/02/air-pump-gree-amber-GWH09YD-GWH12YD-service-manual.pdf">Gree Amber GWH09YD-GWH12YD Service Manual (PDF)</a><a href="https://kaspars.net/wp-content/uploads/2022/02/air-pump-gree-amber-GWH09YD-GWH12YD-service-manual.pdf" class="wp-block-file__button wp-element-button" download aria-describedby="wp-block-file--media-5d6ce814-9b05-4b14-91f0-463de15a1317">Download</a></div>



<h2 class="wp-block-heading" id="ir-receiver-module">Remote IR Receiver Module</h2>



<p>Attached to the back of the inner block cover is a display module combined with an IR receiver. I was wondering if the IR receiver logic could be handled there and forwarded to the main PCB via something like UART. Turns out the LCD elements and the IR receiver diode run down to the main PCB so there is nothing to hijack.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2500" height="1624" src="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-lcd-display-ir-receiver.jpeg?strip=all&#038;quality=90&#038;resize=2500,1624" alt="Gree GWH09YD-S6DBA1 front cover LCD module with IR receiver" class="wp-image-8024" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-lcd-display-ir-receiver.jpeg?strip=all&amp;quality=90&amp;resize=800%2C520 800w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-lcd-display-ir-receiver.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C665 1024w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-lcd-display-ir-receiver.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C998 1536w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-lcd-display-ir-receiver.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1330 2048w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-lcd-display-ir-receiver.jpeg?strip=all&amp;quality=90&amp;resize=384%2C249 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-lcd-display-ir-receiver.jpeg?strip=all&amp;quality=90&amp;resize=768%2C499 768w" sizes="auto, (max-width: 2500px) 100vw, 2500px" /><figcaption class="wp-element-caption">Back of the PCB for Gree GWH09YD-S6DBA2A front cover LCD module with IR receiver.</figcaption></figure>



<h3 class="wp-block-heading" id="ir-remote-protocol">IR Remote Protocol</h3>



<p>I used an infrared photodiode attached directly to pins <code>GND</code> and <code>D3</code> (which is pulled high) of Wemos D1 mini and the <code>IRrecvDumpV3.ino</code> <a href="https://github.com/crankyoldgit/IRremoteESP8266/blob/8b1bfc37ec4afb79a09c757cc28044a867d2f77e/examples/IRrecvDumpV3/IRrecvDumpV3.ino">sketch bundled</a> with v2.8.1 of the <a href="https://github.com/crankyoldgit/IRremoteESP8266">IRremoteESP8266 library</a> to decoded the messages.</p>



<p>Here are the infrared bit sequences captured by the Saleae logic analyser:</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2057" height="267" src="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-YAG1FB3.png?strip=all&#038;quality=90&#038;resize=2057,267" alt="Gree YAG1FB3 remote signal capture" class="wp-image-7966" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-YAG1FB3.png?strip=all&amp;quality=90&amp;resize=800%2C104 800w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-YAG1FB3.png?strip=all&amp;quality=90&amp;resize=1024%2C133 1024w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-YAG1FB3.png?strip=all&amp;quality=90&amp;resize=1536%2C199 1536w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-YAG1FB3.png?strip=all&amp;quality=90&amp;resize=2048%2C266 2048w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-YAG1FB3.png?strip=all&amp;quality=90&amp;resize=384%2C50 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-YAG1FB3.png?strip=all&amp;quality=90&amp;resize=768%2C100 768w" sizes="auto, (max-width: 2057px) 100vw, 2057px" /><figcaption class="wp-element-caption">Capture of the IR signal from the YAG1FB3 remote when turning on the device. </figcaption></figure>



<div class="wp-block-file"><a id="wp-block-file--media-e7f8507d-9676-4c5a-a8c7-f8124d9ee806" href="https://kaspars.net/wp-content/uploads/2022/02/gree-yag1fb3-turn-on-remote.sal">YAG1FB3 remote IR capture (Saleae)</a><a href="https://kaspars.net/wp-content/uploads/2022/02/gree-yag1fb3-turn-on-remote.sal" class="wp-block-file__button wp-element-button" download aria-describedby="wp-block-file--media-e7f8507d-9676-4c5a-a8c7-f8124d9ee806">Download</a></div>



<p>We can clearly see two sets of messages that are repeated twice. Each message has two parts and the first one starts with a longer sync header.</p>



<p>Initially it complained about the packets being too large to fit in the allocated buffer:</p>



<pre class="wp-block-preformatted">WARNING: IR code is too big for buffer (&gt;= 1024). This result shouldn't be trusted until this is resolved. Edit &amp; increase `kCaptureBufferSize`.</pre>



<p>That is because of the <code>kTimeout</code> constant which is set to <code>50</code> by default and is 10ms above the actual period of 40ms between the groups of messages that we see in the logic analyser output above. By setting the value to 30:</p>



<pre class="wp-block-code"><code>const uint8_t kTimeout = 30;</code></pre>



<p>it started decoding the packets as expected:</p>



<pre class="wp-block-code"><code>Protocol  : GREE
Code      : 0x0C084070000000E0 (64 Bits)
Mesg Desc.: Model: 1 (YAW1F), Power: On, Mode: 4 (Heat), Temp: 24C, Fan: 0 (Auto), Turbo: Off, Econo: Off, IFeel: Off, WiFi: Off, XFan: Off, Light: Off, Sleep: Off, Swing(V) Mode: Manual, Swing(V): 0 (Last), Swing(H): 0 (Off), Timer: Off, Display Temp: 0 (Off)
uint16_t rawData&#91;139] = {9004, 4474,  664, 540,  664, 540,  666, 1642,  664, 1644,  664, 542,  664, 540,  664, 542,  664, 542,  664, 542,  664, 542,  664, 542,  664, 1642,  664, 542,  664, 540,  666, 540,  664, 540,  664, 542,  664, 542,  664, 542,  664, 540,  664, 540,  664, 542,  664, 1642,  664, 542,  664, 540,  666, 540,  666, 540,  664, 540,  666, 1642,  664, 1642,  664, 1642,  664, 540,  664, 542,  664, 1642,  664, 540,  664, 19974,  664, 542,  664, 542,  664, 542,  664, 542,  664, 542,  664, 542,  662, 542,  662, 542,  664, 542,  664, 542,  664, 542,  664, 542,  662, 544,  662, 544,  662, 544,  662, 542,  662, 544,  662, 542,  662, 542,  662, 544,  662, 544,  662, 542,  664, 544,  662, 542,  662, 544,  662, 542,  662, 542,  664, 542,  662, 544,  662, 1644,  662, 1644,  662, 1644,  662};  // GREE
uint8_t state&#91;8] = {0x0C, 0x08, 0x40, 0x70, 0x00, 0x00, 0x00, 0xE0};</code></pre>



<p>In the decoded bit timing sequence above we see a 9004us header mark followed by a 4474us space and then the actual message bits where the bit mark is 664us, logical <code>0</code> space is 542us, logical <code>1</code> space is 1642us and with 19974us between the two packets of the message.</p>



<p>Enabling the I-feel mode (where the remote sends the indoor temperature to the indoor unit) does append another packet to the end which isn&#8217;t parsed correctly, though:</p>



<pre class="wp-block-code"><code>Protocol  : UNKNOWN
Code      : 0x5EF985F1 (18 Bits)
uint16_t rawData&#91;35] = {6008, 2986,  658, 546,  658, 548,  658, 548,  658, 1648,  658, 1648,  658, 546,  658, 548,  658, 548,  658, 1650,  658, 546,  658, 1648,  658, 546,  658, 548,  658, 1648,  658, 548,  658, 1648,  658};</code></pre>



<p>It appears that this packet is supported <a href="https://github.com/ToniA/arduino-heatpumpir/blob/279ae403af3fee9d1478a4a2f6632fa1b653c4bb/GreeHeatpumpIR.h#L17-L20">by the <code>arduino-heatpumpir</code> library</a>. According to the <a href="https://github.com/ToniA/arduino-heatpumpir/blob/279ae403af3fee9d1478a4a2f6632fa1b653c4bb/GreeHeatpumpIR.cpp#L314-L336"><code>GreeYACHeatpumpIR::send()</code> method</a> we&#8217;re expecting a header followed by two data bytes (<a href="https://github.com/ToniA/arduino-heatpumpir/blob/279ae403af3fee9d1478a4a2f6632fa1b653c4bb/IRSender.cpp#L12-L30">using the following logic</a>) and one closing <code>GREE_YAC_BIT_MARK</code>:</p>



<ul class="wp-block-list">
<li><code>6008, 2986</code> are the two header marks,</li>



<li><code>658,546 | 658,548 | 658,548 | 658,1648 | 658,1648 | 658,546 | 658,548 | 658,548</code> maps to <code>0x00011000</code> in binary which is <code>24</code> in decimal (the temperature measured by the remote).</li>



<li><code>658,1650 | 658,546 | 658,1648 | 658,546 | 658,548 | 658,1648 | 658,548 | 658,1648</code> maps to <code>0b10100101</code> or <code>0xA5</code> in hex <a href="https://github.com/ToniA/arduino-heatpumpir/blob/279ae403af3fee9d1478a4a2f6632fa1b653c4bb/GreeHeatpumpIR.cpp#L320">as expected</a>.</li>



<li><code>658</code> is the closing <code>GREE_YAC_BIT_MARK</code>.</li>
</ul>



<h2 class="wp-block-heading" id="wi-fi-module">Wi-Fi Module</h2>



<p>There is a built-in Wi-Fi module which uses <a href="https://github.com/cmroche/greeclimate">a protocol that has been reverse-engineered</a> and enables full control over the local network once the unit has been added to the Wi-Fi network using the GREE+ app for iOS and Android. There is even <a href="https://www.home-assistant.io/integrations/gree/">a fully functional HomeAssistant integration</a>.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2500" height="1875" src="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-top.jpeg?strip=all&#038;quality=90&#038;resize=2500,1875" alt="Gree GWH09YD-S6DBA1 built-in WiFi module top" class="wp-image-8044" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-top.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-top.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-top.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-top.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-top.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-top.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2500px) 100vw, 2500px" /><figcaption class="wp-element-caption">Gree GWH09YD-S6DBA2A built-in WiFi module top.</figcaption></figure>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2400" height="1800" src="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-back.jpeg?strip=all&#038;quality=90&#038;resize=2400,1800" alt="Gree GWH09YD-S6DBA1 built-in WiFi module back" class="wp-image-8045" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-back.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-back.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-back.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-back.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-back.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-back.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2400px) 100vw, 2400px" /><figcaption class="wp-element-caption">Gree GWH09YD-S6DBA2A built-in WiFi module back.</figcaption></figure>



<p>The <code>COM-MANUAL</code> label and the four wires going to the module from the PCB indicate that this is possibly an UART-to-WIFI bridge. However, attaching the digital logic analyser probes to the dark-brown, light-brown and GND pins produced a lot of noise without clear indication of the data being transfered.</p>



<h3 class="wp-block-heading">Wi-Fi Module Firmware</h3>



<p>Initially the unit was reporting firmware version <code>v1.00</code> and only in April 2023 it offered an update to <code>v3.76</code> via the official <a href="https://apps.apple.com/us/app/gree/id1167857672">Gree+ app</a> which completed successfully.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="828" height="728" src="https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-1.0.0.png?strip=all&#038;quality=90&#038;resize=828,728" alt="Gree firmware update from v1.00 to v3.76" class="wp-image-8542" style="width:414px;height:364px" srcset="https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-1.0.0.png?strip=all&amp;quality=90&amp;resize=800%2C703 800w, https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-1.0.0.png?strip=all&amp;quality=90&amp;resize=384%2C338 384w, https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-1.0.0.png?strip=all&amp;quality=90&amp;resize=768%2C675 768w, https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-1.0.0.png?strip=all&amp;quality=90&amp;resize=828%2C728 828w" sizes="auto, (max-width: 828px) 100vw, 828px" /><figcaption class="wp-element-caption">Firmware update to v3.76.</figcaption></figure>
</div>


<p>In July 2023 it started showing an available update to <code>v3.77</code> but I haven&#8217;t been able to apply it due to a network timeout after requesting the update.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="828" height="762" src="https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-update-2023.jpeg?strip=all&#038;quality=90&#038;resize=828,762" alt="Gree firmware update to v3.77" class="wp-image-8543" style="width:414px;height:381px" srcset="https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-update-2023.jpeg?strip=all&amp;quality=90&amp;resize=800%2C736 800w, https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-update-2023.jpeg?strip=all&amp;quality=90&amp;resize=384%2C353 384w, https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-update-2023.jpeg?strip=all&amp;quality=90&amp;resize=768%2C707 768w, https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-update-2023.jpeg?strip=all&amp;quality=90&amp;resize=828%2C762 828w" sizes="auto, (max-width: 828px) 100vw, 828px" /><figcaption class="wp-element-caption">Firmware update to v3.77.</figcaption></figure>
</div>


<p>There is a <a href="https://github.com/maxim-smirnov/gree-wifimodule-firmware">GitHub repository collecting all the firmware files</a> which can be obtained from Gree servers in the same way the mobile app does it. The app uses the firmware version reported by the <a href="https://github.com/cmroche/greeclimate/blob/d13c0db0b42164ffe980f575ed9befa7dba44968/greeclimate/device.py#L260"><code>hid</code> parameter</a> such as <code>362001065736+U-QCOM4004CV3.76.bin</code> for my unit where the first part <code>362001065736</code> is the <code>firmwareCode</code> that is used to check for a new version by making a GET request to:</p>



<pre class="wp-block-code"><code>http://grih.gree.com/wifiModule/Lastversion?firmwareCode=<span style="font-family: inherit; font-size: inherit;">362001065736</span></code></pre>



<p>where <code>grih.gree.com</code> can be any of the local servers such as <code>eu.grih.gree.com</code>, for example. It returns a JSON blob:</p>



<pre class="wp-block-code"><code>{
    "CreateDate": "2023-06-15 08:27:08",
    "commProtVer": "V1.2.1",
    "desc": "1、devLogin包中增加hid、ModelType、bc字段；\r\n2、连接调度服时优先使用1812端口（1812端口与5000端口轮换使用）；\r\n3、配网成功后不响应Wi-Fi开关。",
    "forcedUpgrade": 1,
    "frcUpgdType": 0,
    "r": 200,
    "url": "http://grih.gree.com/wifiModule/image/10528/145680",
    "ver": "3.77"
}</code></pre>



<p>or for from the <a href="http://eu.grih.gree.com/wifiModule/Lastversion?firmwareCode=362001065736">EU server</a>:</p>



<pre class="wp-block-code"><code>{
    "CreateDate": "2023-07-14 02:29:37",
    "commProtVer": "V1.2.1",
    "desc": "In this version, we have fixed some known issues.",
    "forcedUpgrade": 0,
    "r": 200,
    "url": "http://eu.grih.gree.com/wifiModule/image/10141/145680",
    "ver": "3.77"
}</code></pre>



<p>Notice how the firmware URLs are different! However, the contents of both files is identical as confirmed by checksums reported by the server (the <code>FileMd5</code> response HTTP header):</p>



<pre class="wp-block-code"><code>$ curl -I http://grih.gree.com/wifiModule/image/10528/145680
HTTP/1.1 200 OK
Server: nginx/1.26.1
Date: Sun, 03 Nov 2024 12:08:45 GMT
Content-Type: application/octet-stream
Content-Length: 145680
Connection: keep-alive
Content-Disposition: attachment; filename="ota_sdkshell-1335624479074045096.bin"
Content-Range: bytes 0-145679/145680
<strong>FileMd5: f5ac9d07b5499dac210d550710f7ef2a</strong>
Strict-Transport-Security: max-age=31536000
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache
Set-Cookie: HttpOnly
Set-Cookie: Secure</code></pre>



<p>and:</p>



<pre class="wp-block-code"><code>$ curl -I http://eu.grih.gree.com/wifiModule/image/10141/145680
HTTP/1.1 200 OK
Date: Sun, 03 Nov 2024 12:09:19 GMT
Content-Type: application/octet-stream
Content-Length: 145680
Connection: keep-alive
Server: nginx
Content-Disposition: attachment; filename="U-QCOM4004CV3.77.bin-9979849298584095054.bin"
Content-Range: bytes 0-145679/145680
<strong>FileMd5: f5ac9d07b5499dac210d550710f7ef2a</strong>
supcc: 3324d648008ce504a8a519571dc2aa8e4816e5ae92c53100a3dd9052e9b9165c
Strict-Transport-Security: max-age=31536000
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache
Set-Cookie: HttpOnly
Set-Cookie: Secure</code></pre>



<p>and tested locally:</p>



<pre class="wp-block-code"><code>$ md5sum <a href="https://kaspars.net/wp-content/uploads/2022/02/3.77-eu.bin" data-type="attachment" data-id="9587">3.77-eu.bin</a>
f5ac9d07b5499dac210d550710f7ef2a  3.77-eu.bin

$ md5sum <a href="https://kaspars.net/wp-content/uploads/2022/02/3.77.bin" data-type="attachment" data-id="9588">3.77.bin</a>
f5ac9d07b5499dac210d550710f7ef2a  3.77.bin</code></pre>



<p>Having access to these firmware files allows us to do all kinds of interesting things such find diffs between versions and extract string references using <a href="https://www.gnu.org/software/binutils/">GNU binutils</a>. Here are all the strings as text files for each version:</p>



<ul class="wp-block-list">
<li><a href="https://kaspars.net/wp-content/uploads/2022/02/3.74.strings.txt" data-type="attachment" data-id="9598">3.74 strings</a></li>



<li><a href="https://kaspars.net/wp-content/uploads/2022/02/3.76.strings.txt" data-type="attachment" data-id="9599">3.76 strings</a></li>



<li><a href="https://kaspars.net/wp-content/uploads/2022/02/3.77.strings.txt" data-type="attachment" data-id="9600">3.77 strings</a></li>



<li><a href="https://kaspars.net/wp-content/uploads/2022/02/3.78.strings.txt" data-type="attachment" data-id="9601">3.78 (test version) strings</a></li>
</ul>



<p>The most valuable find appears to be the  <code>QCOM4004</code> reference which points to only a few pages on the web, including <a href="https://docs.utyun.com/TechnicalPlatform/ServicePlatform/yingjianyun">this documentation</a> for Alibaba Cloud platform and SDK.</p>



<p>It is interesting to see that the firmware codes don&#8217;t increase with each version &#8212; for example, the same code <code>362001065736</code> is used for versions 3.76, 3.77 and the test 3.78. It is also not clear why the difference between 3.74 and 3.77 is so tiny:</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2630" height="614" src="https://kaspars.net/wp-content/uploads/2022/02/gree-3.74-3.77-diff.png?strip=all&#038;quality=90&#038;resize=2630,614" alt="Diff between versions 3.74 and 3.77 of Gree firmware" class="wp-image-9603" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-3.74-3.77-diff.png?strip=all&amp;quality=90&amp;resize=1280%2C299 1280w, https://kaspars.net/wp-content/uploads/2022/02/gree-3.74-3.77-diff.png?strip=all&amp;quality=90&amp;resize=1920%2C448 1920w, https://kaspars.net/wp-content/uploads/2022/02/gree-3.74-3.77-diff.png?strip=all&amp;quality=90&amp;resize=1536%2C359 1536w, https://kaspars.net/wp-content/uploads/2022/02/gree-3.74-3.77-diff.png?strip=all&amp;quality=90&amp;resize=2048%2C478 2048w, https://kaspars.net/wp-content/uploads/2022/02/gree-3.74-3.77-diff.png?strip=all&amp;quality=90&amp;resize=384%2C90 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-3.74-3.77-diff.png?strip=all&amp;quality=90&amp;resize=768%2C179 768w, https://kaspars.net/wp-content/uploads/2022/02/gree-3.74-3.77-diff.png?strip=all&amp;quality=90&amp;resize=1024%2C239 1024w" sizes="auto, (max-width: 2630px) 100vw, 2630px" /><figcaption class="wp-element-caption">Diff between versions 3.74 and 3.77 of Gree firmware.</figcaption></figure>



<p>It is almost as if 3.77 rolls back 3.76 to 3.74.</p>



<h3 class="wp-block-heading">Wi-Fi Firmware Update</h3>



<p>The update process is initiated by the mobile app which connects to the unit via a jump server that helps with traversing the layers of NAT. </p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2716" height="2090" src="https://kaspars.net/wp-content/uploads/2022/02/gree-wifi-firmware-upgrade.png?strip=all&#038;quality=90&#038;resize=2716,2090" alt="Gree app triggering a firmware update for Wi-Fi module" class="wp-image-9614" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-wifi-firmware-upgrade.png?strip=all&amp;quality=90&amp;resize=1280%2C985 1280w, https://kaspars.net/wp-content/uploads/2022/02/gree-wifi-firmware-upgrade.png?strip=all&amp;quality=90&amp;resize=1920%2C1477 1920w, https://kaspars.net/wp-content/uploads/2022/02/gree-wifi-firmware-upgrade.png?strip=all&amp;quality=90&amp;resize=1536%2C1182 1536w, https://kaspars.net/wp-content/uploads/2022/02/gree-wifi-firmware-upgrade.png?strip=all&amp;quality=90&amp;resize=2048%2C1576 2048w, https://kaspars.net/wp-content/uploads/2022/02/gree-wifi-firmware-upgrade.png?strip=all&amp;quality=90&amp;resize=384%2C295 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-wifi-firmware-upgrade.png?strip=all&amp;quality=90&amp;resize=768%2C591 768w, https://kaspars.net/wp-content/uploads/2022/02/gree-wifi-firmware-upgrade.png?strip=all&amp;quality=90&amp;resize=1024%2C788 1024w" sizes="auto, (max-width: 2716px) 100vw, 2716px" /><figcaption class="wp-element-caption">A network capture of Gree+ app triggering a firmware update of Wi-Fi module.</figcaption></figure>



<p>First, it fetches the <code>hid</code> attribute of the current firmware via an encrypted <code>pack</code> request:</p>



<pre class="wp-block-code"><code>{"cols":&#91;"Pow","Mod","TemUn","SetTem","TemRec","WdSpd","Tur","Quiet","SwUpDn","SwingLfRig","Air","Blo","Health","SvSt","Lig","StHt","SwhSlp","SlpMod","LigSen","UvcControl","Dmod","Dwet","ModelType","HeatCoolType","AllErr","AppTimer","AIEnSaveDis","hid"],"mac":"UNIT_MAC_ID","t":"status"}</code></pre>



<p>to which the unit responds with encoded:</p>



<pre class="wp-block-code"><code>{"t":"dat","mac":"UNIT_MAC_ID","r":200,"cols":&#91;"Pow","Mod","TemUn","SetTem","TemRec","WdSpd","Tur","Quiet","SwUpDn","SwingLfRig","Air","Blo","Health","SvSt","Lig","StHt","SwhSlp","SlpMod","LigSen","Dmod","Dwet","ModelType","HeatCoolType","AllErr","AppTimer","hid"],"dat":&#91;0,4,0,19,0,5,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,32858,0,0,0,"362001065736+U-QCOM4004CV3.76.bin"]}</code></pre>



<p>after which the app does another <code>pack</code> request:</p>



<pre class="wp-block-code"><code>{"cols":&#91;"TemsSenOut","TemSen","DwatSen","FaultDisplay","AntiDirectBlow","hid","ElcEn","Slp1L1","Slp1H1","Slp1L2","Slp1H2","Slp1L3","Slp1H3","Slp1L4","Slp1H4","Slp1L5","Slp1H5","Slp1L6","Slp1H6","Slp1L7","Slp1H7","Slp1L8","Slp1H8"],"mac":"UNIT_MAC_ID","t":"status"}</code></pre>



<p>to which the unit responds with:</p>



<pre class="wp-block-code"><code>{"t":"dat","mac":"502cc685f806","r":200,"cols":&#91;"TemSen","DwatSen","hid","Slp1L1","Slp1H1","Slp1L2","Slp1H2","Slp1L3","Slp1H3","Slp1L4","Slp1H4","Slp1L5","Slp1H5","Slp1L6","Slp1H6","Slp1L7","Slp1H7","Slp1L8","Slp1H8"],"dat":&#91;51,0,"362001065736+U-QCOM4004CV3.76.bin",160,0,160,0,160,0,160,0,160,0,160,0,160,0,160,0]}</code></pre>



<p>and then finally the app uses the data from the update sever mentioned above to send another encrypted <code>pack</code> payload:</p>



<pre class="wp-block-code"><code>{"t":"upgrade","url":"http://eu.grih.gree.com/wifiModule/image/10141/145680","mac":"UNIT_MAC_ID"}</code></pre>



<p>to which the unit responds with <code>pack</code> that is encrypted with the hard-coded <code>a3K8Bx%2r8Y7#xDh</code> key:</p>



<pre class="wp-block-code"><code>{"t":"ret","r":200,"mac":"502cc685f806"}</code></pre>



<p>Afterwards the app appears to wait for the unit to update itself (for a hardcoded period of time) and to eventually respond with an updated <code>hid</code> value matching the new firmware. However, in my case it never happens even if I send an upgrade request with a different firmware URL.</p>



<h2 class="wp-block-heading" id="bms-and-com-manual-connections">BMS and COM Manual Connections </h2>



<p>There are two additional wire connections that are coming out of the PCB that are left not connected:</p>



<ul class="wp-block-list">
<li><code>BMS</code> which is potentially a Modbus or CAN connections for Building Management Systems.</li>



<li><code>COM-MANUAL</code> which is designated as &#8220;Wired Controller (optional)&#8221; in the service manual.</li>
</ul>



<p>There is a lot of potential for gaining full read-write access to the device through these ports but I haven&#8217;t gotten to that yet.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="1410" height="1123" src="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-O-indoor-diagram.png?strip=all&#038;quality=90&#038;resize=1410,1123" alt="Gree GWH09YD-S6DBA1AO indoor PCB diagram" class="wp-image-8054" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-O-indoor-diagram.png?strip=all&amp;quality=90&amp;resize=800%2C637 800w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-O-indoor-diagram.png?strip=all&amp;quality=90&amp;resize=1024%2C816 1024w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-O-indoor-diagram.png?strip=all&amp;quality=90&amp;resize=384%2C306 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-O-indoor-diagram.png?strip=all&amp;quality=90&amp;resize=768%2C612 768w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-O-indoor-diagram.png?strip=all&amp;quality=90&amp;resize=1410%2C1123 1410w" sizes="auto, (max-width: 1410px) 100vw, 1410px" /><figcaption class="wp-element-caption">Gree GWH09YD-S6DBA1A indoor PCB diagram.</figcaption></figure>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="1581" height="1073" src="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-pcb-top.png?strip=all&#038;quality=90&#038;resize=1581,1073" alt="Gree GWH09YD-S6DBA1A indoor PCB" class="wp-image-8049" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-pcb-top.png?strip=all&amp;quality=90&amp;resize=800%2C543 800w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-pcb-top.png?strip=all&amp;quality=90&amp;resize=1024%2C695 1024w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-pcb-top.png?strip=all&amp;quality=90&amp;resize=1536%2C1042 1536w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-pcb-top.png?strip=all&amp;quality=90&amp;resize=384%2C261 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-pcb-top.png?strip=all&amp;quality=90&amp;resize=768%2C521 768w, https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-pcb-top.png?strip=all&amp;quality=90&amp;resize=1581%2C1073 1581w" sizes="auto, (max-width: 1581px) 100vw, 1581px" /><figcaption class="wp-element-caption">Gree GWH09YD-S6DBA1A indoor PCB.</figcaption></figure>



<h2 class="wp-block-heading">Wired Controller XK76</h2>



<p>Some of the Gree models support wired controllers or thermostats in addition to the RF remotes. This indoor unit has two unpopulated connectors labeled <code>BMS</code> and (forgot the other one) in addition to the <code>WIFI</code> cable that is connected to the WIFI module.</p>



<p>The <code>BMS</code> connector is attached to the wired controller and it appears to be using some kind of serial protocol (potentially Modbus over RS485 similar to their commercial units) to communicate with the remote controller.</p>



<p>Unfortunately, it isn&#8217;t very clear which wired controllers support which indoor units especially because the model numbers don&#8217;t appear to be shared between units sold in EU and US, for example. Your best option is to review the service manual for the heat pump and determine the controller model by the picture. I decided to get what appeared to be the most recent version of the wired controllers XK76 and just hoped it would work with my device. And luckily it does!</p>



<p><strong>Important:</strong> Make sure to turn off the heat pump completely before connecting the controller or it will return an error code <code>E6</code> and fail to communicate with the device. I almost thought it just doesn&#8217;t work and put it on sale&#8230; </p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2022/04/gree-xk76-wired-controller-thermostat-box-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="" class="wp-image-8072" srcset="https://kaspars.net/wp-content/uploads/2022/04/gree-xk76-wired-controller-thermostat-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/04/gree-xk76-wired-controller-thermostat-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/04/gree-xk76-wired-controller-thermostat-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/04/gree-xk76-wired-controller-thermostat-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/04/gree-xk76-wired-controller-thermostat-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/04/gree-xk76-wired-controller-thermostat-box-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">XK76 comes in a box with two back panels, a four wire cable and a patch cable.</figcaption></figure>



<p>And here is the photo of the PCB which appears to have just a single microcontroller and three physical connection ports with matching drivers and a bunch of passives to drive the screen:</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-top-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="The PCB of the Gree Gree XK76 wired controller thermostat" class="wp-image-8073" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-top-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">The <code>CN4</code> connector on the top-right is used to attach the communications cable. With markings GRJ4K-B on the PCB.</figcaption></figure>



<p>And here is a photo of the main controller which appears to be <a href="https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc3000-arm9:MC_71572">NXP LPC3100 series ARM9</a>:</p>



<figure class="wp-block-image alignwide size-large"><img loading="lazy" decoding="async" width="1024" height="768" src="https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-teardown-scaled.jpeg?strip=all&#038;quality=90&#038;resize=1024,768" alt="Gree XK76 wired controller with NXP LPC3100 ARM9 microcontroller" class="wp-image-8074" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-teardown-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-teardown-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-teardown-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-teardown-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-teardown-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-teardown-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Gree XK76 with NXP LPC3100 ARM9 microcontroller.</figcaption></figure>



<h2 class="wp-block-heading" id="indoor-outdoor-communication">Outdoor and Indoor Unit Communication</h2>



<p>There is no official documentation for the communication protocol used between the indoor and outdoor units. Below are my findings based on reverse-engineering and the insight shared by other enthusiasts after publishing this post.</p>



<h3 class="wp-block-heading">System Design</h3>



<p>All of the heat pump control logic is handled by the outdoor unit while the indoor unit only requests heating or cooling and sends the temperature readings of the indoor heat exchanger as input for the outdoor control board.</p>



<p>The communication between the outdoor and indoor units happens via a DC signal referenced to the AC power ground.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="768" height="531" src="https://kaspars.net/wp-content/uploads/2022/05/gree-outdoor-unit-wiring.png?strip=all&#038;quality=90&#038;resize=768,531" alt="Gree Heat Pump Outdoor Unit Wiring" class="wp-image-8218" srcset="https://kaspars.net/wp-content/uploads/2022/05/gree-outdoor-unit-wiring.png?strip=all&amp;quality=90&amp;resize=384%2C266 384w, https://kaspars.net/wp-content/uploads/2022/05/gree-outdoor-unit-wiring.png?strip=all&amp;quality=90&amp;resize=768%2C531 768w" sizes="auto, (max-width: 768px) 100vw, 768px" /><figcaption class="wp-element-caption">Wire labeled &#8220;BK&#8221; (2) used for communication signal between the indoor and outdoor units.</figcaption></figure>
</div>


<h3 class="wp-block-heading" id="indoor-outdoor-protocol">Communication Protocol</h3>



<p>I was able to attach an oscilloscope and record the following communication between the outdoor and indoor units. See <a href="https://www.reddit.com/r/AskElectronics/comments/ukxui7/how_to_decode_minisplit_heatpump_indoor_and/">this thread on Reddit</a> for what others think.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="800" height="480" src="https://kaspars.net/wp-content/uploads/2022/02/gree-outdoor-indoor-inverter-communication.png?strip=all&#038;quality=90&#038;resize=800,480" alt="Gree heatpump indoor and outdoor unit communication" class="wp-image-8282" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-outdoor-indoor-inverter-communication.png?strip=all&amp;quality=90&amp;resize=384%2C230 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-outdoor-indoor-inverter-communication.png?strip=all&amp;quality=90&amp;resize=768%2C461 768w, https://kaspars.net/wp-content/uploads/2022/02/gree-outdoor-indoor-inverter-communication.png?strip=all&amp;quality=90&amp;resize=800%2C480 800w" sizes="auto, (max-width: 800px) 100vw, 800px" /><figcaption class="wp-element-caption">Indoor and outdoor unit communication.</figcaption></figure>
</div>


<p>It is using a 0-60V serial signal centered around 30V &#8212; the outdoor control board keeps the signal at 30V and the indoor unit pulls it low to 0V to send the data. For replies the outdoor unit pulls the signal high to 60V.</p>



<p>The logic analyser was able to decode the serial signal when set to <strong>LSB byte order, 1200 baud rate, 8 data bits, 1 stop bit and even parity</strong>.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="1238" height="1041" src="https://kaspars.net/wp-content/uploads/2022/02/gree-inverter-heat-pump-communication-serial.png?strip=all&#038;quality=90&#038;resize=1238,1041" alt="Gree heat pump heat exchanger and compressor communication" class="wp-image-8292" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-inverter-heat-pump-communication-serial.png?strip=all&amp;quality=90&amp;resize=800%2C673 800w, https://kaspars.net/wp-content/uploads/2022/02/gree-inverter-heat-pump-communication-serial.png?strip=all&amp;quality=90&amp;resize=1024%2C861 1024w, https://kaspars.net/wp-content/uploads/2022/02/gree-inverter-heat-pump-communication-serial.png?strip=all&amp;quality=90&amp;resize=384%2C323 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-inverter-heat-pump-communication-serial.png?strip=all&amp;quality=90&amp;resize=768%2C646 768w, https://kaspars.net/wp-content/uploads/2022/02/gree-inverter-heat-pump-communication-serial.png?strip=all&amp;quality=90&amp;resize=1238%2C1041 1238w" sizes="auto, (max-width: 1238px) 100vw, 1238px" /><figcaption class="wp-element-caption">Serial communication with 20 bytes of data sent between the indoor and outdoor units.</figcaption></figure>



<p>Based on the functionality of the multifunctional inverter testers mentioned below, it should contain the following data:</p>



<ul class="wp-block-list">
<li>Operation mode (heating, cooling)</li>



<li>Internal fan speed</li>



<li>Set temperature</li>



<li>Bus voltage (AC supply)</li>



<li>Bus current</li>



<li>Compressor frequency</li>



<li>Expansion valve opening</li>



<li>Module temperature (?)</li>



<li>Inner ring temperature (?)</li>



<li>Inner tube temperature (?)</li>



<li>Outer ring temperature (?)</li>



<li>Outer tube temperature (?)</li>



<li>Exhaust temperature</li>



<li>Cold inlet temperature (?)</li>
</ul>



<p>The first byte indicates the type of the message (<code>0x31</code> and <code>0x32</code> in the examples above) followed by the actual data bytes closed out by an 8-bit modulo 256 checksum byte. Here are the messages I&#8217;ve been able to decode:</p>



<h4 class="wp-block-heading">Message <code>0x31</code> Source</h4>



<figure class="wp-block-table"><table><thead><tr><th>Byte</th><th>Hex</th><th>Decimal</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>0x31</td><td>49</td><td></td><td>Destination or source address?</td></tr><tr><td>1</td><td>0x20</td><td>32</td><td></td><td>Destination or source address?</td></tr><tr><td>2</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>3</td><td>0x14</td><td><strong>20</strong></td><td><strong>Heating</strong></td><td>Mode, 20=heat, 17=cool, 19=ventilation, ?=auto, ?=dry, fan-only=?, off=?</td></tr><tr><td>4</td><td>0x8</td><td><strong>8</strong></td><td><strong>Auto</strong></td><td>Fan speed, 1=low, 2=medium, 3=high, 4=turbo, 128=off, 8=auto? (low, medium low, medium, medium high, high)</td></tr><tr><td>5</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>6</td><td>0x38</td><td><strong>56</strong></td><td><strong>16</strong></td><td>Set temperature (value &#8211; 40)</td></tr><tr><td>7</td><td>0x3C</td><td><strong>60</strong></td><td><strong>20</strong></td><td>Room temperature (value &#8211; 40)</td></tr><tr><td>8</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>9</td><td>0x3A</td><td><strong>58</strong></td><td><strong>18</strong></td><td>Refrigerant temperature inside (value &#8211; 40)</td></tr><tr><td>10</td><td>0x7</td><td>7</td><td></td><td></td></tr><tr><td>11</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>12</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>13</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>14</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>15</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>16</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>17</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>18</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>19</td><td>0x22</td><td><strong>34</strong></td><td><strong>34</strong></td><td>CheckSum8 Modulo 256</td></tr></tbody></table></figure>



<h4 class="wp-block-heading">Message <code>0x31</code> Reply</h4>



<figure class="wp-block-table"><table><thead><tr><th>Byte</th><th>Hex</th><th>Decimal</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td><strong>0x31</strong></td><td><strong>49</strong></td><td></td><td>Destination or source address?</td></tr><tr><td>1</td><td><strong>0x10</strong></td><td><strong>16</strong></td><td></td><td>Destination or source address?</td></tr><tr><td>2</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>3</td><td><strong>0x14</strong></td><td><strong>20</strong></td><td><strong>Heating</strong></td><td>Mode, 20=heat, 17=cool, 19=ventilation, ?=auto, ?=dry, fan-only=?, off=?</td></tr><tr><td>4</td><td><strong>0x20</strong></td><td><strong>32</strong></td><td><strong>32</strong></td><td><strong>Compressor frequency?</strong></td></tr><tr><td>5</td><td><strong>0x5A</strong></td><td><strong>90</strong></td><td><strong>90</strong></td><td><strong>Outdoor fan frequency?</strong></td></tr><tr><td>6</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>7</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>8</td><td>0x1</td><td>1</td><td></td><td>Unknown</td></tr><tr><td>9</td><td>0x23</td><td>35</td><td></td><td>Unknown</td></tr><tr><td>10</td><td>0x61</td><td>97</td><td></td><td>Unknown</td></tr><tr><td>11</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>12</td><td><strong>0x33</strong></td><td><strong>51</strong></td><td><strong>11</strong></td><td><strong>Outside temperature (value &#8211; 40)</strong></td></tr><tr><td>13</td><td><strong>0x30</strong></td><td><strong>48</strong></td><td><strong>8</strong></td><td><strong>Suction line temperature (value &#8211; 40)</strong></td></tr><tr><td>14</td><td><strong>0x5C</strong></td><td><strong>92</strong></td><td><strong>52</strong></td><td><strong>Discharge line temperature (value &#8211; 40)</strong></td></tr><tr><td>15</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>16</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>17</td><td>0x4</td><td>4</td><td></td><td>Unknown</td></tr><tr><td>18</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>19</td><td><strong>0x17</strong></td><td><strong>23</strong></td><td></td><td><strong>CheckSum8 Modulo 256</strong></td></tr></tbody></table></figure>



<h4 class="wp-block-heading">Message <code>0x32</code> Source</h4>



<figure class="wp-block-table"><table><thead><tr><th>Byte</th><th>Hex</th><th>Decimal</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td><strong>0x32</strong></td><td><strong>50</strong></td><td></td><td>Destination or source address?</td></tr><tr><td>1</td><td><strong>0x20</strong></td><td><strong>32</strong></td><td></td><td>Destination or source address?</td></tr><tr><td>2</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>3</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>4</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>5</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>6</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>7</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>8</td><td><strong>0x11</strong></td><td><strong>17</strong></td><td></td><td>Unknown</td></tr><tr><td>9</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>10</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>11</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>12</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>13</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>14</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>15</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>16</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>17</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>18</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>19</td><td><strong>0x63</strong></td><td><strong>99</strong></td><td></td><td>CheckSum8 Modulo 256</td></tr></tbody></table></figure>



<h4 class="wp-block-heading">Message <code>0x32</code> Reply</h4>



<figure class="wp-block-table"><table><thead><tr><th>Byte</th><th>Hex</th><th>Decimal</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td><strong>0x32</strong></td><td><strong>50</strong></td><td></td><td>Destination or source address?</td></tr><tr><td>1</td><td><strong>0x10</strong></td><td><strong>16</strong></td><td></td><td>Destination or source address?</td></tr><tr><td>2</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>3</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>4</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>5</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>6</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>7</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>8</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>9</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>10</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>11</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>12</td><td><strong>0x39</strong></td><td><strong>57</strong></td><td></td><td>Unknown</td></tr><tr><td>13</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>14</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>15</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>16</td><td>0</td><td>0</td><td></td><td></td></tr><tr><td>17</td><td>0xA</td><td><strong>10</strong></td><td></td><td>Unknown</td></tr><tr><td>18</td><td><strong>0x36</strong></td><td><strong>54</strong></td><td></td><td>Unknown</td></tr><tr><td>19</td><td><strong>0xBB</strong></td><td><strong>187</strong></td><td></td><td>CheckSum8 Modulo 256</td></tr></tbody></table></figure>



<p>There are several other message types that I haven&#8217;t yet captured.</p>



<h3 class="wp-block-heading">Portable and Multifunctional Tester for Inverter A/C</h3>



<p>There appear to be several inverter tester tools which support the single wire communication used by multiple brands. The GT2D3AAa model is often referenced as the &#8220;new&#8221; version of the older model GZJ10D009 but I haven&#8217;t been able to confirm that. Importantly, GZJ10D009 is specifically branded by Gree:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="750" height="750" src="https://kaspars.net/wp-content/uploads/2022/02/gree-GZJ10D009-tester.jpeg?strip=all&#038;quality=90&#038;resize=750,750" alt="Gree GZJ10D009 tester" class="wp-image-8281" srcset="https://kaspars.net/wp-content/uploads/2022/02/gree-GZJ10D009-tester.jpeg?strip=all&amp;quality=90&amp;resize=384%2C384 384w, https://kaspars.net/wp-content/uploads/2022/02/gree-GZJ10D009-tester.jpeg?strip=all&amp;quality=90&amp;resize=150%2C150 150w, https://kaspars.net/wp-content/uploads/2022/02/gree-GZJ10D009-tester.jpeg?strip=all&amp;quality=90&amp;resize=120%2C120 120w, https://kaspars.net/wp-content/uploads/2022/02/gree-GZJ10D009-tester.jpeg?strip=all&amp;quality=90&amp;resize=750%2C750 750w" sizes="auto, (max-width: 750px) 100vw, 750px" /><figcaption class="wp-element-caption">Gree GZJ10D009 tester.</figcaption></figure>
</div>


<p>And here is the &#8220;new&#8221; version:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="768" src="https://kaspars.net/wp-content/uploads/2022/02/GT2D3AAa-inverter-tester.jpg?strip=all&#038;quality=90&#038;resize=1024,768" alt="GT2D3AAa inverter multifunction tester" class="wp-image-8280" srcset="https://kaspars.net/wp-content/uploads/2022/02/GT2D3AAa-inverter-tester.jpg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/02/GT2D3AAa-inverter-tester.jpg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/02/GT2D3AAa-inverter-tester.jpg?strip=all&amp;quality=90&amp;resize=768%2C576 768w, https://kaspars.net/wp-content/uploads/2022/02/GT2D3AAa-inverter-tester.jpg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">GT2D3AAa inverter multifunction tester (source: <a href="https://www.aliexpress.com/item/1005004529164927.html">AliExpress</a>).</figcaption></figure>
</div>


<h2 class="wp-block-heading">Drain Pan Heater in Cold Climates</h2>



<p>The outside unit contains a resistive heater for the drain pan which is turned on and draws constant 100W when the outside temperature falls below 0C (32F) <strong>even when the unit is not running or defrosting anything</strong> (there might be a setting that controls this but I haven&#8217;t been able to find it). </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1500" height="2000" src="https://kaspars.net/wp-content/uploads/2022/02/pan-heater-power-draw.jpeg?strip=all&#038;quality=90&#038;resize=1500,2000" alt="Gree drain pan heater drawing 0.4A during freezing temperatures" class="wp-image-8300" srcset="https://kaspars.net/wp-content/uploads/2022/02/pan-heater-power-draw.jpeg?strip=all&amp;quality=90&amp;resize=800%2C1067 800w, https://kaspars.net/wp-content/uploads/2022/02/pan-heater-power-draw.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C1365 1024w, https://kaspars.net/wp-content/uploads/2022/02/pan-heater-power-draw.jpeg?strip=all&amp;quality=90&amp;resize=1152%2C1536 1152w, https://kaspars.net/wp-content/uploads/2022/02/pan-heater-power-draw.jpeg?strip=all&amp;quality=90&amp;resize=384%2C512 384w, https://kaspars.net/wp-content/uploads/2022/02/pan-heater-power-draw.jpeg?strip=all&amp;quality=90&amp;resize=768%2C1024 768w, https://kaspars.net/wp-content/uploads/2022/02/pan-heater-power-draw.jpeg?strip=all&amp;quality=90&amp;resize=1500%2C2000 1500w" sizes="auto, (max-width: 1500px) 100vw, 1500px" /><figcaption class="wp-element-caption">Drain pan heater drawing 0.4A at 240V during freezing temperatures.</figcaption></figure>
</div>


<p>This leads to 2.4kWh of additional energy consumption per day which is unfortunate. Note that the heater is only for the drain pan and not the compressor so there is no reason it should be on for more than the defrost cycle and some time after it.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2488" height="1484" src="https://kaspars.net/wp-content/uploads/2022/02/pan-heater.png?strip=all&#038;quality=90&#038;resize=2488,1484" alt="Gree drain pan heater power consumption during cold climate" class="wp-image-8299" srcset="https://kaspars.net/wp-content/uploads/2022/02/pan-heater.png?strip=all&amp;quality=90&amp;resize=800%2C477 800w, https://kaspars.net/wp-content/uploads/2022/02/pan-heater.png?strip=all&amp;quality=90&amp;resize=1024%2C611 1024w, https://kaspars.net/wp-content/uploads/2022/02/pan-heater.png?strip=all&amp;quality=90&amp;resize=1536%2C916 1536w, https://kaspars.net/wp-content/uploads/2022/02/pan-heater.png?strip=all&amp;quality=90&amp;resize=2048%2C1222 2048w, https://kaspars.net/wp-content/uploads/2022/02/pan-heater.png?strip=all&amp;quality=90&amp;resize=384%2C229 384w, https://kaspars.net/wp-content/uploads/2022/02/pan-heater.png?strip=all&amp;quality=90&amp;resize=768%2C458 768w" sizes="auto, (max-width: 2488px) 100vw, 2488px" /><figcaption class="wp-element-caption">Gree drain pan heater drawing 100W during cold weather.</figcaption></figure>



<p>The compressor compartment and piping are really well insulated:</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-unit-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Gree GWH09YD-S6DBA2A outdoor unit" class="wp-image-8309" srcset="https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-unit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-unit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-unit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-unit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-unit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-unit-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">Gree GWH09YD-S6DBA2A outdoor unit.</figcaption></figure>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-wiring-scaled.jpeg?strip=all&#038;quality=90&#038;resize=2560,1920" alt="Gree GWH09YD-S6DBA2A outdoor unit element connections" class="wp-image-8310" srcset="https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-wiring-scaled.jpeg?strip=all&amp;quality=90&amp;resize=800%2C600 800w, https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-wiring-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C768 1024w, https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-wiring-scaled.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C1152 1536w, https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-wiring-scaled.jpeg?strip=all&amp;quality=90&amp;resize=2048%2C1536 2048w, https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-wiring-scaled.jpeg?strip=all&amp;quality=90&amp;resize=384%2C288 384w, https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-wiring-scaled.jpeg?strip=all&amp;quality=90&amp;resize=768%2C576 768w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /><figcaption class="wp-element-caption">Gree GWH09YD-S6DBA2A outdoor controller connections.</figcaption></figure>



<p>Notice how the <code>4WAY</code> valve 220V switch is almost right next to the <code>HEAT</code> connection for the resistive heater so it should be possible to connect a timer relay which keeps the heater running only for 10 or 30 minutes after the defrost cycle.</p>



<h2 class="wp-block-heading">Forums and Links</h2>



<ul class="wp-block-list">
<li><a href="https://www.facebook.com/groups/2208343752742110/">Heat pump builder community on Facebook</a> (in Polish) where people convert air-source mini-split heat pump to heat water for heating.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/gree-amber-nordic-gwh09yd-s6dba1/feed</wfw:commentRss>
			<slash:comments>39</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1.jpeg" length="969537" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-lcd-display-ir-receiver.jpeg" length="1080194" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-YAG1FB3.png" length="30330" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-top.jpeg" length="972028" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA1-wifi-module-back.jpeg" length="1202109" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-1.0.0.png" length="18456" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2023/08/gree-firmware-update-2023.jpeg" length="19816" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-3.74-3.77-diff.png" length="105592" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-wifi-firmware-upgrade.png" length="318838" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-O-indoor-diagram.png" length="235685" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-GWH09YD-S6DBA2A-pcb-top.png" length="236317" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/04/gree-xk76-wired-controller-thermostat-box-scaled.jpeg" length="738602" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-top-scaled.jpeg" length="980580" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-xk76-wired-controller-thermostat-pcb-teardown-scaled.jpeg" length="994130" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/05/gree-outdoor-unit-wiring.png" length="35638" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-outdoor-indoor-inverter-communication.png" length="16699" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-inverter-heat-pump-communication-serial.png" length="40608" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/gree-GZJ10D009-tester.jpeg" length="85147" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/GT2D3AAa-inverter-tester.jpg" length="87742" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/pan-heater-power-draw.jpeg" length="260374" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/pan-heater.png" length="42528" type="image/png" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-unit-scaled.jpeg" length="814960" type="image/jpeg" /> <enclosure url="https://kaspars.net/wp-content/uploads/2022/02/GWH09YD-S6DBA2A-outdoor-wiring-scaled.jpeg" length="460299" type="image/jpeg" />	</item>
		<item>
		<title>Notes on MySensors</title>
		<link>https://kaspars.net/blog/mysensors-notes</link>
					<comments>https://kaspars.net/blog/mysensors-notes#comments</comments>
		
		<dc:creator><![CDATA[Kaspars]]></dc:creator>
		<pubDate>Sun, 23 Jan 2022 12:34:58 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Home Automation]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<guid isPermaLink="false">https://kaspars.net/?p=7948</guid>

					<description><![CDATA[MySensors is a great project for building IoT devices but it tries to do many things &#8212; define a general serial communications protocol (similar to ModBus, CAN), provide a software library for many hardware devices on top of the Arduino abstraction layer, firmware updates and many other things. I first tried it in 2018 when [&#8230;] <a href="https://kaspars.net/blog/mysensors-notes" class="read-more excerpt-read-more">Read&#160;more&#160;&#8594;</a>]]></description>
										<content:encoded><![CDATA[
<p><a href="https://github.com/mysensors/MySensors">MySensors</a> is a great project for building IoT devices but it tries to do many things &#8212; define <a href="https://www.mysensors.org/download/serial_api_20">a general serial communications protocol</a> (similar to <a href="https://modbus.org/">ModBus</a>, <a href="https://en.wikipedia.org/wiki/CAN_bus">CAN</a>), provide a software library for many hardware devices on top of the Arduino abstraction layer, firmware updates and many other things. I first tried it in 2018 <a href="https://kaspars.net/blog/attiny841-rfm69-mysensors" data-type="post" data-id="6753">when building wireless sensor nodes</a> using the RFM69 radios.</p>



<span id="more-7948"></span>



<p>The last stable release of the library was <a href="https://github.com/mysensors/MySensors/releases/tag/2.3.2">in late 2019</a> and the project <a href="https://forum.mysensors.org/topic/11684/where-did-everyone-go/">appears to have been abandoned</a> by the original maintainers as the <a href="https://github.com/mysensors/MySensors/pulls">pull requests are left unmerged</a> and issues unresolved. Having worked on large open source projects I know that this can happen as the priorities change for the original contributors. It would be great if new contributors could be added to the project to keep it going.</p>



<figure class="wp-block-image alignwide size-full"><img loading="lazy" decoding="async" width="2000" height="1252" src="https://kaspars.net/wp-content/uploads/2022/01/era-node-rs485-raspberry-pi.jpeg?strip=all&#038;quality=90&#038;resize=2000,1252" alt="Era node using ESP8266 (Wemos D1 mini) connected to Raspberry Pi over RS485" class="wp-image-7950" srcset="https://kaspars.net/wp-content/uploads/2022/01/era-node-rs485-raspberry-pi.jpeg?strip=all&amp;quality=90&amp;resize=800%2C501 800w, https://kaspars.net/wp-content/uploads/2022/01/era-node-rs485-raspberry-pi.jpeg?strip=all&amp;quality=90&amp;resize=1024%2C641 1024w, https://kaspars.net/wp-content/uploads/2022/01/era-node-rs485-raspberry-pi.jpeg?strip=all&amp;quality=90&amp;resize=1536%2C962 1536w, https://kaspars.net/wp-content/uploads/2022/01/era-node-rs485-raspberry-pi.jpeg?strip=all&amp;quality=90&amp;resize=384%2C240 384w, https://kaspars.net/wp-content/uploads/2022/01/era-node-rs485-raspberry-pi.jpeg?strip=all&amp;quality=90&amp;resize=768%2C481 768w, https://kaspars.net/wp-content/uploads/2022/01/era-node-rs485-raspberry-pi.jpeg?strip=all&amp;quality=90&amp;resize=2000%2C1252 2000w" sizes="auto, (max-width: 2000px) 100vw, 2000px" /><figcaption>Era node using ESP8266 (Wemos D1 mini) connected to Raspberry Pi over RS485.</figcaption></figure>



<p>Here are my notes on the state of things as I attempt to use the MySensors protocol for <a href="https://github.com/kasparsd/era">wired (!) nodes over the RS485 physical layer</a> to create switches and sensor nodes for my home automation system:</p>



<h2 class="wp-block-heading">General Notes</h2>



<ul class="wp-block-list"><li>Some controllers don&#8217;t have support for many of the <a href="https://www.mysensors.org/download/serial_api_20#internal">internal message types</a> which are used for node registration <code>I_REGISTRATION_REQUEST</code>, finding node parent IDs <code>I_FIND_PARENT</code>, assigning node IDs <code>I_ID_REQUEST</code>, etc. This prevents nodes that expect those features from working with gateways that don&#8217;t support these features. For example, here are the <a href="https://github.com/tbowmo/node-red-contrib-mysensors/blob/e1d4d53320e49122ab5183d04b64376e1880527f/src/lib/mysensors-controller.ts#L39-L57">message types supported by the Node-RED integration</a> or the supported <a href="https://github.com/theolind/pymysensors/blob/84ec6c6a0f4984ef0064908d27b92d13f30fc7ef/mysensors/handler.py">messages types by the pymysensors library</a> that is also used by the <a href="https://www.home-assistant.io/integrations/mysensors">Home Assistant integration</a>.</li></ul>



<h2 class="wp-block-heading">General Issues</h2>



<ul class="wp-block-list"><li>The version 3 of Arduino core for ESP8266 isn&#8217;t compatible with how MySensors tries to inject itself into the <code>setup()</code> and <code>loop()</code> calls, <a href="https://github.com/mysensors/MySensors/issues/1496">as reported here</a>. There is <a href="https://github.com/mysensors/MySensors/pull/1513">a pull request</a> to fix this.</li></ul>



<h2 class="wp-block-heading">RS485 Transport Layer Issues</h2>



<ul class="wp-block-list"><li>The RS485 transport layer doesn&#8217;t support using <a href="https://www.arduino.cc/en/Reference/softwareSerial">Arduino SoftwareSerial</a> for communicating to the RS485 transceivers. Issue <a href="https://github.com/mysensors/MySensors/issues/1300">reported here</a> and potentially <a href="https://github.com/mysensors/MySensors/pull/1510">fixed by my pull request here</a>. This is probably because originally SoftwareSerial wasn&#8217;t part of the Arduino core and the project had to pull in optimised versions of similar libraries for Atmel microcontrollers.</li><li>The <a href="https://github.com/mysensors/MySensors/issues/1450">node ID discovery/assignment is broken over the RS485 transport layer</a>. There is <a href="https://github.com/mysensors/MySensors/pull/1451">a pull request to fix this</a>.</li></ul>



<h2 class="wp-block-heading">Alternatives to MySensors</h2>



<p>MySensors serial implementation is great because it allows nodes to talk to the network while most of the other protocols require that the communication is initiated by the controller which isn&#8217;t very suitable for scenarios such as switching lights and other real-time events.</p>



<p>Here are some alternative protocols for building &#8220;multi-master&#8221; bus networks using RS485:</p>



<ul class="wp-block-list"><li><a href="https://www.pjon.org/ThroughSerial.php">PJON ThroughSerial</a> defines the communication but doesn&#8217;t define the message types for standard automation events so you need to define your own layer for this.</li><li><a href="https://www.uartbus.eu/">UARTBus</a> which is influenced by KNX but appears to be relatively new.</li></ul>



<p>Do you know of any other protocols that would support this?</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kaspars.net/blog/mysensors-notes/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<enclosure url="https://kaspars.net/wp-content/uploads/2022/01/era-node-rs485-raspberry-pi.jpeg" length="808660" type="image/jpeg" />	</item>
	</channel>
</rss>
