< Go back
Check out our documentary (YouTube)
As a part of a two-semester long Software Engineering project at Heriot-Wat University, we (a group of six students) have been asked to create a fictitious software engineering company which is building a smart home system of the future to a client. During the 7 months we have built:
go doc, as no good solution exists.
Afterwards, we converted nacdlow.com into a portfolio website describing each of the project we worked on. The description in section two of this document is adapted from the portfolio website.
You may also check out our coursework’s stage 3 report which goes in detail regarding the entire project.
The core parts of the project (such as the web application server and plugin API) is written in Go, but other languages have been used in different parts of the project, such as Java for the Minecraft plugin, LaTeX for collaborating on requirements specifications. Getting the e-ink display to work required us to modify the Waveshare driver so we can display the output upside-down, which was a bit tricky. The program to update the e-ink display was written in Python.
We even used tools such as Adobe XD for prototyping and usability testing, Tinkercad for creating the iglü case which was 3D printed (thanks to Edinburgh Hacklab). Other tools used were Blender, GIMP, Adobe Lightroom, Photoshop, After Effects, Premiere Pro, and Illustrator, these were used in making graphics, banners, logos, promotional video and other forms of artwork. We are lucky to have a group with a diverse range of skills.
The following are all of the services part of the project.
A mail server has been setup, and each member of the team has an inbox (such as firstname.lastname@example.org). A general broadcast email was also created. This is as we try to manage our group as similarly to an actual company as possible, and from that we have learned a lot.
Each project has a its own description, each project will be listed below.
This is the core of the smart home system. This project contains most of the work done on the project. It is a self-contained project which includes:
Visit our demo website to try it out!
It is the web server and control system for the smart home. Its purpose is to control home appliances and Internet-connected devices. It is self-contained, handling access-control among other things, and should work without Internet connection.
The server is written in Go, and uses the macaron web framework and XORM for the object-relational mapping library. We have built a custom plugin API which runs over Remote Procedure Calls (RPC) using HashiCorp’s go-plugin library.
For the front-end, iglü uses MDBootstrap for the basic design, which we have built upon. And to provide more interactivity and better user experience quickly, we have used jQuery. Other libraries are used such as Chart.js, FontAwesome, and Skycons (from Darksky) to add dynamic graphical elements on the page.
These are some libraries and frameworks we have used to speed up development so we could focus on the product.
Since the source code of the project is provided, you may build and run iglü.
You require the following packages:
Then clone the project, build, and run it.
$ git clone https://github.com/Nacdlow/iglu-server $ cd iglu-server $ make $ ./nacdlow-server run [--port 443] [--dev]
No database set-up is required, all required tables will be created automatically on an SQLite database file.
iglüOS is our custom Raspbian Lite-based distribution built for Nacdlow’s iglü. It allows you to have an OS image for the Raspberry Pi with iglü installed as a service, which boots on startup.
It also allows you to also set up WiFi configuration (eduroam, in this case) for expo purposes.
Our distribution includes the following changes:
We ran this distribution on a Raspberry Pi Zero W, which contains a Waveshare e-ink display and a real-time click (RTC). We placed this in a 3D-printed case printed on a Prusa 3D printer at the Edinburgh Hacklab.
To create this custom distribution, we created a set of Bash scripts which
modifies Raspbian Lite. This is done by resizing the main partition in the
.img file using
qemu, and using
kpartx to mount the partitions to
loop devices. Once mounted, the script performs any modifications to the files,
proot along with
qemu-arm-static to run commands for updating and
installing packages, enabling custom
systemd services, and do other changes
to the system.
The resulting image is then flashed to a microSD card, and inserted in the Raspberry Pi fully configured and working.
As we were working on private GitLab repositories, we weren’t able to use GoDoc to generate documentation for our project.
So we created a simple Unix-like tool which allows you to pipe the output of go doc to generate Markdown.
After implementing this, we have created a script to generate our Wiki for the iglü server repository automatically, including a table-of-contents.
I have released this program as a separate project, which you may check out and use.
This is a custom Domain Name Server which returns a custom response for our domain, used for testing PWAs with HTTPS support (required by service workers).
In our use case we set it up to resolve
local.nacdlow.com to our local
computer’s IP address.
It uses Miek Gieben’s DNS library for both resolving and serving.
This is our Software Development Kit for developing iglü server plugins in Go. It is based on HashiCorp’s go-plugin library, which they use in their products.
Plugins communicate with the iglü server via Remote Procedure Calls (RPC), this makes it so that if a plugin crashes, the server will continue running and allows us to restart the plugin. Also it allows us to create plugins in different languages if required in the future.
This SDK provides a Go interface which can be implemented so the server may load the binary.
This is our internal plugin package graphical program, which allows us to:
It then places it in the marketplace repository, and stores them in categories depending on the platform/architecture (just like Debian’s APT).
This is iglü marketplace website and plugin repository. It contains the descriptions of all plugins, and their compiled binaries. The website is also linked to our Payment Gateway for purchasing paid plugins.
To download a package, the marketplace redirects the user to the local iglü instance prompting the download of the plugin.
The site is built with Hugo, and is statically generated (just like this current website).
Visit the marketplace: https://market.nacdlow.com
Our Stripe testing payment gateway, which is built for our static Marketplace website. This is deployed on Heroku and uses Stripe’s Go library.
This payment gateway may only be accessed through the Marketplace, and since
this is using Stripe’s test mode, you may use their test card
numbers to continue through the purchase. You
4242 4242 4242 4242 with any expiry/CVV number.
We wrote a program in Python which pulls in data from the smart home system and displays it on the e-ink display. We used FontAwesome icons and converted them to bitmaps to support the display.
This program uses our Waveshare Driver Patch so the display is flipped upside-down, due to the space constriction in the 3D printed case.
We built a patch for the Python Waveshare
epd2in13_V2.py driver, which flips
the output upside-down.
This is because of the limitations of our 3D printed build, and where the USB power port is located on the Raspberry Pi Zero W.
Instructions on using this patch is available in the project’s repository page.
We created a Bukkit/Spigot Minecraft server plugin, which allows us to sync aspects of the simulated iglü environment in a Minecraft game world. We did this instead of building our own custom simulation environment, whether that be a simple interface or a custom simulation game.
This allowed us to save a lot of time in simulating, as Minecraft is a game which is easy to extend.
To make the Minecraft Spigot plugin work, we built a iglü plugin, which is built entirely using our Plugin SDK. This allows our Minecraft Spigot plugin to display in-game lights and devices in the “search devices” list.
To demonstrate that the system may also interact with the real world, we created an iglü plugin which integrates the LIFX Wi-Fi enabled LED bulbs to hook into iglü, displaying all the available lights registered on the account.
This is an iglü plugin which customises the look-and-feel of iglü using web extensions, adding a light theme to the iglü interface.
The group consists of:
Although the projects are not open-sourced, the projects’ source code may still be browsed on our GitHub organisation.
This means you may only view the source code, you may not be able to use any parts of the source code or redistribute it. The project remains the exclusive rights of the project creators.