LED Statue

Status
Not open for further replies.
Start by trying to run the code on a Linux desktop or laptop. Any Linux computer with USB should work. It's much easier to fiddle with it on a regular computer. Only compile and run it on a Beaglebone after you've got it completely working on a regular PC.
 
If you only need animations, it might be easier to just write the code directly on Teensy. The OctoWS2811 fire example might be a good starting point.

You're working with a relatively small number of LEDs, so streaming live video probably doesn't make any sense. Even my 1920 LED board doesn't give much resolution to see facial expressions or other important details.
 
I am making baby steps of progress over here. I have been playing around with the teensy 3.1 on my Windows laptop and now I am trying to do the same with my Beaglebone. I loaded the VideoDisplay module onto the teensy with my Windows laptop and then plugged it into the Beaglebone. Then I compiled this code with the command g++ serialTest.cpp serialib.cpp -o serialexe.

#include <stdio.h>
#include "./serialib.h"


#if defined (_WIN32) || defined( _WIN64)
#define DEVICE_PORT "COM1" // COM1 for windows
#endif

#ifdef __linux__
#define DEVICE_PORT "/dev/ttyS0" // ttyS0 for linux
#endif


int main()
{
serialib LS; // Object of the serialib class
int Ret; // Used for return values
char Buffer[128];




// Open serial port

Ret=LS.Open(DEVICE_PORT,9600); // Open serial link at 9600 bauds
if (Ret!=1) { // If an error occured...
printf ("Error while opening port. Permission problem ?\n"); // ... display a message ...
return Ret; // ... quit the application
}
printf ("Serial port opened successfully !\n");




// Write the AT command on the serial port

Ret=LS.WriteString("?"); // Send the command on the serial port
if (Ret!=1) { // If the writting operation failed ...
printf ("Error while writing data\n"); // ... display a message ...
return Ret; // ... quit the application.
}
printf ("Write operation is successful \n");




// Read a string from the serial device
Ret=LS.ReadString(Buffer,'\n',128,5000); // Read a maximum of 128 characters with a timeout of 5 seconds
// The final character of the string must be a line feed ('\n')
if (Ret>0) // If a string has been read from, print the string
printf ("String read from serial port : %s",Buffer);
else
printf ("TimeOut reached. No data received !\n"); // If not, print a message.



// Close the connection with the device

LS.Close();

return 0;
}


After running the program, I get this output:

Serial port opened successfully !
Error while writing data

I am not sure how to troubleshoot this but I would appreciate any help you can give.
 
I was reading mortonkopf notes on making PixelControler work with the Teensey but I still can't get it to work. I have an 8x12 grid connected to a teensey 3.1. I am using Windows so I changed the following lines in octotpm2serial:

const int ledsPerStrip = 12;
#define NUM_LEDS 96

and the following in config.properties:

net.listening.port=COM7
net.listening.addr=COM7
net.send.port=COM7
osc.listening.port=COM7
led.pixel.size=96
output.resolution.x=12
output.resolution.y=8

as soon as I upload the octo file to the teensey, all the LEDs turn a bluish white color. Then I start the PixelControler and nothing happens on the grid. This is the output I see in the cmd window:

View attachment errors.txt

I never see that red square that takes a picture of my screen either.

Any ideas on how to troubleshoot?
 
hi @BuffaloFan32, for screen capture using pixelcontroller, you need to enable first as it is set to disabled by default. There are two parts to this:
1) the config file needs to allow it to happen
2) then you can choose to use it by selecting the source option whilst pixelcontroller is running.

To set the config.properties file correctly go to this section:
Code:
#=========================
#default values for generators
#=========================
initial.image.simple=logo.gif
initial.blinken=torus.bml
initial.text=PIXELINVADERS

font.filename=04B_03__.TTF
font.size=82

#x/y offset for screen capturing generator
#if you define screen.capture.window.size.x as 0, the screen capture generator will be disabled
screen.capture.offset=100
screen.capture.window.size.x=500
screen.capture.window.size.y=300

make sure you remove the # sign in front of any of the screen.capture lines, and change x=0 to something like x=500.
save the config file

Then, when you restart pixelcontroller, go to the first source controller (the pink arrow shows the one I mean), labelled blinkenlight by default, select the source by clicking on the currently selected source (blinkenlight) and select Screen capture.
pixelcontroller1.png

you will then see a red capture square.

Thats the easy bit. regarding your setup, it might be better to ask Michu over at Pixelcontroller, he is very helpful and knowledgeable. In the first instance, are you using the usb type connection (serial) or are you trying to use ethernet (artnet)? looks like serial. I have not used this for a while, as was using ethernet, but it certainly was working with serial. I will have a look again.
Can you post your ino sketch please.
 
Last edited:
The error log says that it is looking for: WARNING: Failed to open port </DEV/TTY.USBMODEM1061>

in the config.properties file, you will need to edit this to be the same as the port that is opened - if you look at the Arduino >Tools> serial port whilst the teensy is plugged in and working, you will see the port assign, and you can enter this into the config file.

you do this in the following section of the config file:

Code:
#=========================
#settings for tpm2 device
#do NOT FORGET to define the output resolution above!
#=========================
#Where is the TPM2 device connected?
#  on Linux/OSX use names like "/dev/ttyUSB1"
#  on Windows use names like "COM1"
tpm2.device=/dev/tty.usbmodem214891
tpm2.baudrate=115200

I don't use windows, but I would guess that you would therefore need to put that line as:
"tpm2.device= COM7" rather than what you current have in this section of the config file, which seems to be "tpm2.device=/DEV/TTY.USBMODEM1061".

make sure that all other device types in the file are hashed out, as this mean an error of more than one device type found.
 
Last edited:
@mortonkopf, thanks, that worked! There are still some kinks there that I think I can work through but I have a video playing on my grid.
 
glad it helped. not sure what your kinks are, but you need to check your properties for number leds / panels / zigzag config, etc. Its not very clear but you need to assign the grid layout at different places to create the correct orientation /led number assignment.

I should really put a thread up on how to use pixelcontroller, maybe i'll get round to that at some stage.
 
@mortonkopf you should post a thread on that because it is pretty awesome. Although I have just been messing around with it.

The kinks I was referring to are:
1. My LEDs are RBG but that was an easy fix.
2. The image is not rotated but it is a mirror image of what I expected along the x axis of my grid. I have played with the ROTATION and FLIPPEDY commands in the config file but can't get it quite right.
3. The image is very bright and my grid gets hot quickly. There is probably a way to dim the lights by reducing the RBG values but I haven't gotten this far yet.
 
@mortonkopf, did you ever get any of the processing examples to work with pixelInvaders? I have pixelInvaders working pretty well with my tiny prototype now but I have some specific ideas in mind for my larger grid (once that gets up and running). For instance, what if I want to distplay two images next to each other on the same grid? Or, what if I want to display text and a video?
 
@BuffaloFan32, I did not go into the Processing pde as it was not part of my requirements. It looked like there was huge scope to use pixelcontroller for so much more. I was using the screen capture for a dirty video playback mechanism via onscreen x-y position, and using the onboard text scroller, but that was it. Really using it for the basic visuals. I think you can now take on the baton for progressing it further. ;)

IF you go into the config file and change the panel arrays to two rows of two, and restart the pixelcontroller, you will get additional panels of the size specified.
#=========================
#settings for Art-Net devices
#Info: PixelController supports more than 1 universe
#do NOT FORGET to define the output resolution above!
#=========================
#HINT: you define how many artnet panels are in use, in this example we use four panels.
#artnet.layout.row1=NO_ROTATE
artnet.layout.row1=NO_ROTATE,NO_ROTATE
artnet.layout.row2=NO_ROTATE,NO_ROTATE

I have not worked with this, so perhaps ask Michu @ pixelcontroller about this function, but you can then output different patterns to different artnet 'panels'. Although it seems to work for four, I have issues with setting it up for two.

You can then set the text and the type of text action, as well as the source for that panel, such as screen capture by clicking on the blue bar beneath the matrix you want to setup, and then applying what you want. Have not looked into other input streams, as I guess that this is the processing side of things.

I'm not sure that this will give you the control that you want, however. anyhow, you can see from the image that adding the 2x2 rows gives you the four viewer boxes. You can change each of the source graphics by clicking on the blue bar (on the image its just under three, it goes bright blue when selected). then change all sources to passthru, and then select what you want, here I selected screen capture, so the red box appeared, and you can see the pixelated image in the lower left hand corner.
pixelcontroller1.jpg

HOWEVER>>>> I have not wired this up to an array, so have not tested how the output is distributed, most like universe0 then uni1, but I don't know that.
 
Last edited:
That is interesting. I guess I was confused about what a panel was. I was thinking that a different panel would need to be on a separate Teensey but I guess you could have two panels on one Teensey or four panels stretched across 100 Teenseys. I will play with this and let you know what happens. In my mind I picture my output on four panels or so (within the same grid) but they are not all square shaped. Thanks!

btw, I would love to progress his Processing examples further but I have so much trouble with Processing on my computer. I think it is related to my graphics card but it doesn't help that I am a novice.
 
Yeh, I think that pixelcontroller is not going to support different grid sizes, I have not seen anything in the config.properties to suggest that it is possible, but might be mistaken. Also, I think that you will start running into other limitations when scaling up.
 
@BuffaloFan32, sure. What data transfer type are you using, Artnet, tpm2 or tpm.net? As the config file has tpm2 device com7 but you have the artnet layout section un-hashed? I have not set up an array using multiple tpm2 device panels, so not sure if this is possible, if this is your approach. I will have a look, but Michu at pixelcontroller should be able to tell you straight away about this
 
@mortonkopf, I am not sure. I have a teensey3.1 connected to 8 WS2812 strips. I thought it was correct because the output looked good on my grid (before I tried to split it into panes). Sorry, I am still a novice.
 
I have now been able to split the output screen into four panels or two panels. However, when I hook my grid up it doesn't work anymore. I think it is because I commented out the references to the tpm2 devices and uncommented the art-net references. Is there a way to figure out the ip address of the teensey3.1 on windows? I do not see it in my network connections. Also, when I referred to it in the tpm2 section I used "COM4" but that does not seem to work in the art-net section. Any idea how to find my grid?
 
Hey Guys, I am about half-way through covering my statue with LEDs and I am thinking about power supplies. My friend help me do these calculations and I was wondering if you have anything to add:

Key data points are 5V and 24W/m

If your statue is wrapped in 2.5 m strips:
24 W / m x 2.5 m = 60W

60W per strip x 100 strips = 6,000 W

Total current (I)
P = V x I, I = P / V
I = 6,000 W / 5 V = 1,200 A
Dimming factor by 50%: 600 A

Number of supplies = 600 A / 50 A per supply = 12 supplies

Power Supplies per Breaker:
I = P/V
50A x 5V = 250W/power supply
= 250W / 110 VAC
= 2.5A
= 8 power supplies per 20A breaker
 
My statue currently has a bunch of strips on it (100+). I would like to connect the teensy to it 1 row at a time to make sure each strip is working. I have some code to do that. The problem is that each strip is a different length and I am too lazy to count the number of LEDs on each strip (200+). Is there a way to query the strip and output the number of LEDs to the serial monitor each time I plug a new strip into the Teensy?
 
You can set your test program NUMLEDs to greater than number of LEDs in any strip....500..

If you want a more precise count, set all LED in the strip to white, measure the current, and use the formulas in the previous post?
 
I didn't think of that. I was kind of hoping to have it output to the serial monitor though. I just thought that would be easier
 
The leds will not send back such a count value. As above, you can set the numleds to over compensate, and it will not cause any issues. Also, you can send a colour coded argument through a loop to set a group of leds to a particular colour and then provide a count if you want to know how many you have, such as a loop that counts to 50 and turns leds 0 to 49 red, then leds 50 to 99 blue etc. this way you can't then check that the leds are working and also count the sets of 50, or 30 or whatever.
 
Thank you for the suggestions. I will probably go with something like @mortonkopf's idea (it seems like the least work intensive).

However, I was wondering if I could build a device that could help figure out the number of LEDs in the strip. The idea being that I could connect the Teensy with some code to send 500 pixels worth of data down the strip and connect another Teensy or an Arduino that is listening at the other end of the strip. I seem to remember that the Teensy transmits a string of 1 byte per pixel at the beginning of the strip and then each subsequent pixel eats one byte and transmits the rest of the string to the next pixel. So, if the receiver at the end of the string detected 300 bytes and the Teensy at the beginning transmitted 500 bytes, then the receiver could output 200 pixels to the serial monitor. I am not sure how to do this but if you guys think it would be useful and could point me in the right direction, I would be happy to take a crack at it.
 
Hello again,
I am having some trouble soldering strips that are on my statue. The problem is that the statue is not near an electrical outlet and the battery powered iron I am using is not very strong so it takes the solder a long time to melt. Do you guys know or have any recommendations for a solder that melts at a lower temperature?
 
Status
Not open for further replies.
Back
Top