
following the previous post, after some tries, I was finally able to install a fully LAN/Wi-FI Internet Radio Player into a cheap router with a single usb port, 32 Mbytes of ram and 8 Mbytes of Flash plus a cheap USB Audio card and ... nothing else

I choosed the TP-Link TL-WR710N router because of its integrated power supply, I don't want to have any power cord laying around!


These are the instructions to configure and install it on a TP-Link TL-WR710N Router:
Install Barrier Breaker 14.04 firmware for TL-WR710N router:
https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/openwrt-ar71xx-generic-tl-wr710n-v1-squashfs-factory.bin
configure your router as usual: system, ssh access, network, dhcp and WiFi (we'll keep these configurations),
test it but do not install any package.
Update the firmware with my custom firmware (see below) using Luci interface but do not forget to enable the option to keep settings! (current configuration files)
this is my custom firmware for TL-WR710N without luci, ppp and IPv6 to save precious space:
http://www.lovisolo.com/asterisk/software/openwrt/firmware/TP-Link_TL-WR710/Barrier_Breaker_14.07/ar71xx_senza_luci_ppp_ipv6/openwrt-ar71xx-generic-tl-wr710n-v1-squashfs-sysupgrade.bin
(you may also use it for any other project, if you want to use a different router you need to build your custom specific firmware)
After the firmware update (a few minutes) the router reboots
then you can access it as usual (by ssh access because there is no more luci interface)
then give the following commands:
opkg update
opkg install kmod-sound-core
opkg install kmod-usb-audio
opkg install alsa-utils
opkg install mpd-mini
opkg install mpc
mkdir /root/music
mkdir /root/playlist
touch /root/mpd.db
edit mpd configuration file to match the following
vi /etc/mpd.conf
#
music_directory "/root//music"
playlist_directory "/root/playlists"
db_file "/root/mpd.db"
bind_to_address "127.0.0.1"
port "6600"
input {
plugin "curl"
}
audio_output {
type "oss"
name "My OSS Device"
device "/dev/dsp" # optional
}
replaygain "album"
volume_normalization "yes"
samplerate_converter "internal"
audio_buffer_size "8192"
buffer_before_play "30%"
# eof
Note: vi commands
"I" to edit file
press "Esc" and ":" and "wq" to save
launch mpd for the first time (ignore errors)
mpd
then reboot
reboot
Install PHP support
opkg update
opkg install php5 php5-cgi
Configure uhttpd web server for PHP
vi /etc/config/uhttpd
config uhttpd 'main'
list listen_http '0.0.0.0:80'
list listen_http '[::]:80'
list listen_https '0.0.0.0:443'
list listen_https '[::]:443'
option home '/www'
option rfc1918_filter '1'
option max_requests '3'
option max_connections '100'
option cert '/etc/uhttpd.crt'
option key '/etc/uhttpd.key'
option cgi_prefix '/cgi-bin'
option script_timeout '60'
option network_timeout '30'
option http_keepalive '20'
option tcp_keepalive '1'
option ubus_prefix '/ubus'
option config '/etc/httpd.conf'
option interpreter '.php=/usr/bin/php-cgi'
option index_page 'index.php index.html'
config cert 'px5g'
option days '730'
option bits '1024'
option country 'DE'
option state 'Berlin'
option location 'Berlin'
option commonname 'OpenWrt'
create working directory
mkdir /www/music
install and launch ftp server to load files form your pc to the router
opkg install vsftpd
/etc/init.d/vsftpd start
transfer with a ftp client (user = root) from your pc all the files you'll find inside the "www" directory of the following zip file:
http://www.lovisolo.com/asterisk/software/openwrt/radio-mp3/www.zip
into the router "/www/music" directory
enable mpd to autostart at boot
/etc/init.d/mpd enable
then reboot
reboot
adding radio stations
To add internet radio stations use the following command:
mpc add (sreaming-url)
some stations to add:
mpc add http://144.76.106.52:7000/chillout.mp3
mpc add http://icestreaming.rai.it/4.mp3
mpc add http://205.164.62.15:9010/
mpc add http://srv6.karadio.biz:20474/
mpc add http://streaming.radionomy.com/PassionLoveRadio
mpc add http://176.31.240.87:8025
mpc add http://stream.srg-ssr.ch/m/rsj/mp3_128
mpc add http://stream.srg-ssr.ch/m/rsc_it/mp3_128
mpc add http://stream.srg-ssr.ch/m/rsp/mp
mpc add http://streaming204.radionomy.com:80/100-CHILL
mpc add http://streaming.radionomy.com/CristalRelax
mpc add http://streaming.radionomy.com/Radio-Quelit
mpc add http://streaming.radionomy.com/GOLDEN-SIXTIES-SEVENTIES-EIGHTIES-RADIO
mpc add http://streaming.radionomy.com/R-E-T-R-OF-M
mpc add http://streaming.radionomy.com/radio-accordeon
mpc add http://streaming.radionomy.com/100-HIT-ra
mpc add http://streaming.radionomy.com/colombiaromantica
mpc add http://streaming.radionomy.com/Ambiance-Reggae
mpc add http://streaming.hotmix-radio.net/hotmixradio-lounge-128.mp3
mpc add http://streaming.radionomy.com/always-80s
mpc add http://streaming.radionomy.com/Hit-s-My-Music-Pop-Rock
mpc add http://streaming.radionomy.com/Cafe-Romantico-Radio
mpc add http://streaming.radionomy.com/1000-HITS-Sweet-Radio
mpc add http://46.37.20.205:8000/rdsmp3
ecc.
Now you can access the web interface from http://ip-of-your-router/music
example: http://192.168.1.1/music
NOTE: this interface needs Chrome browser to be correctly displayed.
----------------------------------------------------------
Extra stuffs
To save anytime your current audio volume level, launch the following command:
/usr/sbin/alsactl -f /etc/alsa0.state store 0
and then to restore it on boot, insert the following line in "/etc/rc.local" file, right before the "exit 0" line
vi /etc/rc.local
/usr/sbin/alsactl -f /etc/alsa0.state restore 0
-------------------------------------------------------------
Web interface as seen from an Android/iPhone smartphone:
NOTE: this interface needs Chrome browser to be correctly displayed.
Volume up and volume down do not seem to work