Category: Raspberry Pi

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 142 Comments

MongoDB 3.0.7 on Raspberry Pi 2!

MongoDB logoI have successfully compiled MongoDB version 3.0.7 and tools on the Raspberry Pi 2. ¬†Full instructions are after the break — click on “more“. ¬†As usual I found great help from the Linux community for getting this to work on ARM7. ¬†mongo, mongod, mongos, and tools¬†are all working great. ¬†The WiredTiger Engine does NOT work under 32-bit ARM but, AFAIK, all other components do ūüôā

NOTE: I have made MongoDB 3.0.9 binaries available for Raspbian (Jesse) for R-Pi 2 – here.

(more…)

Read MoreView 18 Comments

Node.js v4 & v5 on Raspberry Pi 2

Node.jsI had been experimenting with the world of Javascript on the server-side using Node.js. ¬†I “fell off the horse” when Node.js had an identity and direction crisis and io.js was forked. ¬†Node.js and io.js have reunited and the latest supported version is v4.2 with v5.0 just released. ¬†The latest “apt-get” version of Node.js as of¬†15 September 2015 is (something like) 0.6 on Raspbian Wheezy. ¬†Not current enough IMHO. I also wanted to take advantage of the ARMv7 processor in the Raspberry Pi 2. ¬†The best way forward was to figure out how to compile the latest version from source. ¬†NOTE that instructions have been updated for Raspbian Jessie and later versions of node.js.

(more…)

Read MoreView 3 Comments

CouchDB 1.6 on Raspberry Pi

CouchDB_logoPer its website, Apache CouchDB‚ĄĘ is a database that uses JSON for documents, JavaScript for MapReduce indexes, and regular HTTP for its API. ¬†One of its very cool and powerful features is that you can even serve web apps directly out of CouchDB.

CouchDB is available for Raspberry Pi via a simple, “apt-get install couchdb” BUT you’ll be installing version 1.2. ¬†The latest stable version as of 1 September 2015 is 1.6.1. ¬†While 1.6.1 is the latest, I found an excellent how-to for installing 1.6.0 at the blog, “Playing JEE on the Pi“. ¬†The big difference between¬†1.6.0 and 1.6.1 is the fix of an admin password hash issue. ¬†If you are using admin passwords, be aware that start-up under 1.6.0 could be an issue. ¬†I have not yet had time to upgrade the install process for 1.6.1.

In any case, you can find very easy to follow install instructions in an article, “Installing CouchDB 1.6.0 on the Raspberry Pi”¬†on the “Playing JEE on the Pi” blog. ¬†Follow the instructions carefully and you’ll end up with:

pi@Pi-2 ~ $ which couchdb
/usr/local/bin/couchdb
pi@Pi-2 ~ $ couchdb -V
couchdb - Apache CouchDB 1.6.0

Note: if you have installed an older version of CouchDb using “apt-get” you should uninstall first! ¬†You’ll see a few warnings with the new build and install but everything will install and function correctly. ¬†Failure to uninstall a previous version¬†will result in permission issues and incorrect start-up.

View 2 Comments

MongoDB on the Raspberry Pi 2

Raspberry Pi 2 After purchasing a Raspberry Pi 2, I decided to move some of my projects to it.  I also added an external 2.5 inch USB drive via a USB hub.  I store various sensor information in a MongoDB database and needed everything to run on the R-Pi 2.  I chose to stick with the well-supported Debian Linux port, Raspbian Wheezy, as opposed to ARCH Linux that I used on my old R-Pi B+, as the R-Pi 2 has a quad core ARMv7 processor that requires a new kernel.

UPDATE¬†(30 January¬†2016): ¬†I’ve compiled MongoDB 3.0.9 and tools for R-Pi 2 Raspbian (Jessie). ¬†Check here.

UPDATE (25 December 2015): Instructions for compiling MongoDB 3.0.7 and tools for R-Pi 2 running Raspbian Jessie are now available.  Check here.

UPDATE (8 November 2015): If you are running Raspbian Jessie, you can “apt-get install mongodb”. ¬†This will result in an install of MongoDB v2.4. ¬†Good enough for most uses and you get a working mongo shell ūüėČ ¬†If you want MongoDB v2.6.3, read-on!

I was back to hunting for a compatible MongoDB binary — or instructions on how to compile from source. ¬†Research showed that MongoDB does not compile for ARM after version 2.6.3 ūüôĀ ¬†Searching the ‘net led me to the “facat’ blog.” This blog shows how to cross-compile MongoDB 2.6.3 for ARM. ¬†Precompiled binaries are also available. ¬†NOTE that the mongo shell does NOT work correctly on the R-Pi. ¬†“mongod”, the server, does work fine and can be accessed programmatically or via a mongo shell from another (non-R-Pi) computer. ¬†I use “mongo” on my Mac to connect to “mongod” running on the R-Pi 2.

more after the break

(more…)

Read MoreView 9 Comments

mongoDB 2.6 and Node.js 0.10.29 on Raspberry Pi

mongoDB on Raspberry PiA while back, I compiled mongoDB 2.1 for Raspberry Pi based upon instructions found on other sites and kind work by developers sharing code on Github.  I acquired a Raspberry Pi B+ and tried to compile mongoDB as I had done previously.  I quickly found out that the (old) compiled version (2.1.1) no longer functions under Raspbian.

I had also been trying out Arch Linux for R-Pi as it was “lighter” and did not include all the GUI/X components that I don’t use. ¬†I use R-Pi for more server centric things and use frame buffer apps for video and images (omxplayer, fbi, fim).

I saw a comment to a posting¬†when Googling for new info for mongoDB on R-Pi. ¬†It said, simply, “use Arch Linux”. ¬†So I did! ¬†I had a little trouble getting Arch Linux to run on the B+ but after a firmware update obtained by a “pacman -Syu” on a R-Pi model B, I could now boot and use Arch Linux on the R-Pi B+ ūüôā

I did simple installs via “pacman -S” for “mongodb” and “nodejs”. ¬†I now have full mongoDB 2.6.3 with utilities, Node.js 0.10.29 and npm 1.4.21 working just fine. ¬†Sure mongoDB is pretty slow and can only handle 2GB DBs but I’ve partitioned my data into multiple DBs and combine queries and results using JavaScript.

My effusive thanks go to the Arch Linux Package maintainers!

View 1 Comment

Software for the Crosley Radio-Pi

I’ve been asked in emails and comments about what software I use on my 1942 Crosley Radio-Pi project.

I use the recommended Raspbian distro of Linux based on Debian Wheezy.  I normally do not start or use the GUI/X.  Many Raspberry Pi users use a Linux distro oriented around XBMC such as  OpenELEC or Raspbmc.  XBMC is a software media player that allows users to play and view most videos, music, podcasts, and other digital media files from local and network storage media and the internet.

While I have a Logitech K400 keyboard with touchpad attached via a USB dongle for “local” use, I almost always ssh into the R-Pi from my Mac. ¬†The Radio-Pi ¬†is connected to my home Wi-Fi network via an Edimax EW-7811UN Wi-Fi USB adapter (US$10 at Amazon).

More info on my frequently used apps and utilities after the break. ¬† (more…)

Read More

Raspberry Pi meets 1942 Crosley Radio

crosley_radio_side_webA while back, I saw a picture online of a restored antique radio that caught my attention. ¬†The accompanying ¬†post described the process of restoration. ¬†I’m not into radio restorations but I think¬†the old wood radio cases are very “cool”. ¬†I also recently contributed to a Kickstarter project for HDMIPi, an “affordable 9 inch High-Def screen for the Raspberry Pi”. ¬†I thought that I might place the screen and R-Pi inside an old radio case.

After looking on eBay and craigslist, I could not find a suitable enclosure for the HDMIPi and paper mockups showed the screen to be a bit small at a distance.  I used my old original iPad as a test device for measurements and viewing.  I liked the viewing and pixel size of this its screen.crosley_radio_back_web

Well, the HDMIPi was going to be slow in coming (still is) and I saw (fairly) inexpensive 1024 X 768 iPad displays and driver boards on eBay. ¬†I also found a old 1942 Crosley radio case that had a front cut-out that was very close to the iPad screen size. ¬†The radio portion was not fixable so the case was reasonably “priced”. ¬†I¬†bid on it … and won. ¬†I then¬†had yet another project demanding time ūüėČ

(more…)

Read MoreView 16 Comments

Raspberry Pi meets mongoDB

mongoDB on Raspberry PiI’ve been looking at noSQL databases in conjunction with Node.js. I have several Raspberry Pis that I have been using as development and test platforms. I have had good success with couchDB but have seen more examples and deployments using mongoDB. MongoDB is clearly developed on Intel processors but has been ported to non-Intel processors with different “endian”. Getting mongoDB to compile and run on a Raspberry Pi has been a challenge — as seen by the dearth of info when Googling. I did run across a couple of useful sites with links and directions on how to compile mongoDB on the R-Pi BUT both had a few problems. I’ve managed to get mongoDB version 2.1.1 working. ¬†Specific instructions — (more…)

Read MoreView 7 Comments