Category Archives: Howto

10W Far Red LED Grow Floodlight

Far red (740nm) might be very beneficial to tomato production.  Studies have shown that it can help produce longer “hypocotyl” (the seedling shoot that becomes the stem) by just blasting the plant with 12 minutes of light at the end of the day (16hr photoperiod with T5 lights).  Other studies claim that far red can help reduce or eliminate sucker growth.


Total cost: $33


LED Stair Lights

Stairs are pretty boring, but they don’t have to be.  I convinced my loving wife that she needed stair lights.  I put the project off for over 6 months while I’ve been greenhousing, but now that that project is more completed, I have time to get back to house projects.  Let’s get building.


First, we will use the APA102 lights.  These are individually controllable.  They are the same lights we’ve used in our ambilight project with the minnowboard max.

I came up with a simple light protocol that supports “instructions” rather than just raw pixel data so it’s fast and light.  I’ve published the library here on github (be sure to use it with my forked Adafruit_dotstar library which has the “driver” for the LightProtocol).  I loaded that onto a particle photon, combined with an level shifter, and powered the thing with a Drok DC-DC power supply and a 24V 5A AC-DC adapter.

To install the LED strips on the stairs, I picked up several aluminum channels from and the corresponding “frosted” covers.  To stick the channels on the stairs, I used 3M automotive double-sided tape.  The aluminum can be drilled and screws can be used to mount, but I didn’t do that.  I used a simple dremel to cut the channels where I needed to.

I’m hiding the photon and the power supply in the closet which is adjacent to the stairs.  I cut a small hole in the wall on the closet side and put a 4 wire, 14AWG cable through the wall.  This is low-voltage (5V), so you don’t need an electrician or a expensive permit to install inside the wall… at least in my area.  On the other side, I combined a 2 socket “keystone” faceplate with a couple two wire speaker jacks.  This doesn’t look half bad.


Using the same python library as the minnowboard max ambilight project, and adding a “driver” that can speak our “LightProtocol” that we’ve installed on the particle photon, we are able to to complex effects and themes on the desktop and change the lights over wifi.

I have three effects coded up: “Chase”, “Random Rainbow Transforms”, and “Rainbow”.  Check out the video for how these effects look on our lights.  What other cool effects can we do?


Secure websocket server using autobahn and trollius (asyncio)

Websockets are a pretty useful way of passing information to and from clients.  But how do you make them secure?  I’m documenting how I’m figuring it out as I go.  Let’s get started.

First, let’s get a simple autobahn server and client up and running.  This is straight from the asyncio example on github.  Running it with python and python respectively.

To make things secure, first we need to create some keys and certificates.  I am creating a self-signed certificate and key for both the server and the test client:

Next we need to add a few lines to our server and client.  For the server add:

sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
sslcontext.load_cert_chain(‘server.crt’, “server.key”)
and when we create the server, we will pass in the context.  Find the “loop.create_server” line and change it to:
coro = loop.create_server(factory, ‘’, 9000, ssl=sslcontext)
The client is almost identical:
sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
sslcontext.load_cert_chain(‘client.crt’, “client.key”)
coro = loop.create_connection(factory, ‘’, 9000, ssl=sslcontext)
That’s it!

Using yocto combo layers and adding a new layer

It’s easy to add your own layer using the combo layer system.

  1. Edit conf/combo-layers.conf and add a section for your layer.
  2. cp conf/combo-layers-local-sample.conf to conf/combo-layers-local.conf and add a section for your new layer
  3. run scripts/combo-layer init
  4. after you have a build directory (by sourcing oe-init-build-env) edit build/conf/bblayers.conf and add your layer
  5. bitbake as per normal