Saturday, 1 March 2014

OLA Raspberry Pi LED ws2810 artnet glediator 41*15 matrix

 This setup will be doing the same result as the pixel.py shown in the last post, but now we are able to use any version of glediator or any pixel generator software using artnet.

this is hardware I did to do this
http://learn.adafruit.com/light-painting-with-raspberry-pi/hardware

and you can see the video of the final work
https://www.youtube.com/watch?v=ED2u5O7GyEY 


First download The OLA images where can be found at http://nomis52.net/data/raspi/.


Flashing the SD Card using Windows

Using the Win32DiskImager program

  1. Download the distribution from  http://nomis52.net/data/raspi/. or from a mirror or torrent. Make sure the distribution is for the Raspberry Pi, as others will not work. Usually these are zipped (compressed) files ending in .zip or .gz (something like "distribution-name.zip").
  2. Extract the image file from the downloaded .zip file, so you now have "distribution-name.img".
  3. Insert the SD card into your SD card reader and check what drive letter it was assigned. You can easily see the drive letter (for example G:) by looking in the left column of Windows Explorer. You can use the SD Card slot (if you have one) or a cheap Adapter in a USB slot.
  4. Download the Win32DiskImager utility (it is also a zip file). You can run this from a USB drive.
    Win32DiskImager screen
  5. Extract the executable from the zip file and run the Win32DiskImager utility; you may need to run the utility as Administrator! Right-click on the file, and select 'Run as Administrator'
  6. Select the image file you extracted above.
  7. Select the drive letter of the SD card in the device box. Be careful to select the correct drive; if you get the wrong one you can destroy your data on the computer's hard disk! If you are using an SD Card slot in your computer (if you have one) and can't see the drive in the Win32DiskImager window, try using a cheap Adapter in a USB slot.
  8. Click Write and wait for the write to complete.
  9. Exit the imager and eject the SD card.
  10. You are now ready to plug the card into your Raspberry Pi.

Username : pi
password : openlighting
  
 Enable Turbo Mode (Optional) and Expand the Root Partition (Optional)

 sudo raspi-config

and select the overclock option, put 1000.

 

Run this:

sudo apt-get update
sudo apt-get upgrade
 

then run this

for pin in 17 21; do
  echo $pin > /sys/class/gpio/export;
  chmod a+w /sys/class/gpio/gpio${pin}/value;
  chmod a+w /sys/class/gpio/gpio${pin}/direction;
done

 Connecting to OLA

http://xxx.xxx.xxx.xxx:9090. 

then restart raspberry pi

reboot now

Configuration.

A matrix of 41*15 = 615 Led.
As we know artnet protocol use no more than 171 Led per Universe. How many universe we have in 615 Led. Each universe has to be multiple of 41 that is the quantity of LED I have horizontal.
171 / 41=4.17. So I will be using 4 horizontal lines per universe. 41*4= 164 Led per Universe.

How many universe we have to use
615 / 164 = 3.75. this meas that we have to use 3 universe of 164 LED and the fourth universe will be of 123 LED.
1 universe: 164 LED
2 universe: 164 LED
3 universe: 164 LED
4 universe: 123 LED
    Total   :  615 LED

Now we have to configure  ola-spi.conf

nano /var/lib/ola/conf/ola-spi.conf

for a matrix 41*15 = 615 LED this will be the configuration

base_uid = 7a70:00000100
device_prefix = spidev
enabled = true
spidev0.0-0-dmx-address = 1
spidev0.0-0-personality = 1
spidev0.0-0-pixel-count = 164
spidev0.0-1-dmx-address = 1
spidev0.0-1-personality = 1
spidev0.0-1-pixel-count = 164
spidev0.0-2-dmx-address = 1
spidev0.0-2-personality = 1
spidev0.0-2-pixel-count = 164
spidev0.0-3-dmx-address = 1
spidev0.0-3-personality = 1
spidev0.0-3-pixel-count = 123
spidev0.0-backend = software
spidev0.0-ports = 4
spidev0.0-spi-ce-high = false
spidev0.0-spi-speed = 1200000
spidev0.0-sync-port = 0
spidev0.1-0-dmx-address = 1
spidev0.1-0-personality = 1
spidev0.1-backend = software
spidev0.1-ports = 1
spidev0.1-spi-ce-high = false
spidev0.1-spi-speed = 100000
spidev0.1-sync-port = 0

then Cnt  X, save

reboot now

Now go to http://xxx.xxx.xxx.xxx:9090

Click add Universe. 

Put here id: 1 and name : 1     

New Universe Settings
Universe Id
Universe Name

 then you need to add 2 ports for each universe. One input port where raspberry pi will be receiving the data from pixel generator (glediator). in this case artnet port. and one output port where raspberry pi will be sending the data to the Hardware LED MATRIX, in this case will be using SPI port spidev0.0

So you will see something like this depending of how many LED do you have

Universe Settings
Universe Id          1
Universe Name    1  
Merge Mode
Input Ports
Device Description Priority

ArtNet [192.168.1.141]ArtNet Universe 0:0:1
Output Ports
Device Description Priority

SPI Devicespidev0.0, output 0, WS2801 Individual Control, 492 slots @ 1. (7a70:00000101)Not supported

So you need to do this for each universe you have.

Now download the latest version of glediator.

Go to matrix size. Add the values for your matrix

then go to output.


and below is my configuration.

and then click patch artnet


If you have any comment or question please do.


 

 

 


2 comments:

  1. Hey! :)
    I would like to build this also. But!
    If I would create a new universum then I have no SPI Plugin to select it.
    Please help!

    ReplyDelete
  2. Hi, nice work, your post has inspired me, and have managed to have pi working with a 25 pixel string I had received last year and never really used.
    I am thinking of going bigger, was wondering how you did the patch in software, did you have to create 4 output devices and then patch each device with x items starting from position x ?

    ReplyDelete