gkaindl / ambi-tv

a flexible ambilight clone for embedded linux
296 stars 85 forks source link

Success Story + Help for others (ws2801 easy image) #63

Open ca0abinary opened 10 years ago

ca0abinary commented 10 years ago

This worked really well for me, I'm using ws2801 LED strips and everything else is exactly the same. Reason I'm posting is I see a lot of software issues / compilation issues / overclocking etc... And all this is unnecessary since I've put in the time to build an image!

This image is 300MB expanded and should fit on any card over 256MB. It's very stripped down so there's no need for overclocking and everything "just works". The only things anyone will need to modify is /etc/ambi-tv.conf (your setup is likely different than mine) and possibly /etc/network/interfaces if you don't run a network cable to your pi.

The credentials are: user: root pass: pi

The 75MB 7-zip compressed image can be downloaded from: http://dl.dropboxusercontent.com/u/6709302/ws2801_ambitv_raspi.7z

nickmazz commented 10 years ago

All hail Ca0abinary!!!!!!!!

On Mar 9, 2014, at 8:53 AM, ca0abinary notifications@github.com wrote:

This worked really well for me, I'm using ws2801 LED strips and everything else is exactly the same. Reason I'm posting is I see a lot of software issues / compilation issues / overclocking etc... And all this is unnecessary since I've put in the time to build an image!

This image is 300MB expanded and should fit on any card. It's very stripped down so there's no need for overclocking and everything "just works". The only things anyone will need to modify is /etc/ambi-tv.conf (your setup is likely different than mine) and possibly /etc/network/interfaces if you don't run a network cable to your pi.

The credentials are: user: root pass: pi

The 75MB 7-zip compressed image can be downloaded from: https://dl.dropboxusercontent.com/u/6709302/ws2801_ambitv_raspi.7z

— Reply to this email directly or view it on GitHub.

supercrab commented 10 years ago

@ca0abinary I just tried the link but it didn't work :( Can you repost it please?

supercrab commented 10 years ago

Fixed it! Just needed to be http://

danrspencer commented 10 years ago

Worked perfectly for me too with some WS2801 LEDs. Thanks!

civic95man commented 9 years ago

Out of curriosity, how were you able to drop the cpu usage so much from 100% to less than 5% with the ambi-tv program? Did you make any modifications to the program?

ca0abinary commented 9 years ago

Nothing. I suspect the default Raspian install is causing the overhead. Making it a very thin installation seems to have fixed the CPU load issues.

civic95man commented 9 years ago

Thanks for the tip. What image did you use? Did you start with a default Raspbian and strip away everything unneeded or did you use something custom?

ca0abinary commented 9 years ago

I used raspbian-ua-netinst as a starting point. Afterwards I added packages via aptitude and then fully cleaned the system and resized the image after testing. It's possible to make the image even smaller with some pretty invasive techniques, but I chose to be conservative. There's an ubuntu thread detailing how to clean up the junk from a linux system.

civic95man commented 9 years ago

Great! Thanks for the info. I'm making some changes to the program and wanted to make a new image.

ca0abinary commented 9 years ago

A slightly easier / quicker method would be to simply replace the /usr/sbin/ambi-tv binary file. You could do this by loop-mounting the ext partition and copying the file into it. Dismount and your image is ready to go! :-)

civic95man commented 9 years ago

Yeah, I had been doing that but it's just time consuming to do that for one little change. I'm still working on my final enclosure so I haven't needed to touch the program until I try and integrate everything together.

Crafu commented 9 years ago

Many thanks for this, I've been trying to get this up and running for months. This is probably a very dumb question, but how do I exit out of the program once it's running? I still need to configure the config file but the ambitv program kicks in straight away and I'm unable to do anything except cycle through the options. Many thanks C

ca0abinary commented 9 years ago

The easiest way is to start your Raspberry Pi without the USB capture dongle plugged in. If it is not connected ambi-tv will crash and you'll be able to use the command line.

Also you can press control-C and it should exit the app.

Alternatively you can SSH into your raspberry pi and kill the ambi-tv app. This is the approach I use, kill the app change the config, restart the app. Keep repeating until your settings are perfect.

Crafu commented 9 years ago

Great stuff, I'll give it a shot right now.

clarkent86 commented 9 years ago

I've installed the ambitv.bin but nothing boots when I power on the Pi. I'm using Win32DiskImager , selecting ambitv.bin, and writing it to my MicroSD card. Am I doing something wrong? Other images have worked this way in the past but I've never installed a .bin with Win32DiskImager.

I'm going to sleep for the night, but if I haven't heard anything back I think I'll try a different writer.

ca0abinary commented 9 years ago

Win32DiskImager should be fine. I've only tested this out on Raspberry Pi Model B. Although it should work fine on any variant, that might be a factor. You might also try a different SD card, and it should be at least 512MB to fit the entire image.

clarkent86 commented 9 years ago

I'm trying to use a B+ model with an HDMI output. Is the image not configured for HDMI? I'm very new to these images and config so sorry if these are dumb questions!

ca0abinary commented 9 years ago

The image is configured to use HDMI first and CVBS as fallback (the B+ has both, the CVBS signal is in the headphone jack). I've never tested on the B+ though so there may be a problem with the firmware? I would suggest flashing the image to your SD card then replacing he config.txt on the FAT partition (the one that shows in windows) with the config.txt from an image that is known to work on your board. That should get it booting. The other issue you might have is power, it's possible your board is drawing more power than your supply can provide. Make sure you have at least 700mA for the Pi and at least 10mA per LED in your string (if you are using the same supply for both). I had to buy a 5v 12A power supply originally designed for medical equipment for my setup.

clarkent86 commented 9 years ago

I just did exactly that before reading this! The new config.txt got it working. Thank you!! I'm at work so I'll try this with my LEDs tonight :) :). Also I have plenty of 5V amperage (10A).

clarkent86 commented 9 years ago

Hey ca0abinary, or anyone else who has this image...Would anyone do me a solid and update this image of Raspbian and post it? I only ask because none of the ports on my B+ model work without the latest Raspian updates, including the ethernet port.

Either that or if anyone knows of a way to update from mounting the image onto a mac I would be eternally grateful if you could share that with me!

ca0abinary commented 9 years ago

@clarkent86 Not super easy for this particular situation. A new kernel and modules need to be compiled if that's the case. One thing you could try is using the kernel and initramfs from a B+ image and dropping it onto the SD card. If that works, awesome! Otherwise it's a couple of days work to get the latest rasbian kernel and compile in the drive for this capture card as a kernel module. Unfortunately without a B+ to test on, I can't really work on this myself.

clarkent86 commented 9 years ago

I'll give that a try tonight. Thanks again.

ca0abinary commented 9 years ago

The USB capture card is controlled by a kernel driver. What happened is you updated the kernel and booted into the old filesystem. I’m guessing the USB capture card module didn’t load and so ambi-tv can’t find it to use it so the edge color program is failing. (Just a guess though.) You will likely need to start from scratch on this one. Use raspbian-ua-netinsthttps://github.com/debian-pi/raspbian-ua-netinst/ as a starting point and compile and install the usbtv-driver (under misc) then follow the rest of the instructions. It should work fine.

From: clarkent86 [mailto:notifications@github.com] Sent: Friday, November 14, 2014 8:11 PM To: gkaindl/ambi-tv Subject: Re: [ambi-tv] Success Story + Help for others (ws2801 easy image) (#63)

So I replaced the entire boot partition with the up to date network install looking to write the image over it...but it booted your image instead! The only problem is I when I try to run ambi-tv I get the following error:

"failed to start initial program 'program_tv_edge_color' . aborting..."

Do you think this might be due to a discrepancy in the boot partition? Any ideas?

Thanks again for any help you can offer.

clarkent86 commented 9 years ago

Yeah I gave up on getting it to work and my last post since I couldn't even get the mood program to work.

I installed the netinstall and have built the project. I also have spidev installed. It's listed in devices and the module is loaded. I started ambi-tv from the command line straight to the mood light program and it appears to work! I can toggle the pause and attempt to switch to the usbtv program but that would crash as I don't have that module/driver installed.

Sadly all that happens on my LED strips is the first one turns blue.

I see that when others install the wheezy linux build that they have to remove spidev from a blacklist configuration that allows it to boot on startup. There is no such blacklist on the net installed version of raspbian, so I would assume there would be no problem running it...but again all that happens is the first LED on my strip turns blue.

I suppose when I get home I can grep for the spi-bcm2708 module to see if it's been blacklisted elsewhere, but I'm currently at a loss.

ca0abinary commented 9 years ago

@clarkent86 It's normal to have the first LED a random color when either the strip is not initialized correctly or the wiring is incorrect. My first time I used an Arduino with the adafruit (https://github.com/adafruit/LPD8806) sketch loaded to ensure my strip was working correctly, then I duplicated the wiring with my Pi and tested with mood light.

clarkent86 commented 9 years ago

By initializing the strip correctly do you mean through the software?

My wiring matches the correct configuration. The only difference is that I do not have a toggle button, so only the SCLK and MOSI are wired on my Pi board to the center pins on my LED strip.

One issue might be that my power adapter is not color coded, so my voltage and ground may be reversed...but if that were the case would the first LED even turn on?

Here is a quick look at my current config from the back of the TV: leds I've triple check that all of the LED strips are correctly connected.

and this is what I've edited in the sample.conf:

... leds-top 18-49 # left-to-right leds-bottom 99-68 # left-to-right leds-left 17-0 # top-to-bottom leds-right 50-67 # top-to-bottom ...

I'm assuming the left and right is based on the image when you're looking at the front of the tv, so I may have that backwards...but that's irrelevant at this point.

ca0abinary commented 9 years ago

@clarkent86 A few debugging questions pop to mind:

I think your power is hooked up correctly since the LED is on and there's no magic smoke escaping.

clarkent86 commented 9 years ago

Ahh, so that has to be my issue...I didn't realize the Pi had to be connected to the same power adapter, I'm powering it through it's original power adapter and I was going to splice everything onto my power adapter after everything was working. I thought putting them on the same adapter was optional, that the LEDs had the logic to pull the correct amperage themselves. If this is not the case then I think you've solved my final issue! Again, I am a novice when it comes to the electrical components to this. I've always wanted to get into the arduinos and Pi ever since it came out and this is my first step. I truly appreciate the help you've offered and I hope this fixes my issue! I'll update later tonight.

pcr-coding commented 9 years ago

If your power adapter is to weak to supply both (the LEDs and the Pi) you can still use 2 separate power adapters but you have to connect their ground! This will also work.

clarkent86 commented 9 years ago

Good news! The LEDs are getting power correctly. A few LEDs on each strip are randomly turning on when connected to my power source. It cycled through a couple different light configurations and then stayed static. Bad news is that running the mood program does not effect the lights in any way. I only got them working at midnight last night so I'll have a bit more time to play around with it later today. If you had anything to suggest I would appreciate it though!

Thanks for all your help thus far!!!

pcr-coding commented 9 years ago

Did I understand you correctly: You got them working with the mood program last midnight (for a short time)? If yes I guess your software is OK and you "only" have some hardware problems. Do you have many LEDs? If so try to supply the power from both ends to the strip (only power not MOSI and SCLK). Make sure your power supply is strong enough to power the pi and all your LEDs.

clarkent86 commented 9 years ago

I did not get them powered with the mood light program. They seem to turn on from the power source alone. If I plug them in without power to the Pi they still turn on to the static configuration.

I will try powering the other end of the LEDs as well tonight! I think you may be onto something there because on the last strip of my LEDs only a couple on the side closer to the power source are turning on and nothing on the other. There are a lot more turning on on the other strips.

clarkent86 commented 9 years ago

Also I ended up using alligator clips on my power adapter. I think I might have some more power/connectivity issues with that config. My Pi actually rebooted a couple times with this config so I'm thinking I just need a better power connection.

ca0abinary commented 9 years ago

@clarkent86 I usually do a "sanity check" in this situation which means testing each part individually. Since you are running a Raspberry Pi B+ (untested) with untested wiring and untested software it's hard to know what is working and what's not. I suggest picking up a cheap Arduino and running the Adafruit script against your strand. It will let you know

Another benefit of the Adafruit sketch is it will allow you to control how many LEDs you are lighting. So start with 5 then move up to 10, 15, 20, 30, etc... and make sure it works.

If you can't get an Arduino, get a full copy of raspbian installed on your B+ and use ambi-tv with only the mood-light program in the config and the v4l2-grab-source removed.

clarkent86 commented 9 years ago

I know my power supply is sufficient, but I'll test the output just in case. It should be plenty though, its 5V 10A. I have a leftover strand I'm going to plug into, otherwise my current setup has 100 LEDs. Also I'm going to use a star mapping for the power supply that my co-worker is going to help me out with. hopefully this all gets me running, but if not I'll end up trying the arduino testing.

clarkent86 commented 9 years ago

Hey @ca0abinary, I caved and bought a model B, but since I have a couple B+s I was wondering: If I sent you a B+ for free would you be willing to try and update the current net install nraspbian to work with the WS2801 LEDs and possibly the USB grabber? I know it's no small feat to get the USB grabber functionality. I thought it might be good for anyone in the future who might be trying this with a B+ since the Bs are becoming more scarce and more expensive because of that.

Thanks.

ca0abinary commented 9 years ago

@clarkent86 Sure, if you sent one along I would be happy to work on a single solution for B/B+. Go ahead and send me an email, my email address is listed on my public profile.

odinfox commented 7 years ago

Hi @ca0abinary, Can you upload this image again, looks like Dropbox closed your link for generating too much traffic.

Thanks

ca0abinary commented 7 years ago

Hopefully Mega will be a good provider for this file: https://mega.nz/#!Sdd20I6A!vc4nGlVdc-rPAOxhl3QQLHESalvl3r5T0s8c-0x1DN4