-
1Step 1
Prepare the Pi Zero and Unicorn HAT
Plug the Pi Zero into the back of the Unicorn HAT. Plug the OTG to USB host cable or adapter into the Pi Zero. Plug the OTG cable or adapter into the Pi Zero USB port. Plug a USB keyboard into the OTG cable or adapter. Plug in an HDMI monitor using the mini HDMI adapter. The monitor and keyboard will be used to enter the WiFi parameters. Once WiFi is working, the monitor and keyboard are not needed.
-
2Step 2
Download and install Raspian Jessie Lite on a micro SD card from the following link. There is a link on the page for details on burning the file to an SD card.
https://www.raspberrypi.org/downloads/raspbian/
Plug the micro SD card into the Pi. Lastly plug in power to the Pi. You should see boot messages on the monitor.
-
3Step 3
Login to the Pi using the keyboard. The default password is "raspberry".
Upgrade Raspian like this.
sudo apt-get update sudo apt-get upgrade
To enable WiFi, modify the following file.
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Add the following lines to the end of /etc/wpa_supplicant/wpa_supplicant.conf. Substitute your WiFi network SSID and PSK.
network={ ssid="wifirouter" psk="wifipassword" }
-
4Step 4
Configure Raspian which only needs to be done once.
sudo raspi-config
- Expand Filesystem
- Change User Password
- Boot Options: B1 Console
- Internationalization: I1 Change locale
- Uncheck en_GB.UTF-8 UTF-8
- Check en_US.UTF-8 UTF-8
- Default locale: None
- Internationalization: I2 Timezone: choose your location
- Advanced Options: Hostname: aurora1
- Finish: Select reboot
-
5Step 5
Unplug the USB keyboard and plug in the WiFi adapter.
After the Pi reboots, login using SSH. Depending on your computer, "ssh pi@aurora1" or "ssh pi@aurora1.local" might work. If not, use the IP address as in the previous step.
-
6Step 6
Install the Unicorn HAT software
curl -sS get.pimoroni.com/unicornhat | bash
After the installation finishes see if the LED matrix works.
cd ~/Pimoroni/unicornhat sudo python ./simple.py
The LEDs should turn on with the color magenta then turn off at the end.
-
7Step 7
Install ArtNet and OPC server
ArtNet and Open Pixel Control (OPC) protocols allow other computers to control LEDs. The last line runs the server in the background.
cd sudo apt-get install python-twisted git clone https://github.com/bbx10/artnet-unicorn-hat cd ~/artnet-unicorn-hat sudo python artnet-server.py &
The next step is to run the server in every power up and reboot. Edit the cron table.
crontab -e
In the editor, add the following line to the end then save the file.
@reboot sudo /usr/bin/python /home/pi/artnet-unicorn-hat/artnet-server.py &
-
8Step 8
Install Fadecandy examples. Run a small Perl program to verify the LEDs work.
cd sudo apt-get install git git clone https://github.com/scanlime/fadecandy cd fadecandy/examples/perl ./chaser.pl
If the LEDs do not work, check wiring, power, etc. Make sure artnet-server.py is running.There are many examples in different languages including C++, Perl, and Python. In some cases, the source code must be changed to adjust the number of LEDs. Most of the examples assume the OPC server is running on the same computer so they use 127.0.0.1 as the IP address. It is possible to create a standalone system where the patterns are generated on the Pi. But this project assumes more than one matrix is present and another computer is controlling the LEDs.
The Processing examples must be run on a Windows, Mac, or Linux computer because Processing needs a graphics console. The examples must be modified to use the Pi IP address instead of 127.0.0.1. Processing can control more than one Pi running WiFi Aurora. Each one will have a unique IP address and hostname. Use raspi-config to give each a unique hostname such as aurora1, aurora2, etc.
.--------------------. .----------------------. | Win, Mac, Linux | | Pi Zero WiFi Aurora | | | | | |Processing -> OPC +-> WiFi ->+ OPC -> artnet-server +-> WS281x |grid8x8_dot.pde | | | 8x8 LEDs .--------------------. .----------------------.
If Processing and OPC does everything you need, there is no reason to proceed. If you want to use Glediator and Jinx, continue on. -
9Step 9
Install Glediator
Run Glediator on a Win, Mac, or Linux computer with graphics desktop. Note this step is not done on the Pi Zero but on a computer. The commands are for an Linux terminal window. Windows users should download config.zip from the Files section.
First download the Glediator configuration file.
cd git clone https://github.com/bbx10/artnet-unicorn-hat cd artnet-unicorn-hat nano artnet-unicorn-hat.gled
This is how the IP address 192.168.1.231 looks like in the file. Change the IP address to match the Pi Zero IP address.
Patch_Uni_ID_0_IP1=192 Patch_Uni_ID_0_IP2=168 Patch_Uni_ID_0_IP3=1 Patch_Uni_ID_0_IP4=231
Close and save the file.Use a web browser to download glediator_v2.0.3.zip from http://www.solderlab.de/index.php/downloads/file/19-glediatorv203.
Create a new directory then extract Glediator.
cd mkdir ~/gled cd ~/gled unzip ~/Downloads/glediator_v2.0.3.zip cd dist java -jar Glediator_V2.jar
If you see errors about missing binary RXTX, ignore them. In this case, Glediator controls the LEDs using network packets, not serial communications. RXTX is a library for serial communications. -
10Step 10
Configure Glediator
Glediator is designed to work with many different LED arrays so it must be told the dimensions and arrangements of the LED matrix. It must also be told the IP address of the Pi with the Unicorn Hat.
In Glediator change the matrix size to 8 by 8. At the Glediator main screen, select Options | Matrix Size.
Size_X = 8 Size_Y = 8
To start ArtNet output, begin at the Glediator main screen then select Options | Output.
At the Output Options screen:
Output Mode: Artnet Mapping Mode: Single_Pixels
Ignore the rest in the top half of the screen. Ignore the left bottom options which are for serial ports.
In the right bottom options click on Patch ArtNet/TMP2.Net.
At the "Artnet & TPM2.Net Patcher" screen, load artnet-pimoroni-unicorn-hat.gled from the ~/artnet-unicorn-hat directory.
Click on Done
Back at the Output Options screen, click on Apply Changes.
Click on "Open Socket". Glediator will start sending pixel animation to the Pi.
Click on Done to get back to the main screen.
At this point, the control panel can be used to generate new patterns.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Is this project still active? It seems to have potential, but I had a few questions.
1. You say,
> The Processing examples must be run on a Windows, Mac, or Linux computer because Processing needs a graphics console.
Is this true? I'm using a Pi Zero to run Processing natively, then have a NeoPixel 8x8 connected to Fadecandy (which in turn is connected to the Pi Zero's USB) and all works fine. The Pi Zero's HDMI out works fine to display the Processing UI at full frame rate.
2. Is your use of Fadecandy examples implying that the Pi Zero itself can emulate the hardware Fadecandy? I realize the Unicorn isn't a standard NeoPixel 8x8, but is my hardware setup above including Fadecandy redundantly, when the Pi Zero's outputs could feed the NeoPixel?
3. I'm stuck with Glediator unable to recognize the Fadecandy/NeoPixel setup I have. Do you think your network-driven patch would work over the Pi Zero's USB-to-Fadecandy/NeoPixel setup? I'm troubleshooting RXTX and Glediator being unable to recognize a serial output right now. . . .
Thanks very much~
Are you sure? yes | no