Category Archives: Raspberry Pi

Zero Config Raspberry Pi on IPv6

Thanks to this post and a little tinkering, I demonstrated how to set up a zero config raspberry pi with IPv6 running a Django web application. The use case here is that I want to find my device using a web browser, without having to set it up at all, and without needing DHCP. In other words, with this configuration you could connect a machine with a browser and an ethernet directly to the raspberry pi, and access its functions with no configuration at all. I started with the ubuntu release for the raspberry pi, and added the avahi daemon as described in the post. I added ipv6 to the /etc/modules file. I added the xml description of the ssh service as described for the file /etc/avahi/services/ssh.service. I rebooted and verified the service description using “Bounjour Browser“. Because I left the default user and system name, the login is “ssh -6 ubuntu@ubuntu.local”. By running my Django server with an IPv6 flavor:

sudo python manage.py runserver [::]:80

I am able to access the instance at
http://ubuntu.local
– running over ipv6. I can do this with a direct connection to my iMac with no DHCP service.  The iMac can talk directly to the Raspberry pi through a switch if the ipv6 configuration is set to “autmatically” or “link local only”.   The manual IPv6 configuration requires an IPv6 router which isn’t needed for my use case (and I don’t have).

The challenge came with windows7 and Ubuntu as a host to access the Raspberry Pi over the link local address.   If I manually configure a static IPv6 address for both Raspberry Pi and the host, the connection works.   If I manually configure just the Raspberry Pi and try to access it from the iMac using a link local address, it says there is no route to the Raspberry Pi.

ping6 -I en0 ubuntu.local
PING6(56=40+8+8 bytes) fe80::426c:8fff:fe1d:562e%en0 --> 2001:db88:1:77::1
ping6: sendmsg: No route to host
ping6: wrote ubuntu.local 16 chars, ret=-1
ping6: sendmsg: No route to host

The challenge I have had with Ubuntu is getting it to understand which interface to use, as described here.  I note that when the iMac pings a link local address, it resolves it and appends the interface name:

ping6 ubuntu.local
PING6(56=40+8+8 bytes) fe80::426c:8fff:fe1d:562e%en0 --> fe80::ba27:ebff:fe1a:74e5%en0
16 bytes from fe80::ba27:ebff:fe1a:74e5%en0, icmp_seq=0 hlim=64 time=0.699 ms

That seems to be a missing piece for Ubuntu. Yes, you can configure a static IPv6 address on both sides of the connection, but that completely defeats the purpose. I’ll continue to look for a way to get Ubuntu to work as a host and update once I figure it out. In the meantime, I’ve turned on IPv4 over DHCP in /etc/network/interfaces and that works on my local network

auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
iface eth0 inet6 auto

Just follow changes to the interfaces file with “sudo ifdown eth0; sudo ifup eth0”.

Ubunto Snappy for Raspberry Pi

I’m inspired by the Raspberry Pi platform so I recently acquired one to see how well the technologies I know run on it.  Basically I’d like to demonstrate that it can be a zero config module running either Rails or DJango as a web app server to provide web appliance functionality without configuration.

So far I’ve loaded a couple of distributions.   I’ve booted ubuntu 14.04 “trusty” and mostly configured rails.   Even though I’m using an 8GB micro SD card, it appears that the system loads everything into the 2GB ram, so a “df -k” reports 1.7GB total and about 700MB available after the rails installation.  Merely interesting, as one of my teachers used to say.

The potentially more interesting distribution is the Snappy distribution.   Very minimal.    I’ve only played with it a bit, but a very compelling feature is a zero config DNS entry at webdm.local, which presents a (currently useless) web interface at http://webdm.local:4200.  It also allows ssh access:

ssh ubuntu@webdm.local

which shows great promise.   For me, by default this errors out:

Permission denied (publickey,password).

The issue is that ChallengeResponseAuthentication is disabled by default, so it never asks for a password.   To get past this,  I need to hook up a display and a keyboard, edit the config file /etc/ssh/sshd_config to change the ChallengeResponseAuthentication to ‘yes’.  

Perhaps even more odd, is that the package management tool “snappy” fails out of the box. This is a side effect of the certificate mechanism for installation (a very good idea), but it fails because the snappy core doesn’t know the date. Raspberry Pi doesn’t know what date it is, and the snappy core doesn’t include NTP. SO you need to log in and set the date for it to do anything. I don’t know what packages are available, but searching for ruby and rails comes up empty. NTP also. The objective for this distributio nis to support the Internet of Things (IoT), so it HAS to be zero config, but it doesn’t have to know the date, or allow packages to be installed, out of the box. Maybe better if it doesn’t, but it makes the developer’s life more of a challenge.

I’ll update more later.