未加星标

Little Box of Fip

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二05 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

Little Box of Fip

I’ve made many Raspberry Pi internet radios in the past here’s how to make the simplest one possible, making use of an ancient RaspberryPi 1B that was lying neglected at the back of the drawer. This one is so simple, you can’t even change channel the only internet radio station I ever listen to is the French station fip , so this is a perfect addition to the kitchen, and I’ll wire it in to the 3.5mm audio input socket on an old iPod dock.

Here’s what you need:

An old Raspberry Pi with SD card, power supply, wifi dongle A keyboard, HDMI cable and some wired internet all of these only temporarily A 3.5mm audio jack lead to connect to the input of an amplifier or iPod dock. Fresh OS install

I did try updating the old version of Wheezy on the old Pi’s SD card, but I ran into all sorts of problems. Far easier to do a fresh install of Raspbian Jesse Lite this is a small install that doesn’t have a GUI, nor any of the software installed on the desktop like LibreOffice or the dreaded leviathan that is Wolfram. It’s command line only. That’s all we need for this.

First, as there were no files I wanted on the card, I re-formatted the SD card in my MacBook using Disk Utility as a single FAT32 partition. It was an 8GB card but I am sure you could use a far smaller one. I then downloaded NOOBS Lite , unzipped and dragged the files onto the SD card, then ejected it from the MacBook and plugged it back in the Pi.

I then plugged the Pi into my TV and plugged some wired internet into the Pi’s ethernet socket, booted it up and did a network install of Raspbian Jesse Lite. When this was finished I rebooted the Pi, and ranraspi-config to do a few things:

enabled ssh so I can log in remotely if I need to (it won’t have a screen or keyboard) forced audio output to audio jack selected option to wait untilhas network to boot renamed device ‘fip’ so I can find it on my home network easily Install a media player and add a station

I then installed the mpc media player by typing:

sudo apt-get install mpc mpd

I then added fip as a radio station by typing:

mpc add http://audio.scdn.arkena.com/11016/fip-midfi128.mp3

(You can find addresses for BBC local, regional and national radio stations onmy page here.)

Test this works by typing

mpc play 1

at the command line. You should hear the station you added from the headphone jack on the Pi. (If you add more stations they’d be mpc play 2, 3, etc.)

I then ran

alsamixer

at the command line to turn the volume up as high as it can go, and stopped the stream playing with

mpc stop Make it play automatically at boot

I then wrote a little shell script to play the radio by typing nano radio.sh and entering the following lines:

#!/bin/bash mpc play 1

The press ctrl-x to save and exit.

Then I typed

chmod 755 radio.sh

to make it executable. I then typed sudo nano /etc/rc.local and added this line before exit 0:

/home/pi/radio.sh

Reboot the Pi, and it should now play your internet stream as soon as it boots up.

Wifi would be useful so I unplugged the ethernet, added a USB dongle and followed the instructions here about setting up a wifi network’s SSID and password. Rebooted without wired internet and bingo, a little box that just plays my favourite radio station. This is probably massive feature creep, but if I could add ONE button, it might be one to shut it down gracefully…

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

主题: Raspberry PiMacBookiPodOffice
分页:12
转载请注明
本文标题:Little Box of Fip
本站链接:http://www.codesec.net/view/480577.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(26)