<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pierre-yves Baloche on Medium]]></title>
        <description><![CDATA[Stories by Pierre-yves Baloche on Medium]]></description>
        <link>https://medium.com/@baloche.pierreyves?source=rss-f9d9033da9dd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hSIei3qOWY4oitEKe0vJDw.jpeg</url>
            <title>Stories by Pierre-yves Baloche on Medium</title>
            <link>https://medium.com/@baloche.pierreyves?source=rss-f9d9033da9dd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 19:33:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@baloche.pierreyves/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[PiHQCam —Camera oriented Software & UI]]></title>
            <link>https://medium.com/@baloche.pierreyves/pihqcam-camera-oriented-software-ui-48cdb0d6c1b1?source=rss-f9d9033da9dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/48cdb0d6c1b1</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[pihqcam]]></category>
            <category><![CDATA[kivy]]></category>
            <category><![CDATA[high-quality-camera]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Pierre-yves Baloche]]></dc:creator>
            <pubDate>Sun, 12 Jul 2020 18:09:24 GMT</pubDate>
            <atom:updated>2020-07-12T20:07:58.575Z</atom:updated>
            <content:encoded><![CDATA[<h3>PiHQCam — Camera oriented Software &amp; UI</h3><p><em>Note: This article is part of a series of articles aimed at describing the complete process of creation of this project. You can read about the story behind this full project </em><a href="https://medium.com/@baloche.pierreyves/pihqcam-the-story-behind-4c0a394821f6"><em>here</em></a><em> and the related 3D case design </em><a href="https://medium.com/@baloche.pierreyves/pihqcam-designing-a-full-raspberry-pi-camera-enclosure-56306b41b56f"><em>here</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ela-P8Ljr8tCTqGyAT5EeA.jpeg" /><figcaption>Test picture from the camera with some added effect.</figcaption></figure><p>When you are creating a full project from scratch, often based on a late-night idea that keeps you awake for the rest of the night, it always drives you to multiple stages to reach your final destination. It usually starts on a simple concept, followed by some tweaking and messing around with bunch of wires and sensors (especially when you are like me, often in the Raspberry Pi universe), up to the point when you reach “something that works”. However, when you intend to share your project with others, you often look back and tell yourself that it could do with a little bit more polishing than the original attempt. I feel that there is nothing worse than a project that you intend to try and as opposed to be a straight forward set of instructions, it sometimes ends up as a full-night browsing for answers to why you get the XYZ error message.</p><p>This is why it took me a little bit more time to complete this third part of the PiHQCam project as I intended to provide all the necessary instructions for people to be able to deploy from a clean Raspberry environment. Also, this is the first stage of software features that I intended to include in the project. I already have additional features that I intend to bring into the main stack of the application. Now is the time to get your PiHQCam “software-ready” as well as to go through its interface and set of features.</p><h3>“<em>Engage</em>” the software installation</h3><h4>Base system configuration</h4><p>We’ll start from a clean installation of the Raspberry Pi OS, previously called Raspbian, based on its Buster revision. However, as opposed to start with the standard distribution that includes all the graphical interface &amp; components, I preferred to start from its “lite” version. The reason is that as we intend to use directly the camera, we don’t want to install software that we won’t be using at all such as spreadsheet and word processors. Also, originally, I was hoping to use directly the “preview” mode of the Raspberry Pi Camera module, as it also works without from problem, from the command line. However, I had to revise this angle during the development phase as it turned out to be incompatible with the framework I had decided to use for the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aetVEKOhmW79sT66cjpKdA.png" /><figcaption>Raspberry Pi Imager</figcaption></figure><p>Not so long ago, people had to download first of all the right distribution archive and use additional software to “burn” the operating system on their SD cards. Luckily for us, the Raspberry Foundation has simplified much more the process through a neat tool, the Raspberry Pi Imager, that you can directly download from <a href="https://www.raspberrypi.org/downloads/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fQV-Jim5MF2PnygsVRN0Mw.png" /><figcaption>Simple UI for easy OS installation</figcaption></figure><p>Once installed on your workstation (From PC to Mac and of course, Raspberry Pi), the installation procedure is painless as you’ll see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5lJFIvN1tHj0ziH3p8wcA.png" /><figcaption>A custom install is required</figcaption></figure><p>First of all we need to choose the right distribution for our camera, so we’ll first choose the “Raspbery Pi OS Other” option from the main menu, followed by selecting the “Raspberry Pi OS Lite (32 Bits) : no desktop environment” choice. Once this is done, you can insert the SD Card to use in your system and select it from the tool’s drive chooser and you are then ready to it the “Write” button to start the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rWWeyCqGmY0LRjNMYd5YSA.png" /><figcaption>Successful Burn</figcaption></figure><p>It will take a bit of time to go through the writing and verification phases by the tool. Once this is done, your SD Cad is automatically ejected and you are ready to go… well almost. Indeed, as the access to the USB Port is limited, unless you want to start the installation process with an PiHQCam not fully assembled, we’ll be configuring its remote access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UipRZB6dXVQs_UuiGla4Hg.png" /><figcaption>Boot partition mounted with success.</figcaption></figure><p>Once you have popped back in your SD Card, the “boot” partition will be loaded in your system. To activate the remote access, open up a command-line terminal and gain access to the SD card drive’s location, such as the following for example on Mac, :</p><blockquote>cd /Volumes/boot</blockquote><p>First of all, just create an empty file names “ <strong><em>ssh</em></strong> ” to enable remote SSH access from the first configuration boot of the Pi. You can do so by using the following command:</p><blockquote>touch ssh</blockquote><p>Now that the SSH access is done, we need to provide the Wi-Fi required information to the Pi, to gain access to our local network. To do so, create a new file “ <strong><em>wpa_supplicant.conf</em></strong> ”, still at the root of the “boot” partition, with the following command which will open up a new editor to insert the necessary Wi-Fi configuration:</p><blockquote>nano wpa_supplicant.conf</blockquote><p>Below is an example of a configuration compatible with the current <em>Buster</em> Raspberry distribution:</p><blockquote>ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev</blockquote><blockquote>update_config=1</blockquote><blockquote>country=FR</blockquote><blockquote>network={</blockquote><blockquote>ssid=”MY-WIFI-NETWORK-SSID”</blockquote><blockquote>psk=”MY-WIFI-NETWORK-PASSPHRASE”</blockquote><blockquote>key_mgmt=WPA-PSK</blockquote><blockquote>}</blockquote><p>This is a simple configuration that of course you need to tune according to your own settings:</p><p><strong><em>country</em></strong>: Choose the country code of your own country of course (FR, GB …);</p><p><strong><em>MY-WIFI-NETWORK-SSID</em></strong>: Enter here the SSID of your own Wi-Fi network;</p><p><strong><em>MY-WIFI-NETWORK-PASSPHRASE</em></strong>: Enter here the secret passphrase / password to connect to your Wi-Fi network.</p><p>Just exit the Nano editor (<em>Ctrl-X</em>, and <em>Y</em> to save the changes) to complete the configuration procedure. Of course, you can always edit these elements later on, once you are remotely connected to your Raspberry Pi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L-GM0pYLDjPnze7QJYQZGg.png" /><figcaption>Initial remote configuration completed.</figcaption></figure><p>Just Before “ejecting” your SD Card, have a look at its <strong><em>boot</em></strong> partition to make sure that both files are there and ready for usage.</p><p>Safely eject your SD card in order to prevent its corruption and insert it to the side of the screen enclosure of the project, before remounting it (or not) into the camera’s body part. Tweezers can be your best friends in these times, to insert and especially remove, the card, as well as handling the wired connection of the trackball.</p><p>You’re ready to go, so go on, and power-up your Raspberry Pi!</p><p>As it starts for the first time, you’ll see some LED blinking and the main screen powering up but … no image! Don’t worry! It is completely normal as the Raspberry Pi does not “see” yet the beautiful Pimoroni Hyperpixel Screen. We’ll come to this in a minute, but first, we need to continue the configuration part from the Pi itself.</p><p>Still from your command-line terminal, try to connect after one minute to your Raspberry Pi over SSH. To do so, use the following command:</p><blockquote>ssh pi@raspberrypi.local</blockquote><p>Indeed, by default, this command should allow you to connect to any Pi that has its standard network configuration done (SSH enabled + Correct Wi-FI configuration). It is always a good thing to change its network hostname right away to avoid connecting to the “wrong” Pi on your network. May be, the first time you issue this command, you might have to add some network-related fingerprint to your local machine’s registry, which is quite standard procedure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQMgCcmJAAd2fOQbjpxe0A.png" /><figcaption>Standard SSH security warning.</figcaption></figure><p>Once you are agreeing to do it, the SSH connection will require to enter the standard <strong><em>pi</em></strong> user’s password: “ <strong><em>raspberry</em></strong> ” (without the quotes of course). And upon hitting the right keys, you’ll gain remote access to the Raspberry Pi at the heart of your new Pi-Powered camera.</p><p>We’ll proceed first by ensuring that the Raspberry Pi has its software registry and local components all updated to the latest. In order to <em>refresh</em> the elements provided by the distribution, we’ll issue the following commands:</p><blockquote>sudo apt-get update</blockquote><blockquote>sudo apt-get -y full-upgrade</blockquote><p>The system will contact the official software repositories to update all software related information and will then proceed with the system’s full upgrade to the latest versions. This might take a bit of time, depending on your network connection and bandwidth. Once this is completed, we’ll install some basics tools with the command:</p><blockquote>sudo apt-get install -y vim git screen</blockquote><p><strong><em>vim</em></strong>: if you have seen few summers like me, you might me more used to edit text with this tool;</p><p><strong><em>git</em></strong>: this is a software code utility that we’ll be needing later on;</p><p><strong><em>screen</em></strong>: quite useful when performing task remotely on a pi, it creates a <em>virtual</em> environment, like a terminal, in which you can issue your commands and that, if your remote SSH session terminates, it will still hold the context and running commands together.</p><p>Now that we have to set some of the parameters required for the system to be fully secured and operational, through the use of the Raspberry configuration tool.</p><blockquote>sudo raspi-config</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zCNihnGTxCj-cAzgTbq8_Q.png" /><figcaption>Raspberry Configuration Tool Main Menu.</figcaption></figure><p>Once the configuration interface is available, we need to change the following settings:</p><p><strong><em>Hostname</em></strong>: in order to easily access the Raspberry over our network, it is better to give it a proper name, especially if you like me you have multiple Pis running on your LAN. So we can give it the following name “ <strong>picamera</strong> ”.</p><p><strong><em>Pi user password</em></strong>: as the default password is always the same for all Raspberry Pi, it is good (and safe) to change it to something more personal.</p><p>After changing some network parameter and security items, we are going now to activate few interfaces for our project to work:</p><p><strong><em>PiCamera</em></strong>: of course, we need our camera to be activated to be able to take some nice shots, so better turn it on right now.</p><p><strong><em>I2C</em></strong>: this is the internal communication interface required by the trackball, so we also need to activate it.</p><p><strong><em>Advanced Options - Memory Split</em></strong>: as we are going to deal with high quality (and size) images, we need to give more “freedom” to the system to cope with them. Thus, we need to increase the memory split setting to “ <strong><em>256</em></strong> ”.</p><p>We are done now with the configurations, but <strong>DO NOT REBOOT</strong> just yet the Raspberry Pi as we have few more things we need to install.</p><h4>Pimoroni Components Configurations</h4><p>As our project relies on two great components from the Pimoroni Pirates (YARRHHH :), we are going to proceed right away with their configuration.</p><p>First of all, we need to install the library for the HyperPixel 4 Square screen to get some crisp image and visual interface for the project. They made it quite easy really through the use of a simple line command (that you can always split if you’d like to see what lies behind its magic):</p><blockquote>curl <a href="https://get.pimoroni.com/hyperpixel4">https://get.pimoroni.com/hyperpixel4</a> | bash</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9cfEZe9DqoD1x9GWvBNY_g.png" /><figcaption>Installing Pimoroni’s HyperPixel Library</figcaption></figure><p>It will fetch an interactive installation shell script that will ask you couple of questions, but that are fairly straight forward. You just need to confirm to proceed with the installation as well as choosing the model &amp; configuration for the screen. As it is a one-line installer, it is able to cope with the right screen (Rectangular / Square) and Pi (PI4 and Others) models. For our project, we’ll choose the option <strong>3</strong>, “ <strong><em>Weirdly Square - Pi 3B+ or older</em></strong> ” to match our own configuration with the A3+.</p><p>The installation process will take a little bit of time, depending on your bandwidth, but at its end, when being asked to reboot, say “ <strong><em>No</em></strong> ” as some additional steps will be required.</p><p>First, we need to edit the configuration file used during the boot sequence to add some extra screen parameters.</p><blockquote>sudo nano /boon/config.txt</blockquote><p>At the end of the file, add the following lines in order to power-off the screen’s backlight when shutting down:</p><blockquote># Turn off the Hyperpixel Screen when shutting down</blockquote><blockquote>dtoverlay=gpio-poweroff,gpiopin=19,active_low=1</blockquote><p>And we are done for the screen’s configuration so next time we’ll reboot, we’ll be able to see the Raspberry’s console on the screen directly.</p><p>Now, before rebooting the Pi, we need to install the libraries required for the trackball’s control. There is also a single line command line available, however, I encountered some programming issues when using it, so I highly recommend you to use directly the GIT sources and build the library as the process is quite simple.</p><p>First of all, we need to add some more python libraries to our system with the following command:</p><blockquote>sudo apt-get install -y python3-pip python3-setuptools python3-dev python3-rpi.gpio python3-picamera</blockquote><blockquote>python3 -m pip install --upgrade --user Cython==0.29.10 pillow</blockquote><p>It will install the necessary Python 3 Libraries required for development as well as the <em>picamera</em> lib to access the HQ Camera Module from Python.</p><p>The second command install additional required libraries for the Pimoroni’s trackball. We are now ready to perform the Trackball’s Library installation through the following set of commands:</p><blockquote>cd ~/Pimoroni</blockquote><blockquote>git clone <a href="https://github.com/pimoroni/trackball-python%60">https://github.com/pimoroni/trackball-python</a></blockquote><blockquote>cd trackball-python</blockquote><blockquote>sudo ./install.sh</blockquote><p>Once it has finished cloning the code repository from Git, as well as performing the library’s installation, you can now finally reboot the Pi as all is ready to do some checkups.</p><blockquote>sudo reboot</blockquote><p>As you enter the command, you should see a first difference: indeed, the Raspberry Pi OS console is now visible on the HyperPixel screen, giving you some more clues on what is going on. When you get to the login prompt stage, connect back to your Pi over SSH, keeping in mind to change the hostname to what you defined earlier on. For example:</p><blockquote>ssh pi@picamera.local</blockquote><p>Now that we know that the screen is working well, we might want to try the trackball as well. First of all, as the i2c port, used to connect the trackball to the screen is registered with a different ID, we need to temporarily create a link to it to use the Pimoroni’s examples.</p><blockquote>sudo ln -s /dev/i2c-3 /dev/i2c-1</blockquote><p>Now that our trackball is “visible” for the example, let’s put a bit of fun and color with the <em>rainbow</em> example:</p><blockquote>cd ~/Pimoroni/trackball-python/examples</blockquote><blockquote>python3 rainbow.py</blockquote><p>You should now see your trackball lightning up with multiple colors. If this is not the case, you should be getting some useful error messages to try to find out what went wrong. May be check the polarity and connection between the screen and the trackball as the connection might be a bit loose if you haven’t <em>extended</em> sufficiently the pins soldered to the cable.</p><h3>Go-go-gadgeto PiHQCamera</h3><h4>Project source installation</h4><p>Now that our system is ready and tested with its core components, we need to install some more libraries. One of them is Kivy, a really neat framework that I discovered when searching on how to build graphical interface without the use of the X standard environment. Kivy is using some custom configuration file to define the screens that are composing the application, offering multiple standard components, from media management to customized inputs. Going through all Kivy’s capabilities would take another full article, so I can only encourage you to browse their documentation and to take a walk through all the examples available ( <a href="https://kivy.org/#home">https://kivy.org</a> ).</p><p>However, there are some issues with it, that are important to know about. I do not know if they are linked to the particular setup of the HyperPixel as I did not have the time to investigate more, but I wanted to share them with you as they will have an impact on the use of the project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y2g16HZC1vLb5Y3iv0KJ4A.png" /><figcaption>Tab Panels “Impossible Touch” selection.</figcaption></figure><p><strong><em>Tab Panels</em></strong>: the main interface is organized in 3 tabs (that we’ll go through later on). However, I could not get Kivy to allow “switching” between tabs by touch: I guess some internal event is not being raised properly as lots of SDL warning messages are being raised on the console. This is why the trackball comes to our rescue as scrolling left to right will trigger switching tabs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BFmrZGHiBKpKfbg8bUkP1Q.png" /><figcaption>Menu selection might be tricky sometimes.</figcaption></figure><p><strong><em>Menus &amp; Configuration fields</em></strong>: Kivy allows property management fairly easily really, however, still due to some SDL error message, “confirming choices in combo box might be a bit tricky and “prolonged” press on the screen might be necessary to validate file path or choosing the resolution of the pictures/movies.</p><p>Beside these points, that I hope to improve/fix in the future, this is quite a nice way to build fullscreen application on Raspberry.</p><p>Now, Kivy requires multiple libraries that are all installed with the following command:</p><blockquote>sudo apt install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev pkg-config libgl1-mesa-dev libgles2-mesa-dev libgstreamer1.0-dev git-core gstreamer1.0-plugins-{bad,base,good,ugly} gstreamer1.0-{omx,alsa} libmtdev-dev xclip xsel libjpeg-dev</blockquote><p>It will take some time again, so go ahead and grab a nice refreshing beverage ;)</p><p>After the installation process is complete, we need to retrieve the project’s source code from GitHub:</p><blockquote>cd ~</blockquote><blockquote>git clone <a href="https://github.com/pierreyvesbaloche/PiHQCam.git">https://github.com/pierreyvesbaloche/PiHQCam.git</a></blockquote><blockquote>cd PiHQCam</blockquote><p>There is already also a <a href="https://github.com/pierreyvesbaloche/PiHQCam/releases/tag/1.0.0">first</a> release so you can choose it if you’d prefer not to run the code from the streamline.</p><p>Once the project’s directory is created we need to create a dedicated folder for our pictures and movies:</p><blockquote>mkdir DCIM</blockquote><p>Also, to finish up the library’s installation, we perform one last dependencies installation:</p><blockquote>pip3 install -r requirements.txt</blockquote><p>Courage, we are almost set! We need now to add some specific configuration to the Kivy’s settings in order to get the HyperPixel Touch par working. To do so, we need to edit the main configuration file:</p><blockquote>nano ~/.kivy/config.ini</blockquote><p>Once in it, locate the “ <strong><em>[input] </em></strong>” section and replace it entirely with the following lines:</p><blockquote># Get the touchscreen to work with Kivy</blockquote><blockquote>[input]</blockquote><blockquote>mouse = mouse</blockquote><blockquote>mtdev_%(name)s = probesysfs,provider=mtdev</blockquote><blockquote>hid_%(name)s = probesysfs,provider=hidinput</blockquote><blockquote># Review the calibration</blockquote><blockquote>[postproc:calibration]</blockquote><blockquote>(mtdev) = xoffset=1,yoffset=1,xratio=-1,yratio=-1</blockquote><p>We are now ready to try out the PiHQCam project:</p><blockquote>export PYTHONPATH=.</blockquote><blockquote>python3 pihqcam/main.py</blockquote><p>The main interface will come up on your screen, directly with the camera view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Xsg0boWmVniVFL3YsivZQ.jpeg" /><figcaption>The PiHQCam project operational.</figcaption></figure><p>You can toggle the various vertical/horizontal panels by touch and navigate through the 3 main tabs with the left/right scroll of the trackball.</p><p>We can now exit the program by scrolling to the far-right tab with the trackball then press the “ <strong><em>Quit </em></strong>” button on the screen to perform the final stage of the installation.</p><p>I have prepared a configuration service file in order to have the program startup automatically when the Pi starts, as we won’t be able to use any mouse or keyboards while on the go (<strong><em>hint</em></strong> : unless you set them up over bluetooth :). To enable this new service, simply enter the following commands:</p><blockquote>sudo cp etc/picamera.service /etc/systemd/system/</blockquote><blockquote>sudo systemctl enable picamera.service</blockquote><blockquote>sudo systemctl start picamera.service</blockquote><blockquote>sudo systemctl stop picamera.service</blockquote><p>It will copy the service definition file to the system’s location at first, then enable it for use. You can use the “ <strong><em>start</em></strong> ” command to launch the main application, ensuring that everything is ok, then stopping it with the last “ <strong><em>stop</em></strong> “ command.</p><p><strong>Congratulations! You are now ready to use your Pi Powered HQ Camera!</strong></p><h4>PiHQCam GUI <strong><em>walkthrough</em></strong></h4><p>As said earlier on, the interface is organized between panels, all allowing access to different settings &amp; usage. Three main functionalities are represented by tabs on top of the screen: “ <strong><em>Camera </em></strong>” Direct view from the camera, “ <strong><em>Browser </em></strong>” for file access to medias and “ <strong><em>Info</em></strong> ” for access to information &amp; configuration of the camera.</p><p><strong>Camera Tab</strong></p><p>The Camera interface providing direct view for the camera when not capturing/filming. Originally, I had intended to use the PiCamera “preview” mode to have better visibility and performance while using it. However, and without getting too much into technical details, the use of Kivy window management and the camera preview, is not possible as the camera preview gets displayed “under” Kivy’s windows and I could not find any ways to solve it (transparent filling &amp; Z-index, did not solved the issue….) Hopefully the next major revision of Kivy (actually 1.11.1) will be able to cope with this better. This is why I had to implement a custom preview mode, and then <em>freezing</em> the display when a picture or a video is taken.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SFPieilTxLBKxktTPaSdhw.png" /><figcaption>The camera preview tab.</figcaption></figure><p>Under the main camera preview, there are 3 buttons that allow you to choose from the different capture modes available:</p><p><strong><em>Camera</em></strong>: Take a single shot right-away, when pressing once the trackball’s button.</p><p><strong><em>Timer</em></strong>: Trigger a timer before taking the shot whose duration is configurable.</p><p><strong><em>Video</em></strong>: Record with the camera when starting and stopping the sequence by pressing once the trackball for each segment.</p><p>The left side of the screen also integrates an “Effects” panel that you can press on to reveal the set of available effects with the camera. Some of them are compatible with the direct view whereas others are not, so don’t be surprised. Simply touch the “View” panel to go back to the main camera preview screen.</p><p><strong>Browser Tab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ygc3ZOLe438t9AzojtT5oA.png" /><figcaption>The file browser tab.</figcaption></figure><p>The “Browser” tab points to the location configured (DCIM by default) where all the medias (pictures and videos) are stored. You can scroll between them with up &amp; down rolls of the trackball which will update the preview of the media on the right-hand side (but give it some time to cope with big size images &amp; movies :).</p><p>Under the preview, some basic information is available like the name, date, time &amp; resolution in the “ <em>Info</em> ” panel.</p><p>You can also perform some actions when revealing the “ <em>Action</em> ” panel under the preview. Currently, only the “ <em>Delete</em> ” option is available but additional features will come after.</p><p><strong>Info Tab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gH75_GXwN5C8lZlw6-Rs0w.png" /><figcaption>The information &amp; actions tab.</figcaption></figure><p>The last “ Info ” tab allows you to reach the settings of the application, as well as either quitting the application or even shutting down completely the camera, so that you’ll be able to unplug the camera safely once the screen is completely turned off. You can define the following parameters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_E-uvmwgMLrUwzK-pyMrDA.png" /><figcaption>Settings sub-menu.</figcaption></figure><p><strong><em>Picture</em></strong>: where the medias are to be stored. A virtual keyboard will pop up for you to enter the path, or use a bluetooth keyboard to enter it with more ease.</p><p><strong><em>Thumbnails</em></strong>: where the thumbnails of the medias will be generated &amp; stored.</p><p><strong><em>Timer</em></strong>: how long the timer should last before taking the shot.</p><p><strong><em>Still Resolution</em></strong>: the resolution to be used for the *camera* &amp; *timer* modes.</p><p><strong><em>Video Resolution</em></strong>: the resolution to be used for the *video* mode.</p><h3>Now Go &amp; Shoot!</h3><p>I know that the installation process might be a bit long, but this is nothing compared to the time spent in forums and Internet searches to get the “right” line of parameters to get it all to work. As this was my first Kivy based project, I have taken quite some “shortcuts” and I hope to be able to get back to it soon to improve its quality as well as set of features.</p><p>Indeed, like all Raspberry Pi projects, lots of the features integrated in the current version came during the design and development of it, as well as many mores that have filed up a backlog long enough to keep me busy for a while (…just need the time … ;).</p><p>Between the idea, the case’s 3D design, software coding &amp; testing (with some hair tearing refactoring tasks too), it took me a fair amount of time to be able to share with you this project so I look forward to hear from you about how it went for you and to see some pictures of your creations. Have Fun !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48cdb0d6c1b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PiHQCam - Designing a full Raspberry Pi Camera enclosure]]></title>
            <link>https://medium.com/@baloche.pierreyves/pihqcam-designing-a-full-raspberry-pi-camera-enclosure-56306b41b56f?source=rss-f9d9033da9dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/56306b41b56f</guid>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[3d-printing]]></category>
            <dc:creator><![CDATA[Pierre-yves Baloche]]></dc:creator>
            <pubDate>Thu, 04 Jun 2020 21:43:15 GMT</pubDate>
            <atom:updated>2020-07-12T18:11:03.149Z</atom:updated>
            <content:encoded><![CDATA[<h3>PiHQCam — Designing a full Raspberry Pi Camera enclosure</h3><p><em>Note: This article is part of a series of articles aimed at describing the complete process of creation of this project. You can read about the story behind this full project </em><a href="https://medium.com/@baloche.pierreyves/pihqcam-the-story-behind-4c0a394821f6"><em>here</em></a><em> and its software configuration </em><a href="https://medium.com/@baloche.pierreyves/pihqcam-camera-oriented-software-ui-48cdb0d6c1b1"><em>here</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kJ1IW4YhdtFRHh4q6TEHzA.png" /><figcaption>The resulting Raspberry Pi HQCam enclosure</figcaption></figure><p>Designing a complete 3D enclosure from scratch is not an easy task but is a fascinating one and I could only invite you to try it some time. Yes, you will spend countless hours in learning how to use CAD softwares, tearing your hair out on how to have pieces locking properly together (and in my case, that is a challenge of its own!) and finally once your first print is done that you missed the obvious (“<em>Wait ? that piece shouldn’t be moving</em>…”). BUT ! This is such a joyful experience when you have it all done and you already think about your next project.</p><p>In this case, the full project lasted for about 3 weeks, from the first draft on a simple piece of paper, to the extented set of elements into which you broke down “<em>your thing</em>”! After sharing the “<em>Why?</em>” I did it, it was important to me to share the “How?” part that most people will be interested in.</p><h3>Short Version</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*NnQFtKP9ecd0O1tzvle68A.png" /></figure><p>The complete set of parts to print are already available on <a href="http://thingiverse.com/thing:4425806">Thingiverse</a> and a detailed video on how to assemble them is available on <a href="https://www.youtube.com/watch?v=bUC98WaIeWQ">YouTube</a>.</p><h3>Long Version</h3><p>Still here ? Well thank you ;) . It will be my pleasure to give you a little bit of insight on each parts of the set, for you to either understand how I came up with it but may be more important, how you could re-mix it to match your own project. So let’s take a walk down the yellow brick road…</p><h4>The Trackball support</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*0QfgSW8jW8qC-5S_GXtGrQ.jpeg" /><figcaption>Support for the trackball</figcaption></figure><p>Funnily enough, we won’t start with the main enclosure or “<em>body</em>” of the camera but we’ll start with a much smaller one : the support for the trackball. Designing the “<em>body</em>” is actually something you’ll do all along the way to ensure that every little detail is right and that the pieces are getting along well.</p><p>As I started this project with the idea of being able to trigger the picture like I would normally do on a Reflex camera, I had to first get the trackball which will serve this purpose as well as indicating various events or states of the camera. It also had to take into account the wires position, going down towards the main “<em>brain</em>” of the project being the Raspberry Pi A3+.</p><p>The trackball is thus able to sit on it, held into position by the 4 little pegs, and the “extra” bit on its back, helps to keep Dupont cables right in position and not sliding down the connecting pins, soldered to the trackball.</p><p>Its front is also a little bit cut-off, but this is to use it with 2 other parts:</p><ul><li>A front rod to maintain the integrity of the full handle;</li><li>A side “claw” used to keep the trackball support from sliding down and also enforcing the attachment of the camera’s handle to its body.</li></ul><h4>The handle’s top</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*JnER9iN44cuHSjPM1BcrzQ.jpeg" /></figure><p>The handle has to be big enough to serve three roles:</p><ul><li>Hold the trackball protected and position it well enough for usage;</li><li>Give sufficient room to the rods (1 at the front and 2 at the back) to keep both top and bottom parts of the handle from sliding away from each other;</li><li>Be wide enough to allow holding the handle in one hand.</li></ul><p>Its curves have also to be smooth to provide an enjoyable feeling while using the camera. Most importantly, the handle is to be split in 2 parts (top &amp; bottom) to allow the introduction of the trackball and its wiring, yet allowing to access it easily in case of malfunction.</p><h4>The Rods (front &amp; back)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*EoF1URpyNZsj_FEPpbunzg.jpeg" /></figure><p>These elements are indeed used to block the top and bottom parts of the handle together, and provide structural integrity to the whole handle.</p><p>They are identical at the back, and a little bit thinner at the front for spacing issues.</p><p>They all include 2 square holes on their sides to allow the use of blocking “<em>claws</em>” that will:</p><ul><li>Block the moving parts of the handle;</li><li>Provide interlocking between the handle and the main camera body.</li></ul><p>Just a slight detail about the back ones, they will only be able to be put in place in the bottom part, once the “double locking claws” will be inserted.</p><h4>The double locking claws</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*guP9CQbXNFqWPxUUXxS8ew.jpeg" /></figure><p>This part is quite important as being the first level of contact between the handle and the body of the camera.</p><p>The 2 positions on its top allow the 2 back rods to fall into, making it more integrated with the rest of the bottom part of the handle.</p><p>Also, the 2 claws will slide into position with the body to make sure that they are bound properly together.</p><p>Its locking effect will be reinforced wy other parts of our 3D puzzle.</p><h4>The handle’s bottom</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*QK9pVPvg_9jp6MkJGXma6g.jpeg" /></figure><p>One of the most significant part of the project, the handle’s bottom has tobe quite sturdy to provide a good “grip” feeling when handling the camera.</p><p>Also, that’s where most of the pressure will be put and therefore needs to be solid enough to cope with it.</p><p>Beside the spaces required for the pieces we have seen so far, they are few more holes you might be wondering about.</p><p>The main “cut” in the middle is to allow the Dupont cables running from the trackball to have some space (in case yours are a bit too long) for storing, thus reducing the pulling strain it could put all the way up to the trackball.</p><p>At its bottom right, another significant hole is pressent to allow a “bridging” part to come to reinforce the “claw” effect to tighten up the handle to the body.</p><p>Finally, the two little square holes are for the upcoming thin-claws. Now that most of the parts for the handle are covered, we can move on to the next “moving” parts.</p><h4>The Camera module support(s)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*l99IZU_9WVeniXXUe4VHdQ.jpeg" /></figure><p>To allow the project to be modular, two versions were designed:</p><ul><li>One to accomodate the newly released High Quality Camera Module;</li><li>Another to keep compatibility with the existing Standard 5 and 8Mp Camera modules.</li></ul><p>Locking holes for the nuts to provide a first level support for the Camera Module are necesary to avoid pressing the board too hard against this support.</p><p>It is also equiped (<em>note : visible on the shadow</em>) with 4 claw-type bits to allow the camera support to slide and lock with the main body.</p><p>The camera’s 4 fixing screws (2.5 x 10mm long) then will be helpfull to maintain the Camera Module to the support, fixing themselves in the main body.</p><h4>The Screen module</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*kc8yRwwc4XunVj7bmP14oA.jpeg" /></figure><p>This was probably the second most complex part to design after the body. In it had to be contained the Raspberry unit, fixed to the Pimoroni HyperPixel Square screen, but with the following additional constraints :</p><ul><li>Give access to the SDCard (yes, that’s one of these “<em>How did I miss that</em> ?”);</li><li>Give access to the main plugs of the Raspberry Pi A3+ (power, HDMI, sound and USB);</li><li>Give a path for the camera strip cable and the Dupont cables coming from the trackball;</li><li>Include some “swinging” poles to allow its handling, especially when shooting pictures in uncomfortable angles.</li></ul><p>Also , as the whole unit will generate some heat, it will need some ventilation cuts and of course, the screw holes at its back to hold in position. That was easy, isn’t it ?</p><h4>The battery pack holder</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*bQl2oAPEiwc9cCA46Vb4nA.jpeg" /></figure><p>Without practicle power carying approach, this camera project would be useless. As I used for quite a while the Anker 10000 Powerbank, it also revealed itself sufficient to power all the electronical components. It was thus declared “<em>fit for service</em>”.</p><p>The powerbank is eqiped with a charging indicator composed of 4 little blue LEDs at its front, so the enclosure was slightly cut to make then visible.</p><p>Bigger side cuts were made to allow an easy extraction of the battery if necessary.</p><p>Beside this “holding” role, this part also serves as a protection to the cable that runs from the camera module to the Raspberry Pi. A gap is indeed integrated in the body, allowing the cale to run through, and is kept in place by the battery holder, so that removing the battery would not be risky for the cable.</p><h4>The Body</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*jKz9wAp3vUzuKarjY0NImw.jpeg" /></figure><p>As I was saying earlier on, the Body is the part that will go under most of the revision during your design.</p><p>As you’ll add up more pieces to the puzzle, you’ll have to adjust the main body many times, but after a while, you’ll have all the necessary holes and curves you’d like to give it a proper shape.</p><p>Little detail, as the main USB connection for the battery pack will be on the outside of the camera, it was vital NOT to forger the little side hole to allow the power cable to run all the way to the Raspberry Pi.</p><h4>The customisation spot</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*g1Mod8_Q3ecCEciPBxlHSw.jpeg" /></figure><p>As you might have noticed on the lower right part of the camera’s body, a special “sliding” space is included. This is for the “<em>custom</em>” part where you can slide your own Logo or camera name to make this design your own.</p><p>In my case I chose the “HQCam Mark I” writting as alittle reminder of the Canon Professional Camera cases that are all “Mark’ed”.</p><h4>The body bridge</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*K8AlA_rpC3VbsX38XDb9bw.jpeg" /></figure><p>This unit allows the body part to be strongly connected to the handle.</p><p>Its positionning can be a bit tricky, but was made in such a way to add a strong bound to the 2 parts and yet, is still removable. Without it, the double locking claws could easily break under pressure.</p><h4>The “U” claws</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*xZFIWjb-2NsuTWGxYFvBYw.jpeg" /></figure><p>These 2 parts (one thinner than the other for the front) are additional tightning mechanism for the body and the handle.</p><p>They also provide the locking of the fron and back rods in the top and bottom parts of the handle, preventing them from moving away.</p><p>They could be a bit fidly to insert, but with some filling, it is no problem at all.</p><h4>The Screen Lock (Round &amp; Flat parts)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*6i_HYKOQA-Llv5XRD77i5g.jpeg" /></figure><p>The final parts allow you to maintain the screen holder in position with the body, avoiding it to move away unexpectedly.</p><p>Once placed on top of the right pole of the screen holder, the little flat part (note: <em>not represented here</em>) comes to make the blocking part.</p><h3><strong>Final Words on the design</strong></h3><p>I hope that going through these parts gave you a better insight of how I came up with the full picture (original for a camera case heh ? ;) and that you enjoyed it.</p><p>It might sound (overly-)complicated but I am not too much of a fan of using screws, unless really forced to.</p><p>The next part of this story will take place with a run-through of the assembly process, but you can already have a preview on the <a href="https://www.youtube.com/watch?v=bUC98WaIeWQ">YouTube </a>video.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56306b41b56f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PiHQCam — The story behind]]></title>
            <link>https://medium.com/@baloche.pierreyves/pihqcam-the-story-behind-4c0a394821f6?source=rss-f9d9033da9dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c0a394821f6</guid>
            <category><![CDATA[3d-design]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[raspberry-pi-cases]]></category>
            <category><![CDATA[raspberry-pi-camera]]></category>
            <dc:creator><![CDATA[Pierre-yves Baloche]]></dc:creator>
            <pubDate>Sun, 31 May 2020 21:51:54 GMT</pubDate>
            <atom:updated>2020-07-12T18:10:15.367Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Note: This article is part of a series of articles aimed at describing the complete process of creation of this project. The full 3D design story is now available for reading </em><a href="https://medium.com/@baloche.pierreyves/pihqcam-designing-a-full-raspberry-pi-camera-enclosure-56306b41b56f?sk=95ecbff102700775e6d48ee4e586ce2a"><em>here</em></a><em> and its software configuration </em><a href="https://medium.com/@baloche.pierreyves/pihqcam-camera-oriented-software-ui-48cdb0d6c1b1"><em>here</em></a><em>.</em></p><p>Since I was a little kid, I always was drawn to cameras. As early as 12 when I was given my very first Minox 35el from my parents, I really enjoyed the feel of being able to take pictures … sometimes with happy ending but also frustration : indeed, at the time, there was no autofocus, no auto-ranging feature and you had also to handle the exposure of the picture through a tiny needle moving in the viewfinder. But this was fun!</p><p>Of course, as the time passed by, I naturally moved to more evolved cameras to finish getting my first Canon EOS 300 “Rebel” with a nice set of objectives to give freedom to my creativity, from wedding pictures to high-speed Kite-surfing. But this was of course before I discover another great passion of mine, with the constantly renewing-potential and fun of the Raspberry Pi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MrPup5mF2h-J80j_3g7tWg.jpeg" /><figcaption>The first picture taken from the completed project : “Shooting-Bear &amp; Raspberries”</figcaption></figure><h3>Raspberry and Photography : a match made in heaven</h3><p>My interest in mixing a RaspberryPi and elements such as lenses, started when I stumbled upon a 3D design from Chia-Ming Lee. It was a custom-made adapter for Canon-lenses (<a href="https://www.thingiverse.com/thing:909176">https://www.thingiverse.com/thing:909176</a>) where the 3D part was in charge of :</p><ul><li>Holding in place the PiCamera, once removed of its own lens;</li><li>Being directly mounted on the Canon Lens.</li></ul><p>And it was quite a setup!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ja0sQTQPdJ41XJUlhSPSiA.jpeg" /><figcaption>First “enhanced” Pi-Camera Setup</figcaption></figure><p>But the results were there as it was a first step towards being able to make some nice (“<em>ultra-zoomed”</em>) photography directly from the Pi. Well… “<em>directly</em>” is a bit of a shortcut as you can see it on the picture, there was a need for a keyboard &amp; mouse combo, an external screen and being limited by the original camera ribbon length (extending it to a 50cm one made things a little bit easier).</p><p>Also, big “<em>No NO !</em>”, the adapter was printed in blue which was the only color I had in sufficient quantity at the time. Therefore, all the pictures taken had their colors modified with some extra-blue!.</p><p>This <em>semi</em>-success attempt was the first step towards what the PiHQCam was going to be. Indeed, during the summer of 2019, I managed to acquire Pimoroni’s <a href="https://shop.pimoroni.com/products/hyperpixel-4-square">HyperPixel 4.0 Square — Hi-Res Display for Raspberry Pi</a>. The dimension of the screen was ideal to start thinking about bringing the lens adapter to a new level. Reacting also to the touch events, it could become a great replacement for both the screen &amp; keyboard devices of the initial setup.</p><p>However, I wasn’t sure exactly of the shape it could fit in as, integrating with Canon Lenses is something complex and you still need to be able to hold the camera, use the lenses’s settings from one hand and triggering the picture from the other one. I remembered my youth and how I was dreaming of getting one day a Canon EX1 model. The form factor would have been ideal to mix connecting the lens and the Pi but I just wasn’t seeing myself designing such a complex body.</p><h3>April 2020 : Time to get back in (photo-)business</h3><p>As the world was going through one the most critical health situation I had ever known (and hopefully, this will be the last one!), a great news came from Raspberry Pi : a 12.3 Megapixel High Quality Camera, supporting interchangeable lenses, compatible with C-Mount lenses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ia9MOJZuuVjak1sPgyd1QA.png" /><figcaption>The official HQ Camera Product Launch message on Twitter <a href="https://twitter.com/Raspberry_Pi/status/1255754351622131715">https://twitter.com/Raspberry_Pi/status/1255754351622131715</a></figcaption></figure><p>It was (<em>confinement-</em>)time to get back into this project.</p><p>Since the past summer, I had also figured-out an additional mean of control for the camera. As the screen would use the full size GPIO connector of the Raspberry Pi, there was however an extra i2c connector extension, right under it, perfect for connecting … Pimoroni’s <a href="https://shop.pimoroni.com/products/trackball-breakout">Trackball Breakout</a> ! This little device would thus allow me to :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3d_tYUbF_e_TO9fuSjhpcw.jpeg" /><figcaption>Testing prototype of the screen &amp; trackball integration</figcaption></figure><ul><li>Trigger the shot on the camera;</li><li>Indicate notifications to the user (such as a timer);</li><li>Navigate in the application module I would have to build to support all of this.</li></ul><p>Now was the occasion to spend my non-commuting time (and countless nights !) to design what could be one of my biggest projects to put all of them together, but most important, also try to do it in a given time to have a first version fully operational and keep evolutions for upcoming releases. Indeed, once the “body” of the camera is created, I can easily upgrade its system.</p><p>Also, as I was not forgetting the joy provided by my first Pi Camera sensor project, called “snapabird”, used as a bird-feeding filming project, I wanted this new project to be also compatible with the original sensor to be able to made it available to all Raspberry Pi Camera users (whether they are HQ or not).</p><p>As the weeks of design were passing and that the number of projects involving the newly released sensor kept on popping out on my Twitter account, I couldn’t be more motivated to get it done. The fantastic projects done by <a href="https://twitter.com/OldTechNewSpec/status/1263146786983677953">Martin Mander</a> (@OldTechNewSpec) and <a href="https://twitter.com/MrPJEvans/status/1266720040327483397">P.J. Evans</a> (@MrPJEvans) involving the Raspberry Pi HQ Camera kept me on getting the project to its first stage.</p><p>And <em>Voilà</em> ! …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWR6pUi_hbqecVbb5Rr83g.jpeg" /><figcaption>Behold : “The Raspberry Pi HQCam Mark I”</figcaption></figure><p>First thing first, I had to give it back to the Raspberry Foundation and make use of the white and “<em>raspberry</em>” colors (red-cherry actually) for the body of the camera in the completely modular design.</p><p>The full design will be of course made available on my <a href="https://www.thingiverse.com/Funkypiwy/designs">Thingiverse </a>and <a href="https://github.com/pierreyvesbaloche/PiHQCam">Github </a>repos, but just to give you a glimpse of it, here are some bits to wet your appetite:</p><ul><li><strong>Pi Powered</strong> : at the heart of the PiHQCam, I used a Raspberry Pi A3+ in order to limit the power consumption mostly as there was no need for ethernet connection, but still, needed more power than the Raspberry PiZero, especially when we’ll be dealing with some of the high-quality pictures and videos that the HQ Camera can produce.</li><li><strong>Everything holds into your hand</strong> : the battery is inserted on the left side of the camera, a little bit like in the old time with the “Daguerreotype”. As I am right-handed, this felt more natural to me, but the design can of course be easily modified for left handed if necessary ;).</li><li><strong>Compatible camera sensor support for HQ and non-HQ versions </strong>: as the sensor is mounted on a separate part from the body, another version is soon be tested to hold the “normal” Raspberry Pi Camera instead of the HQ.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ADIzetZDD0262wwpf936pA.jpeg" /><figcaption>Babbage Bear</figcaption></figure><ul><li><strong>Large viewable area</strong>: the 4&quot; screen is providing a large viewing interface as well as sufficient “touching” area to access settings and other elements.</li><li><strong>Maintain access to the Pi behind</strong> : as it can be necessary to connect the Pi back again to more “stable / desk-oriented” devices, I made the enclosure of the screen movable to lift the screen up, either to have a better viewing angle, or, gain access to its power, HDMI and USB connectors.</li><li><strong>Integrate with C-Mount Lenses</strong> : as the Pi HQ Camera is compatible with C-mount lenses, it will be easier with an adaptor to get my range of Canon ones to be used with it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*3r2i9SI6WTceiPqS1NkFDw.gif" /></figure><ul><li><strong>Implement the “B.R.L.” directive</strong> : the <strong><em>B</em></strong><em>linking </em><strong><em>R</em></strong><em>ed </em><strong><em>L</em></strong><em>ed</em> is part of many Raspberry Pi projects, especially at their beginning. Thus, I added by default a 5 sec “red” timer to all shots, followed by some extra color codes for the result.</li></ul><p>In the end, after many weekends and evenings, designing and 3D printing the enclosure, with no failed print which is on its own another success for me, I am quite glad to share this project with the Raspberry &amp; Makers communities.</p><p>Subsequent articles will soon be published with the design process and software choices made to work on this project, but don’t worry, soon, you too will be able to print your Pi HQCam!</p><p>Concerning the “<em>Mark I</em>” revision, this is purely for the fun but it will be much easier to change just this bit with the future versions of the Raspberry Camera ;) .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVYN8OHfldy8RUXymZLFxg.jpeg" /><figcaption>A Pi among the Raspberries</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c0a394821f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shutdown your Raspberry Pi from the touch of a « Nerf » Button]]></title>
            <link>https://medium.com/@baloche.pierreyves/shutdown-your-raspberry-pi-from-the-touch-of-a-nerf-button-780d413c77b8?source=rss-f9d9033da9dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/780d413c77b8</guid>
            <category><![CDATA[dashbutton]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Pierre-yves Baloche]]></dc:creator>
            <pubDate>Mon, 08 Apr 2019 14:18:31 GMT</pubDate>
            <atom:updated>2019-04-08T14:18:31.248Z</atom:updated>
            <content:encoded><![CDATA[<h3>Shutdown your Raspberry Pi from the touch of a « Nerf » Button</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H8ubjUi_KUnAPwv-vyyh9g.jpeg" /></figure><p>When you are working with a RaspberryPi, you are often facing the problem of being able to shut it down properly and ideally from the touch of a button. You can always add on one of the GPIO a simple push button to do the job, but then comes the question : « How can I integrate it nicely ? » . Let’s investigate a possible re-use of the Amazon (<em>Discontinued</em>) « Dash » button to do so.</p><h4>Upgrading an existing Pi-Project</h4><p>The crew from <strong><em>Pimoroni</em></strong> (<a href="https://shop.pimoroni.com/">https://shop.pimoroni.com/</a>) developed over the years a set of add-ons to be able to add such functionality to existing Pi projects.</p><p>One of their projects I enjoy the most, is their « Pirate-Radio » (<a href="https://shop.pimoroni.com/products/pirate-radio-pi-zero-w-project-kit">https://shop.pimoroni.com/products/pirate-radio-pi-zero-w-project-kit</a>) to easily listen to Internet radio stations. All functionalities such as skip tracks/stations and volume controls are available from the « tip » of the finger through simple, short buttons, as well as for the shutdown one.</p><p>However, to find these little button can sometime be a problem, especially when you are suffering from the “Big Finger” illness ;) .</p><p>Therefore, I thought of using one of Amazon’s « Dash » button to control the remote shut down the radio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*WoZR9e5au3U0kHqx2Pc6qQ.jpeg" /></figure><h4>I just “Nerf’ed” the Pi</h4><p>This replenishment service button was launched in 2015 by Amazon, in order to be able to command « from a single press », the product that it was associated with, such as washing-machine product. Unfortunately it got discontinued in March 2019, as Alexa was supposed to be a better alternative for easy ordering. However, these buttons are great for makers ! Mine being tagged as « Nerf » , I though it would be perfect to « terminate » any Pi.</p><p>In order to do so, I decided to use the « <strong><em>Python Amazon Dash</em></strong> » (<a href="https://pypi.org/project/amazon-dash/">https://pypi.org/project/amazon-dash/</a>) (PAD)as all the functions I would need would be integrated. However, I ran into some little troubles while installing the project, that I wanted:</p><ul><li>PAD is scanning network activities with tcpdump related commands, hence you need to have it installed on your Pi, which might not be the case if you are using a « <em>lite</em> » edition of Raspbian. Just run the appropriate command to have it installed on your system beforehand:</li></ul><blockquote>sudo apt-get install tcpdump</blockquote><ul><li>PAD also depends on “<strong><em>scapy</em></strong>” (<a href="https://scapy.net/">https://scapy.net/</a>) to run, but the currently released version seems to have a problem while installing as the « LICENSE » file is missing. The Python package has been fixed but it is not yet released. You then need to install it with the following command to avoid the problem:</li></ul><blockquote>sudo pip install — pre scapy</blockquote><ul><li>Finally, PAD can be installed with no problem with:</li></ul><blockquote>sudo pip install amazon-dash</blockquote><p>Now that all the necessary packages are installed, we need to find out our button’s identity</p><h4>Where’s my button ?</h4><p>To be able to use your button, you need first of all to have it associated with your Amazon account, <strong>but not fully configured</strong>. Indeed, the final stage of its configuration is to associate it with a product available on Amazon : <strong>just do not select anything</strong>! And don’t worry about the warning notifications &amp; e-mails on your phone about finishing the process, we’ll cover that up soon.</p><p>PAD includes all the functions to identify your button on your WI-FI network. Use the « <strong><em>discovery</em></strong> » command to scan the active devices on your network. Once you pressed your button, make note of the MAC address that came up on the screen.</p><blockquote>sudo amazon-dash discovery</blockquote><p>Finally we need to register our button in the configuration file of PAD to assign our shutdown command to the Raspberry Pi.</p><blockquote>sudo vim /etc/amazon-dash.yml</blockquote><p>All we need to do is to add another device, identified by the MAC address, and to use the « <strong>sudo poweroff</strong> » command to shutdown our Raspberry Pi.</p><pre># amazon-dash.yml</pre><pre># ---------------</pre><pre>settings:</pre><pre>  # On seconds. Minimum time that must pass between pulsations.</pre><pre>  delay: 10</pre><pre>devices:</pre><pre>  XX:YY:ZZ:AA:BB:CC:</pre><pre>    name: PiRadio Nerf Button</pre><pre>    user: pi</pre><pre>    cmd: sudo poweroff</pre><p>Once configured, we activate the PAD service to have it running once the Raspberry Pi is powered on.</p><blockquote>sudo systemctl enable amazon-dash.service</blockquote><blockquote>sudo systemctl start amazon-dash.service</blockquote><p>Now, If I press the button, my Pi shuts down right away… Victory !</p><h4>But here comes the SPAM…</h4><p>As soon as you pressed the button, I bet you got a popup notification on your phone, inviting you to register a product with your button and I’m sure you could definitely do without it.</p><p>In order to get rid of any messages from Amazon about your button, your ISP box or local network router is your best friend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_DwkppLXRerJFeh2CLOPXQ.png" /></figure><p>You can reuse the MAC address of the button in the “Parental Control” section of the network controller to block any Internet access, always, for your button. That way, the button will still emit the message on the local network, but will not go back to Amazon anymore.</p><p>And this is the end of the SPAM from your button and the start of an easier way to remotely shutdown any Pi you’d like.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=780d413c77b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build your own Pi-Powered TV Recording System]]></title>
            <link>https://medium.com/@baloche.pierreyves/build-your-own-pi-powered-tv-recording-system-24b2d83f29e1?source=rss-f9d9033da9dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/24b2d83f29e1</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Pierre-yves Baloche]]></dc:creator>
            <pubDate>Sun, 24 Mar 2019 21:14:56 GMT</pubDate>
            <atom:updated>2019-03-24T21:26:35.420Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are a Pi-addict like me, I’m sure you were extremely happy like I was, when was announced few months ago, the official <a href="https://www.raspberrypi.org/blog/raspberry-pi-tv-hat/">Raspberry Pi TV HAT</a>. At the same time, my ISP announced a new upcoming setup box, meaning that I had to initiate the “retrieval” of all TV recordings out of my existing setup. Because of the “security” set on them (<em>you know, if you record it through ADSL it’s protected, but if you record it through your DVB receiver it’s not</em>), that process really made me realize that it was time to get out of any ISP proprietary system.</p><h3>Time to gather the troops</h3><p>It wasn’t long before ordering one of the hats and to get it ready to go with a new Raspberry Pi3 and assorted cooling components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5wKoJ9yoXhumyOdG7CNLXg.jpeg" /><figcaption>Pi3, cooling parts &amp; most expected DVB TV Hat</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lMtpSoCt6igXC_nVy0Eecg.jpeg" /></figure><p>The TV hat set is complete with aerial adapter, Pi supports and GPIO header to make it fit properly on top of the Pi. As it is supposed to fir as well a PiZero form-format, the set would please all Pi aficionados.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YWC_nWiXlr_w3729PuJ34w.jpeg" /></figure><p>As I was lucky enough to have some WD Pi-Drive parts (too bad they had been discontinued :( ), once completed by the TV Hat, they would be perfect to create the recording station. There were 2 models of WD Pi-Drive enclosures, small and big, but the big version was impossible to get anywhere (at least for a reasonable price) : that’s OK, as the small unit kinda reminds me of another “fruity” TV box. All that it requires is just a little touch of color to complete the enclosure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jhar8t9_5D05wU9RTajhuQ.jpeg" /><figcaption>Mounted and “labelled” Pi TV Setup box</figcaption></figure><p>Nicely organized, the official WD Pi-Drive keeps everything in place… but actually a little bit “too much”!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_SvS9RW_EIe7zEwbdPRZtA.jpeg" /></figure><p>Indeed, once the Pi3, the official hard-drive and the associated cables in place, there is no space to add our TV Hat.</p><p>Also, considering the positioning of the GPIO port, we are facing 2 issues. First, the orientation of the GPIO would require from the aerial connector to be facing the front of the box, which would not be very nice and practical. Also, as the Pi3 and the hard-drive are right on top of each other, there is actually no space to put the TV Hat in such a confined area. Therefore, an alternative must be found for the hat to be installed.</p><h3>You can keep your (TV-)Hat on after all</h3><p>After some additional research, one alternative came up in order to install the TV-Hat. You can find extension GPIO ribbons that include not just female-to-female connectors but also female-to-male, which in our case would perfectly serve the role of relocating our GPIO port.</p><p>After a little trip on the web I found a set of <a href="https://www.amazon.fr/gp/product/B01L52Y9H6/">Kuman Ribbon GPIO</a> Cables that would do the job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IWwKcWJB3urXEY7w_9u8pw.jpeg" /></figure><p>Now that the extension is found, remains one more question : how to expose the TV-Hat safely outside ? It didn’t took me long until I found the perfect match.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W-MLqr0rR8bfUcnXAsXr0w.jpeg" /></figure><p>As I had a spare <a href="https://thepihut.com/collections/raspberry-pi-cases/products/premium-raspberry-pi-zero-case?variant=25147479112">Premium Raspberry Pi Zero Case</a> lying around, I could use it to hold and protect the TV-Hat, offering GPIO accesses on both top &amp; bottom sides at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bjOsE3XcceEll_UIgPZIVA.jpeg" /></figure><p>Also, luckily enough, its side where would normally fit the SDCard part of a PiZero, would be properly positioned to give access to the aerial adapter, after some cuts made in the internal casing.</p><p>The removable cap would also allow me to protect the hat-based connector for the aerial adapter, if not being used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*576y1u3FjG27MKgGTTIemA.jpeg" /></figure><p>As you can see, the top GPIO access port was also put to use. A <a href="https://shop.pimoroni.com/products/blinkt">Pimoroni Blinkt!</a> came along to provide in the future color-based information status and a <a href="https://shop.pimoroni.com/products/button-shim">Button SHIM</a> as well to give first-hand control over the setup.</p><p>Everything was then ready for the the first trial.</p><h3>Time to setup the software bits</h3><p>The advantage of using a hard-drive based setup, was that I could hold both the Raspbian Operating System and the video recordings on the same unit. No fear of running out of space in that kind of setup.</p><p>The distribution provided by WD for its disk make it quite simple to select the hard-drive as a target. The only SD Card requirement is small, such as a 4Gb one or even smaller, to just bounce onto the hard-drive.</p><p>After a traditional Raspbian setup (activate ssh, sudo apt-get update &amp; upgrade), it’s time to install the necessary libraries and software.</p><p>First, I installed Pimoroni’s one line installers for the blinkt! and button SHIM:</p><pre>curl https://get.pimoroni.com/buttonshim | bash<br>curl <a href="https://get.pimoroni.com/blinkt">https://get.pimoroni.com/blinkt</a> | bash</pre><p>Then I easily installed the TVHeadEnd software package as explained perfectly in <a href="https://thepihut.com/blogs/raspberry-pi-tutorials/watch-digital-tv-in-plex-with-the-raspberry-pi-tv-hat">The PiHut’s Instructions</a>. It was a piece of cake to have the system running in no time.</p><p>Concerning TVHeadEnd, I can only encourage you to get and purchase the full version of <a href="https://play.google.com/store/apps/details?id=org.tvheadend.tvhclient">TVHClient</a> as it allows you to fully control from your Android device, the TVHeadEnd system. Plus, you can also use it to broadcast, through a ChromeCast, any recording you make which I find great. Its interface is very natural and presents no problem to schedule you first recordings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QZClBcC-rRUG7-KxKR8_Lg.jpeg" /><figcaption>Ready to Go for the first test</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oZHUXgZqHGl8afOC_dNUqQ.jpeg" /></figure><p>It was my lucky night when I did my first recording : the great Apollo 13 was on that evening and offered me a nice spectacle. Crystal clear image, easy recording options, the first use of the TV-Hat was a success.</p><p>I had kept the Raspbian GUI at first for easier control, but then decided to switch it off to keep the command-line only interface, in order to keep as much processing power for recording and streaming from the set.</p><p>As you can see, running the Blinkt! add-on would defenetly put some more colors to the flashy white light emitted by the WD Hard-Drive.</p><p>Who knows, may be it can transform in the future into a full ambient-light system ? … I must keep that in mind for another project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ja8Vc7ElFAKsDoLqtmMHfg.jpeg" /><figcaption>It’s Pi-ty Time !!</figcaption></figure><h3>Steady, Steady!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XetW1qEGUVtV9fSMPFOYEA.jpeg" /></figure><p>But as you can see, this new “extension” to the enclosure was not presenting the best signs of stability.</p><p>As the only thing holding the TV-Hat, Blinkt! and Button SHIM is the male connector of the GPIO cable, this definitely needs some reinforcement.</p><p>It was then time to get busy with the 3D printer in order to design a little expansion for the enclosure to keep everybody all together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SBNY_ZIhz8JEhj_nFyeKrw.jpeg" /><figcaption>The TV-Hat “Holder” extension</figcaption></figure><p>This little design had to be able to clip easily on the top of the container, firmly enough to keep the male header of the cable in place and to fit properly in the “Raspberry Pi” spirit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ykdWeIBZNxO1zI-TUkTHSQ.jpeg" /><figcaption>“Keep it all together”</figcaption></figure><p>It took me two attempts to finally come up with the proper design and positioning that would be satisfactory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jBwM8MqHidY48roUvL3rog.jpeg" /></figure><h3>Bonus Round : One button shutdown &amp; status light</h3><p>As I originally intended to control the box without need of any ssh command to turn it off, I started to build the first controls around the Button SHIM. Therefore, I used the “E” button to trigger the shutdown of the box as well as used the SHIM’s single LED for status control.</p><p>I used a simple python service module to do so, in a “<em>pitv.service</em>” file :</p><pre>[Unit]</pre><pre>Description=PiTV service</pre><pre>After=network.target</pre><pre>[Service]</pre><pre>ExecStart=/usr/bin/python3 -u /home/pi/scripts/pitv.py</pre><pre>WorkingDirectory=/home/pi/scripts</pre><pre>StandardOutput=inherit</pre><pre>StandardError=inherit</pre><pre>Restart=always</pre><pre>User=pi</pre><pre>[Install]</pre><pre>WantedBy=multi-user.target</pre><p>The last bit was to design the Python code to add Green light status at startup, Red when manually set to shutdown, and Off when being turned off. The “<em>pitv.py</em>” file’s contract was then defined :</p><pre>#!/usr/bin/env python</pre><pre>import signal</pre><pre>import subprocess</pre><pre>import buttonshim</pre><pre>terminated=False</pre><pre>@buttonshim.on_press(buttonshim.BUTTON_E)</pre><pre>def button_e(button, pressed):</pre><pre>  global terminated</pre><pre>  if not terminated:</pre><pre>    terminated=True</pre><pre>    buttonshim.set_pixel(0xff, 0x00, 0x00)</pre><pre>    subprocess.check_call([&#39;sudo&#39;, &#39;poweroff&#39;])</pre><pre>def signal_handler(signum, frame):</pre><pre>  print(&#39;GOT &#39;+str(signum))</pre><pre>  switcher = {</pre><pre>    signal.SIGTERM: handle_sigterm</pre><pre>  }</pre><pre>  # Get the function from switcher dictionary</pre><pre>  func = switcher.get(signum)</pre><pre>  if func:</pre><pre>    func()</pre><pre>def handle_sigterm():</pre><pre>  print(&#39;Handled SIGTERM&#39;)</pre><pre>  buttonshim.set_pixel(0x00, 0x00, 0x00)</pre><pre>def main():</pre><pre>  buttonshim.set_pixel(0x00, 0xff, 0x00)</pre><pre>  try:</pre><pre>    print(&#39;STARTED&#39;)</pre><pre>    signal.signal(signal.SIGINT, signal_handler)</pre><pre>    signal.signal(signal.SIGHUP, signal_handler)</pre><pre>    signal.signal(signal.SIGTERM, signal_handler)</pre><pre>    signal.pause()</pre><pre>  except KeyboardInterrupt:</pre><pre>    pass</pre><pre>  finally:</pre><pre>    print(&#39;DONE&#39;)<br></pre><pre>if __name__== &quot;__main__&quot;:</pre><pre>  main()</pre><h3>Conclusion</h3><p>I had great fun building this project and now must dive into the TVHeadEnd API and controls to be able to put into motion all the lights available ;)</p><h3>Links</h3><p><a href="https://www.thingiverse.com/thing:3513970">Thingiverse</a> File for External DVB Tunner Support for WD Pi-Drive</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24b2d83f29e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an extended Raspberry Pi Station]]></title>
            <link>https://medium.com/@baloche.pierreyves/building-an-extended-raspberry-pi-station-145b76bab0c0?source=rss-f9d9033da9dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/145b76bab0c0</guid>
            <category><![CDATA[soldering]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[3d-print]]></category>
            <dc:creator><![CDATA[Pierre-yves Baloche]]></dc:creator>
            <pubDate>Fri, 08 Jun 2018 23:02:32 GMT</pubDate>
            <atom:updated>2018-06-08T23:02:32.649Z</atom:updated>
            <content:encoded><![CDATA[<p>Long time Raspberry Fan and addict, I finally decided to start this project with a good goal : Make it fully and Doc Included. Indeed, all my other projects were functional, but I have to say, were lacking documentation in order to better share them.</p><p>This project came up to me as a follow up of Michael Horne’s great post (<a href="http://www.recantha.co.uk/blog/?p=18689">http://www.recantha.co.uk/blog/?p=18689</a>), where he had stuck a PiZero in it. Despite meeting the goal, I wanted to do a little bit more in terms of expansion, and why not make it a fully on-board computer for a car project?</p><p>To do so, i would have to do 3 things:<br>1- Add more lights (First thing to do to all Pi Projects ;)<br>2- Add more control (’cause you don’t want to depend on keyboard and ssh clients)<br>3- Add more connectivity (as you always want to do more things than originally planned !:)</p><p>So, let’s get started and pick up where Michael had stopped.</p><h3>Let’s make the place clean and mapped</h3><p>The first thing I had to acquire was the screen that Michael had found. Luckily for me the French Amazonia had it when the British one was out of stock: Yeepee :D !</p><p>So once the order passed in Amazonia, I managed to get myself a full set including the backup camera, as well as some good tools to install it.<br>I was afraid as some people mentioned it on Michael’s blog, that some of these screens could have different controller cards, making my attempt a little bit more challenging.</p><p>However, what a relieve it was when I opened the screen’s case to see that the card was exactly the same. So, first scare’s gone. I realized that I would be able to put more things inside, but as I’m not too fond of just gluing things inside, why not create a support, in which I would be able to place all my components? And there it was… A simple paper map, in order to map the position of the pegs of the casing, and also to see how much more I could put inside.</p><p>So after some fiddling, I though I could jam in the following :<br>- 2 LEDs in order to expose the Pi’s activity<br>- 2 push buttons to control the pi’s state<br>- The screen controller<br>- The PiZeroW<br>- A Zero2Go pHAT in order to bring “more power” of connectivity to the system.</p><p>I just had ordered some great Pimoroni speakers and had hoped i could fit them inside, but unfortunately, a little too big plus, no space for the phatspeaker as well inside the casing. Ah well, they will be used another time!</p><p>However, as I’m planning to have it placed in a car, and that the PiZero has Bluetooth connectivity, I should be able to get the Pi connected to the car’s BT system for the sound. So not a problem…Only solutions!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XNFvzg-TLabzZu_4F618uA.jpeg" /><figcaption>Beginning of the puzzle …</figcaption></figure><p>After some more try outs, Icame up with the following layout and got myself busy creating the support!</p><h3>Project’s board support</h3><p>To create the support, despite willing to use only Raspbian compatible tools, I ended up using instead an easier tool I have on Windows, 123Design, that I particularly appreciate, but that is unfortunately discontinued… so it took me some time and to create the first layout of the support (especially waiting for this Windowed machine to start up…)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*jgQ8h6Ta6Ol2V6KUw_5aWw.jpeg" /><figcaption>Final Layout for all the system’s components</figcaption></figure><p>After 1.5h of printing, the result came out quite ok…but required with some minor adjustments on the positioning and dimensions of the holes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IyHKGWlXbt1se4ee5HS7Lg.png" /><figcaption>3D Printing of the support</figcaption></figure><p>There were very few adjustments to make and Dagoma’s BuildTrack made it quite easy to have a fine print. I could have make the board a little bit thinner, but I feared that it would break while being taken out of the printer’s bed.</p><p>Now that the support was ready, it was time to get things moving with the soldering iron.</p><h3>Let’s get ready to solder!</h3><p>…Or more precisely, to un-solder! Indeed, the first task to do was to gain a little bit of space on the Zero4u by removing the 4 contact pins, used to make the connection with the bottom part of the PiZero, in its standard installation layout.</p><p>The pins had the following functions: Re-distribute the power coming from the power plug of the PiZero &amp; Hijack the USB Data port connection in order to split it 4 ways.</p><p>Also, the external power connector was a little bit too long to my taste, so that one too had to go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BfnrsgEzaEg35-rfDbBMtg.png" /><figcaption>Zero4U without its lower pins</figcaption></figure><p>Now that the board was in its slimmer version, it was time to hook it up to the PiZero. But, as It happens to me (too) often, sometime there’s a need to do and re-do mounting, therefore, having the 2 boards completely hooked up to each other could do with a little bit of flexibility.</p><p>Thus, I used a simple trick of using a male-female connection wire, and by cutting it in 2, I could then use the male-female connectors to easily hook-up the two boards, while the other side of the wires would be soldered to the boards. As this was the first time I was trying that trick, it tuned out it saved me a lot of time during my try-outs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JiOQjI4-pQVFVtARx0GV8w.png" /><figcaption>Soldered male wire halves, connected to the Zero4U</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1hGMd6IfPjOr5JACs8GpOQ.png" /><figcaption>Soldered female halves, connected to the PiZero</figcaption></figure><p>Two words of advices on this part: One, make sure of the connections you have to make between the boards with wires of different colors, and Two, be VERY careful on using the soldering pads of the PiZero as you could damage it by unwillingly soldering the 2 pads (like I did on the USB Data port) : it’s usually at the end that you realize it…. and thus, are good to redo couple of soldering operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gzhA4mbX5FUcnn6DaPoqKw.png" /><figcaption>Final assembly of the 2 boards by connecting back the 2 halves of the wires</figcaption></figure><h3>Time to Led on!</h3><p>Now that the main elements are connected to each other, it was time to bring on the additional lights and buttons we planned at the beginning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQzQzLOQv5KDD2c8IrAcVw.png" /><figcaption>Led, resistors, buttons, wires…. what else ?</figcaption></figure><p>For the LEDs, I wanted to use Pimoroni’s latest sparky LED in order to show the Pi’s activity when being used, as a redirection of the embedded LED of the board. Also, I wanted to use the green LED to indicate the Pi’s power’s status: however, while doing the configuration, I realized that despite being configurable in the <strong><em>config.txt</em></strong> file, as the PiZero is not equipped with it, then the Power LED would be used during the shutdown sequence instead as, after all, if the Pi is powered on, then the screen would “<em>led</em>” me know? ( OK, I’m out of here …:)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nuqfEOvo5WhWzV-FbBuGng.png" /><figcaption>LED + Resistor + Wire + Protective tube: Safety first!</figcaption></figure><p>Of course, as you can see, I shorten both legs of the LED so make sure to identify clearly its positive and negative legs in order to avoid short circuits afterwards. Also connecting the resistor and the insulating tube allows to have a more compact setting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*chyufLEz8fvmQo8dv00rbg.png" /><figcaption>LEDs and action buttons ready!</figcaption></figure><p>Now, that the LEDs are ready, I just had to prepare the 2 push buttons that were going to be used. The “<strong>green</strong>” button, would be used to wake up the PiZero from its sleeping state, using the reset pins of the board. The “<strong>red</strong>” button would thus be used to turn off the Pi, with the help of a little Python script, activating the green LED at the same time for information.</p><h3>May I have some “Pi” for dessert, please?</h3><p>With all the individual elements ready, it’s time to start the final soldering parts. Two setups have to be done:</p><p>1/ Solder all the necessary elements to the PiZero, in order to have the “more lights and action” parts, as the “connectivity” is already addressed with the Zero4U.</p><p>2/ Solder the PiZero’s video output to the screen’s controller board, as Michael demonstrated in his article.</p><p>So I went with the following setup, hoping to have after still some pins available for “more fun” ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*su2ldO9XC52qJSB5l_qTgg.png" /><figcaption>PiZeroW pins’ usage plan and connections</figcaption></figure><p>The colors I used on the schema for the wires are the same as the real ones I used for the setup, in order to facilitate their identification.</p><p>I started to solder the elements in the following order : first the video signal wires, then the reset button for “wake up”, then the “shutdown” button, then the activity LED, followed by the shutdown LED, and finally the SDA &amp; SCL connection for the video screen.</p><p>Once all the elements were soldered and in place on the board, I was quite happy with the result. Out of the 4 USB ports of the Zero4U, I could use the one facing the internal part to connect the necessary dongle for a small portable keyboard, keeping it inside. Also, the 3 others would be accessible by cutting directly the side of the base of the screen.</p><p>Adding the 4 holes for the 2 LEDs at the front and 2 buttons at the back was easy, but I could have done a better job as one of the LEDs is a bit too close to the edge, so be careful about that when doing your own drilling.</p><p>But, one tiny problem remained: how was I going to power it on, as you might have asked yourself already? Well, I had a small size micro USB extension that I wanted to use, but its width was making it impossible to bend enough to reach the PiZero’s power plug. So, I had to improvise a bit by doing my own little micro USB power cable, in order to connect the real extension one, which would provide a more solid base for powering the whole unit. Also, the fact that we had got rid of the original video (x2) and power cable of the screen was giving just enough space for the USB Cable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*30SW0d2NzYJFbDKy_iEHIw.jpeg" /><figcaption>Final Layout for all the elements</figcaption></figure><p>When folded the whole unit is quite compact and ready for action!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1uASavZMDxxYoI1Rt986PA.jpeg" /><figcaption>Good look for the base unit</figcaption></figure><h3>Last stop: “Casecuttin’ “!</h3><p>Now that the unit is all bundle, and the proper measuring taken for the opening of the 3 USB ports, It is time to use some sharp tools to get them out and available to the world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bE9yFYagoD1PNWyvC5gqvw.jpeg" /><figcaption>The cutting is working well on the case’s plastic</figcaption></figure><p>A quick tip : do use a heat gun to soften the area you intend to cut, as I did not used it enough on the cover and broke one of the side. Fortunately, some extra strong glue and electrical black tape helped me to cover the mistake… but may be this would be the occasion to design another 3D part to print and replace ;).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V4Jzk0gh0lyPRWXHEu28Nw.jpeg" /><figcaption>All 3 USB ports are accessible now</figcaption></figure><p>Both the side and back cover of the case need to be cut, in order to allow a wide variety of USB plugs to be connected. Tested with 3 USB extension cable confirmed the fact they could all be connected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UiB7nU8MjGxr_Pesu3K79A.jpeg" /><figcaption>There goes the USB Ports</figcaption></figure><h3>Software</h3><p>The modifications made to a base Raspbian system are relatively simple.</p><p>First, I redirected the activity LED with the config.txt, following the instructions provided by the RaspberryPi Folks (<a href="https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README">https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README</a>), adding “<strong>param=act_led_gpio=13</strong>” to the end of the file.</p><p>Also, I used <a href="https://github.com/TonyLHansen">Tony L. Hansen</a> ‘s simple shutdown script to properly turn off the PiZero, adapting of course the configuration for the Shutdown LED, using the GPIO 5 (<a href="https://github.com/TonyLHansen/raspberry-pi-safe-off-switch/blob/master/python/shutdown-led-simple.py">https://github.com/TonyLHansen/raspberry-pi-safe-off-switch/blob/master/python/shutdown-led-simple.py</a>)</p><h3>Conclusion</h3><p>This was a great project to initiate and I had lots of fun working on it, from 3D printing to getting as much things as I could in it. Now that the unit is ready with its 3 USB port, it is going to be for another project (already evolving in my little grey cells).</p><p>One last lesson: Don’t hesitate with experimenting and especially contributing! This is how we all progress and grow in doing the things we like!</p><h3>Links</h3><p><a href="http://www.recantha.co.uk/blog/?author=1">Michael Horne</a> Original POST (thank you for bringing out such great ideas) : <a href="http://www.recantha.co.uk/blog/?p=18689">http://www.recantha.co.uk/blog/?p=18689</a></p><p>3D Model for the support : <a href="https://www.thingiverse.com/thing:2943100">https://www.thingiverse.com/thing:2943100</a></p><p>RaspberryPi overlay configuration : <a href="https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README">https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README</a></p><p><a href="https://github.com/TonyLHansen">Tony L. Hansen</a> ‘s shutdown script : <a href="https://github.com/TonyLHansen/raspberry-pi-safe-off-switch/blob/master/python/shutdown-led-simple.py">https://github.com/TonyLHansen/raspberry-pi-safe-off-switch/blob/master/python/shutdown-led-simple.py</a></p><p>Schema Editor “<a href="http://fritzing.org/"><strong>Fritzing</strong></a>” : <a href="https://fritzing.org/">https://fritzing.org/</a></p><p>Parts from Pimoroni’s Treasure Chest : <a href="https://shop.pimoroni.com/">https://www.pimoroni.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=145b76bab0c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>