OpenWrt Forum Archive

Topic: [HowTo] Openwrt cheap Digital Stereo WiFi Internet Radio & MP3 Player

The content of this topic has been archived between 7 Apr 2018 and 5 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

omiez wrote:

Yes i have installed everything like in first post.

Maybe your router doesn't give enough current to the dongle, try to use a powered USB Hub.

I found that my 3G Router D-Link DWM-156 A6 is not listed in /etc/usb_modeswitch.d.

I was searching a lot about it and i was not able to find how to let the modem work, i would like to install a modem which is supported out of the box.

Can you tell me which 3G USB Modem is working without problems?

Tnx

Huawei E169

E169 is not sold here in Brazil. I found E303s-3 from Huawei and Huawei E3531.

omiez wrote:

E169 is not sold here in Brazil. I found E303s-3 from Huawei and Huawei E3531.

Will you use the dongle just to connect to the Internet or also with a chan_dongle on Asterisk PBX?

(Last edited by pilovis on 11 Feb 2015, 08:22)

Just Internet would be fine for me.

I've never tested the dongles you mention, but I think they should work, check also with google.

I successfully tested this USB audio device:

http://usb.brando.com/prod_img/zoom/UADAP011700_02_L.jpg

Only 6 buttons of 7 are recognized by Triggehappy:

KEY_NEXTSONG
KEY_PREVIOUSSONG
KEY_PLAYPAUSE
KEY_VOLUMEDOWN
KEY_VOLUMEUP
KEY_MIN_INTERESTING (key Headset-Mute)

Key Microphone-Mute is not recognized (or not working on my device sad )

(Last edited by pilovis on 13 Feb 2015, 17:07)

Hello pilovis

I could finally run the system because the Audio card arrived here, at the moment i am running without 3g via Wifi until i figure out how to get 3g working.

I have a new question. Is it possible to add .m3u streams and if yes how can i do this?

For example i want to listen this stream: http://metafiles.gl-systemhaus.de/hr/hr3_2.m3u

omiez wrote:

Hello pilovis

I could finally run the system because the Audio card arrived here, at the moment i am running without 3g via Wifi until i figure out how to get 3g working.

I have a new question. Is it possible to add .m3u streams and if yes how can i do this?

For example i want to listen this stream: http://metafiles.gl-systemhaus.de/hr/hr3_2.m3u

1) from your PC (better if Linux S.O.) click on the .m3u link and save it to your desktop instead of playing it
2) open the .m3u saved file with a text editor, inside you'll find the audio stream link:
http://hr-mp3-m-h3.akacast.akamaistream … r-mp3-m-h3

Then use the following format to play it with madplay:

/usr/bin/wget -O -  http://hr-mp3-m-h3.akacast.akamaistream … r-mp3-m-h3 | /usr/bin/madplay --replay-gain=audiophile --attenuate=-0 - &

Note: be carefull, this forum truncate long links like the one above, if you move your mouse pointer on the above link you will see the full link on the bottom status bar, but if you copy the above line you'll get the truncated link and obviously it won't work!

If you want to use MPD instead of Madplayer, in your MPD playlist_directory create a playlist file called "playlist.m3u" and inside it you can put all your audio streaming links.

Example of playlist.m3u:

http://205.164.62.15:9010/
http://37.48.81.130:9530
http://69.60.119.117:8000/
http://144.76.106.52:7000/chillout.mp3
http://205.164.62.15:9010/
http://srv6.karadio.biz:20474/
http://85.214.96.78:8000/stream
http://91.121.164.186:8600
http://stream.srg-ssr.ch/m/rsj/mp3_128
http://stream.srg-ssr.ch/m/rsc_it/mp3_128
http://stream.srg-ssr.ch/m/rsp/mp3_128
http://streaming204.radionomy.com:80/100-CHILL
http://205.164.62.20:8010/
http://streaming206.radionomy.com:80/Nature-1-Max
http://icecast2.rte.ie/ieradio1
http://listen.radionomy.com/the-smooth-lounge
http://radionova128.media.vistatec.ie:80
http://stream-sd.radioparadise.com:8056
http://144.76.106.52:7000/chillout.mp3
http://icestreaming.rai.it/4.mp3
http://str30.creacast.com/r101_thema4

(Last edited by pilovis on 14 Feb 2015, 11:36)

Great help pilovis

I could add everything i wanted, i like this project a lot.

Here my actual Radio Playlist

KEY_KP1 1 /usr/bin/killall madplay mpd ; sleep 1 ; /usr/bin/wget -O - http://icestreaming.rai.it/1.mp3 | /usr/bin/madplay - &
KEY_KP2 1 /usr/bin/killall madplay mpd ; sleep 1 ; /usr/bin/wget -O - http://icestreaming.rai.it/2.mp3 | /usr/bin/madplay - &
KEY_KP3 1 /usr/bin/killall madplay mpd ; sleep 1 ; /usr/bin/wget -O - http://mp3.kataweb.it:8000/M2O | /usr/bin/madplay - &
KEY_KP4 1 /usr/bin/killall madplay mpd ; sleep 1 ; /usr/bin/wget -O - http://mp3.kataweb.it:8000/RadioDeejay | /usr/bin/madplay - &
KEY_KP5 1 /usr/bin/killall madplay mpd ; sleep 1 ; /usr/bin/wget -O - http://46.37.20.205:8000/rdsmp3 | /usr/bin/madplay - &
KEY_KP6 1 /usr/bin/killall madplay mpd ; sleep 1 ; /usr/bin/wget -O - http://shoutcast.unitedradio.it:1301 | /usr/bin/madplay - &
KEY_KP7 1 /usr/bin/killall madplay mpd ; sleep 1 ; /usr/bin/wget -O - http://shoutcast.unitedradio.it:1109 | /usr/bin/madplay - &
KEY_KP8 1 /usr/bin/killall madplay mpd ; sleep 1 ; /usr/bin/wget -O - http://ice07.fluidstream.net:8080/KissKiss.mp3 | /usr/bin/madplay - &
KEY_KP9 1 /usr/bin/killall madplay mpd ; sleep 1 ; /usr/bin/wget -O - http://hr-mp3-m-h3.akacast.akamaistream.net/7/785/142133/v1/gnl.akacast.akamaistream.net/hr-mp3-m-h3 | /usr/bin/madplay - &
KEY_KPASTERISK 1 /usr/bin/killall madplay mpd ; sleep 1 ; /usr/bin/wget -O - http://mp3.ffh.de/radioffh/hqlivestream.mp3 | /usr/bin/madplay - &
KEY_KPSLASH 1 /usr/bin/killall madplay mpd ; sleep 1 ; /usr/bin/wget -O - http://stream.hoerradar.de:80/sunshinelive-mp3-192 | /usr/bin/madplay - &

Now it is logical that if i add a big Keyboard i have more keys i could use to add more Radio Stations.

I was thinking about the possibility to have a web interface so we could acess it and have a longer list where we can click on the station we want to select.

Or is this impossible ?

P.S.
pilovis are you on any Social Network?

EDIT:

Here is a basis for web page Radio http://linuxgazette.net/166/ziemann.html#ziemann.html_8 and another guy made a payer on that basis too http://www.formare.ro/download/nmsradio.zip

Anyone can explain how to do a web page?

(Last edited by omiez on 14 Feb 2015, 01:49)

To have more stations available you could also use MPD with a streaming radios playlist, in that case you need just two buttons to select stations: "next" and "prev" to switch from one station to another.

Also you can use the keypad to insert a multi-digits number (like "001"), then press enter to accept number and store it into a variable to be used to select stations, but you need a little programming to do it.

(Last edited by pilovis on 14 Feb 2015, 11:09)

omiez wrote:

P.S.
pilovis are you on any Social Network?

No, I've deleted my Facebook profile.
I don't like Facebook or Twitter and don't know who's really behind them and who's controlling everything wink

http://www.phawker.com/wp-content/uploads/2013/06/obama-big-brother.jpg

(Last edited by pilovis on 14 Feb 2015, 11:32)

I understand.

Any idea about web interface?

omiez wrote:

I understand.

Any idea about web interface?

I'm working on an embedded web interface for openwrt, uhttpd and madplay wink

Stay tuned ...

(Last edited by pilovis on 14 Feb 2015, 18:51)

Very good pilovis. I am waiting for any news.

A simple way to create a web page to control the Openwrt Internet Radio is to use cgi scripts, by using CGI you don't need to install additional packages.

1) create 'n' cgi scripts named "canalen" (canale1, canale2, etc.) with the following code inside:

#!/bin/ash
/bin/echo ''
/bin/echo ''
/usr/bin/killall madplay mpd ; /bin/sleep 1 ; /usr/bin/wget -O - http://icestreaming.rai.it/1.mp3 | /usr/bin/madplay - &
/bin/echo 'Internet Radio Name'

note: obviously change the "radio streaming URL" and "Internet Radio Name" for each script

save them in /www/cgi-bin directory then give chmod 755 permissions

2) create "radio.html" file in /www directory:

  Internet Radio
<p>
<FORM ACTION="/cgi-bin/canale1.cgi">
<INPUT TYPE=SUBMIT VALUE="canale 1">
</FORM>
<FORM ACTION="/cgi-bin/canale2.cgi">
<INPUT TYPE=SUBMIT VALUE="canale 2">
</FORM>
<FORM ACTION="/cgi-bin/canale3.cgi">
<INPUT TYPE=SUBMIT VALUE="canale 3">
</FORM>
<FORM ACTION="/cgi-bin/canale4.cgi">
<INPUT TYPE=SUBMIT VALUE="canale 4">
</FORM>
<FORM ACTION="/cgi-bin/canale5.cgi">
<INPUT TYPE=SUBMIT VALUE="canale 5">
</FORM>
<FORM ACTION="/cgi-bin/canale6.cgi">
<INPUT TYPE=SUBMIT VALUE="canale 6">
</FORM>
<FORM ACTION="/cgi-bin/canale7.cgi">
<INPUT TYPE=SUBMIT VALUE="canale 7">
</FORM>
<FORM ACTION="/cgi-bin/canale8.cgi">
<INPUT TYPE=SUBMIT VALUE="canale 8">
</FORM>
<FORM ACTION="/cgi-bin/canale9.cgi">
<INPUT TYPE=SUBMIT VALUE="canale 9">
</FORM>
<FORM ACTION="/cgi-bin/canale10.cgi">
<INPUT TYPE=SUBMIT VALUE="canale 10">
</FORM>
<FORM ACTION="/cgi-bin/canale11.cgi">
<INPUT TYPE=SUBMIT VALUE="canale 11">
</FORM>

The url of the web control page is http://ip_address_of_your_router/radio.html

After selecting a channel, use the "Go Back" button of you browser to go back to the main selection page.

This is just an example, I'm sure this method could be improved a lot smile

(Last edited by pilovis on 14 Feb 2015, 22:19)

Hello pilovis

I was breaking my head trying to get the 3g modem work, i am writing to the guy that made usb_modeswitch to see if it is possible.

I will give a try as soon as possible.

How can i see the Sample Rate the Usb Audio card is working at the moment and how could i change it?

I am using the small blue one from post #18
https://forum.openwrt.org/viewtopic.php … 62#p251162

EDIT:

Found this command and it seems to be 44.100 that is ok.

root@OpenWrt:~# cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 4096
buffer_size: 262144
OSS format: S16_BE
OSS channels: 2
OSS rate: 44100
OSS period bytes: 16384
OSS periods: 64
OSS period frames: 4096

EDIT:2

I made the .cgi files and the .html file and it is working until i disconnect the Lan from my computer and even if the mr3020 is on the same WirelessNetwork i can not access the Webpage with the Radios.

How could i access the webpage when using Wifi?

(Last edited by omiez on 15 Feb 2015, 06:42)

1) This is done in /usr/share/alsa/alsa.conf by setting
defaults.pcm.dmix.rate 48000

2) are you able to access luci web page from wifi network?
If not, probably there is something missing in WiFi configuration, maybe the gateway is missing.

(Last edited by pilovis on 15 Feb 2015, 10:06)

Do you use 48000 or is 44100 the better option?

The Router had 192.168.1.254 and main Router was 192.168.1.1 but i could not connect Luci this way.

I changed the ip of the Router in 192.168.5.1 and created another wireless network, so when i connect this Wireless Network i access 192.168.5.1/radio.html.

Did you see in post #61 i spoke about a guy that made something with web access called nmsradio?

I tested the Radio Web Interface package you linked @ http://www.formare.ro/download/nmsradio.zip and worked very well!

Install instructions (very easy) are inside the zip package, basically:

1. create "/www/cgi-bin/nmsradio" directory: mkdir /www/cgi-bin/nmsradio
2. give chmod 755 permissions to "nmsradio" directory: chmod 755 /www/cgi-bin/nmsradio
3. cd to "cgi-bin" directory: cd /www/cgi-bin
4. download the file: wget http://www.formare.ro/download/nmsradio.zip
5. unzip the "nmsradio.zip" file in "/www/cgi-bin/": unzip nmsradio.zip  (opkg install unzip and then you can remove it at the and of the unzipping process to save space: opkg remove unzip)
6. copy the following 4 files in "/www/cgi-bin/nmsradio": play.cgi, alarm.cgi, setalarm.sh, changechannel.sh
7. give chmod 755 permissions to the above files
8. copy the following 2 files in /etc/config: posturi, radio 
9. eventually edit "/etc/config/posturi" to add more radio stations.

To access the Radio web interface type in browser: http://routerIP/cgi-bin/nmsradio/play.cgi.

Note: there is also a web interface to program multiple timers (crontab) to switch on and off radio stations at preset times.
Wake up with your favorite stations! smile

!Be carefull radio crontab will erase all your current crontabs!

(Last edited by pilovis on 18 Aug 2016, 19:12)

This a list of radio streaming URLs to use in "/etc/config/posturi" of the post #71, but you can use the URLs also for other applications.

config playlist
      list post STOP   
     
      list post http://stream.hoerradar.de:80/sunshinelive-mp3-192
      list post http://shoutcast.unitedradio.it:1109
      list post http://shoutcast.unitedradio.it:1301
      list post http://46.37.20.205:8000/rdsmp3
      list post http://mp3.kataweb.it:8000/RadioDeejay
      list post http://mp3.kataweb.it:8000/M2O
      list post http://icestreaming.rai.it/2.mp3
      list post http://icestreaming.rai.it/1.mp3
      list post http://icestreaming.rai.it/4.mp3
      list post http://streaming.radionomy.com/1000-HITS-Sweet-Radio
      list post http://streaming.radionomy.com/cumbias-inmortales
      list post http://streaming.hotmix-radio.net/hotmi … ge-128.mp3
      list post http://streaming.radionomy.com/always-80s
      list post http://streaming.radionomy.com/Hit-s-My-Music-Pop-Rock
      list post http://streaming.streamonomy.com/BeGoodPop
      list post http://streaming.radionomy.com/Cafe-Romantico-Radio
      list post http://traditionalmanele1.zapto.org:3750/
      list post http://b.fmradiomanele.ro:8044/
      list post http://streaming.radionomy.com/Radio-Quelite
      list post http://streaming.radionomy.com/PassionLoveRadio
      list post http://streaming.radionomy.com/CristalRelax
      list post http://streaming.radionomy.com/GOLDEN-S … TIES-RADIO
      list post http://streaming.radionomy.com/A-Better … gs-Station
      list post http://streaming.radionomy.com/R-E-T-R-OF-M
      list post http://streaming.radionomy.com/radio-accordeon
      list post http://streaming.radionomy.com/HappyChristmasradio
      list post http://streaming.radionomy.com/ChristmasWonderlandRadio
      list post http://streaming.radionomy.com/TheChristmasStation
      list post http://streaming.radionomy.com/100-HIT-radio
      list post http://streaming.radionomy.com/colombiaromantica
      list post http://streaming.radionomy.com/Ambiance-Reggae
      list post http://streaming.radionomy.com/Fm-Tropical-Shad-972
      list post http://streaming.radionomy.com/NashvilleEdge
      list post http://streaming.radionomy.com/101countryradio
      list post http://streaming.radionomy.com/SMOOTH-RIVIERA
      list post http://streaming.radionomy.com/ChristmasClassics2014
      list post http://streaming.radionomy.com/VivaLaNavidadRadio
      list post http://streaming.radionomy.com/CountryChristmas
      list post http://streaming.radionomy.com/chd--radio-country
      list post http://streaming204.radionomy.com:80/100-CHILL
      list post http://streaming.radionomy.com/1-Radio-Dance
      list post http://streaming.radionomy.com/Acoustic-FM
      list post http://streaming.radionomy.com/ABC-Love
      list post http://streaming.radionomy.com/Radio-Nostalgia
      list post http://andromeda.shoutca.st:8634/stream
      list post http://streaming.radionomy.com/RadioArdeal
      list post http://91.121.164.186:8600
      list post http://streaming.radionomy.com/DanceRO
      list post http://streaming.radionomy.com/jamaican-roots-radio
      list post http://205.164.62.20:8010/
      list post http://streaming.radionomy.com/radio-ol … k--n--roll
      list post http://92.48.107.35:8000
      list post http://nebula.shoutca.st:9273/stream
      list post http://streaming.radionomy.com/The-Buffalo
      list post http://streaming.radionomy.com/VWClassicRock
      list post http://str30.creacast.com/r101_thema4
      list post http://107.155.111.234:8710
      list post http://stream.srg-ssr.ch/m/rsc_it/mp3_128
      list post http://stream.srg-ssr.ch/m/rsp/mp3_128
      list post http://stream.srg-ssr.ch/m/rsj/mp3_128
      list post http://srv6.karadio.biz:20474/
      list post http://205.164.62.15:9010/
      list post http://37.48.81.130:9530
      list post http://144.76.106.52:7000/chillout.mp3
      list post http://69.60.119.117:8000/
      list post http://radionova128.media.vistatec.ie:80
      list post http://stream-sd.radioparadise.com:8056
      list post http://icecast2.rte.ie/ieradio1
      list post http://listen.radionomy.com/the-smooth-lounge
      list post http://85.214.96.78:8000/stream

(Last edited by pilovis on 15 Feb 2015, 23:52)

Installed nmsradio and it works without problem, your solution works too but adding stations in nmsradio is faster.
I am happy that you like it too.


Like i said before i am using this little blue usb audio card. When i listem to radio and especially when using earphones i can hear that the music is a little bit clicky, maybe some electrical interference. But i want to know if there is some other setting i can do to see if this noise goes away?

I read the hole post and i have done any single update you gave during your installation.

Is it possible to use 14.07 instead of 12.09 on mr3020 or isn't there space to do the first operations to make /overlay?

(Last edited by omiez on 16 Feb 2015, 05:35)

Like i said before i am using this little blue usb audio card. When i listem to radio and especially when using earphones i can hear that the music is a little bit clicky, maybe some electrical interference. But i want to know if there is some other setting i can do to see if this noise goes away?

I have the same adapter but never experienced any noise or clicks sad

Is it possible to use 14.07 instead of 12.09 on mr3020 or isn't there space to do the first operations to make /overlay?

If you use a standard 14.07 release, there is not enough space on 3020 to install USB and FS drivers to make external overlay because of Luci, you should compile a version by yourself without Luci, then install USB and external overlay, then install Luci.

(Last edited by pilovis on 16 Feb 2015, 07:10)

Addendum: a new function to your Internet radio smile

A Westminster chimes that play on the hour, from 08:00 AM to 11:00 PM (you may want to sleep during the night wink )

Download this audio file: https://www.greyware.com/tryout/chimes/ … Chimes.mp3 and save it to "/root" directory:

wget http://www.lovisolo.com/asterisk/softwa … lassic.mp3

edit the file "/etc/crontabs/root" file (if it doesn't exist create it with: touch /etc/crontabs/root) and add the following line:

00 08-23 * * * /usr/bin/madplay /root/westminster_classic.mp3

reboot and enjoy.

Note: when the radio is playing music, the chimes don't play.

(Last edited by pilovis on 25 Feb 2015, 08:54)