Internet Radio on Raspberry Pi

Required: mplayer and hdmi/aux soundbar

[{"id":"99f9aba4.5b2ed8","type":"exec","z":"5966e67.7532218","command":"mplayer -slave  -input file=/tmp/mplayer-control http://81.93.193.35:8945/ > /dev/null 2>&1 &","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"FehervarRadio","x":820,"y":800,"wires":[["77f504c1.f90924"],[],[]]},{"id":"a58e56ea.609758","type":"exec","z":"5966e67.7532218","command":"echo \"pause\" > /tmp/mplayer-control","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Pause/Resume","x":380,"y":120,"wires":[[],[],[]]},{"id":"c282eec8.5ddcc8","type":"exec","z":"5966e67.7532218","command":"echo \"volume 10\" > /tmp/mplayer-control","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Volume +10","x":370,"y":180,"wires":[[],[],[]]},{"id":"e258233b.cd0c8","type":"exec","z":"5966e67.7532218","command":"killall mplayer","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Kill","x":350,"y":300,"wires":[["aef3538e.85d37"],[],[]]},{"id":"424123fc.75a44c","type":"exec","z":"5966e67.7532218","command":"echo \"volume -10\" > /tmp/mplayer-control","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Volume -10","x":370,"y":240,"wires":[[],[],[]]},{"id":"d1dce05b.e393b","type":"exec","z":"5966e67.7532218","command":"amixer ","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"HDMI/AUX","x":360,"y":60,"wires":[[],[],[]]},{"id":"49f2ae1a.fce26","type":"exec","z":"5966e67.7532218","command":"echo \"quit\" > /tmp/mplayer-control","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Quit","x":350,"y":360,"wires":[["aef3538e.85d37"],[],[]]},{"id":"51367347.fada44","type":"exec","z":"5966e67.7532218","command":"killall mplayer","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Kill","x":550,"y":800,"wires":[["4fb581db.38a0c"],[],[]]},{"id":"4fb581db.38a0c","type":"exec","z":"5966e67.7532218","command":"mkfifo /tmp/mplayer-control","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"fifo","x":670,"y":800,"wires":[["99f9aba4.5b2ed8"],[],[]]},{"id":"a7a0814b.4ba93","type":"ui_switch","z":"5966e67.7532218","name":"","label":"HDMI/AUX","group":"41e9245b.1b2b4c","order":1,"width":"0","height":"0","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"cset numid=3 1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"cset numid=3 2","offvalueType":"str","officon":"","offcolor":"","x":180,"y":60,"wires":[["d1dce05b.e393b"]]},{"id":"4b967afb.cdadf4","type":"ui_button","z":"5966e67.7532218","name":"","group":"41e9245b.1b2b4c","order":2,"width":0,"height":0,"passthru":false,"label":"volume +10","color":"","bgcolor":"","icon":"","payload":"\"volume 10\" > /tmp/mplayer-control","payloadType":"str","topic":"","x":170,"y":180,"wires":[["c282eec8.5ddcc8"]]},{"id":"94ab4943.78851","type":"ui_button","z":"5966e67.7532218","name":"","group":"41e9245b.1b2b4c","order":3,"width":0,"height":0,"passthru":false,"label":"volume -10","color":"","bgcolor":"","icon":"","payload":"\"volume 10\" > /tmp/mplayer-control","payloadType":"str","topic":"","x":170,"y":240,"wires":[["424123fc.75a44c"]]},{"id":"c47e4640.52b8d8","type":"ui_button","z":"5966e67.7532218","name":"","group":"41e9245b.1b2b4c","order":4,"width":"0","height":"0","passthru":false,"label":"Stop/Play","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":180,"y":120,"wires":[["a58e56ea.609758"]]},{"id":"cc1bb87b.b33bc","type":"ui_button","z":"5966e67.7532218","name":"","group":"41e9245b.1b2b4c","order":5,"width":0,"height":0,"passthru":false,"label":"Kill","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":190,"y":300,"wires":[["e258233b.cd0c8"]]},{"id":"2d25080e.377fe","type":"ui_button","z":"5966e67.7532218","name":"","group":"41e9245b.1b2b4c","order":6,"width":0,"height":0,"passthru":false,"label":"Quit","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":190,"y":360,"wires":[["49f2ae1a.fce26"]]},{"id":"9efdb93d.f56ce8","type":"ui_button","z":"5966e67.7532218","name":"","group":"62692baf.754224","order":2,"width":0,"height":0,"passthru":true,"label":"Fehérvár Rádió","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":360,"y":800,"wires":[["51367347.fada44","a78ba2f0.419958"]]},{"id":"be603c85.497448","type":"exec","z":"5966e67.7532218","command":"mplayer -slave  -input file=/tmp/mplayer-control http://fehervar.kekduna.hu:8004/ > /dev/null 2>&1 &","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"KekDuna","x":800,"y":680,"wires":[["ae5fa872.80f99"],[],[]]},{"id":"f1fb11c2.7645a8","type":"exec","z":"5966e67.7532218","command":"killall mplayer","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Kill","x":550,"y":680,"wires":[["7283807b.b3f768"],[],[]]},{"id":"7283807b.b3f768","type":"exec","z":"5966e67.7532218","command":"mkfifo /tmp/mplayer-control","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"fifo","x":670,"y":680,"wires":[["be603c85.497448"],[],[]]},{"id":"5ed87c14.75b1cc","type":"ui_button","z":"5966e67.7532218","name":"","group":"62692baf.754224","order":3,"width":0,"height":0,"passthru":true,"label":"Kék Duna","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":340,"y":680,"wires":[["f1fb11c2.7645a8","4792f1de.6ca16"]]},{"id":"235aa385.235bbc","type":"ui_text","z":"5966e67.7532218","group":"62692baf.754224","order":1,"width":0,"height":0,"name":"","label":"Active:","format":"{{msg.payload}}","layout":"row-spread","x":830,"y":340,"wires":[]},{"id":"77f504c1.f90924","type":"function","z":"5966e67.7532218","name":"Fehérvár","func":"msg.payload = \"Fehérvár Rádió\";\nreturn msg;","outputs":1,"noerr":0,"x":1000,"y":800,"wires":[["91e6ea66.d9b988"]]},{"id":"ae5fa872.80f99","type":"function","z":"5966e67.7532218","name":"Kék Duna","func":"msg.payload = \"Kék Duna Rádió\";\nreturn msg;","outputs":1,"noerr":0,"x":1000,"y":680,"wires":[["f21bcf5c.80a518"]]},{"id":"aef3538e.85d37","type":"function","z":"5966e67.7532218","name":"Stopped","func":"msg.payload = \"Stopped\";\nreturn msg;","outputs":1,"noerr":0,"x":660,"y":340,"wires":[["235aa385.235bbc"]]},{"id":"562b4d5b.9a5b84","type":"http in","z":"5966e67.7532218","name":"","url":"/fehervarradiobe","method":"post","upload":false,"swaggerDoc":"","x":140,"y":800,"wires":[["808662b4.c6a1f","9efdb93d.f56ce8"]]},{"id":"6721cfd.739113","type":"exec","z":"5966e67.7532218","command":"echo \"set_property volume 100\" > /tmp/mplayer-control","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Volume 100%","x":380,"y":420,"wires":[[],[],[]]},{"id":"734bcc81.ad27bc","type":"ui_button","z":"5966e67.7532218","name":"","group":"41e9245b.1b2b4c","order":7,"width":0,"height":0,"passthru":false,"label":"Volume 100%","color":"","bgcolor":"","icon":"","payload":"\"volume 10\" > /tmp/mplayer-control","payloadType":"str","topic":"","x":160,"y":420,"wires":[["6721cfd.739113"]]},{"id":"525400af.e1731","type":"exec","z":"5966e67.7532218","command":"echo \"set_property volume 80\" > /tmp/mplayer-control","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Volume 50%","x":370,"y":480,"wires":[[],[],[]]},{"id":"2c7acd2b.826f02","type":"ui_button","z":"5966e67.7532218","name":"","group":"41e9245b.1b2b4c","order":8,"width":0,"height":0,"passthru":false,"label":"Volume 80%","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":170,"y":480,"wires":[["525400af.e1731"]]},{"id":"84ee56dd.838d5","type":"http in","z":"5966e67.7532218","name":"","url":"/radiovolume50","method":"post","upload":false,"swaggerDoc":"","x":140,"y":520,"wires":[["525400af.e1731","a97897be.bd3c3"]]},{"id":"6c00895d.773578","type":"exec","z":"5966e67.7532218","command":"mplayer -slave  -input file=/tmp/mplayer-control http://stream002.radio.hu/mr1.mp3 > /dev/null 2>&1 &","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Kossuth Rádió","x":820,"y":900,"wires":[["13f34b00.97e58d"],[],[]]},{"id":"a32289c3.6a7a88","type":"exec","z":"5966e67.7532218","command":"killall mplayer","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Kill","x":550,"y":900,"wires":[["c7df91d9.a0a9a"],[],[]]},{"id":"c7df91d9.a0a9a","type":"exec","z":"5966e67.7532218","command":"mkfifo /tmp/mplayer-control","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"fifo","x":670,"y":900,"wires":[["6c00895d.773578"],[],[]]},{"id":"c6cc492b.be0d08","type":"ui_button","z":"5966e67.7532218","name":"","group":"62692baf.754224","order":3,"width":0,"height":0,"passthru":true,"label":"Kossuth Rádió","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":360,"y":900,"wires":[["a32289c3.6a7a88","3189c259.9d99fe"]]},{"id":"13f34b00.97e58d","type":"function","z":"5966e67.7532218","name":"Kossuth","func":"msg.payload = \"Kossuth Rádió\";\nreturn msg;","outputs":1,"noerr":0,"x":1000,"y":900,"wires":[["962d1917.dff468"]]},{"id":"e0da9185.08769","type":"http in","z":"5966e67.7532218","name":"","url":"/kossuthradiobe","method":"post","upload":false,"swaggerDoc":"","x":140,"y":900,"wires":[["c6cc492b.be0d08","df21572f.4030d"]]},{"id":"2223991.6da2ee6","type":"function","z":"5966e67.7532218","name":"msg = OK","func":"msg.payload = \"OK\";\nreturn msg;","outputs":1,"noerr":0,"x":680,"y":520,"wires":[["6217873f.afe1f8"]]},{"id":"6217873f.afe1f8","type":"http response","z":"5966e67.7532218","name":"send OK","statusCode":"","headers":{},"x":840,"y":520,"wires":[]},{"id":"aa3ea0fb.4841a","type":"link in","z":"5966e67.7532218","name":"Aktív rádió","links":["962d1917.dff468","91e6ea66.d9b988","f21bcf5c.80a518"],"x":735,"y":380,"wires":[["235aa385.235bbc"]]},{"id":"962d1917.dff468","type":"link out","z":"5966e67.7532218","name":"","links":["aa3ea0fb.4841a"],"x":1115,"y":900,"wires":[]},{"id":"a0d41318.799c1","type":"link in","z":"5966e67.7532218","name":"Rádió Leállítva","links":["3189c259.9d99fe","a78ba2f0.419958","4792f1de.6ca16"],"x":495,"y":380,"wires":[["aef3538e.85d37"]]},{"id":"3189c259.9d99fe","type":"link out","z":"5966e67.7532218","name":"","links":["a0d41318.799c1"],"x":515,"y":860,"wires":[]},{"id":"a78ba2f0.419958","type":"link out","z":"5966e67.7532218","name":"","links":["a0d41318.799c1"],"x":515,"y":760,"wires":[]},{"id":"91e6ea66.d9b988","type":"link out","z":"5966e67.7532218","name":"","links":["aa3ea0fb.4841a"],"x":1115,"y":800,"wires":[]},{"id":"df21572f.4030d","type":"link out","z":"5966e67.7532218","name":"","links":["ee66e8fb.c1614"],"x":295,"y":940,"wires":[]},{"id":"ee66e8fb.c1614","type":"link in","z":"5966e67.7532218","name":"SendOK","links":["df21572f.4030d","808662b4.c6a1f","bafe8fd0.e3b79","e5d8a29b.537238","a97897be.bd3c3","dcc099f8.80b898"],"x":500,"y":520,"wires":[["2223991.6da2ee6"]]},{"id":"808662b4.c6a1f","type":"link out","z":"5966e67.7532218","name":"SendOK","links":["ee66e8fb.c1614"],"x":295,"y":840,"wires":[]},{"id":"e44b16d8.fb9da","type":"http in","z":"5966e67.7532218","name":"","url":"/kekdunaradiobe","method":"post","upload":false,"swaggerDoc":"","x":140,"y":680,"wires":[["e5d8a29b.537238","5ed87c14.75b1cc"]]},{"id":"e5d8a29b.537238","type":"link out","z":"5966e67.7532218","name":"SendOK","links":["ee66e8fb.c1614"],"x":295,"y":720,"wires":[]},{"id":"f21bcf5c.80a518","type":"link out","z":"5966e67.7532218","name":"","links":["aa3ea0fb.4841a"],"x":1095,"y":680,"wires":[]},{"id":"4792f1de.6ca16","type":"link out","z":"5966e67.7532218","name":"","links":["a0d41318.799c1"],"x":515,"y":640,"wires":[]},{"id":"a97897be.bd3c3","type":"link out","z":"5966e67.7532218","name":"SendOK","links":["ee66e8fb.c1614"],"x":315,"y":520,"wires":[]},{"id":"14b3ef1e.cc0c71","type":"http in","z":"5966e67.7532218","name":"","url":"/radioki","method":"post","upload":false,"swaggerDoc":"","x":109,"y":564,"wires":[["dcc099f8.80b898","e258233b.cd0c8"]]},{"id":"dcc099f8.80b898","type":"link out","z":"5966e67.7532218","name":"SendOK","links":["ee66e8fb.c1614"],"x":314,"y":564,"wires":[]},{"id":"41e9245b.1b2b4c","type":"ui_group","z":"","name":"Control","tab":"1d39822e.7d591e","order":2,"disp":true,"width":"6"},{"id":"62692baf.754224","type":"ui_group","z":"","name":"Stations","tab":"1d39822e.7d591e","order":1,"disp":true,"width":"6"},{"id":"1d39822e.7d591e","type":"ui_tab","z":"","name":"Online Radio","icon":"dashboard"}]
jungervin

Flow Info

created 1 month, 1 week ago

Node Types

Core
  • exec (x17)
  • function (x5)
  • http in (x5)
  • http response (x1)
Other
  • link in (x3)
  • link out (x11)
  • ui_button (x10)
  • ui_group (x2)
  • ui_switch (x1)
  • ui_tab (x1)
  • ui_text (x1)

Tags

  • radio
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option