DirkPrefect
Posts: 24
Joined: Tue May 07, 2013 3:07 am

MINIPI: Airplay receiver for your car.

Sun Jul 21, 2013 9:17 pm

List of parts used:
Raspberry Pi Model A
wireless usb adapter (based on RTL8192cu chipset)
usb to micro usb cable
3.5mm audio to 3.5mm audio cable
2GB or larger SD card
12v USB power adapter (maybe depends on car)
Raspberry pi case (built or purchased)

Here is the link to download the image https://dl.dropboxusercontent.com/u/6715184/minipi.7z. Windows users will need 7-zip to expand the image and then use win32-diskimager to write the image to a 2GB or larger SD card.

This is based on latest raspian image, is setup for US keyboard and locale, is overclocked to 800mhz and has memory set to minimum amount for GPU. Uses default user and password of pi and raspberry .
The default SSID is MINIPI and password is DontBlink .
The files you will want to edit are as follows:
/etc/hostapd/hostapd.conf - where you configure the SSID and password for the wifi network
/etc/init.d/shairport - where you set the name of the airplay receiver.

You can edit these files after the pi has booted by joining its wifi and connecting with ssh. I use iSSH on my iPad to do any tweaking. Using putty on a windows laptop or desktop (with a wifi adapater) works just as well.

I have a 2009 MINI Cooper and wanted to add the ability to stream pandora from my iPhone to my car. The car has bluetooth but doesn't support A2PD for streaming. The car does have traditional iPod support and an AUX in port. So having a model A pi sitting on the shelf needing a project I set out to solve the problem. I had found other projects with similar goals but many of them require you to use your phone or tablet as a hotspot. I wanted to avoid this as many service providers including mine charge an insane monthly fee for the ability to use this built into the OS feature. First I got airplay (shairport) working on my local network and tested the sound output. The original build using the master branch of shairport had mixed results. I switched over to the dev-1.0 branch and found the sound output was stable and used less cpu/memory. Next up was to make my wifi adapter based on the RTL8192cu chipset work as a hotspot. After following 3 different guides I was able to connect to the pi as a hotspot, but airplay/shairport would not work. I tried many things trying to find the magic combo to get it work with no luck. Then one day I stumbled across this guide http://learn.adafruit.com/setting-up-a- ... t/overview on adafruit. There were two things different in this guide than the others I had followed. 1. Using the pre-built binary from adafruit instead of building from source. 2. Removing WPASupplicant. These changes fixed the issue and now using airplay was as simple as joining the pi based wifi and picking the airplay receiver from the app. It took some experimenting but I figured out that as long as I don't send a DNS server address to the device I can still use my cell data to pull in Pandora or other streaming music while sending it out over wifi to the pi.

The main parts of the project now working I started testing to see how stable the setup was and what kind of issues I might see in use. After this testing I found that at times running without a keyboard the wifi adapter would not properly start and as such the hostapd and dhcp servers could fail. So I made some changes and have all the services start in the proper order at the end of the boot process using /etc/rc.local file. I have tested this setup on 2GB class 4 SD cards through 16Gb class 10 cards on 256MB model B, 512MB model B, and Model A Pis and feel the setup is stable enough to release out into the wild.

I use iSSH on my iphone with a connection setup for the pi and sends the command "sudo init 0" to gracefully shutdown the pi when I remember. I have not had any problems so far in the 3 weeks of use in car with a corrupted SD card. In the car I use the built-in usb port which powers on when I open the door and shuts down with the external lights after exiting the car. I built a case using the container an iPod touch came in with a little dremel work, some superglue and plastic standoffs. I plan to add a push button or toggle button to gracefully power down the pi in the near future.
Last edited by DirkPrefect on Tue Aug 26, 2014 1:51 am, edited 1 time in total.

theguardian
Posts: 5
Joined: Sun Jul 21, 2013 11:14 pm

Re: MINIPI: Airplay receiver for your car.

Sun Jul 21, 2013 11:19 pm

Thanks for posting this! I set out to create an airplay receiver about three hours ago and stumbled across this post. I managed to get everything working on my own through tutorials, but...
as long as I don't send a DNS server address to the device I can still use my cell data
How do you go about doing this? Is it as simple as removing:

Code: Select all

option domain-name-servers 8.8.8.8, 8.8.4.4;


from /etc/dhcp/dhcpd.conf

?

DirkPrefect
Posts: 24
Joined: Tue May 07, 2013 3:07 am

Re: MINIPI: Airplay receiver for your car.

Mon Jul 22, 2013 11:07 am

Yes, just comment out those lines. Now you will not get the wifi icon in the status bar on iOS because the cell data is still the primary connection to the Internet.

erenemre
Posts: 1
Joined: Fri Aug 02, 2013 12:38 am

Re: MINIPI: Airplay receiver for your car.

Fri Aug 02, 2013 12:49 am

Thanks for this! It was really helpful.

Quick question if you have time. My setup works perfectly if I'm using it in my house, but when I'm in my car, sound levels are really low and there is always a noise in the background. Do you have any idea why this would happen?

DirkPrefect
Posts: 24
Joined: Tue May 07, 2013 3:07 am

Re: MINIPI: Airplay receiver for your car.

Fri Aug 02, 2013 10:36 pm

erenemre wrote:Thanks for this! It was really helpful.

Quick question if you have time. My setup works perfectly if I'm using it in my house, but when I'm in my car, sound levels are really low and there is always a noise in the background. Do you have any idea why this would happen?
My best guess for the background noise would be a loose ground on either the power source for the pi or the radio. It really depends on what the noise sounds like. A hum that changes with the speed of the engine would be from the alternator. Static could be a loose connection between the audio out and the input on the radio. As for the low sound output it could be anything from the radio keeps separate volumes for each source, or a setting to change the input level on the aux in, some units will knock down the audio to line levels before processing them. If you post or PM more information on your setup I will do my best to help. I noticed when I put the MINIPI into an older van with a tape adapter I needed to turn down the volume using alsamixer but in my mini I need to turn it up to 85-90%.

LlamaGoingNorth
Posts: 4
Joined: Wed Aug 28, 2013 2:12 pm

Re: MINIPI: Airplay receiver for your car.

Fri Aug 30, 2013 9:38 am

I seem to be having difficulty with the dhcp server config file..

Could you please post the original dhcpd.conf file? or the network/interfaces file so that I can reconfigure it?

Thanks!

billybojangles
Posts: 9
Joined: Fri Feb 15, 2013 2:58 am

Re: MINIPI: Airplay receiver for your car.

Fri Oct 04, 2013 1:21 am

This worked perfectly out of the box.. Very cool and just what I was looking for!

Thanks :)

Graves
Posts: 7
Joined: Sun Oct 06, 2013 1:37 am

Re: MINIPI: Airplay receiver for your car.

Sun Oct 06, 2013 1:43 am

Got everything set up, but cant seem to pass data from cell phone (galaxy s3) to the Pi. Im using your prepared image and wondering if i still have to edit out optional dns server on it. Im using an Edimax nano wifi adapter which should be the right one. Wondering if im missing something here.

rictorg
Posts: 2
Joined: Sun Oct 06, 2013 12:00 pm

Re: MINIPI: Airplay receiver for your car.

Sun Oct 06, 2013 12:02 pm

Two Questions. First, would this image normally work on the "B" model. Second, can you recommend via Amazon or Newegg an inexpensive and compatible wireless adapter. I seem to be having difficulties getting this to work, which is disappointing as this is exactly what I want my pi to do.

Graves
Posts: 7
Joined: Sun Oct 06, 2013 1:37 am

Re: MINIPI: Airplay receiver for your car.

Fri Oct 11, 2013 2:24 am

Ok i have verified it works with Iphone, but for the life of me cant get my android phone to work. It connects to the Pi, but wont share the cell data. I have used a static ip but it will not let me use no DNS. Im lost at this point. Any ideas.

Btw. I have also used dhcp on android but it keeps sending googles dns settings. The Pi seems to be fine the problem is on my android phone. Its driving me insane at this point lol.

swindmiller
Posts: 23
Joined: Mon Oct 14, 2013 1:58 pm

Re: MINIPI: Airplay receiver for your car.

Mon Oct 14, 2013 1:59 pm

Thanks for posing this, I found what I am going to do with my PI!!

Do we know if this image will work on the B version of the PI yet?

Thanks,
Scott

swindmiller
Posts: 23
Joined: Mon Oct 14, 2013 1:58 pm

Re: MINIPI: Airplay receiver for your car.

Mon Oct 14, 2013 2:09 pm

Really sorry!!! Totally missed that was already said in the post. :oops:

swindmiller
Posts: 23
Joined: Mon Oct 14, 2013 1:58 pm

Re: MINIPI: Airplay receiver for your car.

Thu Oct 17, 2013 2:57 am

I have to so say this is AWESOME!!! I just received my usb wifi card and this image worked with no additional setup. I bought this card: http://www.amazon.com/gp/product/B003MT ... UTF8&psc=1 and bought a USB sound card as well after reading some of the problems people had with the onboard sound but I have to say I think the onboard sounds just fine :) Maybe there have been updates since those posts I don't know, I am just starting out with the PI.
A big thanks to DirkPrefect for this image...it saved me a bunch of time. I can now use this and add onto it.

Thanks again!!
Scott

lokkenjawnz
Posts: 2
Joined: Fri Feb 10, 2012 9:31 am

Re: MINIPI: Airplay receiver for your car.

Mon Oct 21, 2013 11:04 pm

@Graves Have you gotten anywhere with getting it to work with an Android device? I want to implement this in my car, but I've got an Android phone, so it won't be much use if it won't connect properly!

@DirkPrefect This looks fantastic! Have you tried running MPD on it, or even something more fancy like mopidy? MPD + some attached storage + airplay capabilities would make for one hell of a flexible music player!

rictorg
Posts: 2
Joined: Sun Oct 06, 2013 12:00 pm

Re: MINIPI: Airplay receiver for your car.

Wed Oct 30, 2013 3:43 am

I ordered the Edimax wifi module and it works like a charm. Thanks for posting this image!

mooseamoose
Posts: 3
Joined: Sun Jan 06, 2013 9:08 pm

Re: MINIPI: Airplay receiver for your car.

Sat Dec 28, 2013 12:04 am

Would this airplay implementation work for video as well as audio? Thanks!

swindmiller
Posts: 23
Joined: Mon Oct 14, 2013 1:58 pm

Re: MINIPI: Airplay receiver for your car.

Sat Dec 28, 2013 11:29 am

Just audio as far as I know.

DirkPrefect
Posts: 24
Joined: Tue May 07, 2013 3:07 am

Re: MINIPI: Airplay receiver for your car.

Sat Jan 04, 2014 1:03 am

This only uses the version one of Airplay so it only does audio. I am working on a new image for this with all the updated software. I will look into adding MPD or other suggestions. I have a Nexus 4 that I will check to see if there is a work around for getting both the wifi and cell data to work.

mooseamoose
Posts: 3
Joined: Sun Jan 06, 2013 9:08 pm

Re: MINIPI: Airplay receiver for your car.

Sun Jan 05, 2014 2:54 pm

That would be great!

pablo808
Posts: 5
Joined: Thu Oct 17, 2013 11:31 pm

Re: MINIPI: Airplay receiver for your car.

Wed Jan 08, 2014 11:01 am

I tried this image today but could not see the MINIPI Airport destination after joining the wifi network.

I checked the RPi processes and it does indeed show shairport running.

Trying to connect with an iOS devices running latest iOS 7.0.4.

Update:

To get the Airport icon displayed on the iOS device, I had to rerun the following manually.

Code: Select all

sudo service avahi-daemon restart
sudo service shairport restart
Thanks

rog.computer5
Posts: 1
Joined: Mon Jan 13, 2014 2:59 am

Re: MINIPI: Airplay receiver for your car.

Mon Jan 13, 2014 3:04 am

I download the image but Im getting a error message _> PANIC:VFS UNABLE TO MOUNT ROOT FS ON UNKNOWN-BLOCK(179,2)
ENTERING KDB (CURRENT - 0XDD82AC80, OID 1) DUE TO KEYBOARD ENTERY
KDB>

Any help would be appreciate.

Thanks :(

Chriz239
Posts: 1
Joined: Mon Mar 10, 2014 9:04 pm

Re: MINIPI: Airplay receiver for your car.

Mon Mar 10, 2014 9:17 pm

@pablo:
Very good hint for IOS 7.0.4! But i found out that you have to restart this services after connecting to wifi.

How did you fix this problem that the airplay symbol appears automatically?

kind regards,
Chris

mattdcox
Posts: 1
Joined: Fri Mar 14, 2014 4:10 pm

Re: MINIPI: Airplay receiver for your car.

Fri Mar 14, 2014 4:14 pm

Couple of questions,

Does the file system run in read only mode? If no, how do you keep the FS from going bad? Is yours wired to have continuous power? I was thinking if I wired the pi to continuous power, and the peripherals to switched, I would only need to shut it down when I left town.

This is my first pi, I don't want to wreck it. Great write up.

Thanks
Matt

tezmo
Posts: 1
Joined: Wed May 14, 2014 10:19 am

Re: MINIPI: Airplay receiver for your car.

Wed May 14, 2014 10:22 am

Hey Dirk - the link in your first post no longer works - is the image available online anywhere else? Thank you!

aroo
Posts: 1
Joined: Thu Jul 17, 2014 3:30 am

Re: MINIPI: Airplay receiver for your car.

Thu Jul 17, 2014 3:34 am

I've been trying to replicate your work from scratch (new to rpi) but want to see where I'm going wrong. Stuck on the access point portion. Can you re-post the image?

Thanks!

Return to “Graphics, sound and multimedia”