Skip to content

Docker container of Node-RED and the rpi_ws218x library in order to use easly Adafruit Neopixel rings (and more).

License

Notifications You must be signed in to change notification settings

JohannCOSTE/docker-nodered-rpi_ws281x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-nodered-rpi_ws281x

Overview

This project is born from a IoT school work. We needed to connect the Adafruit NeoPixel rings (16 leds and 12 leds) to a Raspberry Py but we haven't anthing exepect the leds and the wires. After seeking on the web I found this tutorial http://frederickvandenbosch.be/?p=1014 which help me a lot. In order to simply a little more the process, I decided to create in Docker container which will contained all the stuff needed in order to be able to make the leds works just with a docker pull and a docker run. Futhermore to make the led utilisation really user friedly and compliant with IoT pusrpose, I wanted to add Node-RED to the container.

Credits

This projet is born thanks to:

What's inside

The docker file is pretty simple, from the official Node-RED image it install the needed package and clone the rpi_ws281x library and initialise the evirnomment. I add some personnal scripts to use basic feature of the leds.

How to build

From Docker hub

$> docker pull johanncoste/rpi_ws281x_nodered:latest

Manually

$> git clone https://github.com/JohannCOSTE/docker-nodered-rpi_ws281x.git .
$> cd docker-nodered-rpi_ws281x
$> docker build -t rpi_ws281x_nodered .

How to run

Beacause of GPIO access, you have to run the container in privileged mode:

docker run -p 1880:1880 --privileged johanncoste/rpi_ws281x_nodered

How to access

It's first a Node-RED container so to access it you have to connect to:

http://0.0.0.0:1880/

Replace 0.0.0.0 by the IP adress of your device

Python scripts and Json flows

Python

There is some default python scripts that will be move inside the container at the root. You case use them directly with Node-RED:

  • /color.py r v b blink will light up the led with the r v b color and the led will blink with a frequency of blink second.
  • ledtest.py will just display some colors on the leds, you can use it to test if all is correctly wired.

You may have to edit the # LED strip configuration section of them in order to change the number of leds of you device etc.

Json

There is also a Json flow color_flow.json that will show you an exemple of the script usage via Node-RED. You have to import it manually via the Import option in Node-RED.

How to wire

You will find Fritzing file in the fritzing directory (you can download fritzing here).

Schema

About

Docker container of Node-RED and the rpi_ws218x library in order to use easly Adafruit Neopixel rings (and more).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published