<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Flint 2 on Michael’s Domain</title><link>https://jeltsch.org/en/tags/flint-2/</link><description>Recent content in Flint 2 on Michael’s Domain</description><generator>Hugo</generator><language>en-us</language><copyright>Copyright © 2002 - 2026 Michael Jeltsch.</copyright><lastBuildDate>Fri, 24 Jul 2026 00:18:18 +0300</lastBuildDate><atom:link href="https://jeltsch.org/en/tags/flint-2/index.xml" rel="self" type="application/rss+xml"/><item><title>Python rules our plants</title><link>https://jeltsch.org/en/flint2/</link><pubDate>Wed, 24 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeltsch.org/en/flint2/</guid><description>&lt;p&gt;In 2025, we updated our 12-year-old router (the Asus RT-AC66U, WiFi 5/IEEE 802.11ac) and replaced it with a WiFI 6 
 &lt;a href="https://www.gl-inet.com/products/gl-mt6000/" target="_blank" rel="noopener noreferrer nofollow"&gt;Flint 2 (GL-MT6000)&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
. While the default user interface of the Flint 2 is pretty basic, its advanced setup is a powerhouse. When you click &amp;ldquo;Advanced Setup&amp;rdquo;, you can access the underlying 
 &lt;a href="https://openwrt.org/" target="_blank" rel="noopener noreferrer nofollow"&gt;OpenWRT&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 user interface. OpenWRT is a Linux distribution for routers. And unsurprisingly, it is very powerful. A year ago, we started to use a 
 &lt;a href="https://phlizon.eu/products/phlizon-pl1000-qb-full-spectrum-led-grow-light" target="_blank" rel="noopener noreferrer nofollow"&gt;LED array&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 to help our plants survive the winter. To automatically operate the lights, we use a 
 &lt;a href="https://kb.shelly.cloud/knowledge-base/shelly-plus-plug-s-v2" target="_blank" rel="noopener noreferrer nofollow"&gt;Shelly smart plug&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 via a Python script that calculates the light levels and electricity prices (using 
 &lt;a href="https://www.sahkonhintatanaan.fi/sahkon-hinta-api" target="_blank" rel="noopener noreferrer nofollow"&gt;the sähkönhintatänään API&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 to get the price data) and switches the plant lights only on when both light levels and electricity prices are low. Today, we moved this Python script from my desktop computer to the Flint 2 router. There are thousands of installable packages available for OpenWRT (directly from the router UI: Applications &amp;gt; Plug-ins). To make my Python script work on the router, we first needed to install the openssh-server to get shell access (btw. the p/l combo is root/&amp;ldquo;same password as for the web UI&amp;rdquo;, the router correctly opens the access only to the local network). We also installed python3 and python3-pip and then pip-installed the two non-standard packages 
 &lt;a href="https://pypi.org/project/ShellyPy/" target="_blank" rel="noopener noreferrer nofollow"&gt;ShellyPy&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 (to address the smart plugs) and 
 &lt;a href="https://pypi.org/project/astral/" target="_blank" rel="noopener noreferrer nofollow"&gt;astral&amp;nbsp;






 
 
 
 &lt;svg class="svg-inline--fa fas fa-up-right-from-square fa-2xs" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 512 512" overflow="visible"&gt;&lt;use href="#fas-up-right-from-square"&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/a&gt;
 (to calculate the dark/bright periods for any given day at Helsinki latitude, which is around 60°North). We just needed to add an entry to the crontab to run the script once every hour. Since you are logged in as root, you just need to execute crontab -e and add this line to the crontab &lt;code&gt;0 * * * * python3 /root/plantlight.py&lt;/code&gt; and restart the cron daemon (which you can do via the OpenWRT UI under &amp;ldquo;System &amp;gt; Startup&amp;rdquo;).&lt;/p&gt;</description></item></channel></rss>