A collection of seemingly unrelated Paolo Bernardi's personal tools with cool code names!
Lilium is a software system composed by a set of modules; the only thing that they have in common is being developed and used by Paolo Bernardi.
So far, Lilium includes the following module:
- Cecilia, a network of temperature and humidity sensors deployed throughout Paolo Bernardi's home (whose code name is, incidentally, Cecilia).
The project used to include the PBOTS module as well, but it was later refactored into a separate application.
The most prominent feature of the Lilium system is the web interface: Lilium is a Django project and each module is an app that implements some sort of dashboard or "command and control" interface. However, the modules usually need some back-end support programs as well: they can be found in the tools
directory within each module's Django app.
Cecilia is a distributed temperature and humidity sensor network, currently deployed at Paolo Bernardi's house.
Cecilia exploits several hardware components to form a distributed sensor network:
- Several Arduino Uno with DHT22 sensors.
- A Raspberry PI, which collects data from the Arduino units and, optionally, from a DHT22 sensor that can be wired directly to its GPIO pins.
The Arduino sensors can be connected to the local Ethernet network (you'll need an Ethernet shield) or to the Raspberry PI via a USB cable. For example, Paolo Bernardi house's topology is as follows:
The source code, located in the cecilia
directory, is structured in 3 separate components:
- a web dashboard (the Django views, models, urls, templates and static files) that shows an overview and a detailed view of each configured sensor;
- a data collector script that gathers temperature and humidity readings from DHT22 sensors directly wired to a Rapberry PI or to Arduino UNO units, which in turn are connected to the Raspberry PI via Ethernet or USB;
- firmwares for Arduino Uno units wired to DHT22 sensors, connected to the network with Ethernet shields or directly to the Raspberry PI via USB.
In the tools
sub-directory there are the collector scripts and the Arduino firmwares.
Prerequisites:
- Python 3 with Django, BeautifulSoup and Requests.
Lilium can be deployed as a normal Django application:
- Copy
lilium/local_settings.py-sample
tolilium/local_settings.py
and edit the latter to match the local machine's configuration. - Apply the migration to your DB with
python manage.py migrate
. - Run it with
python manage.py runserver 192.168.0.1:1234
(for development and testing purposes) or configure it with a more robust setup.
The setup of Cecilia involves several steps other than Lilium's base configuration, on the Arduino units and on the Raspberry PI collector:
- Flash the Arduino units with the appropriate firmware.
- Install the Arduino units by plugging them to the local LAN or to the USB port of the Raspberry PI.
- Install the collector scripts on the Raspberry PI.
- Change the
SERVER_URL
variable incollectors.py
. - Add the relevant
collector_*.sh
scripts to/etc/rc.local
.
Lilium is licensed under the terms of the GNU Affero General Public License version 3.
As it should be clear by glancing at this README, Paolo Bernardi loves code names: 😉
- Lilium, the project name, doesn't have a specific meaning: it is just the Latin name for the lily flower. Most importantly, this code name facilitated the design of the project logo since fleur-de-lis outlines are widespread and well-known. A previous attempt at naming the project, "Iris", fell short of a decent logo design.
- Cecilia, the sensor network module name, takes after the code name of Paolo Bernardi's house, which in turn is inspired by its location: St. Cecilia is the patroness saint of Acquasparta.