Raspberry Pi vs. CloudKey


  • Sun 30 September 2018
  • misc

Recently, we've been rolling out a bunch of Ubiquiti Networks UAP-AC-PRO-E Access Points, first to $CTO's, $CEO's, and my house, and once we were satisfied that they worked OK, $DAYJOB's offices and datacenters.

These access points need a controller in order to work. The data doesn't flow through the controller, rather, that's how you configure stuff here in the future. The controller is written in Java (sigh) but that means you have some degree of choice on what to run it on.

Of course "some degree of choice" means you need something to run it on. At my house this was easy - it's available as a .deb so I chose to run it inside a Ubuntu LX brand zone.

But what about at Bill's house? I initially went with a Unfi Cloud Key on the theory that a $77 hardware appliance would be best. But the Cloud Key lives up to its name and demands that you have a login into the Ubiquiti Cloud, which purports to allow you to manage your wireless from anywhere in the world.

That's a great idea in theory but I never did get the off-site management working and the cloud-based SSO in order to talk to my local configuration manager is the sort of thing that creates a chicken-or-egg problem if you're trying to fix stuff while the Internet is broken.

But I was happy with my home based ersatz-Ubuntu setup. That got me to wondering - we ran STB user interfaces on Java at Time Warner Cable, on CPUs that compared unfavorably with a first generation Raspberry Pi... would a Raspi2b, 3b, or 3b+ fit the bill? They cost less than a Cloud Key, and are capable of doing all sorts of other random housekeeping stuff such as running (much better than your router's built-in) dhcp and dns servers, monitoring reachability in the interests of catching your last mile ISP in the act, etc.

I gave this a try and indeed performance is satisfactory, though when I did this a couple of months ago Ubiquiti did not have its own repository - they do now as of September 17 2018 and their preferred installation method of "here install this .deb and then run sudo apt-get update –fix-missing" did not comport with the way that I like to do things. Fortunately, the dependencies were limited to OpenJDK, mongodb, and jsvc, so I wrote a little Ansible to automatically install the software on a Pi.

{% highlight yaml %}

  • hosts: raspi-3bplus

tasks:

- name: updating apt cache
  apt: update_cache=yes

- name: mongodb
  apt: name=mongodb-server state=latest

- name: openjdk-8
  apt: name=openjdk-8-jre-headless state=latest

- name: jsvc
  apt: name=jsvc state=latest

- name: Check if unifi controller is installed
  command: dpkg-query -W unifi
  register: unifi_check_deb
  failed_when: unifi_check_deb.rc > 1
  changed_when: unifi_check_deb.rc == 1

- name: Download unifi 5.8.30
  get_url: 
    url="http://dl.ubnt.com/unifi/5.8.30/unifi_sysvinit_all.deb"
    dest="/tmp/unifi_sysvinit_all.deb"
  when: unifi_check_deb.rc == 1

- name: Install unifi 5.8.30
  apt: deb="/tmp/unifi_sysvinit_all.deb"
  sudo: true
  when: unifi_check_deb.rc == 1

...

How to do the installation is hopefully only of historical interest since as I mentioned there's a repo for that now, but the performance was actually not bad, and "stick a raspberry pi in the rack" is how we decided to deploy in a couple of our office locations.

I'll report back later when I have some time to lab up installing entirely via apt.