Epilepsia is a user friendly cape for the beaglebone capable of driving up to 32 strips of neopixels (actually, WS2812B LEDs) in parallel.
- Can drive 64x32 WS2812B LEDs at around 450-500 fps
- Support the Open Pixel Control protocol and websockets for feeding data.
- Can be configured for 8, 16 or 32 outputs.
- Gamma correction and brightness settings
The led_driver class handles the communication with the PRUs. Each PRU can drive 16 WS2812 led strips in parallel using two 74HC4094 serial to parallel shift register. The bits of the frame buffer are reordered by the beablebone's CPU before being copied to the PRUs shared memory. Each PRU just has to sequentially read that memory to fill its shift registers. The single wire protocol of the led strips is implemented by switching the parallel outputs of the 74HC4094 IC.
The following schematic shows the wiring the 74HC4094s and the PRUs:
You can compile epilepsia and build a debian package with the provided Dockerfile:
git clone https://github.com/fyhertz/epilepsia.git
cd epilepsia
docker build -t fyhertz/epilepsia -f docker/Dockerfile docker
docker run -ti -v `pwd -P`:/data fyhertz/epilepsia
The -v option is needed to mount the project files in the container. On Windows/Mac OS you might want to replace the pwd
command with the path to the your clone of the project.
Cross compiling epilepsia from a linux host:
- You will need the clpru C/C++03 compiler from TI to build the PRU firmware:
wget http://software-dl.ti.com/codegen/esd/cgt_public_sw/PRU/2.2.1/ti_cgt_pru_2.2.1_linux_installer_x86.bin -O clpru.bin
chmod +x clpru.bin
./clpru.bin --mode unattended --prefix /opt/ti
- A C++14 cross compiler is needed for building the ARM linux binary. On debian/ubuntu run:
sudo apt-get update && apt-get install -y make g++-arm-linux-gnueabihf
- The project simply uses some plain Makefiles
make
Supported hardware: beaglebone black, beaglebone black wireless, beaglebone green, beaglebone green wireless
For simplicity sake, this guide assumes that you are using, or are willing to use, a recent firmware image for your device. As of May 2018, that means:
- kernel version > 4.9. Before that, the pru_rproc driver behaves differently
- U-boot overlays which have recently replaced Kernel overlays
- cape-universal readily available. It's a set of device tree overlays that allows you to easily select pin modes with the pin-config command line tool.
If for some reason you don't want to reflash your beaglebone, epilepsia should still work (maybe with some more work) as long as you have the pru_rproc driver (and not the uio_pruss driver).
- So, if you don't want any headache, get the latest official debian build here (with debian 9 as of May 2018) and flash your device with it.
- On the bb green wireless you need to disable the wireless virtual overlay. Epilepsia requires P8_11 and P9_31. To do that edit /boot/uEnv.txt and uncomment "disable_uboot_overlay_wireless=1". On the bb black, disable hdmi video: uncomment "disable_uboot_overlay_video=1".
- TODO
To avoid unnecessary write access to bb emmc and prolongate its lifespan you can do the following:
- Use a circular buffer for syslogs:
apt-get install busybox-syslogd; dpkg --purge rsyslog
- Use tmpfs for logs and tmp files. Edit /etc/fstab and append:
tmpfs /tmp tmpfs nosuid,nodev 0 0
tmpfs /var/log tmpfs nosuid,nodev 0 0
tmpfs /var/tmp tmpfs nosuid,nodev 0 0
- At this point you can remove logrotate
apt remove --purge logrotate
- Software estimation of power consumption
- Beaglepocket support
- Frame interpolation