HDMI Video Capture via USB Adapter

R-Pi Video displayed on a Mac Mini

View your Raspberry Pi (Zero, 2, 3, 4) display on-the-go without VNC or prior configuration. Great inexpensive device for your toolbox! Laptop required 🙂

I have a bunch of R-Pis of various flavors. I also use R-Pi cameras (regular, IR and HQ) on a regular basis. I don’t always know the WiFi or network config for where I’m going. Sure, you can change files on your SD Card to configure things for WiFi or connect to a laptop via VNC (if you know about access point configs or know the network ahead of time). A GREAT tool I’ve added to my toolbox is an inexpensive video encoder – also known as an HDMI Video Capture USB Device. I picked up 2, at different times, off eBay for about $15/each. They are very small and light – about 2″ x 1″.

Video Capture Adapter

I was prompted to write this as I saw an Adafruit Tweet that mentioned their (new) product, “USB 2.0 to HDMI Video Capture Adapter.” A good deal at $20 with HDMI cable. All you do is plug your video-out from an R-Pi into the HDMI input and plug-in the adapter to a USB port. It then acts like a webcam in that you can use apps to view the R-Pi display on Mac, PC or Linux laptop (or desktop). This is an awesome, easy way to view video to focus a camera or preview an image or video stream – without stutter or dropped frames – that you get using VNC.


Timelapse video from a remote source

Infrared Sky Camera

This is yet another take on how-to create a time-lapse video.  In my case, a website updates a photo of the sky on a regular basis. I wanted to turn that into a time-lapse video and deploy to another, or possibly the same, website. I decided to use a Raspberry Pi 4 that was “sitting around.”

My project evolved as I tried different techniques and apps. I ended up creating a couple of bash scripts to do the job. I used the “ffmpeg” audio/video framework as it was bash command line friendly. I have tested my scripts on my Raspberry Pi 4 with Raspbian OS as well as on different Linux boxes running Ubuntu and Debian.

For how-to scripts with instructions, click on “more

Read MoreView 6 Comments

MongoDB 4.2.x (64-bit) on Raspberry Pi 4

Ubuntu 18.04.x (ARM 64-bit) is now available for the Raspberry Pi 4. While not an officially supported OS from either the Foundation or Ubuntu, James A. Chambers has been working on a port for the Raspberry Pi 4. A 64-bit OS is required to run 64-bit MongoDB 4.2.x. MongoDB (the company) just recently provided a 64-bit ARM version for Ubuntu 18.04. I will show how to install this version of MongoDB under Ubuntu 18.04 on the Raspberry Pi 4.

Note that my Raspberry Pi 4 has 4GB RAM. I believe from past experience that 2GB is sufficient to run MongoDB. I have had issues with a 1GB RAM system but worked around by creating a swap disk.

Please read my instructions carefully and copy and paste where you can. I have noticed a couple of typos on the MongoDB website where the “ARM” keyword was missing in some commands.

First, follow the instructions on James A Chambers website to install Ubuntu 18.04. I used “Release v17” but there may now be a newer release. Make sure you have updated the bootloader per James’ Raspberry Pi 4 Bootloader Guide. In short do a “rpi-update” and a “rpi-eeprom-update” under Raspbian BEFORE burning and booting-from the Ubuntu 18.04 image. I booted with ethernet connected to establish keys, etc. with Ubuntu. I chose not to use a GUI but again, James mentions several available in his write-up.

Read MoreView 8 Comments

PyPortal Blackjack game: uses sprites, touch, audio

PyPortal Blackjack Game

I recently visited relatives that frequent casinos at Niagara Falls. I decided to brush-up my Blackjack skills (or lack thereof). I was also looking to enhance my Python (CircuitPython, that is) skills by developing projects, such as this Blackjack game 😉

The Adafruit PyPortal IoT Device with display has everything you need to connect to the internet, build rich GUIs, connect various sensors AND is easy to program in CircuitPython using Adafruit libraries. The “Explore & Learn” area on the Adafruit website is filled with great sample code, nifty apps and lots of inspiration.

When not working on a personal project, I install various projects from Adafruit on my PyPortal.  A few of my favorites are the PyPortal Weather Station, the PyPortal ISS Tracker, and the PyPortal NASA Image of the Day Viewer.  I also examine and learn techniques from other projects such as the PyPortal Alarm Clock.

After examining the code for these projects and reading documentation for the PyPortal and CircuitPython Libraries, I started developing my Blackjack game. Code examples were great but I had a harder time finding the libraries I needed in order to understand how graphics were displayed. A short guide, “CircuitPython Display Support Using displayio” really helped me understand the use of sprites, graphics as bitmaps, groups, etc. Definitely worth checking out.

Card Element Sprites in a TileGrid
Read MoreView 6 Comments

PyPortal – access the micro-SD Card

PyPortal IoT Device

The Adafruit PyPortal is a great little IoT device with lots of projects available. It’s an awesome H/W and S/W platform that inspires many creative ideas. The PyPortal uses an ATMEL (Microchip) ATSAMD51J20, and an Espressif ESP32 Wi-Fi coprocessor. PyPortal has a 3.2″ 320 x 240 color TFT resistive touch screen and has several built-in sensors. It also has support for a micro-SD Card. The device itself shows up as a USB drive when plugged into a computer — but not the micro-SD Card 🙁

Software support for PyPortal is via CircuitPython. There is a great Integrated Development Environment (IDE) available in the form of Mu. Mu is a simple Python editor that also has a built-in serial-port terminal. It allows command-line input of CircuitPython for instant programming, testing, and debugging. This feature is referred to as the REPL (Read-Evaluate-Print-Loop). Deployment of code to a PyPortal is immediate with Mu’s “Save” function.

As I was experimenting with my PyPortal, I wanted to put code and resources (images, fonts, code) on a removable micro-SD Card. Easy to do on my computer but not obvious how to do on PyPortal 🙁 I looked at several PyPortal sample apps and perused CircuitPython docs available on the Explore and Learn Area on the Adafruit websitet

I’m sharing what I learned in a hopefully concise manner to save others time and frustration 😉

Read MoreView 4 Comments

UPDATE: CouchDB 2.3 on Raspberry Pi 4 & 3

From the Apache CouchDB docs:

CouchDB is a database that completely embraces the web. Store your data with JSON documents. Access your documents with your web browser, via HTTP. Query, combine, and transform your documents with JavaScript. CouchDB works well with modern web and mobile apps.

CouchDB also has Fauxton, a native web-based interface built into CouchDB. It provides an interface to the majority of the CouchDB functionality, including the ability to create, update, delete and view documents and configuration parameters.

I’ve already written a blog post for installing CouchDB 2.0 under Rasbian Jessie for Raspberry Pi.  I’m updating my instructions for CouchDB 2.1 2.3 and Raspbian Buster (in addition to Stretch and Jessie). I’m presenting this “how-to” in cookbook form — i.e. just type in the commands as presented and you should end up with a functional CouchDB install.  For more background and info, check out my previous blog post.

[Updated 10 July, 2019] Continue for detailed instructions


Read MoreView 7 Comments

MongoDB 4.0.11 (64-bit) on Raspberry Pi 3

MongoDB plus Bionic Beaver on Pi

[UPDATED 05 Jan 2020] There is now an official Ubuntu 18.04 LTS image for Raspberry Pi 3. Install the arm64 image following instructions on the Ubuntu Wiki. You can then install MongoDB 4.2.x per this blog entry. NOTE that I still recommend adding swap space – as mentioned below.

[UPDATED 03 Nov 2019] Looking to run MongoDB 4.2.x on a Raspberry Pi 4? Check out this post. It is also possible to run Ubuntu 18.04.2 (ARM 64-bit) directly on the Raspberry Pi 3. You can read more about this and get SD Card images from the Ubuntu wiki. I am using the server version of “Ubuntu Classic” as opposed to the new “Snappy Ubuntu Core.” MongoDB has an official release of MongoDB 4.0.6 4.0.11 for “Ubuntu 16.04 Linux 64-bit ARM 64.” I will show how to install this version of MongoDB under Ubuntu 18.04 on the Raspberry Pi 3B+. These instructions should work for any version of R-Pi 3 but I have only tested on my Raspberry Pi 3B+.

Read MoreView 21 Comments

MongoDB 3.4 (64 bit) running on a Raspberry Pi 3 [update]

[Updated: 28 Feb 2019] Time to lose this post!  The MongoDB 3.4 binaries have vanished from the Debian buster ARM repository BUT I now have MongoDB 4.0.6 running under Ubuntu 18.04 on a Raspberry Pi 3B+  Check out this new post!

I’ve been asked multiple times if MongoDB 3.2 (or greater) can run on a Raspberry Pi.  The answer has always been “no” — as you need a 64-bit OS to run versions >= 3.2.  Some 64-bit Linux OS’s are starting to become available for R-Pi that, in theory, could run 64-bit MongoDB.  I finally found a configuration that was easy to install and use.  I now have MongoDB 3.4.18 running under Debian buster on a Raspberry Pi 3 — with a few caveats 😉

The Debian buster release for Raspberry Pi 3 is NOT yet an official image. The hardware still needs the non-free R-Pi firmware to boot. NOTE: the latest image WILL work for the new R-Pi 3B+.  There are a growing number of apps that run under buster 🙂  My install is strictly terminal based — or headless (via ssh).  The MongoDB utilities are also (now) ported.  You can run “mongod,” “mongos,” the “mongo” shell and utilities such as “mongoimport,” “mongodump,” and “mongorestore” from the local command line or via ssh.

Here is the how-to:

  • get and install the Debian buster image on a microSD Card
  • boot the R-Pi 3 under Debian buster
  • update the OS via “update” and “upgrade”
  • install MongoDB via “apt-get install”
  • configure memory and swap
  • test out your configuration
  • put data into MongoDB database(s)
  • enjoy!

Detailed instructions after the break…


Read MoreView 5 Comments

Pi-hole® Ad Blocker runs great on the ODROID C2

I decided to try the Pi-hole® network-wide ad blocking service on a ODROID C2 SBC. I Googled around and saw mention of this running on ODROIDs but no specific “how-to” info. I know it runs well on a Raspberry Pi as I tried that 🙂 The ODROID C2 has more power, memory and network bandwidth so it should be (and IS) a great host.

In case you don’t know, Pi-hole is a network-level advertisement and internet tracker blocking service which acts as a DNS sinkhole and optional DHCP server for use on a local/private network. You setup your computers to use the Pi-hole host as the DNS server — and your done! It also provides a great web interface dashboard for options and status.

Installing Pi-hole on an ODROID C2 running Ubuntu is very straightforward. You can use the instructions from Git: https://github.com/pi-hole/pi-hole

git clone --depth 1 https://github.com/pi-hole/pi-hole.git Pi-hole
cd "Pi-hole/automated install/"
sudo bash basic-install.sh

If you end up using Pi-hole, please support its development. Donation info is available at the Git URL above.


Insert webcam image into a webpage

Raspberry Pi Zero W with camera in official case

I had the need to embed a webcam image in a webpage. I did not want to stream video and did not want to view images directly on my Raspberry Pi. I wanted to take a picture every so often and upload the image onto a website. I also wanted the webpage to update with the latest image. One other requirement was for the webcam to (try to) survive power outages without file system corruption and with auto-start at boot/reboot. Yet another Raspberry Pi Zero project was born!

I will assume that you have setup a Raspberry Pi Zero W with an official camera module though other Raspberry Pi versions will certainly work. I am using the official Zero case with camera lid as it makes a nice small package and protects the camera. I recommend using the Raspbian Stretch Lite Operating System. Ensure that you configure WiFi and have internet connectivity where you plan to position the Pi/Camera. You will need terminal or ssh access to the Pi during the setup described here.

Project steps:

  • Test camera and software configuration & prepare image for uploading
  • Setup SSH keys for easy, hands-off image file upload
  • Write shell script to take & upload image
  • Create a start-up service to launch the script & recover from errors
  • Create an environment where only RAM & not the SD Card is used
  • Prepare the target server & webpage to receive & update image
  • Enjoy!
Read MoreComment