jimpo / ledbetter-firmware

LEDBetter Lights Raspberry Pi Linux image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LEDBetter Firmware

See here for project information.

This is a custom Linux build using Buildroot with a Rust binary installed that runs the LEDBetter driver.

Development

To test the Rust binary, use cargo test.

Building Linux image

First add the wpa_supplicant configuration for your local WiFi network. This should be placed in buildroot/board/raspberrypi0w/overlay/etc/wpa_supplicant.conf and is gitignored because the contents are sensitive. Run the wpa_passphrase utility to generate the network configuration. The file contents should look like

ap_scan=1

network={
    ssid="This is the SSID and below is a derived hex string"
    psk=43d9f8fe1af5131736330cc1865fe3412cfe00c0d8a5de22cd15207ee334613a
}

Next add a LEDBetter config.toml at buildroot/board/raspberrypi0w/overlay/usr/share/ledbetter/config.toml. Below is an example:

name = "Awesome Lights"
render_freq = 10

[output]
target = "rpi"
pins = [12, 13]

[controller]
host = "192.168.10.64"
port = 80

[layout]
# pixel_locations are generated from a pixel layout in the web app
pixel_locations = [
    [[-0.79, 0.0], [-0.79, 0.017], [-0.79, 0.033], [-0.79, 0.05], [-0.79, 0.067], [-0.79, 0.083], [-0.79, 0.1], [-0.79, 0.117], [-0.79, 0.133], [-0.79, 0.15], [-0.79, 0.167], [-0.79, 0.183], [-0.79, 0.2], [-0.79, 0.217], [-0.79, 0.233], [-0.79, 0.25], [-0.79, 0.267], [-0.79, 0.283], [-0.79, 0.3], [-0.79, 0.317], [-0.79, 0.333], [-0.79, 0.35], [-0.79, 0.367], [-0.79, 0.383], [-0.79, 0.4], [-0.79, 0.417], [-0.79, 0.433], [-0.79, 0.45], [-0.79, 0.467], [-0.79, 0.483], [-0.79, 0.5], [-0.79, 0.517], [-0.79, 0.533], [-0.79, 0.55], [-0.79, 0.567], [-0.79, 0.583], [-0.79, 0.6], [-0.79, 0.617], [-0.79, 0.633], [-0.79, 0.65], [-0.79, 0.667], [-0.79, 0.683], [-0.79, 0.7], [-0.79, 0.717], [-0.79, 0.733], [-0.79, 0.75], [-0.79, 0.767], [-0.79, 0.783], [-0.79, 0.8], [-0.79, 0.817], [-0.79, 0.833], [-0.79, 0.85], [-0.79, 0.867], [-0.79, 0.883], [-0.79, 0.9], [-0.79, 0.917], [-0.79, 0.933], [-0.79, 0.95], [-0.79, 0.967], [-0.79, 0.983], [-0.79, 1.0], [-0.79, 1.017], [-0.79, 1.033], [-0.79, 1.05], [-0.79, 1.067], [-0.79, 1.083], [-0.79, 1.1], [-0.79, 1.117], [-0.79, 1.133], [-0.79, 1.15], [-0.79, 1.167], [-0.79, 1.183], [-0.79, 1.2], [-0.79, 1.217], [-0.79, 1.233], [-0.79, 1.25], [-0.79, 1.267], [-0.79, 1.283], [-0.79, 1.3], [-0.79, 1.317], [-0.79, 1.333], [-0.79, 1.35], [-0.79, 1.367], [-0.79, 1.383], [-0.79, 1.4], [-0.79, 1.417], [-0.79, 1.433], [-0.79, 1.45], [-0.79, 1.467], [-0.79, 1.483], [-0.79, 1.5], [-0.79, 1.517], [-0.79, 1.533], [-0.79, 1.55], [-0.79, 1.567], [-0.79, 1.583], [-0.79, 1.6], [-0.79, 1.617], [-0.79, 1.633], [-0.79, 1.65], [-0.79, 1.667], [-0.79, 1.683], [-0.79, 1.7], [-0.79, 1.717], [-0.79, 1.733], [-0.79, 1.75], [-0.79, 1.767], [-0.79, 1.783], [-0.79, 1.8], [-0.79, 1.817], [-0.79, 1.833], [-0.79, 1.85], [-0.79, 1.867], [-0.79, 1.883], [-0.79, 1.9], [-0.79, 1.917], [-0.79, 1.933], [-0.79, 1.95], [-0.79, 1.967], [-0.79, 1.983], [-0.79, 2.0], [-0.79, 2.017], [-0.79, 2.033], [-0.79, 2.05], [-0.79, 2.067], [-0.79, 2.083], [-0.79, 2.1], [-0.79, 2.117], [-0.79, 2.133], [-0.79, 2.15], [-0.79, 2.167], [-0.79, 2.183], [-0.79, 2.2], [-0.79, 2.217], [-0.79, 2.233], [-0.79, 2.25], [-0.79, 2.267], [-0.79, 2.283], [-0.79, 2.3], [-0.79, 2.317], [-0.79, 2.333], [-0.79, 2.35], [-0.79, 2.367], [-0.79, 2.383], [-0.79, 2.4], [-0.79, 2.417], [-0.79, 2.433], [-0.79, 2.45], [-0.79, 2.467], [-0.79, 2.483]],
    [[ 0.79, 0.0], [ 0.79, 0.017], [ 0.79, 0.033], [ 0.79, 0.05], [ 0.79, 0.067], [ 0.79, 0.083], [ 0.79, 0.1], [ 0.79, 0.117], [ 0.79, 0.133], [ 0.79, 0.15], [ 0.79, 0.167], [ 0.79, 0.183], [ 0.79, 0.2], [ 0.79, 0.217], [ 0.79, 0.233], [ 0.79, 0.25], [ 0.79, 0.267], [ 0.79, 0.283], [ 0.79, 0.3], [ 0.79, 0.317], [ 0.79, 0.333], [ 0.79, 0.35], [ 0.79, 0.367], [ 0.79, 0.383], [ 0.79, 0.4], [ 0.79, 0.417], [ 0.79, 0.433], [ 0.79, 0.45], [ 0.79, 0.467], [ 0.79, 0.483], [ 0.79, 0.5], [ 0.79, 0.517], [ 0.79, 0.533], [ 0.79, 0.55], [ 0.79, 0.567], [ 0.79, 0.583], [ 0.79, 0.6], [ 0.79, 0.617], [ 0.79, 0.633], [ 0.79, 0.65], [ 0.79, 0.667], [ 0.79, 0.683], [ 0.79, 0.7], [ 0.79, 0.717], [ 0.79, 0.733], [ 0.79, 0.75], [ 0.79, 0.767], [ 0.79, 0.783], [ 0.79, 0.8], [ 0.79, 0.817], [ 0.79, 0.833], [ 0.79, 0.85], [ 0.79, 0.867], [ 0.79, 0.883], [ 0.79, 0.9], [ 0.79, 0.917], [ 0.79, 0.933], [ 0.79, 0.95], [ 0.79, 0.967], [ 0.79, 0.983], [ 0.79, 1.0], [ 0.79, 1.017], [ 0.79, 1.033], [ 0.79, 1.05], [ 0.79, 1.067], [ 0.79, 1.083], [ 0.79, 1.1], [ 0.79, 1.117], [ 0.79, 1.133], [ 0.79, 1.15], [ 0.79, 1.167], [ 0.79, 1.183], [ 0.79, 1.2], [ 0.79, 1.217], [ 0.79, 1.233], [ 0.79, 1.25], [ 0.79, 1.267], [ 0.79, 1.283], [ 0.79, 1.3], [ 0.79, 1.317], [ 0.79, 1.333], [ 0.79, 1.35], [ 0.79, 1.367], [ 0.79, 1.383], [ 0.79, 1.4], [ 0.79, 1.417], [ 0.79, 1.433], [ 0.79, 1.45], [ 0.79, 1.467], [ 0.79, 1.483], [ 0.79, 1.5], [ 0.79, 1.517], [ 0.79, 1.533], [ 0.79, 1.55], [ 0.79, 1.567], [ 0.79, 1.583], [ 0.79, 1.6], [ 0.79, 1.617], [ 0.79, 1.633], [ 0.79, 1.65], [ 0.79, 1.667], [ 0.79, 1.683], [ 0.79, 1.7], [ 0.79, 1.717], [ 0.79, 1.733], [ 0.79, 1.75], [ 0.79, 1.767], [ 0.79, 1.783], [ 0.79, 1.8], [ 0.79, 1.817], [ 0.79, 1.833], [ 0.79, 1.85], [ 0.79, 1.867], [ 0.79, 1.883], [ 0.79, 1.9], [ 0.79, 1.917], [ 0.79, 1.933], [ 0.79, 1.95], [ 0.79, 1.967], [ 0.79, 1.983], [ 0.79, 2.0], [ 0.79, 2.017], [ 0.79, 2.033], [ 0.79, 2.05], [ 0.79, 2.067], [ 0.79, 2.083], [ 0.79, 2.1], [ 0.79, 2.117], [ 0.79, 2.133], [ 0.79, 2.15], [ 0.79, 2.167], [ 0.79, 2.183], [ 0.79, 2.2], [ 0.79, 2.217], [ 0.79, 2.233], [ 0.79, 2.25], [ 0.79, 2.267], [ 0.79, 2.283], [ 0.79, 2.3], [ 0.79, 2.317], [ 0.79, 2.333], [ 0.79, 2.35], [ 0.79, 2.367], [ 0.79, 2.383], [ 0.79, 2.4], [ 0.79, 2.417], [ 0.79, 2.433], [ 0.79, 2.45], [ 0.79, 2.467], [ 0.79, 2.483]],
]

To build a Linux image for the Raspberry Pi Zero W, first download Buildroot. The buildroot/ directory is an external Buildroot tree. Accordingly, from the Buildroot repo directory you can run

$ make BR2_EXTERNAL=$LEDBETTER_FIRMWARE_REPO_PATH/buildroot raspberrypi0w_defconfig
$ make BR2_EXTERNAL=$LEDBETTER_FIRMWARE_REPO_PATH/buildroot make

About

LEDBetter Lights Raspberry Pi Linux image


Languages

Language:Rust 89.3%Language:Shell 7.5%Language:Makefile 3.2%