aboutsummaryrefslogtreecommitdiff
path: root/public/simple-world-clock-with-eiink-display-and-raspberry-pi-zero.html
diff options
context:
space:
mode:
Diffstat (limited to 'public/simple-world-clock-with-eiink-display-and-raspberry-pi-zero.html')
-rwxr-xr-xpublic/simple-world-clock-with-eiink-display-and-raspberry-pi-zero.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/public/simple-world-clock-with-eiink-display-and-raspberry-pi-zero.html b/public/simple-world-clock-with-eiink-display-and-raspberry-pi-zero.html
index 09db436..fe62dc5 100755
--- a/public/simple-world-clock-with-eiink-display-and-raspberry-pi-zero.html
+++ b/public/simple-world-clock-with-eiink-display-and-raspberry-pi-zero.html
@@ -1,4 +1,4 @@
1<!doctype html><html lang=en-us><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="JBMAFP - github.com/mitjafelicijan/jbmafp"><link href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL69vf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv76+/8LBwQkAAAAAAAAAAAAAAAC+vb3/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL+9vf/Bv78JAAAAAAAAAAAAAAAAu7q6/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC7ubr/vr29CAAAAAAAAAAAy8nJAZ6foP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnqGj/6GipAoAAAAAHLjU/xcXHf/BwsL/I8XY/yPK3v8XGiD/IbjL/yPF2f8XGiD/Fxkf/yLF2f8gnK3/Fxog/62ztv8fwNf/FRcd/x271v8mz93/GRsi/xkXHf8p097/GiIp/xobIv8p0t3/KdPe/xocIv8fYmr/KNPe/xoZH/8aHCL/J87c/xy81/8VFxz/IsPZ/8zS0/8XGiD/Ir/R/yPH2/8XGiD/Fxkf/yPH2/8dd4T/GBog/yPJ3f8jyNr/uru9/xcUGv8cudb/EhITDKi5vRKlvMP/RUpOERwcHRAdOj4QHTk8EBwdHRAdNTgQHTo/EBwcHRAcHB0QSGduEKW4vf+koqQfHzg+EBqz0ewSFRv7EyMr/xq51vsTERb7ExUb+xq41fsau9j7ExUb+xiPp/sZudb7ExUb+xMVG/sZuNX/GKvI/BIUGfMdvdn/IrfL/xcaIP8n1eb/J9Dh/xkcIf8ZGR7/J8/f/xxCSv8ZGyH/J9Dg/ybQ4P8ZHCL/FSQs/yPK3/8UExj/GE1b/ybS5P8ZGB7/Ghwj/ynW5P8p2Ob/Ghwi/yWrtv8p1eH/Ghwi/xocIv8p1uT/J8XT/xkcIv8m1un/Hb7d/xUYH/8hzOr/HtHu/xcaIf8XGB//I8vi/xgxOv8XGSD/I8rg/yPK4P8XGiD/GUFL/yPP6f8SERj/Fhkh/x3A4f8AAAAAJ2f9/ydr//8mZPH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlYu38J2v//ydo/f8AAAAAAAAAAAd8/fkFqf//Iob8sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMY39awWr//8FfP3/AAAAAAAAAAAFm/7/SfD//wR+/f8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOB/f9B7v//BaX+/wAAAAAAAAAAQ878SAyZ/v9n1v4KAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADu9v8DDJb+/z3N/XgAAAAA3/sAAN/7AADf+wAA3/sAAAAAAAAAAAAAAAAAAN/7AAAAAAAAAAAAAAAAAAAAAAAAj/EAAI/5AACP8QAA3/sAAA==" rel=icon type=image/x-icon><title>Simple world clock with eInk display and Raspberry Pi Zero</title><meta name=description content="Our team is spread across the world, from the USA all the way to Australia, sohaving some sort of world clock makes sense."><meta name=author content="Mitja Felicijan"><link rel=alternate type=application/rss+xml title="Mitja Felicijan's posts" href=https://mitjafelicijan.com/index.xml><link rel=alternate type=application/rss+xml title="Mitja Felicijan's notes" href=https://mitjafelicijan.com/notes.xml><style>:root{--border-color:gainsboro;--border-size:2px;--link-color:blue;--bg-color:#eee}body{padding:2.5rem;max-width:1900px;background:#fff;font-family:sans-serif;line-height:1.35rem;font-size:16px}hr{border:0;border-bottom:var(--border-size)solid var(--border-color);margin-block-start:1.5rem}a{color:var(--link-color);text-decoration:none}h1,h2,h3{line-height:initial}h1{font-size:xx-large}footer{margin-block-start:2rem}cap{text-transform:capitalize}blockquote{font-style:italic}table{max-width:100%;border:var(--border-size)solid var(--border-color);border-collapse:separate;border-spacing:0}table thead tr th{border-bottom:var(--border-size)solid var(--border-color);text-align:left}table th,table td{padding:.5em .8em}ul.list li{padding:.2em 0}ul{line-height:1.35em}pre{text-wrap:nowrap;overflow-x:auto;padding:0 1em;border:var(--border-size)solid var(--border-color)}code{padding:0 3px;font-size:14px;border:0;background:var(--bg-color)}pre code{line-height:1.3em;background:#fff}pre,code,pre *,code *{font-family:monospace}figure{margin-inline-start:0;margin-inline-end:0}figure img{}figcaption{text-align:center}figcaption p{margin:.3em 0 0}img,video,audio{width:800px;max-width:100%;border:var(--border-size)solid var(--border-color);padding:.5em}header nav{display:flex;gap:.9rem}article iframe{margin:0!important}audio::-webkit-media-controls-enclosure{border-radius:0}@media only screen and (max-width:600px){body{padding:.5em;word-wrap:break-word}header nav{gap:.7rem}header nav .hob{display:none}a{word-wrap:break-word}}</style><header><nav class=main itemscope itemtype=http://schema.org/SiteNavigationElement role=toolbar><a href=/>Home</a> 1<!doctype html><html lang=en-us><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="JBMAFP - github.com/mitjafelicijan/jbmafp"><link href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAA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SERj/Fhkh/x3A4f8AAAAAJ2f9/ydr//8mZPH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlYu38J2v//ydo/f8AAAAAAAAAAAd8/fkFqf//Iob8sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMY39awWr//8FfP3/AAAAAAAAAAAFm/7/SfD//wR+/f8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOB/f9B7v//BaX+/wAAAAAAAAAAQ878SAyZ/v9n1v4KAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADu9v8DDJb+/z3N/XgAAAAA3/sAAN/7AADf+wAA3/sAAAAAAAAAAAAAAAAAAN/7AAAAAAAAAAAAAAAAAAAAAAAAj/EAAI/5AACP8QAA3/sAAA==" rel=icon type=image/x-icon><title>Simple world clock with eInk display and Raspberry Pi Zero</title><meta name=description content="Our team is spread across the world, from the USA all the way to Australia, sohaving some sort of world clock makes sense."><meta name=author content="Mitja Felicijan"><link rel=alternate type=application/rss+xml title="Mitja Felicijan's posts" href=https://mitjafelicijan.com/index.xml><link rel=alternate type=application/rss+xml title="Mitja Felicijan's notes" href=https://mitjafelicijan.com/notes.xml><style>:root{--border-color:gainsboro;--border-size:2px;--link-color:blue;--bg-color:#eee}*::selection{background:var(--link-color);color:#fff}*::-moz-selection{background:var(--link-color);color:#fff}*::-webkit-selection{background:var(--link-color);color:#fff}body{padding:2.5rem;max-width:1900px;background:#fff;font-family:sans-serif;line-height:1.35rem;font-size:16px}hr{border:0;border-bottom:var(--border-size)solid var(--border-color);margin-block-start:1.5rem}a{color:var(--link-color);text-decoration:none}h1,h2,h3{line-height:initial}h1{font-size:xx-large}footer{margin-block-start:2rem}cap{text-transform:capitalize}blockquote{font-style:italic}table{max-width:100%;border:var(--border-size)solid var(--border-color);border-collapse:separate;border-spacing:0}table thead tr th{border-bottom:var(--border-size)solid var(--border-color);text-align:left}table th,table td{padding:.5em .8em}ul.list li{padding:.2em 0}ul{line-height:1.35em}pre{text-wrap:nowrap;overflow-x:auto;padding:0 1em;border:var(--border-size)solid var(--border-color)}code{padding:0 3px;font-size:14px;border:0;background:var(--bg-color)}pre code{line-height:1.3em;background:#fff}pre,code,pre *,code *{font-family:monospace}figure{margin-inline-start:0;margin-inline-end:0}figure img{}figcaption{text-align:center}figcaption p{margin:.3em 0 0}img,video,audio{width:800px;max-width:100%;border:var(--border-size)solid var(--border-color);padding:.5em}header nav{display:flex;gap:.9rem}article iframe{margin:0!important}audio::-webkit-media-controls-enclosure{border-radius:0}@media only screen and (max-width:600px){body{padding:.5em;word-wrap:break-word}header nav{gap:.7rem}header nav .hob{display:none}a{word-wrap:break-word}}</style><header><nav class=main itemscope itemtype=http://schema.org/SiteNavigationElement role=toolbar><a href=/>Home</a>
2<a href=/#posts>Posts</a> 2<a href=/#posts>Posts</a>
3<a href=/#notes>Notes</a> 3<a href=/#notes>Notes</a>
4<a href=/#sideprojects class=hob>Side Projects</a> 4<a href=/#sideprojects class=hob>Side Projects</a>
@@ -15,7 +15,7 @@ project.<p>A while ago I bought a small eInk display <a href="https://shop.pimor
15pHAT</a> and I 15pHAT</a> and I
16have a bunch of <a href=https://www.raspberrypi.org/products/raspberry-pi-zero/>Raspberry Pi's 16have a bunch of <a href=https://www.raspberrypi.org/products/raspberry-pi-zero/>Raspberry Pi's
17Zero</a> lying around that 17Zero</a> lying around that
18I really need to use.<figure><img src=/posts/world-clock/hardware.jpg alt="Inky pHAT, Raspberry Pi Zero"></figure><p>Since the Inky <a href="https://shop.pimoroni.com/products/inky-phat?variant=12549254217811">Inky 18I really need to use.<figure><img loading="lazy" src=/posts/world-clock/hardware.jpg alt="Inky pHAT, Raspberry Pi Zero"></figure><p>Since the Inky <a href="https://shop.pimoroni.com/products/inky-phat?variant=12549254217811">Inky
19pHAT</a> is 19pHAT</a> is
20essentially a HAT, it can easily be added on top of the <a href=https://www.raspberrypi.org/products/raspberry-pi-zero/>Raspberry Pi 20essentially a HAT, it can easily be added on top of the <a href=https://www.raspberrypi.org/products/raspberry-pi-zero/>Raspberry Pi
21Zero</a>.<p>First, I installed the necessary software on Raspberry Pi with <code>pip3 install inky</code>.<p>And then I created a file <code>clock.py</code> in home directory <code>/home/pi</code>.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span><span style=color:green>#!/usr/bin/env python</span> 21Zero</a>.<p>First, I installed the necessary software on Raspberry Pi with <code>pip3 install inky</code>.<p>And then I created a file <code>clock.py</code> in home directory <code>/home/pi</code>.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span><span style=color:green>#!/usr/bin/env python</span>
@@ -62,7 +62,7 @@ Zero</a>.<p>First, I installed the necessary software on Raspberry Pi with <code
62</span></span><span style=display:flex><span>board.show() 62</span></span><span style=display:flex><span>board.show()
63</span></span></code></pre><p>And because eInk displays are rather slow to refresh and the clock requires 63</span></span></code></pre><p>And because eInk displays are rather slow to refresh and the clock requires
64refreshing only once a minute, this can be done through cronjob.<p>Before we add this job to cron we need to make <code>clock.py</code> executable with <code>chmod +x clock.py</code>.<p>Then we add a cronjob with <code>crontab -e</code>.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span>* * * * * /home/pi/clock.py 64refreshing only once a minute, this can be done through cronjob.<p>Before we add this job to cron we need to make <code>clock.py</code> executable with <code>chmod +x clock.py</code>.<p>Then we add a cronjob with <code>crontab -e</code>.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span>* * * * * /home/pi/clock.py
65</span></span></code></pre><p>So, we end up with a result like this.<figure><img src=/posts/world-clock/world-clock.jpg alt="World Clock"></figure><p>And for the enclosure that can be 3D printed, but I haven't yet something like 65</span></span></code></pre><p>So, we end up with a result like this.<figure><img loading="lazy" src=/posts/world-clock/world-clock.jpg alt="World Clock"></figure><p>And for the enclosure that can be 3D printed, but I haven't yet something like
66this can be used.</p><iframe id=vs_iframe src="https://www.viewstl.com/?embedded&url=https%3A%2F%2Fmitjafelicijan.com%2Fposts%2Fworld-clock%2Fenclosure.stl&color=gray&bgcolor=white&edges=no&orientation=front&noborder=no" style=border:0;margin:0;width:100%;height:400px></iframe><p>You can download my <a href=/posts/world-clock/enclosure.stl>STL file for the enclosure 66this can be used.</p><iframe id=vs_iframe src="https://www.viewstl.com/?embedded&url=https%3A%2F%2Fmitjafelicijan.com%2Fposts%2Fworld-clock%2Fenclosure.stl&color=gray&bgcolor=white&edges=no&orientation=front&noborder=no" style=border:0;margin:0;width:100%;height:400px></iframe><p>You can download my <a href=/posts/world-clock/enclosure.stl>STL file for the enclosure
67here</a>, but make sure that dimensions make 67here</a>, but make sure that dimensions make
68sense and also opening for USB port should be added or just use a drill and some 68sense and also opening for USB port should be added or just use a drill and some