Category: Raspberry Pi

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

(more…)

Read MoreView 5 Comments

MongoDB 4.0.11 (64-bit) on Raspberry Pi 3

MongoDB plus Bionic Beaver on Pi

[UPDATED 05 Aug 2019] It is now possible to run Ubuntu 18.04.2 (ARM 64-bit) directly on the Raspberry Pi 3 (not yet on 4). 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+.

(more…)
Read MoreView 14 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…

(more…)

Read MoreView 5 Comments

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!
(more…)
Read MoreComment

Replace that tennis ball with a talking Raspberry Pi!

The challenge is not to hit the ladder while parking

Our garage has a ladder sticking out near where we park our car.  We want to park close to the ladder leaving enough room to walk in front of the car and also allow room behind the car for the garage door to close. A typical solution to this need, and one we’ve used in the past, is to have a tennis ball on a string positioned such that the car window nudges the ball and shakes the string — so you know when to stop.  A great analog solution!  I, however, desired a digital solution that incorporates a Raspberry Pi.

This parking-assist solution doesn’t “speak” to me!

OK, a digital solution should either have a sensor that is tripped by the car or, even better, something that could dynamically measure and show the distance from the car to the ladder.  This would require some way to provide feedback to the driver.   Hmmmm, feedback could be visual or maybe via sound.  Yes,  that’s it!  I could have an R-Pi measure the distance and “talk” to the car driver.  Another project is born 😎

 

(more…)

Read MoreView 4 Comments

MongoDB 3.0.14 for Raspbian Stretch

The main operating system for Raspberry Pi, Raspbian, continues to evolve.  The latest version as of August 2017 is “Raspbian Stretch” — based upon the current stable version of Debian 9.  The previous version was known as “Raspbian Jessie”.  One difference between versions is OpenSSL libraries. OpenSSL is a general purpose cryptography library that provides an open source implementation of the Secure Sockets Layer (SSL).  My previous builds of MongoDB relied on the older library.  As a result, my previous binaries for 3.0.14 and 3.0.9 do not run under Raspbian Stretch.  Given this change as well as other changes to MongoDB source and newer compilers, I could no longer compile MongoDB 3.0.14 with SSL.

After a few source tweaks and use of various compiler flags, I have manged to compile MongoDB core apps and tools.  These binaries do NOT support SSL and only run under Raspian Stretch on a Raspberry Pi 3.  [UPDATE — 2018 Mar 22] I have confirmed that these binaries work on the latest Raspberry Pi 3 Model B+ with the March 2018 version of Raspbian.

(more…)

Read MoreView 17 Comments

CouchDB 2.0 on Raspberry Pi

The Apache Software Foundation has released CouchDB version 2.0.  CouchDB 2.0, is a “distributed” version of CouchDB, a mature NoSQL, document-oriented data-store that is accessable via a RESTful JSON API. Developers can take advantage of CouchDB’s offline capability and reliable data sync for web, mobile and IoT apps at (any) scale.

[NOTE: September 2017 — CouchDB 2.1 and Raspbian Stretch have been released.  Check out updated instructions in this blog post]

Current Raspbian (November 2016) can “apt-get install” version 1.4 and I have previously written about getting CouchDB 1.6 running on the R-Pi.  I have now installed version 2.0.0 on an R-Pi 3 and am sharing the process.  It is pretty straightforward to get CouchDB 2.0 running on the R-Pi. It takes a combination of the R-Pi specific 1.6 install and the “generic linux” 2.0 install to get things running.

(more…)

Read MoreView 18 Comments

R-Pi Clock Radio – Zeroed!

clock_radio_20160909_smallWe had a really old alarm clock in our bedroom.  Really old.  The LED number segments, which were a nice dim red in color, had been dying at the rate of 1 segment a year and it was getting hard to read the time.  My wife finally had enough of my “I’ll get a new one real soon” excuse and bought a new big, bright, blue LED clock to replace the old clock.  It was blue … and *really* bright … even in its dim-mode 🙁  It had to go!

My converted 1942 Crosley Radio was collecting dust on my workbench.  I had finally received a Raspberry Pi Zero and Zero4U USB hub to play with but was already lusting after the new R-Pi Zero with camera port.  I recently upgraded the audio-output on my Mac from an old USB HiFiMan Express DAC to  a Schiit Modi DAC.   Hmmmmm, seemed like I had the ingredients to make a BIG clock “radio” with alarm(s) and great stereo audio?

(more…)

Read MoreView 30 Comments

Using Python with MongoDB on Raspberry Pi 2 & 3

mongodb plus pythonI’ve written about getting MongoDB running on the Raspberry Pi 2. View my other posts where you can get binaries (3.0.9) or learn how to compile from scratch (3.0.7). The mongo shell works great but you may want/need to code in Python, especially for device control or data logging, etc.

PyMongo is a Python distribution containing tools for working with MongoDB, and is the recommended way to work with MongoDB from Python. You can either use Python 2 or Python 3. Python 3 did not come on the minimal Raspbian Jessie image but can be installed using “sudo apt-get install python3”.

To install the appropriate PyMongo for MongoDB 3.0.x you can do the following from the command line. Note you could use “python3” where I use “python”, depending on your preference. I normally use the default Python 2.7.

Instructions after the break: (more…)

Read MoreComment

MongoDB 3.0.9 binaries for Raspberry Pi 2 & 3 (Jessie)

I’ve received feedback that some folks are having problems compiling MongoDB 3.0.7 per my instructions AND it takes a long time 😉

MongoDB 3.0.9 just became available but needs quite a few changes to source in order to compile on the Raspberry Pi.  I worked through MongoDB build scripts for ARCH ARM Linux and managed to “translate” for Raspbian (Jessie) Linux on the R-Pi 2.  Rather than creating patch files and writing instructions for building from source, I am providing my compiled binaries.  PLEASE do not post links to my binaries!  Feel free to download for personal use from this site.

[NOTE: I have compiled version 3.0.14 and created binaries for Raspbian Jessie for the R-Pi 2 & 3. NEW: I have also created 3.0.14 binaries for the R-Pi 3 running Raspbian Stretch that will also work on the new R-Pi 3B+.  I have confirmed that the instructions in this blog entry work with the new binaries.]

(more…)

Read MoreView 141 Comments