Skip to content

Setting up your Raspberry PI

Maxime Bergeron edited this page Nov 6, 2019 · 6 revisions

Setting up the raspberry pi 3

Why the Pi?

Note - this project has been tested with the RPi3, which already bundles everything to receive and send commands to the devices. Nevertheless, it should work on virtually any computer/microcomputer that supports python3

The RPi is a great device to use as your home automation/IoT hub. It consumes very little power (with video off) and can easily send commands via Wifi, Bluetooth Low Energy or GPIO. If you can control a device using either:

  • A bluetooth BLE command
  • A shell/bash command
  • A android app

...there are many chances that it works or might eventually work - after some development - with this project.

RPi3 Setup

  1. Install Raspbian (or any UNIX distro that is lightweight and has a command-line interface, so pretty much any distro right now). Refer to https://www.raspberrypi.org/help/noobs-setup/2/
  2. Login via SSH from another computer, usually with "ssh pi@raspberrypi". Google it if you do not know how to use SSH.
  3. Update it
sudo apt update 
sudo apt dist-upgrade 
Then install python pip:
sudo apt install python3-pip
  1. Pip install the project requirements.
pip3 install argparse configparser decora-wifi

Note - Requirements may change over time. If you run the project and it complains about X module not found, just execute: pip3 install X.

  1. (Optional) If you plan on using HDMI-CEC, double-check that your TV supports it and plug the HDMI cable to an unused slot that is CEC capable. You might also want to turn off the graphics output on the Pi to save energy (will not affect the CEC capability) by doing so: sudo nano /etc/rc.local, then add "/usr/bin/tvservice -o" at the end of the file, then save (ctrl-X). Reboot.

  2. Install git then clone the repo

sudo apt install git-core git
Go to the destination folder, or "cd" and enter to clone to the home folder.
git clone https://github.com/Mazotis/Lightserver
  1. Test the server (Note - will most likely not start before you Configure the play.ini file)
cd Homeserver
sudo chmod +x ./home.py
sudo chmod +x ./homeclient.py
./home.py --server
  1. When everything works, run the server automatically at boot.
sudo cp homeserver.service /etc/systemd/system
sudo systemctl enable homeserver
sudo systemctl start homeserver
Then double-check that everything works okay:
sudo systemctl status homeserver