airtraffic

Author Topic: KSFB has been Plugged!  (Read 281206 times)

Offline dave

  • Site Founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 4593
    • LiveATC.net
Re: KSFB has been Plugged!
« Reply #25 on: April 19, 2011, 08:38:57 PM »
My Sheeva ran the Lake Parker feed all week for Sun 'n Fun, including surviving Level 5 thunderstorms and a few power cycles.
:-)

Offline smeuse

  • Newbie
  • *
  • Posts: 15
Re: KSFB has been Plugged!
« Reply #26 on: April 24, 2011, 02:54:45 PM »
Finally had time to get the Dreamplug working. I ended up just using "hw:0,0" for the device in the config. Still getting things adjusted; I'm guessing I'll need to attenuate the audio a bit.

The one thing I noticed (which really shouldn't surprise me) is that it runs pretty high CPU. It makes the command line a little laggy, but hey, not bad for what it is :)

-Steve

Offline smeuse

  • Newbie
  • *
  • Posts: 15
Re: KSFB has been Plugged!
« Reply #27 on: April 24, 2011, 03:48:57 PM »
For future reference for anyone using Darkice with the Dreamplug: use "plughw:0,0" for the audio device, *not* "hw:0,0".

"hw:0,0" was spiking the CPU and slowing down/distorting the audio. I'm not sure what the deal is between the two device names, I'll have to look that up later.

So now, 1 Darkice process running at a sample rate of 11Kb/s, the CPU is hovering around 21%.

Also, the audio was no problem, no attenuation required.

I also prevented httpd, dnsmasq, cups and bluetooth from starting, I'm now only using 50MB of ram (down from over 200MB by default).

-Steve


Re: KSFB has been Plugged!
« Reply #28 on: June 01, 2011, 02:31:45 PM »
I have a whole instruction of how to set up a sheeva plug from my tech guy, but he is a tech guy and i need to edit out some swearing i have done it twice and following these steps work for me i will get it on here in a couple mins of editing...

Re: KSFB has been Plugged!
« Reply #29 on: June 01, 2011, 02:37:03 PM »
As for setup from a new sheva plug if memory serves you need to do the following:

1)
After boot you need to first fix DHCP
edit
/etc/dhcp3/dhclient.conf
and comment out (IE add a #  to supersede domain-name-servers 127.0.0.1;)    so you should see # supersede domain-name-servers 127.0.0.1;
restart


2) you now need to fix some screwed up permissions for your var files
Edit
/etc/rc.local
and add the following lines:

chmod 1777 /tmp /var/tmp
mkdir -p /var/cache/apt/archives/partial
/usr/sbin/ntpdate-debian

save and exit
you now need to run the script you just saved by entering:
./rc.local

after it runs enter
dpkg-reconfigure tzdata
to setup time so apt-get will work correctly

reboot for fun

3)
 you now need to fix apt-get as they screwed up the distro IP
edit
/etc/hosts
change the IP the have for ports.ubuntu.com to 91.189.92.175    ie it should read
127.0.0.1 localhost
91.189.92.175 ports.ubuntu.com

reboot

4)
now you need to update apt-get and install some other stuff

run:
apt-get update

then run:
apt-get install man

then run:
apt-get install wget

then run:
apt-get install darkice

5)
now you need to update the os to something that actually understands the USB audio devices

this MUST be done via the USB cable and NOT via IP SSH, so install the relivant drivers and log into the device via serial terminal

   5a)
first you need to fix another screwup
edit
/etc/sysctl.d/10-process-security.conf
find the line that says:
vm.mmap_min_addr #####
and set the #### to 32768
save exit reboot

   5b)
go to the root directory and enter
wget http://sheeva.with-linux.com/sheeva/README-PLUG-UPDATE.sh
this will download the update script
now enter:
chmod 777 README-PLUG-UPDATE.sh

now enter:
./README-PLUG-UPDATE.sh
its going to spit out:
Use ./README-PLUG-UPDATE.sh VERSION --nandkernel to write kernel to NAND
Or  ./README-PLUG-UPDATE.sh VERSION --rootkernel to write kernel to /boot

you want to go to http://sheeva.with-linux.com/sheeva/ and find the most up to date version (at the time it is 2.6.38.7)
also you want to use the NAND kernal so if 2.6.38.7 is still the most up todate you want to enter:
./README-PLUG-UPDATE.sh 2.6.38.7 --nandkernel

   DON'T reboot yet, read next step fully


   5c)
Read steps before proceeding past this point, if you screw this up you could brick the plug

reboot,
because you are NOT on SSH but using TTY and the serial usb cable you will be presented with the bios boot screen, during the boot process there is an option to interrupt boot,   interrupt it but hitting the "any" key  DOH!!!!!
 enter:
setenv mainlineLinux yes

then enter:
setenv arcNumber 2097

then enter:
printenv bootargs

you now want to write down the locations of the NAND partitions and make sure they jive with the next step

enter:
setenv bootargs rootfstype=jffs2 console=ttyS0,115200 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=192.168.1.9:192.168.1.4:192.168.1.4:255.255.255.0:DB88FXX81:eth0:none

PAY ATTENTION to the nand blocks, if the numbers are different from the above text and what you got from the bootargs, USE THE ADDRESSES YOU GOT FROM "printenv bootargs" paying attention to proper syntax, also remember this is TTY so you can backspace but you cant use the mouse or arrow keys to move the cursor, you need to enter it right the first time, NO TYPOS a single missed space or number change has the potential to brick the plug.

if you are successful after you hit enter nothing should happen it should just jump to the next line
 
5d)
enter:
saveenv

enter:
reset

if all is well it should boot into the OS with the new kernle if it doesn't have a drink and find something else to do.


6)
next config darkice

go to /etc
enter:
nano darkice.cfg

enter the data from the config file you were given


Done, now make the deamon and cron job

7)

so what you want to do is take the below file and put it in /etc/init.d    you can do this by going to /etc/init.d and then entering
nano rc.darkice  then paste the attached script(ask dave for this script or i have it just PM me), save/exit
then you need to change the permissions on the file so the system can open it so go chmod 0750 /etc/init.d/rc.darkice

you now need to update the startup scripts to use the darkice startup file do this by entering (while in /etc/init.d)
update-rc.d rc.darkice defaults 99

reboot the machine, and it "should" now auto start darkice


Now to adding a cronjob that "should" auto restart darkice if it goes down



enter crontab -e  the first time its run the comp should ask what editor you want to use I suggest nano.

after nano has opend you will be presented with a text file with some instructions, at the bottom of these paste:    

*/5 * * * *     root    /etc/init.d/rc.darkice restartifdown 2>&1 > /dev/null

save and exit....


should be good to go......
« Last Edit: June 01, 2011, 02:45:49 PM by Island Pacific Flight Academy »

Re: KSFB has been Plugged!
« Reply #30 on: June 01, 2011, 02:44:15 PM »
another suggestion.

Change the hostname to something relevant i had two plugs on the same network and i edited the wrong one... also they were interfering with each other have the same hostname on my network.


Offline Ueli

  • Newbie
  • *
  • Posts: 3
Re: KSFB has been Plugged!
« Reply #31 on: July 04, 2011, 09:03:23 AM »
Hello!

concerning your setup guide: did you really set up your plug like that, and it worked? Because the version of darkice that you get with apt-get doesn't support MP3 which is crucial for the feed to work.

Greetz

Re: KSFB has been Plugged!
« Reply #32 on: July 04, 2011, 10:10:59 AM »
ill look it over again today when i get in the office but yes i am pretty sure all three of my feeds were set up just like i wrote i have a new cron that i got setup yesterday from buff that fixed some other issues. but other than that i think that one is pretty accurate... are you setting up your own plug?

Re: KSFB has been Plugged!
« Reply #33 on: July 04, 2011, 05:22:06 PM »
checked it out no issue with the setup that was exactly what we did and i will be starting a new one today when fedex gets here... so if it doesnt work for you send me a msg and i will look into what might be the issue you are having.

Offline Ueli

  • Newbie
  • *
  • Posts: 3
Re: KSFB has been Plugged!
« Reply #34 on: July 05, 2011, 01:36:54 PM »
Hello! My setup does work and will go online in some days, but I wasn't able to get it to work with the darkice I got from apt-get. I had to compile my own version of darkice, which was a bit complicated because I don't have a lot of linux experience.

@Dave
Is it possible some feeds don't work with MP3 but some other codec? Or do you have an idea why it works for him?

Greetz Ueli

Offline dave

  • Site Founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 4593
    • LiveATC.net
Re: KSFB has been Plugged!
« Reply #35 on: July 05, 2011, 01:39:30 PM »
They must have a version with MP3 support.  Feeds that are not MP3 will not work.  And I verified that all their feeds are MP3.


Offline Ueli

  • Newbie
  • *
  • Posts: 3
Re: KSFB has been Plugged!
« Reply #36 on: July 06, 2011, 03:51:44 AM »
I just saw that your setup is running on Ubuntu, which has a different apt-get distro. So probably the compiled binarys in the Ubuntu distro are with MP3 support, and the ones in Debian (which I am running) aren't. Thats proba^bly the difference, which makes the installation with Ubuntu a lot easier :)

Greetz Ueli

Offline tonyf

  • Newbie
  • *
  • Posts: 4
Re: KSFB has been Plugged!
« Reply #37 on: January 03, 2012, 09:59:58 AM »
I am currently setting up a SheevaPlug for a feed. One update to the setup instructions if you have recently purchased a new plug.

You need to edit /etc/apt/sources.list

Change the one line to:

"deb http://old-releases.ubuntu.com/ubuntu jaunty main restricted universe multiverse"

The version of debian that is shipped with the new plugs needs jaunty for apt-get, but jaunty has been retired and no longer available in the normal update directory. Therefore the above line points to the old jaunty files. Also note that it appears any  newer debian release (which is not using jaunty) does not support the plug, so don't try to update the os.

Obviously any corrections to this or updates is appreciated.

Tony

Offline Biff

  • Sr. Member
  • ****
  • Posts: 376
    • Biff's Hangar
Re: KSFB has been Plugged!
« Reply #38 on: January 26, 2012, 10:41:50 AM »
My plug died again last week.  It had been running non-stop without even a reboot for almost 150 days.  Something got corrupted and I had no choice but to re-flash and re-build it from scratch.  Luckily, that wasn't too difficult.  It had a similar issue 10 months ago when I had to rebuild it at that time, too.  I have the first model of Sheevaplug.  I hope the newer ones are more stable than mine.

For future reference (mainly my own) here's the procedure.  I should have taken notes, instead I'm recalling this from memory.  This is not a how-to for setting up a new plug.  It will work for that, but it's more than you need.  Don't just follow these steps blindly.  Understand what each is doing and consider if it's correct for your version of plug and situation.  I'm assuming you have some linux knowledge since I'm not detailing every keystroke you need to make.

Use the SheevaPlug Installer to un-brick the thing.  I could not get the windows version (I'm on Win7 64bit) to work at all.  The linux version worked fine from my ubuntu box.  Follow the instructions, it's pretty straightforward.  You'll need a USB thumb drive and a USB cable to connect the plug to your computer.

Use a terminal program to connect to the plug via the USB cable.  Reboot the plug by punching the reset button or pulling the power on it.  You should get a login prompt after it boots.  The root password is "nosoup4u".

Edit /etc/apt/sources.list   Change it to 1 line only:
Code: [Select]
deb http://old-releases.ubuntu.com/ubuntu jaunty main restricted universe multiverse

Update apt-get and install wget so you can download stuff.  Then download the kernel updater script.
Code: [Select]
apt-get update
apt-get install wget

cd /tmp
wget http://sheeva.with-linux.com/sheeva/README-PLUG-UPDATE.sh
bash ./README-PLUG-UPDATE.sh 2.6.35.7 --nandkernel

I use kernel 2.6.35.7 because I know it works.  You might try others.

Still in your terminal session, reboot the plug.  Interrupt the boot process before that countdown stops.  Enter the commands from the top of the plug-update script above.  For my plug, I entered them verbatim.  For your plug, you may need to change the arcNumber and/or bootargs.
Code: [Select]
setenv arcNumber 2097
setenv bootargs rootfstype=jffs2 console=ttyS0,115200 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=192.168.1.9:192.168.1.4:192.168.1.4:255.255.255.0:DB88FXX81:eth0:none
saveenv
boot

The plug will reboot.  Log in as root again.  Now would be a good time to change the root password. If you want your plug to have a static ip, edit /etc/network/interfaces and restart networking.  Make sure your network cable and USB audio adapter are plugged in.  SSH to the plug via ip to make sure that's working.  You can disconnect the USB cable now.

Install darkice and usb audio utils.  Run alsamixer to set input levels (volume).  If alsamixer doesn't see your USB audio adapter, then you have a problem.
Code: [Select]
apt-get install darkice alsa
alsamixer

Create /etc/darkice.cfg   Make sure to set device = plughw:0,0
Create /etc/init.d/darkice  (or rc.darkice if you prefer, I'll attach or provide a link to mine later)

Set the init script to run at boot:
Code: [Select]
update-rc.d darkice defaults 99

You can test that darkice is working by running it from the command line.  You should be able to listen to your feed at LiveATC.net.

Create a cron job to restart darkice when it goes down (and it will)
Code: [Select]
*/5 * * * * /etc/init.d/darkice restartifdown 2>&1 > /dev/null

Now wait 5 minutes for darkice to start, or manually start it via the init script.

It should take less than an hour, probably less than 30 minutes, to un-brick your plug and have it streaming again.
« Last Edit: January 26, 2012, 10:49:40 AM by Biff »

Offline tonyf

  • Newbie
  • *
  • Posts: 4
Re: KSFB has been Plugged!
« Reply #39 on: February 01, 2012, 09:03:02 PM »
My SheevaPlug has been running great for the last 25+ days, however, I am now getting the following darkice error and I lose audio streaming,  close to the same time every day now:

01-Feb-2012 18:47:17 MultiThreadedConnector :: sinkThread reconnecting  0

Once I restart darkice it comes right back up. Has anyone run into this?

Tony

Offline dave

  • Site Founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 4593
    • LiveATC.net
Re: KSFB has been Plugged!
« Reply #40 on: February 01, 2012, 10:37:20 PM »
My SheevaPlug has been running great for the last 25+ days, however, I am now getting the following darkice error and I lose audio streaming,  close to the same time every day now:

01-Feb-2012 18:47:17 MultiThreadedConnector :: sinkThread reconnecting  0

Once I restart darkice it comes right back up. Has anyone run into this?

Tony

Make sure you have a script that checks whether darkice is running.  Run that script from cron once a minute.

Then...kill darkice once a day at some odd hour.

Offline tonyf

  • Newbie
  • *
  • Posts: 4
Re: KSFB has been Plugged!
« Reply #41 on: February 02, 2012, 03:01:31 PM »
My SheevaPlug has been running great for the last 25+ days, however, I am now getting the following darkice error and I lose audio streaming,  close to the same time every day now:

01-Feb-2012 18:47:17 MultiThreadedConnector :: sinkThread reconnecting  0

Once I restart darkice it comes right back up. Has anyone run into this?

Tony

Make sure you have a script that checks whether darkice is running.  Run that script from cron once a minute.

Then...kill darkice once a day at some odd hour.


Cron is now running correctly :-) However, the problem is that darkice doesn't actually stop when there is an issue, (with the above error) therefore the restartifdown isn't doing anything as it doesn't think it needs to restart. Trying to research what that error is and a fix...



Offline Biff

  • Sr. Member
  • ****
  • Posts: 376
    • Biff's Hangar
Re: KSFB has been Plugged!
« Reply #42 on: February 02, 2012, 03:32:58 PM »
Tony,

I modified that restartifdown script to look at CPU usage to determine if darkice is actually running or not.  On my plug, CPU usage will drop from its normal 18-19% down to 10 or less when it loses connection like that.

Offline Biff

  • Sr. Member
  • ****
  • Posts: 376
    • Biff's Hangar
Re: KSFB has been Plugged!
« Reply #43 on: February 02, 2012, 06:48:11 PM »
Attached is my /etc/init.d/darkice script (remove the .txt if you download it).  Notice the restartifdown section checks CPU usage as well as the usual things.

Be sure to set the min_cpu variable near the top of the script to whatever is appropriate for your plug.


Offline tonyf

  • Newbie
  • *
  • Posts: 4
Re: KSFB has been Plugged!
« Reply #44 on: February 03, 2012, 12:01:10 AM »
Tony,

I modified that restartifdown script to look at CPU usage to determine if darkice is actually running or not.  On my plug, CPU usage will drop from its normal 18-19% down to 10 or less when it loses connection like that.

Yes, my darkice process will drop from 10-11% to 1% when it is having its little issue, but the process is still running and 'darkice status' still shows as up which is why it won't restart. I will take a look at your script - thanks.