Update README

master
Ryan Rix 8 years ago
parent 33193c4697
commit 453198c40f

@ -2,20 +2,40 @@
** Installation
You will need a Raspberry Pi that is attached to your network. I am using a Raspberry Pi Model A+ due to its really adorable formfactor and the fact that I have some WiFi dongles laying about.
You will need a Raspberry Pi that is attached to your network. I am using a Raspberry Pi Model A+
due to its really adorable formfactor and the fact that I have some WiFi dongles laying about.
First off, get the =rpi_ws281x= library working, and verify that =strandtest.py= works for you. I followed [[https://learn.adafruit.com/neopixels-on-raspberry-pi/][this Adafruit tutorial]] to get it working, I would recommend the same; you will need a 3v3->5v logic level converter, which is unfortunate, but it makes this so much easier.
This is based on the =rpi_ws281x= library, and I ship an [[http://ansible.com][ansible]] playbook to provision it.
Once you have that working and installed, install the =matrix-client= from Pip.
Remove the =rrix.setup-home= role from =playbook.yaml= and run:
#+BEGIN_SRC sh
sudo pip install matrix-client pyyaml pytz
ansible-playbook -i ../devops/hosts playbook.yaml --become
#+END_SRC
Yes, I install it in to the main Python library path, because I'm an infoterrorist. It's an embedded Raspberry Pi, deal with it.
Yes, I install everything in to the main Python library path, because I'm an infoterrorist. It's an embedded
Raspberry Pi, deal with it.
** Usage
As root: (due to the DMA requirements)
- Create a =~/.mcatrc=
- Run =python ./lightrix.py --room "<YOUR ROOM ID>" -c ~/.mcatrc= and it'll fire up
- Go in to the room and type "rainbow"
- Run =python ./lightrix.py -r "<YOUR ROOM ID>" -c ~/.mcatrc= and it'll fire up
- Go in to the room in Vector or so and type "rainbow"
The playbook will install a systemd unit file =lightrix.service= which you can start and enable to
your heart's content
*** Remote
There is also now a remote control included which you can run to allow you to control the lights
from a web-page.
- Create a =secrets.js= which defines the following variables, and put it in =remote/=
- =accessToken=: A valid access token which the webpage will use to make requests to the HS as
- =hs=: A fully-qualified homeserver URL
- =uid=: the UID that the =accessToken= represents.
- =rooms=: an array of Room IDs which you can use to toggle to mutliple lightrix installations
(assuming each one runs in its own room)
- run =python -m SimpleHTTPServer= in the =remote/= directory
- browse to =http://DOMAIN:8000= to view the remote

Loading…
Cancel
Save