####K. Nolle (23345045), C. J. Cicai (19335265), A. R. Habeeb (23352045), Z. Zhang (22324372)
Our use case was a smart home that would have devices monitoring 'stats' in a room (eg temperature, light, CO2 levels, etc.), could control 'apparatus' in the room (machines that could affect the rooms stats) and could communicate with each other if needed.
SmartHome's have rooms and devices in the rooms. They are the network. You can run one with the command below, and can then use the terminal to interact with devices. (To satisfy project requirements, start with 5 rooms per SmartHome, which will create 5 devices on the network. You can start a network on any Pi)
python3 SmartHome.py --home_id=1 --rooms=5- Once
SmartHomeis running, you can monitor device logs like this:
tail -f home_1/device_logs/room_0_device.log- You can also monitor room stats and apparatus like this:
python3 RoomMonitor.py- You can run the untrusted device using the command below. This will create a device that doesn't join the network officially like the other nodes, therefore it will have its packets ingnored.
python3 UntrustedDevice.py- Make sure requirements are installed (just
pandas)
pip install -r requirements.txt-
Open a terminal on the Pi and run the following script/command to create a
SmartHomeinstance and to create missing directories and log/stat files:python3 SmartHome.py --home_id=1 --rooms=5
-
Open a new terminal in the same directory on the same Pi and run the following command to view the logs of
Room_0:tail -f home_1/device_logs/room_0_device.log
-
Open a new terminal in the same directory on the same Pi and run the following command to view the logs of
Room_1:tail -f home_1/device_logs/room_1_device.log
-
Open a new terminal on the same Pi and run the following script/command to create an
UntrustedDeviceinstance:python3 UntrustedDevice.py
Then input
1when prompted for a home id. -
Open a new terminal on the same Pi and run the following script/command to view the logs of
UntrustedDevice:tail -f home_1/device_logs/untrusted_device.log
- In the first terminal that is running the
SmartHomeinstance, enter0to choose the device inRoom_0. - Enter
turn offto turn the device off. - Notice activity in logs of
Room_0andRoom_1. - Enter
turn onto turn the device on. - Notice activity in logs of
Room_0andRoom_1.
After the steps of scenario 1, the first terminal that is running the SmartHome instance should still be in the menu for Room_0.
- Enter
send interestto bring up destination options - Enter
1to selectRoom_1as the destination of the interest packet. - Enter
tempto send the interest packet for dataroom_1_device/temp. - Notice activity in logs of
Room_0andRoom_1.Room_0sends the interest packet, whichRoom_1receives. ThenRoom_1sends a data packet with the requested data, whichRoom_0receives.
After the steps of scenario 2, the first terminal that is running the SmartHome instance should still be in the menu for Room_0.
- Enter
send interestto bring up destination options - Enter
1to selectRoom_1as the destination of the interest packet. - Enter
foobarto send the interest packet for dataroom_1_device/foobarthat doesn't exist. - Notice activity in logs of
Room_0andRoom_1.Room_0sends the interest packet, whichRoom_1receives. ThenRoom_1sends a data packet sayingroom_1_device/foobardoesn't exist, whichRoom_0receives.
- In the terminal that is running the
UntrustedDeviceinstance (the 4th one opened), enter0to choose the device inRoom_0. - Enter
tempto send the interest packet for dataroom_0_device/temp. - Notice activity in logs of
Room_0andUntrustedDevice.UntrustedDevicesends the interest packet, whichRoom_0receives.Room_1outputs that a packet with unknown encryption was received and discards the packet. Note thatUntrustedDevicenever receives anything back.