HomeIoT is project for smart home automation, simulating a full IoT architecture and providing an user interface to interact with it. IoT devices (lights, motion sensors, thermometers, ...) are all interconnected in a IPv6-based wireless sensor network.
The sensor nodes (motes) are implemented in Contiki-OS and run in the Cooja simulator.
The CoAP protocol enables communication between the motes and a cloud application running the CLI and smart services.
Here is a list of smart devices emulated in the project:
bulb: lightbulbpir: PIR (motion sensor)thermo: thermometerheater: heateraircond: air conditioner
All the motes support the IPv6 protocol. In addition, a node acts as a border router for the whole network.
These are the available commands and their description:
ls: display the currently registered resourcesread: show the status of a resource or a group of themset: change the status of a resource or a group of themsmartlights: get or change the status of the SmartLight servicesmarttemp: get or change the status of the SmartTemperature serviceclear: clear the console outputhelp: display help information about a specific command
A couple of automated smart services are offered:
Smart Lights: every time a PIR sensor detects motion, the corresponding room lightbulb is turned on.Smart Temperature: when the average temperature recorded by the thermometers is above or below certain thresholds, the heaters or the air conditioners are switched on accordingly.
Clone the project in a folder inside Contiki, like contiki-ng/examples/HomeIoT.
Assign another IPv6 address to the loopback interface, to make the registration server reachable from the devices:
sudo ip -6 addr add 2001:0db8:0:f101::1/64 dev lo
Start Cooja, then import the simulation home_simulation.csc.
Set the simulation speed to 100%, and start it after the cloud app (see the next steps).
From another terminal, connect to the border router:
cd border-router
make TARGET=cooja connect-router-cooja
Open another terminal to compile the cloud application:
cd cloud-app
mvn install
Then launch it:
cd target
java -jar home-iot-0.0.1-SNAPSHOT.jar
If you encounter any problem, feel free to open an issue. I am open to pull requests as well.
The project was developed by Leonardo Lai. Please check the license if you are going to use, modify or share this work.