<?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>eink Archives - Digital Urban</title>
	<atom:link href="https://www.digitalurban.org/blog/tag/eink/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.digitalurban.org/blog/tag/eink/</link>
	<description>Data, Cities, IoT, Writing, Music and Making Things</description>
	<lastBuildDate>Wed, 24 Feb 2021 22:40:44 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.digitalurban.org/wp-content/uploads/2012/07/Dulogosm-1.png</url>
	<title>eink Archives - Digital Urban</title>
	<link>https://www.digitalurban.org/blog/tag/eink/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Node.JS, Node Express and Puppeteer for Epaper / EInk Displays: How to Open a Web Page &#038; Save as an Image</title>
		<link>https://www.digitalurban.org/blog/2021/02/24/node-js-node-express-and-puppeteer-for-epaper-eink-displays-how-to-open-a-web-page-save-as-an-image-2/</link>
					<comments>https://www.digitalurban.org/blog/2021/02/24/node-js-node-express-and-puppeteer-for-epaper-eink-displays-how-to-open-a-web-page-save-as-an-image-2/#comments</comments>
		
		<dc:creator><![CDATA[Andy]]></dc:creator>
		<pubDate>Wed, 24 Feb 2021 22:40:44 +0000</pubDate>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[eink]]></category>
		<category><![CDATA[epaper]]></category>
		<category><![CDATA[inkpate]]></category>
		<category><![CDATA[kindle]]></category>
		<category><![CDATA[node express]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[puppeteer]]></category>
		<guid isPermaLink="false">http://www.digitalurban.org/?p=5929</guid>

					<description><![CDATA[<p>The post <a href="https://www.digitalurban.org/blog/2021/02/24/node-js-node-express-and-puppeteer-for-epaper-eink-displays-how-to-open-a-web-page-save-as-an-image-2/">Node.JS, Node Express and Puppeteer for Epaper / EInk Displays: How to Open a Web Page &#038; Save as an Image</a> appeared first on <a href="https://www.digitalurban.org">Digital Urban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
		<div id="fws_69740e90f3b21"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row top-level"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				
<div class="wpb_text_column wpb_content_element " >
	<div class="wpb_wrapper">
		<p class="has-drop-cap">Sometimes there is a need to step back and do things as simply as possible. EInk / Epaper screens are amazing, they carrying on showing an image with zero power and the screens have a certain clarity that is hard to achieve with more standard LED offerings. The more difficult part is getting content onto them, especially content that is well designed and fits the screen.</p>
<p>&nbsp;</p>
<figure class="wp-block-pullquote">
<blockquote>
<p>Puppeteer can do many things but for our use it allows the Pi to open a webpage, take a screengrab, save it as an image and then close. This image can subsequently be served via Node Express and viewed on an eInk screen.</p>
</blockquote>
</figure>
<p>To make the most of eInk/epaper screens you generally grab some information using a microcontroller, such as a Node MCU or ESP32, send it to the screen and then power down. This means you can check for new information over a period of time, say, every 15 minutes, display it and then sleep, allowing your screen to be battery powered for weeks on end.</p>
<p>&nbsp;</p>
<div class="wp-block-media-text alignwide is-stacked-on-mobile">
<figure class="wp-block-media-text__media"><img decoding="async" class="wp-image-5942 size-full" src="http://www.digitalurban.org/wp-content/uploads/2021/02/Nighttimeside-1024x867.jpg" alt="Inkplate 6 Case" /></figure>
<div class="wp-block-media-text__content">
<p>At the moment we are using the amazing <a href="https://inkplate.io/">InkPlate 6.</a> The InkPlate 6 is built around a recycled Kindle Screen and has a built-in ESP32 controller, a lithium battery connecter/charger and perhaps, more importantly, an easy to understand library to display an image and then sleep. In the world of eInk screens, the importance of an easy to understand library really cannot be understated, some of them are notably complex. We have published the <a href="https://www.thingiverse.com/thing:4729759">3D printable case to Thingiverse</a> so all you need is the InkPlate (or any other screen you want to display an image on), a script to load a webpage and some Node JS to grab the information you want to display.</p>
</div>
</div>
<p>&nbsp;</p>
<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile">
<figure class="wp-block-media-text__media"><img decoding="async" class="wp-image-5933 size-full" src="http://www.digitalurban.org/wp-content/uploads/2021/02/IMG_2865-1024x768.jpg" alt="windy.com on an eink screen" /></figure>
<div class="wp-block-media-text__content">
<p>We are using 3 variations of the same script on our ePaper display, one to grab a webpage showing environmental information, a second decoding a weather forecast from the Met Office, another showing a Rainfall radar and we cycle these every 15 minutes with the environmental information showing twice in the hour.</p>
</div>
</div>
<p><!-- /wp:post-content -->The information can of course be any web page you want to display, from a news site,  a social network feed, transport information or anything you want to show.</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph --><strong>Ingredients</strong></p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:list {"ordered":true} --></p>
<ol>
<li>You will need a device capable of running Node JS, we are using a Raspberry Pi 4. We assume here that you have a Pi up and running with the full operating system installed, if not then take a look at the main<a href="https://www.raspberrypi.org/documentation/installation/installing-images/" target="_blank" rel="noreferrer noopener"> Pi site</a> for details on how to set up. If you need any help then drop us a line in the comments and we can expand this section as needs be.</li>
<li>Optional: An eInk screen and controller &#8211; we are using the <a href="https://inkplate.io/" target="_blank" rel="noreferrer noopener">InkPlate 6</a> and our code to load the image once grabbed is now <a href="https://github.com/digitalurban/InkPlate6WebImage">available on GitHub</a>. There are a number of eInk/epaper screens, the most popular ones being made by WaveShare. These will also work if you edit the example code from the libraries that allow the display of online images. Of course, you may simply want to have an automated screengrab of a webpage. Such things are useful in Unity3D to make Augmented Reality displays, for example.</li>
</ol>
<p><!-- /wp:list --></p>
<p><!-- wp:paragraph --><strong>Installing Node JS</strong></p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->The first part is to install Node.JS, thankfully Node is quick and easy to install &#8211; in your terminal enter:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>$ curl -sL https://deb.nodesource.com/setup_15.10.0 | sudo -E bash -</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->The 15.10.0 represent the current version as of February 2021, change this number to the latest version as needs be &#8211; you can find out the current release via the <a href="https://nodejs.org/en/download/current/" target="_blank" rel="noreferrer noopener">main Node JS site.</a> You have now made your Pi aware of where to find Node.</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph --> The next step is to install it:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>sudo apt install nodejs</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->To check all is in place you can run:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>node -v</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->This will tell you the version of Node you are running. You have installed Node, well done, now for the Puppeteer library.</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph --><strong>Installing and Configuring Puppeteer</strong></p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->Puppeteer is a library for Node.js that allows for the control of the Chrome browser in headerless mode (i.e. you dont see it happening). This allows you to open a web page, do something with it &#8211; in our case take a screenshot &#8211; and then close chrome, all via a simple script.</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->Installing Puppeteer is all via a single line in the terminal:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>npm i puppeteer --save</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->Now you have Node.js and Puppeteer installed, all you need now is to create a script to tell Node what to do:</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->We like to start a new script in a new directory called &#8216;Scripts&#8217; (although it can be anywhere).</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->So firstly create a new directory via the terminal:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>mkdir Scripts</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->Now create your first empty script, we are going to call ours &#8216;webpage.js&#8217;:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>sudo nano webpage.js</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->Below is the javascript to cut and paste into your new script:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>const puppeteer = require('puppeteer');
async function timeout(ms) {
  return new Promise(resolve =&gt; setTimeout(resolve, ms));
}
(async () =&gt; {
let browser = await puppeteer.launch({
          headless: true,
          executablePath: '/usr/bin/chromium-browser',
//          args: ['--no-sandbox', '--disable-setuid-sandbox']
  });
  const page = await browser.newPage();
  await page.goto('http:YourWebPageURL');
// 5 second timeout: allows the page to fully render before taking the screenshot
  await timeout(5000);
  await page.setViewport({ width: 800, height: 600});
  await page.screenshot({path: '/home/pi/Scripts/eink.jpg'});
  await browser.close();
})();
</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->The main parts to note above are the http: where you need to add in the webpage you want to capture and the width and height of the page. This should be changed according to the resolution of your screen, the InkPlate 6 runs at 800&#215;600 resolution. The script opens the URL, waits 5 seconds for it to fully load and then saves a screenshot as a jpg to the location of your choice.</p>
<p>To run your script:</p>
<p><code>node webpage.js</code><br /><!-- /wp:paragraph --></p>
<p>The script should now run, load a webpage and save the image to your Pi.</p>
<p><!-- wp:paragraph -->If you are running your eInk display direct from your Pi (such as using a Waveshare screen) you can stop here and point your display to the new image. If however, you are using a screen elsewhere on your network you will need to host it, this is where Node Express comes in.</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph --><strong>Installing Node Express</strong></p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->As with Node and Puppeteer installing is via a simple one line command:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>npm install express --save</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->To start the server and host the image, you need another script. So the same as before, create a script, we called ours server.js:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>sudo nano server.js</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->Cut and paste the following:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>var express = require('express');
var app = express();
var path = require('path');
var public = path.join(__dirname, 'public');
// viewed at http://localhost:8080
app.get('/', function(req, res) {
    res.sendFile(path.join(public, 'index.html'));
});
app.use('/', express.static(public));
app.listen(8080);</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->The above script runs a server at http://localhost:8080 where you can install a welcome page (index.html) if you wish but more importantly you can serve static files, in our case our screen grab eink.jpg. Note that the folder address is &#8216;public&#8217; this is where you will host your files.</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->In our first script we now want to edit the folder where our image is saved, so we can host it as soon as it is created, so simply edit the file, (again using sudo nano webpage.js) to include the &#8216;public&#8217; directory -ie /home/pi/Scripts/public/eink.jpg</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->If you now go to either http://localhost:8080/eink.jpg on the host machine or your http://<em>Your IP of the PI:</em>8080/eink.jpg you should be able to view the jpg.</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->All that needs to be done now is to start the server when the Pi boots and to run the webpage script every set period of time. To load different webpages simply clone the webpage.js script but with a different URL to grab and run it at a different time, as mentioned, we run 4 scripts an hour via cron jobs.</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph --><strong>Cron Jobs</strong></p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->The final part is to run the server at boot and the script every 15 minutes.</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->Firstly go to your root directory by typing:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>cd:</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->Now we want to install a new Cron Job, or edit one we have already set up:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>sudo crontab -e</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->At the end of the file that opens add the following lines:</p>
<p><!-- /wp:paragraph --></p>
<p>&nbsp;</p>
<p><!-- wp:code --></p>
<pre class="wp-block-code"><code>@reboot sudo /usr/bin/node /home/pi/Scripts/server.js
15 * * * * /usr/bin/node /home/pi/Scripts/webpage.js</code></pre>
<p><!-- /wp:code --></p>
<p><!-- wp:paragraph -->Whenever the Pi reboots it will now start the server &#8211; via your server.js script and every 15 minutes run your webpage.js script to take an image of a webpage, which you can subsequently point your eInk screen to load.</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->It may feel like a number of hoops to jump through for a simple screengrab, but once running it opens up the wider world of Node.js and Puppeteer as well as the ability to use your eInk screen to display any webpage you want.</p>
<p><!-- /wp:paragraph --></p>
<p><!-- wp:paragraph -->I hope this has been useful, do drop me a line in the comments with any thoughts or tweet me <a href="https://twitter.com/digitalurban" target="_blank" rel="noreferrer noopener">@digitalurban</a>. It&#8217;s part of a series of new &#8216;how to&#8217;s&#8217; here on <a href="https://digitalurban.org/">digitalurban.org </a>and over at <a href="https://connected-environments.org/" target="_blank" rel="noreferrer noopener">https://connected-environments.org/</a></p>
<p><!-- /wp:paragraph --><br /><!-- wp:paragraph --><!-- /wp:paragraph --> </p>
	</div>
</div>




			</div> 
		</div>
	</div> 
</div></div><p>The post <a href="https://www.digitalurban.org/blog/2021/02/24/node-js-node-express-and-puppeteer-for-epaper-eink-displays-how-to-open-a-web-page-save-as-an-image-2/">Node.JS, Node Express and Puppeteer for Epaper / EInk Displays: How to Open a Web Page &#038; Save as an Image</a> appeared first on <a href="https://www.digitalurban.org">Digital Urban</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.digitalurban.org/blog/2021/02/24/node-js-node-express-and-puppeteer-for-epaper-eink-displays-how-to-open-a-web-page-save-as-an-image-2/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Make an eInk MQTT Reader for the Time, News and Environmental Data</title>
		<link>https://www.digitalurban.org/blog/2020/04/10/the/</link>
		
		<dc:creator><![CDATA[Andy]]></dc:creator>
		<pubDate>Fri, 10 Apr 2020 14:10:45 +0000</pubDate>
				<category><![CDATA[Making]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[data display]]></category>
		<category><![CDATA[eink]]></category>
		<category><![CDATA[inkyWHAT]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[mqtt]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">https://www.connected-environments.org/?p=437</guid>

					<description><![CDATA[<p>The post <a href="https://www.digitalurban.org/blog/2020/04/10/the/">Make an eInk MQTT Reader for the Time, News and Environmental Data</a> appeared first on <a href="https://www.digitalurban.org">Digital Urban</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div id="fws_69740e9107571"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				
<div class="wpb_text_column wpb_content_element " >
	<div class="wpb_wrapper">
		<p><strong>&#8216;THE&#8217; is a mini MQTT Information Display for Time, News and Environmental Information.  </strong>Using a 4.2-inch eInk screen, its concept is simple &#8211; to display information on a rotational basis, updating every couple of minutes. The data can be any feed &#8211; from the latest news headlines through to your smart home, energy usage, live local environmental conditions or simply the time &#8211; THE &#8211; Time, Headlines &amp; Environment.</p>
	</div>
</div>




			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_69740e9107991"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				
<div class="wpb_text_column wpb_content_element " >
	<div class="wpb_wrapper">
		<p>&#8216;THE&#8217; is built from two simple off the shelf components (an eInk InkyWHAT screen from Pimoroni and a Raspberry Pi) the code and the 3D printed casing are open source, allowing you to modify or redesign your own. You can follow along here or also take a look at the build at Instructable &#8211; <a href="https://www.instructables.com/id/Make-Your-Own-MQTT-EInk-Display-for-Time-News-and-/">https://www.instructables.com/id/Make-Your-Own-MQTT-EInk-Display-for-Time-News-and-/</a><br />
The concept comes from a long tradition of viewing data on a screen, from systems such as Teletext, through to the beloved Chumby, onwards to the Sony Dash and then they current iterations of the Echo Show and Google Home. Yet there is a need for a simple information display that does not listen in, does not play music or videos and does not rely on having cloud-based data. Something that simply displays information, at a glance using a beautiful non lit eink screen, on widgets that cycle at predetermined intervals. One brilliant example is the eInk Status Display, using the InkyPhat see <a href="https://jsutton.co.uk/eink-mqtt-status/">https://jsutton.co.uk/eink-mqtt-status/</a> for details. Thus with these in mind and some code to work on &#8216;THE&#8217; was born, one cold weekend in November in deepest Norfolk, while thinking about the Connected Environments Curriculum back at University College London.</p>
	</div>
</div>




			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_69740e9107c79"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				
	<div class="wpb_video_widget wpb_content_element vc_clearfix   vc_video-aspect-ratio-169 vc_video-el-width-100 vc_video-align-center" >
		<div class="wpb_wrapper">
			
			<div class="wpb_video_wrapper"><iframe title="THE (Time, Headlines, Environmental) Updating via MQTT" width="1080" height="608" src="https://www.youtube.com/embed/hScxaoUQEjU?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>
		</div>
	</div>

			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_69740e910a48a"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				
<div class="wpb_text_column wpb_content_element " >
	<div class="wpb_wrapper">
		<p>At its heart, THE is powered by <strong>M</strong>essage<strong> Q</strong>ueuing<strong> T</strong>elemetry <strong>T</strong>ransport (MQTT), allowing it to receive messages as soon as they are broadcast, via series of scripts, written in Python. THE subscribes to the topic (THE/messages) which are displayed on the eInk screen whenever a new one arrives. This allows the hub of THE to simply be a displayer of a single message topic with the timings and subjects configured by external scripts. The configuration allows the system to display a wide range of data sources from internal sources around Smart Home Automation Systems through to the news headlines, personal messages to friends or family or simply to display the time.</p>
	</div>
</div>




			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_69740e910a8c9"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				<div class="img-with-aniamtion-wrap center" data-max-width="100%" data-max-width-mobile="default" data-shadow="none" data-animation="fade-in" >
      <div class="inner">
        <div class="hover-wrap"> 
          <div class="hover-wrap-inner">
            <img fetchpriority="high" decoding="async" class="img-with-animation skip-lazy " data-delay="0" height="1920" width="2560" data-animation="fade-in" src="https://www.digitalurban.org/wp-content/uploads/2020/04/IMG_1871-2-scaled-1.jpeg" alt="eInk MQTT Case" srcset="https://www.digitalurban.org/wp-content/uploads/2020/04/IMG_1871-2-scaled-1.jpeg 2560w, https://www.digitalurban.org/wp-content/uploads/2020/04/IMG_1871-2-scaled-1-300x225.jpeg 300w, https://www.digitalurban.org/wp-content/uploads/2020/04/IMG_1871-2-scaled-1-1024x768.jpeg 1024w, https://www.digitalurban.org/wp-content/uploads/2020/04/IMG_1871-2-scaled-1-768x576.jpeg 768w, https://www.digitalurban.org/wp-content/uploads/2020/04/IMG_1871-2-scaled-1-1536x1152.jpeg 1536w, https://www.digitalurban.org/wp-content/uploads/2020/04/IMG_1871-2-scaled-1-2048x1536.jpeg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" />
          </div>
        </div>
      </div>
    </div><div class="iwithtext"><div class="iwt-icon">  </div><div class="iwt-text"> <strong>To Make a THE you require:</strong></p>
<ol>
<li>A Raspberry Pi (a Pi zero, or a Pi 3 ) &#8211; we used a Pi 3 for ours.</li>
<li><a href="https://shop.pimoroni.com/products/inky-what?variant=13590497624147">An InkywHAT screen;</a></li>
<li>If using a Pi 3 &#8211; <a href="https://www.amazon.co.uk/dp/B07DBX1V44/ref=sspa_dk_detail_0?psc=1&amp;pd_rd_i=B07DBX1V44&amp;pd_rd_w=1HdMP&amp;pf_rd_p=1055d8b2-c10c-4d7d-b50d-96300553e15d&amp;pd_rd_wg=Y4qQz&amp;pf_rd_r=4JJ8PF3QKTVX0BY3XV24&amp;pd_rd_r=e3740e56-0705-448d-931f-71dec884f3ef&amp;spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExS1ZSQVVaREZQMEFIJmVuY3J5cHRlZElkPUEwNTMyMDk0MTQ1WTZCNklTQ005VyZlbmNyeXB0ZWRBZElkPUEwNDA0NTMzMzBJRUlNQk9UTVgxUiZ3aWRnZXROYW1lPXNwX2RldGFpbCZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU=">a right angled USB cable</a> (so the cable fits in the case);</li>
<li>An MQTT broker &#8211; either running on your Pi or elsewhere. Don&#8217;t worry if you do not have one or are not sure what MQTT is, its quick and easy to set up and once installed it will automatically run &#8211; take a look at <a href="https://randomnerdtutorials.com/how-to-install-mosquitto-broker-on-raspberry-pi/">https://randomnerdtutorials.com/how-to-install-mosquitto-broker-on-raspberry-pi/</a> for a full and easy to follow tutorial on getting MQTT running &#8211; in this case mosquitto on your Pi.</li>
<li>An easy to fit case &#8211; head over to <a href="https://www.thingiverse.com/thing:4036382">Thingiverse to download and print our open source case</a>.</li>
<li>Our free and open source scripts to collect the Time, News and Environment conditions.</li>
</ol>
<p> </div><div class="clear"></div></div>
			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_69740e910e3e6"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				<div class="iwithtext"><div class="iwt-icon">  </div><div class="iwt-text"> <strong>Step One: Installing the InkywHAT</strong><br />
The first step is to set and install your InkyWhat eInk sceen. You can install the libraires required for your InkyWHAT by using the easy one-line-installer.<br />
Open a new terminal to connect to your Pi, and type the following, making sure to type y or n when prompted:</p>
<div class="codehilite">
<pre class="EnlighterJSRAW" data-enlighter-language="null">curl https://get.pimoroni.com/inky | bash</pre>
<p>The one-line-installer puts everything in place to get your eInk screen up and running, we recommend you head over to the <a href="https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-inky-what">Pimoroni Getting Started with InkyWhat</a> for more info and examples &#8211; just to check its working.
</div>
<p> </div><div class="clear"></div></div>
			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_69740e910fa05"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				<div class="img-with-aniamtion-wrap center" data-max-width="100%" data-max-width-mobile="default" data-shadow="none" data-animation="fade-in" >
      <div class="inner">
        <div class="hover-wrap"> 
          <div class="hover-wrap-inner">
            <img decoding="async" class="img-with-animation skip-lazy " data-delay="0" height="100" width="100" data-animation="fade-in" src="" alt=""  />
          </div>
        </div>
      </div>
    </div>
			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_69740e9111758"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				<div class="iwithtext"><div class="iwt-icon">  </div><div class="iwt-text"> <strong>Step Two: Getting the Time, News and Environmental Information</strong><br />
THE updates its information via subscribing to an MQTT topic, our custom scripts pull in other sources of information and publish to this topic, allowing any number of sources of information to be used. There are three main files &#8211; one for the Time, a second for the News Feed and a the third for Weather conditions.<br />
<strong>Getting the Time:</strong><br />
All our files are available via the Connected Environments githib for THE &#8211; <a href="https://github.com/ucl-casa-ce/THE">https://github.com/ucl-casa-ce/THE</a><br />
For the time &#8211; download timetomqtt.py.<br />
The script gets the current time and converts it to words for display on THE &#8211; so, for example, 12.14pm becomes The Time is Fourteen Minutes Past Twelve and so on. In the script you need to edit it to add in your own MQTT details  &#8211; we have highlighted the parts to edit in the code.<br />
Copy it across to your Pi in a folder &#8211; we use /home/pi/scripts  &#8211; this can be down either via the command line or via ftp via <a href="https://filezilla-project.org/">Filezilla</a> or similar.<br />
<strong>Getting the News:</strong><br />
For the news, download rsstomqtt.py.<br />
The script gets the latest news from Sky and publishes it to MQTT for THE. You can edit the news source as required in the file. This file can also be copied to pull in any RSS feed directly onto your THE. As before, in the script you need to edit it to add in your own MQTT details  &#8211; we have highlighted the parts to edit in the code.<br />
<strong>Getting the Weather:</strong><br />
For the weather, download darkskytomqtt.py<br />
You need to sign up to use the <a href="https://darksky.net/dev">Darksky API</a> (don&#8217;t worry, it&#8217;s free and allows up to 1000 calls a day, more than enough to display the latest weather on THE). In our script, simply put in your DarkSky key, which you will receive when you sign up to the API and also your longitude and latitude for the location you want to obtain the data for.<br />
You can find a long and lat via  <a href="https://www.latlong.net/">https://www.latlong.net/</a><br />
If all this is new then it may sound complicated but with a little trial and error you will be able to edit files, write your own and get the information you want on THE in no time. Any issues just drop is a line via the contact form below.. </div><div class="clear"></div></div>
			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_69740e911218d"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				<div class="img-with-aniamtion-wrap center" data-max-width="100%" data-max-width-mobile="default" data-shadow="none" data-animation="fade-in" >
      <div class="inner">
        <div class="hover-wrap"> 
          <div class="hover-wrap-inner">
            <img loading="lazy" decoding="async" class="img-with-animation skip-lazy " data-delay="0" height="1920" width="2560" data-animation="fade-in" src="https://www.digitalurban.org/wp-content/uploads/2019/12/IMG_1883-scaled-1.jpeg" alt="THE: eink Time Headlines and Environmental Data" srcset="https://www.digitalurban.org/wp-content/uploads/2019/12/IMG_1883-scaled-1.jpeg 2560w, https://www.digitalurban.org/wp-content/uploads/2019/12/IMG_1883-scaled-1-300x225.jpeg 300w, https://www.digitalurban.org/wp-content/uploads/2019/12/IMG_1883-scaled-1-1024x768.jpeg 1024w, https://www.digitalurban.org/wp-content/uploads/2019/12/IMG_1883-scaled-1-768x576.jpeg 768w, https://www.digitalurban.org/wp-content/uploads/2019/12/IMG_1883-scaled-1-1536x1152.jpeg 1536w, https://www.digitalurban.org/wp-content/uploads/2019/12/IMG_1883-scaled-1-2048x1536.jpeg 2048w" sizes="auto, (max-width: 2560px) 100vw, 2560px" />
          </div>
        </div>
      </div>
    </div><div class="iwithtext"><div class="iwt-icon">  </div><div class="iwt-text"> <strong>Step Three &#8211; THE </strong><br />
Once you have the scripts to collect the feeds you needs to install the main script to run THE.<br />
Download THE_pi_what.py<br />
As with the other scripts, edit where indicated and add in your own MQTT details. Once edited, copy it across to your Pi with your other scripts.<br />
Finally you need the font and the background image:<br />
Download hm.ttf (the font)<br />
Download whatbackground.png<br />
These go in a new folder called &#8216;resources&#8217; inside the scripts folder you crearted on your pi &#8211; simply create the new folder and copy the files across. </div><div class="clear"></div></div>
			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_69740e911491f"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				<div class="iwithtext"><div class="iwt-icon">  </div><div class="iwt-text"> <strong>Step Four &#8211; Run the Scripts at Set Times.</strong><br />
The scripts run at set times on the pi via the cron service. To set this up, simply log into your pi via ssh and type</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">sudo crontab -e</pre>
<p>This sets up a new cron process &#8211; if asked select option &#8216;2&#8217; to edit with nano &#8211; copy the following into the cron file and save (cntl x).</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">*/5 * * * * python3 /home/pi/scripts/timetomqtt.py
*/12 * * * * python3 /home/pi/scripts/rsstomqtt.py
*/18 * * * * python3 /home/pi/scripts/darkskytomqtt.py
@reboot sleep 10 &amp;&amp; python3 /home/pi/scripts/THE_pi_what.py
*/60 * * * * sudo reboot</pre>
<p>&nbsp;<br />
The scripts run at set times &#8211; change them to any time to wish. We reboot the pi every hour to keep things fresh &#8211; this is not required and we know it is not the best of practice but we have found it keeps things running for our purposes. </div><div class="clear"></div></div>
			</div> 
		</div>
	</div> 
</div></div>
		<div id="fws_69740e911509c"  data-column-margin="default" data-midnight="dark"  class="wpb_row vc_row-fluid vc_row"  style="padding-top: 0px; padding-bottom: 0px; "><div class="row-bg-wrap" data-bg-animation="none" data-bg-animation-delay="" data-bg-overlay="false"><div class="inner-wrap row-bg-layer" ><div class="row-bg viewport-desktop"  style=""></div></div></div><div class="row_col_wrap_12 col span_12 dark left">
	<div  class="vc_col-sm-12 wpb_column column_container vc_column_container col no-extra-padding"  data-padding-pos="all" data-has-bg-color="false" data-bg-color="" data-bg-opacity="1" data-animation="" data-delay="0" >
		<div class="vc_column-inner" >
			<div class="wpb_wrapper">
				<div class="iwithtext"><div class="iwt-icon">  </div><div class="iwt-text"> <strong>Step Five</strong><br />
Reboot your Pi and sit back and wait  &#8211; your feeds will appear according the time intervals you set in your cron scripts.<br />
You can edit the files and add as many sources of information as you like.<br />
Do let us know if you make one, edit any scripts or remix the case. </div><div class="clear"></div></div>
			</div> 
		</div>
	</div> 
</div></div>
<p>The post <a href="https://www.digitalurban.org/blog/2020/04/10/the/">Make an eInk MQTT Reader for the Time, News and Environmental Data</a> appeared first on <a href="https://www.digitalurban.org">Digital Urban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
