Skip to content
Florian Hu edited this page Dec 18, 2016 · 1 revision

Circadia Wiki

Setting up Circadia on a Raspberry Pi 3

I just installed Circadia on a new Raspberry Pi 3, here's what I did:

  1. Download a recent Raspbian or NOOBS image, install it as usual on your Pi (in my case Noobs 2_1_0)

  2. Set up your Wifi connection.

  3. run sudo raspi-config

  • enable SSH (if you want to do your work remotely)
  • change the password
  • disable the boot shell on the serial port
  • setup your timezone
  1. Plug in your USB Sound card
  • see if it's working with any old audio file you can find on the Pi aplay ./python_games/match1.wav

  • in my case the audio came out of the onboard audio instead of the sound card so I had to create a file called /etc/asound.conf and add the following lines to make the usb card the default

    defaults.ctl.card 1
    defaults.pcm.card 1
    defaults.pcm.device 0`
    

    you can check the available devices with aplay -l (Note, I tried the usual method of creating the file .asoundrc, and this also works, but not for root (sudo) )

  1. build and install Jeremy Garff's excellent rpi_ws281x library
  • Adafruit has a great post about getting it up and running, adafruit
  • Connect an LED strip to test with (360 Ohm, 1000uF) and get the strandtest.py to work
  1. Download Circadia or use git clone https://github.com/hooyah/Circadia.git

  2. Download some themes to play with, Circadia Themes

  3. open the file MSR_HAL/circadia_hw_lamp.py

  • set the LED configuration at the top to the values that worked for the strandtest.py
  1. Open the file circadia_cfg_template.json
  • under platform_cfg, raspi change the screen_width and screen_height according to your strip
  • change the serial device name to you system's serial port (PI 2=ttyAMA0, PI 3=serial0)
    (on a Raspberry Pi 3 the uart is a bit messed up and needs to be dealt with)
    enable serial0 uart by setting enable_uart=1 in /boot/config.txt
    or don't specify a device with "serial": ""
  • save it as circadia_cfg.json
  1. add the environment variable CIRCADIA_PLATFORM to your env
  • I'm using bash so I added the line export CIRCADIA_PLATFORM="LAMP" to the top of my .bashrc file
  • make sure sudo is able to see it too (visudo)
  • run sudo visudo and add the line Defaults env_keep += "CIRCADIA_PLATFORM"
  • -X to quit then Y to save
  • make sure the variable is there sudo env|grep CIRCADIA
  1. Done. Try the alarm app with: sudo python circadia_alarm.py [themename]
Clone this wiki locally