Skip to Content
It is currently December 15th, 2019, 12:45 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: November 8th, 2013, 2:52 am 
Offline
Senior User
Senior User

Joined: October 26th, 2013, 1:55 pm
Posts: 92
Here is the Raspberry Pi:
Image
It sells for just $35 and can be used for many embedded projects including internet radio relay to transmitter.

1. Download Raspbian: http://www.raspberrypi.org/downloads
2. On a windows machine get Win32DiskImager.
3. Acquire SD card of at least 4gb in size.
4. Insert SD card in windows machine and run Win32DiskImager
5. Load the Raspbian.img file, set destination to SD card and click "write"
6. Put SD card in pi and boot.
7. In the setup change location settings and keyboard layout to match.
8. In the setup set boot to command console only. (init 1)
9. Default login/pwd is pi/raspberry
10. Change the password:
Code:
sudo passwd

10. Execute the following commands:
Code:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mpc mpd


and

Code:
sudo nano /etc/rc.local


Add right before
Code:
Exit 0

add the following
Code:
mpc clear
mpc add http://stardust.wavestreamer.com:9669
mpc play


Change "http://stardust.wavestreamer.com:9669" to your streaming server and port.

Make sure your power is 5v and 1amp (optimal) or so that 4.78v is registered between tp1 and tp2 on the Pi circuit board.

You will also want to issue the "halt"
Code:
sudo halt
command before disconnecting the power for proper shutdown. I ran into issues with mpc not playing at startup after abrupt hard power off (just pulling out the power cord.) There are some howto tricks for making a button that connects to the GPIO header port and a Perl script that would let you direct the halt command at the push of a button.

In the states you can freely create more than one transmitter location to increase coverage using low power transmitters affordably.

On the legality of low power broadcasts the FCC offers these answers:
http://www.fcc.gov/guides/low-power-bro ... o-stations


Top
 Profile  
Reply with quote  
PostPosted: December 31st, 2013, 5:34 pm 
Offline
Senior User
Senior User

Joined: October 26th, 2013, 1:55 pm
Posts: 92
We are working on a new setup that is even more fault tolerant.

For starters the boot partition will be set to read only as to prevent corruption of files with improper shutdowns in the case for the convenience and simplicity of just unplugging the Pi rather than using the GPIO and keypad with script or using display and keyboard. Corruption of boot partition is very common with improper shutdowns.

We are also using cron to check every 30 seconds if the process MPD is running and if it is not running in the case of it crashing it will relaunch it and re-issue the MPC command and arguments.

We have also changed the distro from Raspbian to Arch Linux. Commands are slightly different than the Debian breed however the stability of Arch is much better as I have been told.

I am still running around busy with all kind of stuff however intend to getting around to putting a new guide together for embedding Raspberry Pi's to relay your radio to a transmitter.


Top
 Profile  
Reply with quote  
PostPosted: May 3rd, 2014, 12:01 pm 
Offline
Senior User
Senior User

Joined: October 26th, 2013, 1:55 pm
Posts: 92
We have redone the headless upstreamer to just using a few scripts. Still pending is to ping the stream service and play a local file or playlist if the ping fails, this way no interruptions or dead air. Also we may add a cron that restarts the Pi once a week at some night hour. I am having a friend help me with this today and will report back when it is done.

We currently have one low powered transmitter running in Rogers Park, Chicago. We also just got three more transmitters and Pi's to canvas more of Chicago.

So here is the basic setup or on hackpad at http://q4radio.hackpad.com:

Code:
Setup autologin:

    nano /etc/inittab

Remark following line:

    #1:2345:respawn:/sbin/getty --noclear 38400 tty1

and add below it:

    1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1

Install MPD and MPC:

    apt-get install mpd mpc

Set audio to output to 1/8"

    amixer cset numid=3 1

Write the following 2 scripts in your home folder:

    nano play.sh

    #! /bin/bash

    mpd

    mpc clear

    #replace with your stream link:

    mpc add http://q4radio.primcast.com:8672

    mpc repeat on

    mpc volume 90

    mpc play

    nano check.sh

    #! /bin/bash

    ts=$(date)

    pgrep mpd > /dev/null

    [ $? -eq "1" ] && echo "$ts: mpd not running, restarted..." && '/home/pi/play.sh'

    sleep 5

    done

Change the permissions of both script files:

    chmod +x play.sh

    chmod +x check.sh

Edit .bashrc in your home folder:

    cd ~

    nano .bashrc

add at the end of the file:

    sudo bash ./check.sh &

Edit rc.local in /etc

    nano /etc/rc.local

add at the end of the file:

    sudo bash ./play.sh


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group