This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #112: Split out LED control roles and add Blinkstick role.
- Loading branch information
1 parent
3156394
commit 665ef17
Showing
21 changed files
with
144 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
LEDs - Blinkstick | ||
================= | ||
|
||
Blinkstick LED role to install prerequisites and scripts for controlling Blinkstick-based RGB LEDs with the Raspberry Pi Dramble. | ||
|
||
Requirements | ||
------------ | ||
|
||
N/A | ||
|
||
Role Variables | ||
-------------- | ||
|
||
blinkstick_startup_color: red | ||
|
||
The color the Blinkstick should be after system boot. | ||
|
||
Dependencies | ||
------------ | ||
|
||
N/A | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
- hosts: pi | ||
roles: | ||
- role: leds-blinkstick | ||
|
||
License | ||
------- | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
blinkstick_startup_color: red |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
dependencies: [] | ||
galaxy_info: | ||
author: Jeff Geerling | ||
description: Blinkstick LED control setup for Rasbperry Pi. | ||
company: Midwestern Mac, LLC | ||
license: license (MIT) | ||
min_ansible_version: 2.4 | ||
platforms: | ||
- name: Debian | ||
versions: | ||
- stretch | ||
galaxy_tags: | ||
- monitoring | ||
- system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
- name: Ensure Pip is installed. | ||
apt: name=python-pip state=present | ||
|
||
- name: Ensure blinkstick is installed. | ||
pip: name=blinkstick state=present | ||
|
||
- name: Ensure blinkstick-leds folder exists. | ||
file: | ||
path: /opt/blinkstick-leds | ||
state: directory | ||
mode: 0755 | ||
|
||
- name: Copy Blinkstick control scripts into place. | ||
template: | ||
src: "{{ item }}.j2" | ||
dest: "/opt/blinkstick-leds/{{ item }}" | ||
mode: 0755 | ||
with_items: "{{ blinkstick_scripts }}" | ||
|
||
- name: Make Blinkstick control scripts available in the user's PATH. | ||
file: | ||
path: "/usr/bin/{{ item }}" | ||
src: "/opt/gpio-leds/{{ item }}" | ||
state: link | ||
with_items: "{{ blinkstick_scripts }}" | ||
|
||
- name: Set up cron jobs for Blinkstick control. | ||
cron: 'name="{{ item.name }}" special_time=reboot job="{{ item.job }}"' | ||
with_items: | ||
- name: "Set up blinkstick on startup" | ||
job: "blinkstick --set-mode 3 && blinkstick --set-color {{ blinkstick_startup_color }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Raspberry Pi Blinkstick control scripts | ||
|
||
This folder contains Python scripts that can control Blinksticks (Blinkstick Nanos have been tested, but other models may also work). | ||
|
||
## Using the scripts | ||
|
||
Each of the scripts has a unique purpose: | ||
|
||
- TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
blinkstick_scripts: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
LEDs - GPIO | ||
=========== | ||
|
||
GPIO LED role to install prerequisites and scripts for controlling custom GPIO-based RGB LEDs with the Raspberry Pi Dramble. | ||
|
||
Requirements | ||
------------ | ||
|
||
N/A | ||
|
||
Role Variables | ||
-------------- | ||
|
||
leds_pin_red: 17 | ||
leds_pin_green: 27 | ||
leds_pin_blue: 18 | ||
|
||
A mapping of GPIO pin numbers to color legs on the RGB LED. | ||
|
||
Dependencies | ||
------------ | ||
|
||
N/A | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
- hosts: pi | ||
roles: | ||
- role: leds-gpio | ||
|
||
License | ||
------- | ||
|
||
MIT |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.