<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Honza Kašík</title>
    <description>Quality Engineer at Red Hat Czech sharing solutions to problems which he runs into, his hobbies and interests to the world!
</description>
    <link>http://honzakasik.cz/</link>
    <atom:link href="http://honzakasik.cz/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Thu, 13 Nov 2025 07:49:03 +0000</pubDate>
    <lastBuildDate>Thu, 13 Nov 2025 07:49:03 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>TapHome – moje největší chyba na stavbě</title>
        <description>&lt;p&gt;Na začátku byla idea chytré domácnosti jak ji asi chce každý: spolehlivá, po drátu, s podporou a konfigurovatelná odkudkoliv. Potom co jsem vyhodil z výběru KNX kvůli nákladům a Loxone kvůli uzavřenosti (což byla chyba) jsem našel slovenský TapHome.&lt;/p&gt;

&lt;p&gt;TapHome jsem vybral hlavně kvůli funkci packet parseru, která slibovala snadnou integraci všeho, co nemá oficiální integraci od TapHome a celý systém vyapdal díky tomu celkem otevřeně.&lt;/p&gt;

&lt;p&gt;S odstupem času jsem se rozhodl sepsat proč jsem nakonec TapHome zahodil. Shrnuji své rok staré zkušenosti a některé věci nemusí být aktuální. Jedná se mé osobní názory v rámci recenze.&lt;/p&gt;

&lt;h2 id=&quot;první-problém-dokumentace&quot;&gt;První problém: dokumentace&lt;/h2&gt;

&lt;p&gt;Při &lt;a href=&quot;/2024/04/30/quido-taphome.html&quot;&gt;integraci Papouch Quido&lt;/a&gt; jsem narazil na to, že v dokumentaci chybí podstatná část funkcí packet parseru. Musel jsme procházet existující, nezdokumentovaná řešení a podle názvů funkcí hádat, jestli by se mi třeba daná funkce nehodila.&lt;/p&gt;

&lt;p&gt;Celá hierarchie zařízení nebyla (a možná stále není) v dokumentaci nikde zmíněna a musel jsem prostě hádat. Tehdy jsme to skousl s tím, že se třeba ukáže, že výhody převažují.&lt;/p&gt;

&lt;h2 id=&quot;druhý-problém-přenositelnost&quot;&gt;Druhý problém: přenositelnost&lt;/h2&gt;

&lt;p&gt;TapHome má aplikaci. Jen aplikaci. Chcete cokoliv nakonfigurovat? Jedině s aplikací. Používáte platformu pro kterou není aplikace? Smůla. Rozchodil jsem horko těžko Windows aplikaci ve Wine a zbytek prostě programoval z mobilu s Adnroidem.&lt;/p&gt;

&lt;p&gt;Přitom by stačilo jednoduché webové rozhraní. To zabalíte i do mobilní aplikace. Vždyť tak to dělá Home Assistant.&lt;/p&gt;

&lt;p&gt;Opět jsem si sliboval, že se ukáže síla zařízení a třeba v to něco je.&lt;/p&gt;

&lt;h2 id=&quot;třetí-problém-doménově-specifický-jazyk&quot;&gt;Třetí problém: doménově specifický jazyk&lt;/h2&gt;

&lt;p&gt;Pro programování čehokoliv používá TapHome svůj vlastní DSL. Proto je chabá dokumentace takový problém. Cykly jsou utrpení a musíte se přizpůsobit myšlení autora jazyka.&lt;/p&gt;

&lt;p&gt;Co je ale ještě horší je to, že rozsah použitelných tokenů se liší v závislosti na kontextu. V packet parseru nemůžete použít vše co v automatizaci a naopak.&lt;/p&gt;

&lt;p&gt;Třeba to ale znamená, že zařízení budou spolehlivá když už chybí dokumentace. No ne?&lt;/p&gt;

&lt;h2 id=&quot;čtvrtý-problém-nespolehlivost&quot;&gt;Čtvrtý problém: nespolehlivost&lt;/h2&gt;

&lt;p&gt;Asi jsem tušil, co se bude dít, když jsem dával dohromady architekturu chytré domácnosti. Chtěl jsem stmívatelná světla. TapHome samozřejmě nabízí proprietární dimmery, ale chtěl jsem, aby v případě, že třeba TapHome zanikne, bylo vše rozšiřitelné a udržovatelné. Postavil jsem tedy světla nad DMX – profesionálním protokolem pro ovládání světel a aparatury na koncertech.&lt;/p&gt;

&lt;p&gt;TapHome pro protokol DMX nabízel bránu/gateway. Strávil jsem desítky hodin pokusy rozchodit ji, aby fungovala. Brána v implementaci firmware špatně provádela časování (příliš dlouhé pauzy) a dekodér to nezvládl. I jen jedno světlo připojené k dekodéru zuřivě blikalo. Vím, že podobné problémy měli i další uživatelé.&lt;/p&gt;

&lt;p&gt;Tady jsem si užil první zkušenost s podporou.&lt;/p&gt;

&lt;h2 id=&quot;pátý-problém-neprofesionální-podpora&quot;&gt;Pátý problém: neprofesionální podpora&lt;/h2&gt;

&lt;p&gt;Ticket systém? Nebo snad JIRA? Ale kdeže, klíčovým prvkem podpory je skupina na Facebooku, kde fungují zaměstanci TapHome. Když položíte dotaz, třeba budete mít štěstí a nasměrují vás do soukromých zpráv/emailu.&lt;/p&gt;

&lt;p&gt;S podporou jsem si i volal. Nakonec po cca měsíci dodali novou verzi firmware pro DMX bránu, která vše trochu stabilizovala. Problém ale přetrvával.&lt;/p&gt;

&lt;p&gt;Jak tedy společnost profesionálně vše vyřešila? Stáhla bránu z nabídky, smazala VEŠKEROU dokumentaci a dokonce i zmínky z Facebookové skupiny. Prostě jakoby daný produkt neexistoval. Prý se jim podpora nevyplatí.&lt;/p&gt;

&lt;p&gt;Po tomto incidentu jsme se rozhodl s TapHome skoncovat. Nechcete někdo DMX bránu? Zpátky ji nevezmou.&lt;/p&gt;

&lt;h2 id=&quot;šestý-problém-aktualizace&quot;&gt;Šestý problém: aktualizace&lt;/h2&gt;

&lt;p&gt;Při pohledu do skupiny na Facebooku je vidět, že častým problémem jsou aktualizace. S čím jsem měl problém já osobně bylo, že aktualizace nepopisovala změny, které jsou obsaženy. Běžné ale je, že po aktualizaci firmware nastane problém.&lt;/p&gt;

&lt;p&gt;Chcete přece aktualizovat by byl dům bezpečný, že? Tak tady prý podle “podpory” z Facebooku platí, že když vše funguje tak se nic neaktualizuje.&lt;/p&gt;

&lt;p&gt;Vše jde ruku v ruce s nedostatečnou dokumentací.&lt;/p&gt;

&lt;h2 id=&quot;závěr&quot;&gt;Závěr&lt;/h2&gt;

&lt;p&gt;Není vyloučeno, že si ještě něco vybavím. Přineslo mi to mnoho zkušeností a významnou finanční ztrátu.&lt;/p&gt;
</description>
        <pubDate>Thu, 13 Nov 2025 00:00:00 +0000</pubDate>
        <link>http://honzakasik.cz/2025/11/13/taphome-moje-nejvetsi-chyba.html</link>
        <guid isPermaLink="true">http://honzakasik.cz/2025/11/13/taphome-moje-nejvetsi-chyba.html</guid>
        
        <category>smarthome</category>
        
        <category>home-assistant</category>
        
        <category>tapome</category>
        
        
      </item>
    
      <item>
        <title>Integrace Samsung klimatizace do Home Assistant — po drátu</title>
        <description>&lt;p&gt;Chtěl jsem spolehlivé ovládání multisplitu bez cloudu a internetu. Rozhodl jsem se pro lokální Modbus řešení.&lt;/p&gt;

&lt;h2 id=&quot;co-budeme-potřebovat&quot;&gt;Co budeme potřebovat&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Samsung MIM-B19N jednotku – Poskytuje Modbus RTU rozhraní a připojuje se k proprietární sběrnici venkovní jednotky.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Modbus RTU/TCP převodník – Osobně používám tento čtyřkanálový od Waveshare, protože k němu mám připojené elektroměry a relé &lt;a href=&quot;https://www.aliexpress.com/item/1005006402111790.html&quot;&gt;Waveshare 4 channel RS485 to Ethernet server&lt;/a&gt;. V síti se tváří jako 4 samostatné rozhraní. U každého lze nastavit jiné časování/paritu/stop bits pro Modbus RTU.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Běžící Home Assistant s vhodnou konfigurací – Plně aktualizovaný.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;schéma-zapojení&quot;&gt;Schéma zapojení&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/2025-10-31-samsung-modbus_diagram.png&quot; alt=&quot;Diagram zpaojení&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Modbus RTU mám vedenou přes jeden pár cat7 kabelu.&lt;/li&gt;
  &lt;li&gt;Ethernet jsou běžné kabely.&lt;/li&gt;
  &lt;li&gt;Switch je PoE, napájím z něj i převodník.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;home-assistant-konfigurace&quot;&gt;Home Assistant konfigurace&lt;/h2&gt;

&lt;p&gt;Veškerou konfiguraci mám v samostatném souboru &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;modbus.yaml&lt;/code&gt; ve adresáři s konfigurací Home Assistenta. V &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;configuration.yaml&lt;/code&gt; ji takto vkládám:&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;modbus&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;!include&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;modbus.yaml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;V souboru &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;modbus.yaml&lt;/code&gt; nejdříve musíme nakonfigurovat “hub” - blok konfguace pod kterým jsou přístupné jednotlivé entity. Je potřeba nakonfigurovat IP adresu převodníku a port.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;delay&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;timeout&lt;/code&gt; a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;message_wait_milliseconds&lt;/code&gt; jsou hodnoty získané metodou pokus omyl, které se mi osvědčily:&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;samsung-ac&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;tcp&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;host&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;192.168.1.42&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4196&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;timeout&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;message_wait_milliseconds&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Každá vnitřní jednotka pak definuje svůj vlastní &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;climates&lt;/code&gt; prvek:&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;samsung-ac&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;tcp&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;host&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;192.168.1.42&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4196&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;timeout&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;message_wait_milliseconds&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;climates&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Vnitřní&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;jednotka&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;tajné&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;doupě&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;unique_id&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;vnitrni_jednotka_tajne_doupe&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;slave&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;hvac_onoff_register&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;52&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;address&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;59&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;target_temp_register&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;58&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;scale&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.1&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;hvac_mode_register&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; 
        &lt;span class=&quot;na&quot;&gt;address&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;53&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state_auto&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state_cool&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state_dry&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state_fan_only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state_heat&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;fan_mode_register&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;address&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;54&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state_fan_auto&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state_fan_low&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state_fan_medium&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;state_fan_high&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Vnitřní jednotka obsadí vždy 50 registrů a první začíná na registru 50 (číslováno od 0). Každá další začíná na i*50. Je ale možné, že jednotka prostě přeskočí očekávaný rozsah a je přístupná až na konci – místo 100 až 150 obsadí 200 až 250.&lt;/p&gt;

&lt;p&gt;Čísla registrů a jejich hodnoty vychází z dokumentace k MIM-B19N a pravěpodobně se nezmění.&lt;/p&gt;

&lt;h2 id=&quot;nastavení-vnitřních-jednotek&quot;&gt;Nastavení vnitřních jednotek&lt;/h2&gt;

&lt;p&gt;Pokud jste vše rozběhali může vám přijít divné, že data jdou sice číst, ale nemůžete jednotky ovládat. Je to proto, že Samsung jednotky mají ve výchozím stavu zakázané centrální ovládání. Nejjednoduší způsob jak ho povolit je pomocí originálního IR ovladače.&lt;/p&gt;

&lt;p&gt;Doporučuji &lt;a href=&quot;https://www.youtube.com/watch?v=Uf7oTKOVEME&quot;&gt;toto super video jak zadat ovládací příkazy&lt;/a&gt;. Ve zkratce:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Vyjměte jednu baterii z ovladače.&lt;/li&gt;
  &lt;li&gt;Stiskněte na ovladači tlačítko vypnutí, ovladač se vypne.&lt;/li&gt;
  &lt;li&gt;Stiskněte zároveň tlačítka na snížení a zvýšení teploty – jde to i jedním prstem – a vložte baterii.&lt;/li&gt;
  &lt;li&gt;Ovladač se spustí v režimu zadávání příkazů.&lt;/li&gt;
  &lt;li&gt;Přepínačem intenzity ventilátoru zadejte na první obrazovce &lt;em&gt;d2&lt;/em&gt;. To je označení “direct” příkazů ke změně pouze jednoho parametru. Jinak se zadává celá konfigurace a to je děsná otrava.&lt;/li&gt;
  &lt;li&gt;Stiskněte tlačítko “mode”. Dostanete se na další obrazovku.&lt;/li&gt;
  &lt;li&gt;Zadejte &lt;em&gt;05&lt;/em&gt;. To je číslo segmentu, kde se nachází konfigurace, kterou chceme změnit. V tomto případě povolení centrálního ovládání.&lt;/li&gt;
  &lt;li&gt;Stiskněte tlačítko “mode”.&lt;/li&gt;
  &lt;li&gt;Na třetí obrazovce zadejte &lt;em&gt;10&lt;/em&gt;. &lt;em&gt;1&lt;/em&gt; je hodnota, kterou chceme zapsat. &lt;em&gt;0&lt;/em&gt; je vata.&lt;/li&gt;
  &lt;li&gt;Namiřte ovladač na jednotku a stiskněte tlačítko zapnout. Ozve se melodie zapnutí.&lt;/li&gt;
  &lt;li&gt;Stiskněte tlačítko zapnout znovu až se ozve krátký zvuk. To je potvrzení, že se už nic nezměnilo a hodnota je zapsaná.&lt;/li&gt;
  &lt;li&gt;Takto můžete oběhnout všechny jednotky.&lt;/li&gt;
  &lt;li&gt;Ovladač se vrátí zpět do běžného režimu cyklem: vyndání jedné baterky, stisk tlačítka vypnout, vložením jedné baterky.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ještě jednou: kód je d2-05-10.&lt;/p&gt;

&lt;p&gt;Tak a to je vše. Vše by mělo krásně fungovat.&lt;/p&gt;
</description>
        <pubDate>Fri, 31 Oct 2025 00:00:00 +0000</pubDate>
        <link>http://honzakasik.cz/2025/10/31/samsung-klimatizace-home-assistant.html</link>
        <guid isPermaLink="true">http://honzakasik.cz/2025/10/31/samsung-klimatizace-home-assistant.html</guid>
        
        <category>smarthome</category>
        
        <category>home-assistant</category>
        
        <category>samsung</category>
        
        
      </item>
    
      <item>
        <title>Integrace Papouch Quido do TapHome</title>
        <description>&lt;p&gt;Určitě už jste četli &lt;a href=&quot;https://www.vodnici.net/2023/04/loxone-propojeni-s-modulem-quido-od-papoucha/&quot;&gt;zápisek o propojení Loxone s modulem Quido od Papoucha na vodnickém blogu&lt;/a&gt;. Protože jsem ale nakonec nešel cestou Loxone a zvolil pro systém chytré domácnosti TapHome, potřeboval jsem řešit stejný problém v jiném kontextu.&lt;/p&gt;

&lt;h2 id=&quot;fyzické-zapojení&quot;&gt;Fyzické zapojení&lt;/h2&gt;

&lt;p&gt;Modul české výroby nabízí na šíři cca 12 běžných DIN modulů &lt;a href=&quot;https://papouch.com/quido-eth-100-3-100-vstupu-3-vystupy-a-teplomer-p4641/&quot;&gt;60+40 digitálních vstupů&lt;/a&gt; spolu s volitelným komunikačním rozhraním. Já vybral modul ETH s ethernetem.&lt;/p&gt;

&lt;p&gt;Integrace s kabeláží chytré domácnosti je jednoduchá: do vypínače/tlačítka stačí přivést na jednom vodiči napětí a zbytek vodičů z kabelu můžou být vstupy. Pro běžný UTP kabel je to tedy 1+7 vstupů. Já ale nechal v každé místnosti minimálně pod jedním vypínačem pár vodičů pro připojení NTC teploměru.&lt;/p&gt;

&lt;p&gt;V rozvaděči stačí pak svorku IGND Quida propojit s - pólem zdroje signálového napětí. Pro zachování galvanického oddělení vstupů je nutné použít jiný zdroj pro napájení Quida a jiný pro signály.&lt;/p&gt;

&lt;p&gt;Datové propojení zajišťuje ethernetový kabel zapojený do switche v rozvaděči, který je samozřejmě propojen s routerem s DHCP.&lt;/p&gt;

&lt;p&gt;Dokumentace Quida je skvělá. Opravdu by si z ní mnozí mohli brát příklad.&lt;/p&gt;

&lt;h2 id=&quot;konfigurace-quida&quot;&gt;Konfigurace Quida&lt;/h2&gt;

&lt;p&gt;Po připojení na IP adresu Quida v režimu WEB uživatele přivítá přehled vstupů a jejich stav. Vyzkoušel jsem si tu, že signalizace stavu vstupů funguje a přepnul jsem Quido do režimu UTP. V tomto režimu stačí nastavit cílovou IP adresu a port a Quido tam bude ve výchozím nastavení odesílat packet v protokolu Spinel po každé změně hodnoty jakéhokoliv vstupu.&lt;/p&gt;

&lt;p&gt;UDP jsem zvolil proto, že poslání packetu bez TCP handshaku je mnohem rychlejší a zaručuje nižší odezvu.&lt;/p&gt;

&lt;p&gt;Tím veškerá konfigurace Quida končí. Není to super?&lt;/p&gt;

&lt;h2 id=&quot;packet-parser--důvod-proč-jsem-zvolil-taphome&quot;&gt;Packet parser — důvod, proč jsem zvolil Taphome&lt;/h2&gt;

&lt;p&gt;Ač má TapHome pár slabin (žádné web UI a podprůměrná dokumentace), u mě jasně vyhrál díky &lt;a href=&quot;https://taphome.com/CZ/support/453935111&quot;&gt;packet parseru&lt;/a&gt;. Tato funkce dovoluje integraci &lt;em&gt;jakéhokoliv&lt;/em&gt; rozumně napsaného API. Cloudového i lokálního. Binárního, v plaintextu, JSONu i XML. Můžete integrovat doslova cokoliv co připojíte k síti. V tomto je síla TapHome. Nemusíte se doprošovat integrace toho, či onoho a prostě si to uděláte sami. Tady zcela válcuje Loxone.&lt;/p&gt;

&lt;p&gt;Dokumentace packet parseru pokulhává, ale zkusím sepsat, co jsem zjistil:&lt;/p&gt;

&lt;p&gt;Nejvíce informací se dá načerpat z &lt;a href=&quot;https://github.com/taphome-official/packetparser_templates&quot;&gt;oficiálního repozitáře s templates&lt;/a&gt;. Nic sice není zdokumentované, ale příkladů je tam spousta. Z &lt;a href=&quot;https://taphome.com/CZ/support/2335309829&quot;&gt;oficiální dokumentace&lt;/a&gt; se třeba nedozvíte k čemu přesně dobrý je listener skript.&lt;/p&gt;

&lt;p&gt;V rámci struktury packet parseru máte možnost konfigurovat &lt;em&gt;modul&lt;/em&gt;, který zastřešuje jedno nebo více zařízení. V mém případě konfiguruji UDP modul a u něj &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;localhost&lt;/code&gt; hostname jako IP adresu a port na kterém očekávám UDP packety od Quida. Netuším, jestli vůbec jde v TapHome nakonfigurovat více síťových rozhraní a tak netuším, jaké využití konfigurace IP adresy má. Při nastavení &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;localhost&lt;/code&gt; bude packet parser naslouchat na všech rozhraních a zároveň se tím vyhnu závislosti na pevné IP v síti.&lt;/p&gt;

&lt;p&gt;U každého modulu lze v servisním nastavení nastavit:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Listener script/skript posluchače, který zpracovává jakákoliv data, která v packet parseru přistanou v proměnné &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RECEIVEDBYTES&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Read script pro periodické čtení stavu&lt;/li&gt;
  &lt;li&gt;Write script pro jednotlivý nebo periodický zápis hodnoty&lt;/li&gt;
  &lt;li&gt;a dále také servisní atributy a servisní akce, které ale netuším k čemu slouží a nepátral jsem po tom&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;V detailech modulu lze nastavit proměnné, které chceme sdílet mezi skripty nebo modulem a zařízeními. Při konfiguraci proměnné je zde omezení v podobě typu proměnné, kde lze zvolit jen mezi číslem nebo řetězcem. Složitější struktury jako byte array tedy neuložíte. Nebo aspoň opět nevím jak na to.&lt;/p&gt;

&lt;p&gt;V podstatě stejné věci jdou konfigurovat i u každého zařízení. Chápu to tak, že ve skriptech modulu lze provést složitější akci tak, aby se nemusela provádět u každého zařízení zvlášť.&lt;/p&gt;

&lt;h2 id=&quot;spinel-protokol-a-listener-skript&quot;&gt;Spinel protokol a listener skript&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://cdn.papouch.com/data/user-content/products/quido-standard-spolecne/quido-spinel_cz.pdf&quot;&gt;Spinel protokol&lt;/a&gt; je na první pohled proprietární zbytečnost na cestě za výsledkem. Na pohled druhý výrazně tuto cestu zkrátí.&lt;/p&gt;

&lt;p&gt;Dobrou zprávou je, že ve výchozím stavu v UDP režimu posílá Quido stav všech vstupů při každé změně. Zpráva ve spinel protokolu vypadá nějak takto:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;0b101010&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b1100001&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b10010&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b110001&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b10011&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b1101&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b11011&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b10011001&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b1011101&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b1101&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Děsivé, že? Ale kdepak. Prvních (z pohledu TapHome jde o byte array) 8 bytů jsou stavové informace a protokol. Poslední 2 byty to samé. Nás zajímá 104 bitů mezi těmito skupinami.&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b0&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b11011&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;0b10011001&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Lepší, že? Teď je tu takový malý trik. Ač TapHome používá indexaci v array klasicky zleva do prava, nejvýznamnější bit je úplně pravo a pozice bitu zprava odpovídá stavu vstupu. V příkladu nám tedy Quido říká, že zapnuté vstupy jsou 1, 4, 5, 8, 9, 10, 12 a 13.&lt;/p&gt;

&lt;p&gt;Pokud chceme zjistit stav vstupu 1, naivní kód v TapHome skriptovacím jazyce vypadá takto:&lt;/p&gt;

&lt;div class=&quot;language-pascal highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;GETBIT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GETAT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;RECEIVEDBYTES&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;LEGTH&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;RECEIVEDBYTES&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Nejdříve se podíváme na poslední bajt se stavy a v něm se podíváme na nejvýznamnější bit úplně vpravo. Jako listener skript tento snippet funguje nádherně.&lt;/p&gt;

&lt;p&gt;Jedna z limitací je to, že si musíte vybrat předem jaké zařízení je na jakém vstupu. Zpětně měnit nelze. Pokud chci vstup Quida číslo 1 použít jako stavový kontakt, snippet šablony v XML vypadá takto. Navíc oproti třeba tlačítku je přiřazení do proměnné &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Rc&lt;/code&gt; a negace. Kontakt je totiž při stavu 1 uzavřen:&lt;/p&gt;

&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;Device&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;Name&amp;gt;&lt;/span&gt;${bus_module_reed_contact}&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Name&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;Model&amp;gt;&lt;/span&gt;PacketParserReedContact&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Model&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;Id&amp;gt;&lt;/span&gt;-3&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Id&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;DeviceProperties&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;DeviceType&amp;gt;&lt;/span&gt;0&lt;span class=&quot;nt&quot;&gt;&amp;lt;/DeviceType&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;ReadScriptPacketParser&amp;gt;&amp;lt;/ReadScriptPacketParser&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;InternalPollInterval&amp;gt;&lt;/span&gt;2500&lt;span class=&quot;nt&quot;&gt;&amp;lt;/InternalPollInterval&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;CustomVariables&amp;gt;&lt;/span&gt;[]&lt;span class=&quot;nt&quot;&gt;&amp;lt;/CustomVariables&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;ServiceAttributesScriptsPacketParser&amp;gt;&amp;lt;/ServiceAttributesScriptsPacketParser&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;ServiceActionsScriptsPacketParser&amp;gt;&amp;lt;/ServiceActionsScriptsPacketParser&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;ListenerScriptPacketParser&amp;gt;&lt;/span&gt;Rc := !GETBIT(GETAT(RECEIVEDBYTES,LENGTH(RECEIVEDBYTES) - 3), 0);&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ListenerScriptPacketParser&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;OnStateIconId&amp;gt;&lt;/span&gt;87&lt;span class=&quot;nt&quot;&gt;&amp;lt;/OnStateIconId&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;OffStateIconId&amp;gt;&lt;/span&gt;88&lt;span class=&quot;nt&quot;&gt;&amp;lt;/OffStateIconId&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;OnStateName&amp;gt;&lt;/span&gt;${general_open}&lt;span class=&quot;nt&quot;&gt;&amp;lt;/OnStateName&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;OffStateName&amp;gt;&lt;/span&gt;${general_closed}&lt;span class=&quot;nt&quot;&gt;&amp;lt;/OffStateName&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;ReadStateScriptPacketParser&amp;gt;&amp;lt;/ReadStateScriptPacketParser&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/DeviceProperties&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Device&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Celou šablonu teprve dávám dohromady.&lt;/p&gt;
</description>
        <pubDate>Tue, 30 Apr 2024 00:00:00 +0000</pubDate>
        <link>http://honzakasik.cz/2024/04/30/quido-taphome.html</link>
        <guid isPermaLink="true">http://honzakasik.cz/2024/04/30/quido-taphome.html</guid>
        
        <category>smarthome</category>
        
        <category>taphome</category>
        
        
      </item>
    
      <item>
        <title>Back up configuration using Git and Stow</title>
        <description>&lt;p&gt;After I got new work laptop, I needed to transfer some configuration files to it from the old one. This introduced an opportunity to start versioning it, and also providing more flexible backup handle, finally. It surely is not a good idea to set version control above whole &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$HOME&lt;/code&gt;. When looking for solution to this problemi, I stumbled upon GNU Stow.&lt;/p&gt;

&lt;p&gt;Let’s say your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$HOME&lt;/code&gt; looks like this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;.bashrc
.bash_profile
.git
.vim
.vimrc
Desktop
Documents
Downloads
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You surely know that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bash_profile&lt;/code&gt; represent Bash configuration. But how to pass this information to back up solution/versioning system when you want to separate configurations for different software?&lt;/p&gt;

&lt;h2 id=&quot;gnu-stow&quot;&gt;GNU Stow&lt;/h2&gt;

&lt;p&gt;GNU Stow is basically simple symlink management software. Let’s setup directory containing all configuration we want to keep under git as a child of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$HOME&lt;/code&gt; – &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;configuration&lt;/code&gt;. Under this directory we can create dicrectories containing per-software configuration:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;configuration/
├── bash
├── git
└── vim
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;First, let’s move configuration to corresponding directory: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mv .bash* configuration/bash/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;What &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;stow&lt;/code&gt; command does by default is that it takes the contents of folder which is passed as an argument and creates symlinks to this content in parent directory. When &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;stow bash&lt;/code&gt; is called in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;configuration&lt;/code&gt; directory, it takes the files in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bash&lt;/code&gt; directory and in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$HOME&lt;/code&gt; (which is a parent of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;configuration&lt;/code&gt;) creates symlinks to this files.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$HOME&lt;/code&gt; then looks like this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;...
.bash_profile -&amp;gt; configuration/bash/.bash_profile
.bashrc -&amp;gt; configuration/bash/.bashrc
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;version-it&quot;&gt;Version it!&lt;/h2&gt;

&lt;p&gt;The last thing is using git or your preffered VCS to version this configuration. Just run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git init&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git add .&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git commit -m &quot;Initial commit&quot;&lt;/code&gt; in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;configuration&lt;/code&gt; directory and you are all set.&lt;/p&gt;

&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/stow/manual/&quot;&gt;GNU Stow manual&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://git-scm.com/doc&quot;&gt;Git - Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Tue, 16 Oct 2018 00:00:00 +0000</pubDate>
        <link>http://honzakasik.cz/2018/10/16/back-up-configuration-using-stow-and-git.html</link>
        <guid isPermaLink="true">http://honzakasik.cz/2018/10/16/back-up-configuration-using-stow-and-git.html</guid>
        
        <category>git</category>
        
        <category>stow</category>
        
        <category>simple hack</category>
        
        
      </item>
    
      <item>
        <title>Marlin firmware on Anet A8 board</title>
        <description>&lt;p&gt;Are you planning to upgrade your 3D printer to new firmware for any reason? Read my experience and instructions how to do it!&lt;/p&gt;

&lt;h2 id=&quot;do-i-need-it&quot;&gt;Do I need it?&lt;/h2&gt;

&lt;p&gt;You probably already heard about SkyNet 3D - a Marlin firmware modification targeting Anet A6 and Anet A8. Recently, the Marlin firmware started supporting Anet A8, so there is no need for SkyNet anymore. Maybe you are asking what do you get by installing non original firmware. Here are advantages that I found:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;It’s open source&lt;/li&gt;
  &lt;li&gt;It’s configurable&lt;/li&gt;
  &lt;li&gt;It has auto level support&lt;/li&gt;
  &lt;li&gt;Hot end protection is included&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;why-not-skynet-3d&quot;&gt;Why not SkyNet 3D?&lt;/h2&gt;

&lt;p&gt;The main difference between SkyNet 3d and Marlin is how the configuration is done. For example there is a configuration option called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Z_SAFE_HOMING&lt;/code&gt; which allows safe homing of z axis. This means that the z axis is homed after both x and y axis are done on the center of the bed. This becomes useful when you replace your z axis end switch by sensor. This options is enabled on SkyNet firmware by default, but disabled on Marlin firmware by default. Read along if you are interested what I mean by saying “disabled” and how do you configure these options. This looks like the only diference to me.&lt;/p&gt;

&lt;p&gt;Based on this and that I am more into projects on GitHub than projects on Facebook and given that main SkyNet3D support is based on Facebook, everybody suggesting downloading SkyNet 3D firmware from some shady Google drives and latest SkyNet is based on four versions old Marlin – no, thanks, I will rather use Marlin.&lt;/p&gt;

&lt;h2 id=&quot;the-source-code&quot;&gt;The source code&lt;/h2&gt;

&lt;p&gt;Source code? Why do I need that? It’s simple. The whole “firmware update” thing is done through Arduino IDE. This application was originally made for supporting Arduino development boards, so users could create their own programs and load them to the hardware easily. Since Marlin firmware is distributed as a source code targeting this IDE, we will need to go through some of it to make basic configuration changes.&lt;/p&gt;

&lt;h2 id=&quot;instructions&quot;&gt;Instructions&lt;/h2&gt;

&lt;p&gt;First some prerequisites. You will have to download following things:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Arduino IDE – either &lt;a href=&quot;https://www.arduino.cc/en/main/software#download&quot;&gt;download it from website&lt;/a&gt; or if you use Linux, use your distribution’s package manager. I did it on Fedora like this: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dnf install arduino&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/SkyNet3D/anet-board&quot;&gt;Anet A8 board support for Arduino IDE&lt;/a&gt; – you will need “drivers” for your Anet A8 board to upload new firmware to it. Just click on the green “Clone or Download” and choose “Download ZIP”. Then follow attached instructions in README file. Just a note: On Linux, the Arduino folder is created in your home folder after first run of Arduino IDE.&lt;/li&gt;
  &lt;li&gt;Marlin firmware release – visit &lt;a href=&quot;https://github.com/MarlinFirmware/Marlin/releases&quot;&gt;Marlin GitHub’s releases page&lt;/a&gt; and download latest release (it was 1.1.7 in time of writing this article). It is under the link “Source code (zip)” or “Source code (tar.gz)” under the “Assets” header.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you should have installed Arduino IDE, “board drivers” and downloaded Marlin firmware.&lt;/p&gt;

&lt;h3 id=&quot;arduino-ide-configuration&quot;&gt;Arduino IDE configuration&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;Start Arduino IDE&lt;/li&gt;
  &lt;li&gt;If you have properly installed the Anet A8 board support, there should be now option “Anet A8 V1.0” in Board under Tools menu. Go ahead and select it. (do not select the optiboot variant)&lt;/li&gt;
  &lt;li&gt;If you haven’t connected your printer to computer yet, you can connect it now.&lt;/li&gt;
  &lt;li&gt;After you connect the printer, there should be option available under Port in Tools menu. Select it. In my case, there was &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/ttyUSB0&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Next thing is selecting programmer. Select “AVRISP mkII” under Programmer in Tools menu.&lt;/li&gt;
  &lt;li&gt;As a last thing, you have to install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LiquidCrystal.h&lt;/code&gt; library to your Arduino IDE if you still use the original Anet A8 LCD. Just select Sketch -&amp;gt; Include library -&amp;gt; Manage libraries and in Library Manager window search “LiquidCrystal”, then select latest version and click install button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You are ready to use Arduino IDE for compiling and uploading new firmware!&lt;/p&gt;

&lt;h3 id=&quot;firmware-source-code-preparation&quot;&gt;Firmware source code preparation&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;Unzip (extract) downloaded Marlin firmware to some location. Let’s say, that it was extracted to folder named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Marlin-1.1.7&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Open Arduino IDE again and select Open under File open. Navigate to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Marlin-1.1.7/Marlin&lt;/code&gt; and open &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Marlin.ino&lt;/code&gt; file. This will open all source file from Marlin firmware in Arduino IDE.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;firmware-configuration&quot;&gt;Firmware configuration&lt;/h3&gt;

&lt;p&gt;The main file in which all the configuration is made and the only file which you will ever have to edit is called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Configuration.h&lt;/code&gt;. If some error occurs during it is either Marlin bug, missing package in Arduino IDE, or you set something bad in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Configuration.h&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You won’t be using default configuration file, because that would be too much editing to make. Instead, overwrite the default file by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Configuration.h&lt;/code&gt; file from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Marlin-1.1.7/Marlin/example_configurations/Anet/A8&lt;/code&gt; folder:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd Marlin-1.1.7
cp Marlin/example_configurations/Anet/A8/Confiuguration.h Configuration.h
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, if your printer is still connected and you performed everything in instructions, the code should successfully verify when you click on verify button in top left corner. If it verifies, click on upload button to upload new firmware to your Anet A8.&lt;/p&gt;

&lt;p&gt;The configuration itself is dead simple. Just find an option you want to enable and remove comment operator &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;//&lt;/code&gt;. If you want to disable that option, just comment it out. I suggest to enable &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Z_SAFE_HOMING&lt;/code&gt; option.&lt;/p&gt;

&lt;p&gt;After each change you have to save the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Configuration.h&lt;/code&gt; file and &lt;strong&gt;reupload the firmware&lt;/strong&gt; so that the updated options are uploaded too.&lt;/p&gt;
</description>
        <pubDate>Sun, 17 Dec 2017 00:00:00 +0000</pubDate>
        <link>http://honzakasik.cz/2017/12/17/marlin-firmware-anet-a8.html</link>
        <guid isPermaLink="true">http://honzakasik.cz/2017/12/17/marlin-firmware-anet-a8.html</guid>
        
        <category>Anet A8</category>
        
        <category>3D print</category>
        
        
      </item>
    
      <item>
        <title>vpsFree and Nextcloud</title>
        <description>&lt;p&gt;For a long time I used DropBox to keep my files synced between devices. Since the amount of available space on my free account was getting thinner each day, I finally got myself a membership in vpsFree.cz association which provides VPS to its members. For 900 CZK / 36 EUR per three months you get 8 cores CPU, 4096 megabytes of RAM, 120 gigabytes of hard drive space, one IPv4 address and 32 IPv6 addresses plus additional 250 gigabytes space on NAS drive.&lt;/p&gt;

&lt;p&gt;Since I wanted both to solve my file-sync problem and to refresh my knowledge about server configuration, I hopped into it and started. From several operating systems I chose CentOS 7 for my VPS. Initial configuration of SSH and other services was easy, but then the installation of Nextcloud came.&lt;/p&gt;

&lt;p&gt;Luckily I found &lt;a href=&quot;http://www.marksei.com/install-nextcloud-11-centos-7/&quot;&gt;some guide on marksei.com&lt;/a&gt;. Although this guide provides some information it is not complete and some commands are not explained as they should be, so I try to recreate it better.&lt;/p&gt;

&lt;h2 id=&quot;step-1---software-installation&quot;&gt;Step 1 - Software installation&lt;/h2&gt;

&lt;p&gt;Nextcloud requires PHP 5.6 and higher, since there is only PHP 5.4 in CentOS repository you have to get newer version in your system somehow. The easiest way is to use &lt;a href=&quot;https://webtatic.com/projects/yum-repository/&quot;&gt;Webtatic yum repository&lt;/a&gt; which provides up-to-date PHP packages. You can simply install it by running:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There are surely other ways how to get recent PHP to your system. Better way would be to use &lt;a href=&quot;https://www.softwarecollections.org/en/&quot;&gt;Software Collections&lt;/a&gt; but I didn’t have time to find out how to configure PHP from SCL to run with stock httpd. Using Webtatic makes you dependent on repository owner. When he closes up his business, you have to package security patches yourself.&lt;/p&gt;

&lt;p&gt;You will also need &lt;a href=&quot;https://fedoraproject.org/wiki/EPEL&quot;&gt;EPEL repository&lt;/a&gt; enabled. Install it by running:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you used Webtatic repo, you can now install prerequisities for Nextcloud, including httpd, by running:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;yum install httpd php70w php70w-dom php70w-mbstring php70w-gd php70w-pdo php70w-json php70w-xml php70w-zip php70w-curl php70w-mcrypt php70w-pear setroubleshoot-server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;step-2---database-setup&quot;&gt;Step 2 - Database setup&lt;/h2&gt;

&lt;p&gt;Original article offers three options for databases. I rejected SQLite on first glance since I don’t want to solve performance issues - from remaining options I selected MariaDB since, in my opinion, it is more widely used than PostgreSQL and, in case of any problems I will more likely find help.&lt;/p&gt;

&lt;p&gt;You just need to install MariaDB server and PHP hooks by running&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;yum install mariadb-server php70w-mysql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The preffered way how to create initial configuration is to run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;myql_secure_installation&lt;/code&gt; script. In my case I have to start mariadb service first by running&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl start mariadb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and then I was able to finish configuration using mentioned script. Also don’t forget enable starting mariadb service at boot:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl enable mariadb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Last but one step in database setup is configuring database itself. In this step database &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nextcloud&lt;/code&gt; is created along with user &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nc_user&lt;/code&gt; who has all privileges over database &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nextcloud&lt;/code&gt;. When you are done, press CTRL+D to exit.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;CREATE DATABASE nextcloud;
CREATE USER &apos;nc_user&apos;@&apos;localhost&apos; IDENTIFIED BY &apos;YOUR_PASSWORD_HERE&apos;;
NT ALL PRIVILEGES ON nextcloud.* TO &apos;nc_user&apos;@&apos;localhost&apos;;
FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, restart &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;httpd&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl restart httpd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;step-3---installing-nextcloud&quot;&gt;Step 3 - Installing Nextcloud&lt;/h2&gt;

&lt;p&gt;In this case, installation is done in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/var/www&lt;/code&gt;, but you can choose other path at your discretion.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd /var/www
curl -OJ https://download.nextcloud.com/server/releases/latest-11.zip
tar -xvfj latest-11.zip
# set ownership of nextcloud folder to user apache
chown -R apache:apache nextcloud
# remove installation file
rm latest-11.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In original guide there is mentioned apache configuration which causes nextcloud to be running as root server. Since I wanted to run multiple servers on my machine and to use Let’s encrypt for providing https I decided to use VirtualHost configuration:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;VirtualHost *:80&amp;gt;
   ServerName fooserver.com
   DocumentRoot /var/www/nextcloud

   &amp;lt;Directory /var/www/nextcloud&amp;gt;
      Options +FollowSymlinks
      AllowOverride All

      &amp;lt;IfModule mod_dav.c&amp;gt;
         Dav off
      &amp;lt;/IfModule&amp;gt;

      SetEnv HOME /var/www/nextcloud
      SetEnv HTTP_HOME /var/www/nextcloud

   &amp;lt;/Directory&amp;gt;
&amp;lt;/VirtualHost&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Just add this file to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/httpd/conf.d&lt;/code&gt;, restart apache &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemctl restart httpd&lt;/code&gt; and you are set.&lt;/p&gt;

&lt;p&gt;You will now find running Nextcloud at the root path of your server. You can now also point domain to your server’s IP address using A/AAAA DNS record. Alternatively you can also set sub-domain to ServerName and then add corresponding records to DNS configuration.&lt;/p&gt;

&lt;h2 id=&quot;step-4---its-alive&quot;&gt;Step 4 - It’s alive!&lt;/h2&gt;

&lt;p&gt;Since SELinux is not enabled in VPS I didn’t have to jump around SELinux context. The only thing which left is the installation itself. Just navigate to Nextcloud and finish installation using web installer.&lt;/p&gt;

&lt;p&gt;Just don’t forget to enable start httpd at startup:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl enable httpd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;step-5---lets-encrypt&quot;&gt;Step 5 - Let’s encrypt&lt;/h2&gt;

&lt;p&gt;For more private connection to the server just install certbot and run:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;certbot --apache
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and follow directions in interactive guide if you configured ServerName and corresponding DNS records for your domain previously. Voila - you have your own file sync service secured with your own Let’s encrypt certificate. Certbot automatically creates SSL enabled configuration for Apache alongside with redirect to https version of site.&lt;/p&gt;
</description>
        <pubDate>Tue, 21 Mar 2017 00:00:00 +0000</pubDate>
        <link>http://honzakasik.cz/2017/03/21/vspsfree-a-nextcloud.html</link>
        <guid isPermaLink="true">http://honzakasik.cz/2017/03/21/vspsfree-a-nextcloud.html</guid>
        
        <category>android</category>
        
        <category>sys admin</category>
        
        
      </item>
    
      <item>
        <title>Olomoucký Bazén – Neoficiální aplikace olomouckého bazénu</title>
        <description>&lt;p&gt;Aplikace vznikla jako závěrečným projekt v semináři “Tvorba mobilních aplikací”. Přednášejícím byl zkušený vývojář &lt;a href=&quot;http://www.novaklukas.cz/&quot;&gt;Lukáš Novák&lt;/a&gt;, díky čemuž byl seminář opravdu užitečný a dozvěděl jsem se i “pár” nových věcí o vývoji pro Android.&lt;/p&gt;

&lt;p&gt;Co tedy aplikace umí? Vlastně zas tak nic moc. Začal jsem pravidelně plavat a při návštěvě webových stránek bazénu jsem zjistil, že mají na webu i rozpis obsazenosti jednotlivých drah. O optimalizaci pro mobily však nemohla být řeč a tak byl můj záměr jasný. Aplikace tedy dokáže zobrazit obsazenost drah a aktuální počet návštěvníků. Snadno se tak můžu rozhodnout, jestli právě teď půjdu plavat.&lt;/p&gt;

&lt;p&gt;Zdrojem dat pro aplikaci je právě web bazénu. Zdrojové kódy jsou dostupné pod licencí GNU/GPLv3 na &lt;a href=&quot;https://github.com/honza-kasik/OlomouckyBazen&quot;&gt;mém GitHubu&lt;/a&gt; a aplikace je rovněž dostupná z Google Play! Pokud narazíte na problém, kontaktujte mě, nebo vytvořte issue na &lt;a href=&quot;https://github.com/honza-kasik/OlomouckyBazen&quot;&gt;stránce projektu&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Fri, 30 Dec 2016 00:00:00 +0000</pubDate>
        <link>http://honzakasik.cz/2016/12/30/olomoucky-bazen-android-app.html</link>
        <guid isPermaLink="true">http://honzakasik.cz/2016/12/30/olomoucky-bazen-android-app.html</guid>
        
        <category>android</category>
        
        <category>app development</category>
        
        
      </item>
    
      <item>
        <title>Log usage of resources by process in Bash</title>
        <description>&lt;p&gt;One of my responsibilities in Red Hat is Management Console testing in Wildfly. In early development build of one of earlier releases we observed strange behavior in our test environment. Although the machine had a large amount of memory available at the beginning of tests, it always failed on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;java.lang.OutOfMemoryError&lt;/code&gt; when the test suite was running. We had to find out in which parts of tests this happens.&lt;/p&gt;

&lt;p&gt;Since we are using Selenium and the tests are running in Firefox, the obvious solution would be to track amount of memory which the browser is using. But how? We agreed, that the ideal output for our use would be graph showing dependency of used memory on time.&lt;/p&gt;

&lt;p&gt;After I googled a bit I found a &lt;a href=&quot;https://stackoverflow.com/questions/7998302/graphing-a-processs-memory-usage&quot;&gt;question on stackoverflow.com&lt;/a&gt; posted by user who had similar problem. I though, that I could just use solution from the &lt;a href=&quot;http://stackoverflow.com/a/12595110/4402950&quot;&gt;top voted answer&lt;/a&gt; or solution posted by &lt;a href=&quot;http://brunogirin.blogspot.com/2010/09/memory-usage-graphs-with-ps-and-gnuplot.html&quot;&gt;Bruno Girin on his blog&lt;/a&gt; and that’s it. But it was not suitable for our usage. In our test suite there is used a brand new, clean instance of Firefox for each test. Because of that, I had to come up with solution which would track instances of Firefox which pops up on start of each test.&lt;/p&gt;

&lt;p&gt;In Bash script, which can you find on &lt;a href=&quot;https://github.com/honza-kasik/cpu-mem-usage-monitor&quot;&gt;my GitHub&lt;/a&gt;, output of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ps&lt;/code&gt; command with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-o&lt;/code&gt; option to format custom output is used to track these instances. Output in format &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;pid&amp;gt;,&amp;lt;memory-size&amp;gt;,&amp;lt;cpu-usage&amp;gt;&lt;/code&gt; is then saved in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;usage.log&lt;/code&gt; file by default. Path to target file can be changed by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-l &amp;lt;PATH&amp;gt;&lt;/code&gt; option. Only other output is diagnostic log of script, which outputs to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;stdout&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;stderr&lt;/code&gt; by default so you can find out if there are any errors.&lt;/p&gt;

&lt;p&gt;I documented all available options in readme and I believe that the code is simple enough to be self-explanatory if you need any further help. If you have not enabled creating graph simultaneously with log, you can create it anytime later with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gnuplot -c gnuplot.script usage.log usage.png&lt;/code&gt;. In case you need bigger resolution, just edit first line in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gnuplot.script&lt;/code&gt; and replace &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;800,600&lt;/code&gt; in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set term png small size 800,600&lt;/code&gt; by desired resolution and run the command again.&lt;/p&gt;

&lt;h2 id=&quot;useful-links&quot;&gt;Useful links&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/honza-kasik/cpu-mem-usage-monitor&quot;&gt;Script repository on my GitHub&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/7998302/graphing-a-processs-memory-usage&quot;&gt;Inspiration on Stack Overflow&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://brunogirin.blogspot.com/2010/09/memory-usage-graphs-with-ps-and-gnuplot.html&quot;&gt;Inspiration by Bruno Girin on his blog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Fri, 04 Nov 2016 00:00:00 +0000</pubDate>
        <link>http://honzakasik.cz/2016/11/04/log-amount-of-memory-used-by-process-in-bash.html</link>
        <guid isPermaLink="true">http://honzakasik.cz/2016/11/04/log-amount-of-memory-used-by-process-in-bash.html</guid>
        
        
      </item>
    
      <item>
        <title>Remote files discovery – my first script in Python</title>
        <description>&lt;p&gt;A few years ago I ran into problem. And by solving this problem I was very enriched of new experience and it was also my first practice in open source. The problem was simple: I was given SFTP access to a server and I was ordered to check regularly for new files. First few weeks I’ve been doing this, but after a while I started to forgot. Back then, it was my first job as a web admin and JavaScript was closest to programming so far.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://askubuntu.com/questions/576927/get-notified-about-new-files-on-sftp-server/689242&quot;&gt;My question on askubuntu.com&lt;/a&gt; didn’t bring a solution, so I have decided to make a script to check for new files for me. Since I didn’t want to use solution on server side (which I didn’t have access to), because the maintaining would be more difficult, I have chosen to write a client script in Python for it.&lt;/p&gt;

&lt;p&gt;The script works flawlessly now, using TinyDB to store differences between locally saved state and current state of files on server. You just need to have your public SSH key on server and correctly configure the script in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;configuration.ini&lt;/code&gt; file. The scripts connect to server and it will do everything by itself.&lt;/p&gt;

&lt;p&gt;It was running on Raspberry Pi 2 and probably would run on an original Pi too, I just bought this one, since it was just released and after I bought it I didn’t have to run it on my machine again. Just one Cron entry on Raspbian and that was it.&lt;/p&gt;

&lt;p&gt;If you run into any problems, logging is used and you can look in file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;last-log.log&lt;/code&gt; for any issues.&lt;/p&gt;

&lt;p&gt;The script can be downloaded on my GitHub: &lt;a href=&quot;https://github.com/honza-kasik/check-for-files&quot;&gt;https://github.com/honza-kasik/check-for-files&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Wed, 26 Oct 2016 00:00:00 +0000</pubDate>
        <link>http://honzakasik.cz/2016/10/26/check-for-files.html</link>
        <guid isPermaLink="true">http://honzakasik.cz/2016/10/26/check-for-files.html</guid>
        
        
      </item>
    
      <item>
        <title>LaTeX v Atomu na Fedoře</title>
        <description>&lt;p&gt;Nedávno jsem kvůli psaní bakalářské práce a dalších věcí v LaTeXu hledal nějaký rozumný editor, který by mi v tom pomohl. Na editaci menších věcí v HTML nebo Markdown běžně používám Atom a po doporučení jsem se jej rozhodl použít i pro LaTeX.&lt;/p&gt;

&lt;p&gt;Ve Fedoře 23 používám Atom z repozitáře &lt;a href=&quot;https://copr.fedorainfracloud.org/coprs/mosquito/atom/&quot;&gt;mosquito/atom&lt;/a&gt;, ve kterém přibývají aktualizace rychleji než v &lt;a href=&quot;https://copr.fedorainfracloud.org/coprs/helber/atom/&quot;&gt;helber/atom&lt;/a&gt;. Jako vhodný doplňek pro LaTeX se osvědčil https://github.com/thomasjo/atom-latex - nabízí širokou škálu nastavení – od vlastního LaTex builder přes prohlížeč PDF až po LaTeX engine.&lt;/p&gt;

&lt;p&gt;Pro zprovoznění ve Fedoře jej stačí nainstalovat pomocí správce balíčků přítomného v Atomu nebo pomocí &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apm install latex&lt;/code&gt;. Pak už jen stačí v *.tex dokumentu stisknout kombinaci Ctrl+Alt+B a dokument by se měl zkompilovat. Může se stát, že se zobrazí chyba. V tom případě zřejmě nemáte nainstalovanou distribuci TexLive ve své instalaci Fedory nebo vám jen chybí balíček &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;latexmk&lt;/code&gt;, na kterém doplněk závisí a který není běžnou součástí distribuce.&lt;/p&gt;

&lt;p&gt;Po doinstalování potřebných závislostí – LaTex distribuce a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;latexmk&lt;/code&gt; vše dobře funguje. Mě se navíc osvědčilo povolit možnost zkompilovaní dokumentu po uložení. Nutno také podotknout, že balíček obsahuje pouze nástroje pro usnadnění kompilace. Pokud tedy potřebujete zvýraznění syntaxe, nainstalujte si ještě atom balíček &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;language-latex&lt;/code&gt; Ve výsledku je tedy Atom použitelným LaTeX editorem.&lt;/p&gt;
</description>
        <pubDate>Tue, 03 May 2016 00:00:00 +0000</pubDate>
        <link>http://honzakasik.cz/2016/05/03/latex-v-atomu.html</link>
        <guid isPermaLink="true">http://honzakasik.cz/2016/05/03/latex-v-atomu.html</guid>
        
        
      </item>
    
  </channel>
</rss>
