Guestbook is a project I built for Next Canada: it's a system consisting of a wi-fi login portal, analytics dashboard and a "who's currently in the office" screen.
Next Canada offers a co-working space for their entrepreneurs. They reached out because they wanted to:
- see the names of who was currently in the space (for staff use, but also for others to see)
- report on space usage (it's their primary budget expense, and they want to justify it)
- monitor how much freeloading was going on (during certain times of the year, alumni can make long-term use of the office if they pay)They had tried a paper sign-up sheet, but it was ignored.
I suggested we could leverage the wi-fi to meet their needs. Since everyone who uses the space wants to use the wi-fi, we could require them to "sign the guestbook" to access the wi-fi (like you do at an airport or café).
The experience for a visitor is as follows:
- they scan a QR code (or select the appropriate network on their device)
- they are prompted to "sign in to the network" with the following screen:
- they have wi-fi, and go about their day
- their profile shows up on the "who's here" screen
- if they visit a certain URL, they can update their profile (in particular, to add their photo)
- (due to limitations of the "capture screens", images can't be uploaded)
Administrators are able to...
- see a list of all current profiles and devices
- edit profiles
- for any profile, see a history of access
- run a report for profiles who accessed in a given time period
The implementation involves:
- a refurbished ThinkCentre running a Clojure web app that...
- talks to the Ubiquiti network admin API
- adding or removing MACs of allowed clients
- listing connected clients
- offers up the "sign in to the network screen"
- and stores the resulting profiles and MACs
- regularly polls the Ubiquity network device for connected clients
- and maintains a persistent history of access for each profile
- offers an admin interface
- this ran on a Raspberry Pi zero for 1 year (!)
- I decided to upgrade because...
- longevity (SD cards used like this tend to wear out fast)
- worried I would eventually run out of RAM (some admin operations needed a lot)
- speed (the admin interface was very slow)
- a Raspberry Pi Zero connected to a TV running the "who's here" screen
- which starts a browser after booting with the relevant page from the main server
Fun bits:
- Overall, it was quite satisfying to hook up a multi-device system (network controller, server, screen, mobile devices) and hook into the "wi-fi capture screen" process
- Ubiquity doesn't have an official API, so I had to reverse-engineer the HTTP requests (based on intercepting requests from the admin portal and some notes from the internet)
- includes an on-device js face-detection script to crop and resize the user's uploaded photo
- implemented as an old-school html-only backend (not an SPA with Reagent and React)