Configuring a static IP on HypriotOS for the Raspberry Pi

How you configure a static IP on the Pi changed between Wheezy and Jessie, and it seems on Hypriot’s prebuilt images for running Docker on the Pi, it’s a slight variation.

Edit /etc/network/interfaces.d/eth0, comment out the DHCP line:

iface eth0 inet dhcp

and add:

iface eth0 inet static
address your-static-ip
gateway your-gateway-ip
#google dns servers
domain_name_servers=8.8.8.8, 8.8.4.4

Done!

Docker 1.12 RC on the Raspberry Pi

If you’re excited about playing with the swarm mode in the new 1.12 version of Docker, you can download the release candidates for Linux, Windows, Mac, but it’s not obvious where you can get an ARM compatible version to run on the Raspberry Pi.

The awesome guys over at Hypriot talk about running the 1.12 RC on the Pi, but their prebuilt OS images for the Pi don’t yet include the 1.12 RC version. I found this blog post however, which mentions a download location where you can pick up a .deb file and install it on the Pi with dpkg.

Downloaded, installed on my “to be” Pi cluster of 2 Pis, and up and running! Now to deploy something with swarm 🙂

Mac Docker 1.12.0-rc3-beta18 native client and insecure registry

A while back I set up a local Docker Registry to share images between different machines, and configured it as an ‘insecure registry’ since it’s just for testing. With the latest native Docker engine for Mac OS, I was having difficulty pushing to the Registry, it was just fail with a cryptic message:

$ docker push 192.168.1.66:5000/rpi-mongodb

The push refers to a repository [192.168.1.66:5000/rpi-mongodb]

Get https://192.168.1.66:5000/v1/_ping: http: server gave HTTP response to HTTPS client

I noticed in the Docker menu from the menu bar that there’s a Insecure Registries section under Preferences, Advanced Options. Adding the IP and port of my Registry there fixed my problem, now I can push:

$ docker push 192.168.1.66:5000/rpi-mongodb:latest

The push refers to a repository [192.168.1.66:5000/rpi-mongodb]

3d4f4a09f67b: Pushed 

fc91d495516f: Pushed 

5f70bf18a086: Pushed 

532820a7256b: Pushed 

ed62ae893def: Pushed 

994d5442545b: Pushed 

f097d343f850: Pushed 

latest: digest: sha256:c71c6743924243d6117050a1b5b95adf4effee7c9059315c0bfe500f67e0d16b size: 260

Running gpsd on a Raspberry Pi 3 over UART

Adafruit have a great tutorial for connecting and setting up their GPS Shield on the Pi. To connect it direct to the tx/tx GPIO pins on the Pi (instead of USB), there’s some additional steps covered here. Since the Pi 3 uses it’s hardware serial with the onboard Bluetooth, there’s additional steps covered that are Pi 3 specific.

After following those steps however, runnning cgps would run for a second and quit, with ‘No Fix’. What’s odd was that doing a ‘cat /dev/ttyS0′ would show the GPS NMEA messages being received, so I could tell the GPS board was up and receiving, but something else was not right.

Instead of starting gpsd as a daemon, running it form the commandline with additional debugging options gave some additional clues:

pi@raspberrypi:~ $ sudo gpsd /dev/ttyS0 -n -N -D3 -F /var/run/gpsd.sock

gpsd:INFO: launching (Version 3.11)

gpsd:ERROR: can’t bind to IPv4 port gpsd, Address already in use

gpsd:ERROR: maybe gpsd is already running!

gpsd:ERROR: can’t bind to IPv6 port gpsd, Address already in use

gpsd:ERROR: maybe gpsd is already running!

gpsd:INFO: command sockets creation failed, netlib errors -1, -1

This thread has others with the same issue. There are some suggestions towards the end of the thread to edit /lib/systemd/system/gpsd.socket and change some values, but the one recommendation that worked for me was to use this to start the service:

sudo service gpsd start

and then running cgps connected to the gpsd daemon, and everything is good!