{"id":351971,"date":"2024-05-20T21:59:31","date_gmt":"2024-05-20T21:59:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=351971"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=351971","title":{"rendered":"<span>Wi-Fi internet radio from a router with station switching capability<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td width=\"340\"><img decoding=\"async\" alt=\"Wi-Fi \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0440\u0430\u0434\u0438\u043e\u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/078\/60e\/453\/07860e45370890866e30c66fb523e142.webp\"\/><br \/>  ChatGPT was not used in writing this article.<br \/>  The animated image uses the webp file format instead of gif.<\/td>\n<td>In this article, you will find a complete description of how to make a Wi-Fi internet radio receiver from a router that can play mp3 streams from internet radio stations.<br \/>  It is also possible to switch between two internet radio stations. We will use OpenWRT firmware installed on the router to create a Wi-Fi internet radio. It is possible to complete this project without using a soldering iron. All the components can be placed inside the router to create a finished device \u2014 a Wi-Fi internet radio.<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>To make this, you will need: <\/p>\n<ul>\n<li>Any router with a USB port that can be installed with <a href=\"https:\/\/openwrt.org\/\" rel=\"nofollow noopener noreferrer\">OpenWRT<\/a>, a Linux-based operating system designed for embedded systems. You can check if your router is compatible with OpenWRT on this page: <a href=\"https:\/\/openwrt.org\/toh\/start\" rel=\"nofollow noopener noreferrer\">https:\/\/openwrt.org\/toh\/start<\/a>.<\/li>\n<li><a href=\"https:\/\/aliexpress.com\/wholesale?SearchText=usb+sound+card&amp;maxPrice=200&amp;g=y\" rel=\"nofollow noopener noreferrer\">A USB sound card that costs $1-$2<\/a>.<\/li>\n<li>Any passive (or active) speakers.<\/li>\n<li>Two patch cords \u2014 twisted pair crimped with <a href=\"https:\/\/en.wikipedia.org\/wiki\/Modular_connector#8P8C\" rel=\"nofollow noopener noreferrer\">8P8C connectors (also known as RJ-45)<\/a>.<\/li>\n<li>A personal computer.<\/li>\n<li>Ethernet and Wi-Fi internet connection (optional).<\/li>\n<\/ul>\n<p> <a name=\"habracut\"><\/a>    <\/p>\n<h2>Connecting a router to the Internet<\/h2>\n<p>We need to connect a router that will act as a Wi-Fi internet radio receiver to the home network router using a patch cord. Connect one end of the patch cord to the router that will act as the Wi-Fi internet radio receiver, specifically to the \u00abInternet\u00bb port. Connect the other end of the patch cord to any available LAN port on the home network router. Note that the last (rightmost) port on the router, when viewed from the side where the ports are located, is often reserved by the Internet service provider for IPTV and is not intended for internet access.<\/p>\n<p>Connect a personal computer to the router that will act as the Wi-Fi internet radio using a second patch cord. Insert the plug into any available LAN port on the router.<\/p>\n<p>    <\/p>\n<h2>Reflash a router<\/h2>\n<p>Check if there is an OpenWRT firmware version available for your router: <a href=\"https:\/\/openwrt.org\/toh\/start\" rel=\"nofollow noopener noreferrer\">https:\/\/openwrt.org\/toh\/start<\/a>. You can do this by visiting the OpenWRT wiki page for your router model. For example, the TP-LINK TL-WR842N router has an OpenWRT firmware available. <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/64c\/4e5\/3d9\/64c4e53d9bdc2066ea1118f73531c6cf.png\" alt=\"The TP-LINK TL-WR842N router is listed as a supported device on the OpenWRT website.\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/64c\/4e5\/3d9\/64c4e53d9bdc2066ea1118f73531c6cf.png\"\/><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p> Follow the instructions on the OpenWRT firmware page or the general instructions on the OpenWRT website to reflash your router: <a href=\"https:\/\/openwrt.org\/docs\/guide-user\/installation\/generic.flashing\" rel=\"nofollow noopener noreferrer\">https:\/\/openwrt.org\/docs\/guide-user\/installation\/generic.flashing<\/a>. <\/p>\n<h2>Setting up OpenWRT<\/h2>\n<p>1) To connect to a router via ssh, type the following command in the console: (Windows users can use the <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/terminal\/tutorials\/ssh\" rel=\"nofollow noopener noreferrer\">ssh command<\/a> or <a href=\"https:\/\/www.putty.org\/\" rel=\"nofollow noopener noreferrer\">putty<\/a>) <strong><\/p>\n<pre><code class=\"bash\">ssh root@192.168.1.1<\/code><\/pre>\n<p><\/strong> Then, update the information about the packages in the OpenWRT by typing <strong><\/p>\n<pre><code class=\"bash\">opkg update<\/code><\/pre>\n<p><\/strong> If the command is executed with errors, you need to set up DNS. This can be done in the web interface of OpenWRT. To access the web interface, open a browser and go to the page: <strong><\/p>\n<blockquote><p>\u2800https:\/\/192.168.1.1<br \/>  \u2800http:\/\/192.168.1.1, for an older version of OpenWRT <\/p><\/blockquote>\n<p><\/strong> Ignore the browser warning about the self-signed certificate and proceed to the login page of the web interface. Log in without a password.<br \/>   To set up DNS, go to the <strong><\/p>\n<blockquote><p>Network -> DHCP and DNS section of the top menu. On this page, delete the DNS forwardings entries and add the addresses of the Google and OpenDNS DNS servers, for example: 8.8.8.8, 208.67.222.222, 208.67.220.220, please look at the image:<\/p><\/blockquote>\n<p><\/strong> <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/023\/184\/1ca\/0231841ca7a5007ba9b6a4e99c42fb09.png\" alt=\"How to configure DNS in OpenWRT.\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/023\/184\/1ca\/0231841ca7a5007ba9b6a4e99c42fb09.png\"\/><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p> To configure DNS settings in older versions of OpenWRT (e.g., 19.07) and in some cases, newer versions, follow these steps:   <\/p>\n<ol>\n<li>Access the web interface of OpenWRT.<\/li>\n<li>Go to the top menu and navigate to Network -> Interfaces.<\/li>\n<li>Click on the \u00abEdit\u00bb button next to the WAN interface.<\/li>\n<li>In the dialog box that appears, select the \u00abAdvanced Setting\u00bb tab.<\/li>\n<li>Uncheck the box next to \u00abUse DNS servers advertised by peer\u00bb.<\/li>\n<li>Enter the addresses of the Google and OpenDNS DNS servers.<\/li>\n<\/ol>\n<p> You can also perform the same steps for the LAN interface if you want devices connected to the router to receive DNS server addresses via DHCP.<br \/>   Please note that these steps may vary slightly depending on the specific version of OpenWRT you are using.<\/p>\n<p>2) Install all the packages needed for the USB sound card to work, including <a href=\"https:\/\/manpages.ubuntu.com\/manpages\/bionic\/man1\/madplay.1.html\" rel=\"nofollow noopener noreferrer\">madplay<\/a>, which, along with wget, will play the MP3 stream of an internet radio station. Use the following command: <strong><\/p>\n<pre><code class=\"bash\">opkg install kmod-sound-core kmod-usb-audio kmod-input-core kmod-input-evdev madplay alsa-utils triggerhappy kmod-hid kmod-usb-hid<\/code><\/pre>\n<p><\/strong><br \/>   We will be using a simple USB sound card for $1-$2, for example, <a href=\"https:\/\/aliexpress.com\/item\/32736596135.html?sku_id=61418471270\" rel=\"nofollow noopener noreferrer\">this one from Aliexpress<\/a>: <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/9cc\/ad6\/dde\/9ccad6dde33e9b7dbda113f92a254413.webp\" alt=\"USB sound card.\"\/><br \/>   Also, let&#8217;s update wget. This is necessary for older versions of OpenWRT (for example, versions prior to 19.07) if you want to listen to audio streams transmitted over the https: <strong><\/p>\n<pre><code class=\"bash\">opkg upgrade wget<\/code><\/pre>\n<p><\/strong><\/p>\n<p>  <\/p>\n<p>3) If we want our router to connect to the Internet through the Wi-Fi home network instead of using Ethernet, we need to switch the Wi-Fi module of the router to client mode. This can be done in the web interface of OpenWRT, in the top menu section:<\/p>\n<p> <strong><\/p>\n<blockquote><p>Switch the Wi-Fi module to Client by selecting client mode from the dropdown list of the Mode section<\/p><\/blockquote>\n<p><\/strong> <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/92e\/ff3\/756\/92eff3756899cba51fa103e4cb098a61.png\" alt=\"Wi-Fi module in client mode.\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/92e\/ff3\/756\/92eff3756899cba51fa103e4cb098a61.png\"\/><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p> To connect to a home Wi-Fi network, enter the name of the network in the ESSID field and select the encryption type and password for the network in the \u00abWireless security\u00bb tab. <strong><\/p>\n<blockquote><p>To save the changes made to the Wi-Fi settings, click the \u00abSave\u00bb button in the bottom right corner of the page, and after the Device Configuration dialog disappears, click the \u00abSave &amp; Apply\u00bb button in the bottom right corner of the page.<\/p><\/blockquote>\n<p><\/strong> To connect to the home Wi-Fi network, enter the network name in the ESSID field and select the encryption type and password for the network in the \u00abWireless security\u00bb tab, then click the \u00abSave\u00bb button in the bottom right corner of the page, and after the \u00abDevice Configuration\u00bb dialog disappears, click the \u00abSave &amp; Apply\u00bb button in the bottom right corner of the page; finally, disconnect the patch cord that connects the router that will be used as a Wi-Fi internet radio receiver to the home network router, and check the Wi-Fi connection by executing a command: <strong><\/p>\n<pre><code class=\"bash\">ping altavista.com<\/code><\/pre>\n<p><\/strong>     <\/p>\n<h2>Connect USB sound card<\/h2>\n<p>Now, connect the USB sound card to the USB port of the router. Connect speakers to the output of the sound card. If necessary, if the speakers are active and powered by USB, connect them to the USB port to provide power to the speakers audio-frequency amplifier. You now have a Wi-Fi router with a connected USB sound card and active speakers. <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/1a2\/0dd\/434\/1a20dd434a3b5c9e3a70914471a1eebc.webp\" alt=\"A Wi-Fi router with a connected USB sound card and active speakers.\"\/><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p> In this case, a USB hub was used to connect the USB sound card and active speakers to the single USB port of the router. Some blue electrical tape was also used.     <\/p>\n<h2>Reboot the router<\/h2>\n<p>To reboot the router, enter the command <strong><\/p>\n<pre><code class=\"bash\">reboot<\/code><\/pre>\n<p><\/strong> or restart the router through the web interface on the page: <strong><\/p>\n<blockquote><p>\u2800https:\/\/192.168.1.1\/cgi-bin\/luci\/admin\/system\/reboot<br \/>  \u2800http:\/\/192.168.1.1\/cgi-bin\/luci\/admin\/system\/reboot, for old OpenWRT version<\/p><\/blockquote>\n<p> <\/strong><\/p>\n<p>    <\/p>\n<h2>First time audio stream playback<\/h2>\n<p>To connect to the router via ssh, as we have done before, we can use the following command: <strong><\/p>\n<pre><code class=\"bash\">wget --no-check-certificate -q -O - https:\/\/mpc1.mediacp.eu:8404\/stream | madplay - -Q --no-tty-control<\/code><\/pre>\n<p><\/strong> Here,\u2800https:\/\/mpc1.mediacp.eu:8404\/stream is the URL of an mp3 audio stream from an internet radio station.<br \/>   To test, here are two more audio streams:<br \/>  \u2800http:\/\/radio.m-1.fm\/raduga\/high\u2800http:\/\/i6.streams.ovh:16012\/stream<\/p>\n<p>   wget connects to the internet radio station server, without checking the SSL certificate (&#8212;no-check-certificate), does not display its status in the console (-q), and sends the downloaded audio stream output to STDOUT (-O -). Then, via a pipe (|), the audio stream goes to madplay, which decodes the mp3 stream without displaying its status in the console (-Q) and without responding to button presses (&#8212;no-tty-control). The data is then sent to the USB sound card.<br \/>   To stop playback, press twice <strong><\/p>\n<blockquote><p>Ctrl+c<\/p><\/blockquote>\n<p><\/strong> If we want to play an audio stream with special characters in the URL such as &#8216;? &amp;! # $ &#8216; ( ) * +, \/:; = @ [ ]&#8217; (<a href=\"https:\/\/en.wikipedia.org\/wiki\/URL_encoding#Types_of_URI_characters\" rel=\"nofollow noopener noreferrer\">RFC 3986<\/a>), then we need to enclose the URL in quotes &#8216; &#8216;.<\/p>\n<p>    <\/p>\n<h2>Automatic connection to a stream when the router is turned on<\/h2>\n<p>In Linux, there is a file where you can add commands that will be executed during system startup. In OpenWRT and some other distributions, this file is called rc.local and it is located in the directory \/etc: <strong><\/p>\n<blockquote><p>\/etc\/rc.local<\/p><\/blockquote>\n<p><\/strong> You can also access it through the web interface of OpenWRT: <strong><\/p>\n<blockquote><p>System -> Startup, Local Startup tab<\/p><\/blockquote>\n<p><\/strong> <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/18f\/afa\/2cc\/18fafa2cc272ddd8e44ee60a13dd1290.png\" alt=\"Editing the \/etc\/rc.local file in the OpenWRT web interface.\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/18f\/afa\/2cc\/18fafa2cc272ddd8e44ee60a13dd1290.png\"\/><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p> To add a command that will be executed during the OpenWRT boot process, you need to edit the file before the \u00abexit 0\u00bb line. Once you have added the command, save the file by clicking the \u00abSave\u00bb button.     <\/p>\n<h2>Reconnecting to audio stream after connection loss and switching between two stations<\/h2>\n<p>Switching between two stations is possible thanks to the presence of a file in OpenWRT that stores the brightness value of the LED responsible for indicating the connection of client devices to the LAN network. When we connect a computer to the router using an Ethernet cable, for example, to the LAN4 port, the fourth LED on the router panel will light up.<br \/>   To utilize this feature, we can connect to the router via the console and navigate to the directory <strong><\/p>\n<pre><code class=\"bash\">cd \/sys\/devices\/platform\/leds\/leds\/router_model_name:lan\/<\/code><\/pre>\n<p><\/strong> In this directory, we can find the \u00abbrightness\u00bb file, which stores the brightness value of the LAN LED, ranging from 0 to 255. <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/355\/969\/f26\/355969f260d93b98cfb79ae235592243.png\" alt=\"brightness file in the :lan directory in OpenWRT.\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/355\/969\/f26\/355969f260d93b98cfb79ae235592243.png\"\/><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p> We can determine whether this LED is on or off by using the command <strong><\/p>\n<pre><code class=\"bash\">cat \/sys\/devices\/platform\/leds\/leds\/router_model_name:lan\/brightness<\/code><\/pre>\n<p><\/strong> To view the directories in the \/sys\/devices\/platform\/leds\/leds\/ directory, navigate to that directory using the command <strong><\/p>\n<pre><code class=\"bash\">cd \/sys\/devices\/platform\/leds\/leds\/<\/code><\/pre>\n<p><\/strong> Then, enter the command <strong><\/p>\n<pre><code class=\"bash\">ls<\/code><\/pre>\n<p><\/strong> <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td width=\"150\"> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/c59\/315\/b3e\/c59315b3e843b5b51eb401a4448b35ba.webp\" alt=\"Station switch.\"\/><\/td>\n<td> To connect the wires to the four LAN4 pins (two twisted pairs), we will connect these four wires to a switch (station switch in the \u00abWi-Fi Internet Radio Receiver in open view\u00bb image). The switch will toggle the TX (Transmit) pair with the RX (Receive) pair of the Wi-Fi router. The Wi-Fi router&#8217;s LAN port will remain functional and can be used to connect external devices if the switch is open.<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p> We can now control the state of the LED and the value stored in the brightness file in OpenWRT. <\/p>\n<p>Let&#8217;s write a bash script that we will place in the file \/etc\/rc.local, which will handle connecting to the audio stream, playback, reconnection in case of connection loss, and switching between two internet radio stations.<\/p>\n<pre><code class=\"bash\"> # Put your custom commands here that should be executed once # the system init finished. By default this file does nothing.  echo \"#!\/bin\/sh\" > \/tmp\/checkOnline echo \"if ( ! ping -c 8 8.8.8.8 > \/dev\/null 2>&amp;1 ) ; then echo 'network down'; sh \/tmp\/killPlayer; else echo 'network up'; fi;\" >> \/tmp\/checkOnline echo \"if ( ! pgrep -x madplay > \/dev\/null 2>&amp;1 ) ; then echo 'player down'; sh \/tmp\/killPlayer; else echo 'player up'; fi\" >> \/tmp\/checkOnline chmod +x \/tmp\/checkOnline  echo \"#!\/bin\/sh\" > \/tmp\/killPlayer echo \"\/usr\/bin\/killall -9 wget madplay; sleep 1; echo 'start playRadio'; sh \/tmp\/playRadio &amp;\" >> \/tmp\/killPlayer chmod +x \/tmp\/killPlayer  echo \"#!\/bin\/sh\" > \/tmp\/switchRadioTimer echo \"while true do  STATE=\\`cat \/sys\/devices\/platform\/leds\/leds\/tl-wr842n-v5:green:lan\/brightness\\`  OLDSTATE=\\`cat \/etc\/oldStationSwitchState\\`  if [ \"\\$STATE\" != \"\\$OLDSTATE\" ] ; then echo \\$STATE > \/etc\/oldStationSwitchState; sh \/tmp\/killPlayer; fi;  sleep 1 done\" >> \/tmp\/switchRadioTimer chmod +x \/tmp\/switchRadioTimer  echo \"#!\/bin\/sh\" > \/tmp\/playRadio echo \"OLDSTATE=\\`cat \/etc\/oldStationSwitchState\\` URL='http:\/\/radio.m-1.fm\/raduga\/high' if [[ \\$OLDSTATE -gt 0 ]] ; then URL='http:\/\/i6.streams.ovh:16012\/stream'; fi; wget --no-check-certificate -q -O - \\$URL | madplay - -Q --no-tty-control\" >> \/tmp\/playRadio chmod +x \/tmp\/playRadio  echo \"#!\/bin\/sh\" > \/tmp\/checkOnlineTimer echo \"while true do  sh \/tmp\/checkOnline  sleep 20 done\" >> \/tmp\/checkOnlineTimer chmod +x \/tmp\/checkOnlineTimer  sleep 5; \/tmp\/playRadio &amp; sleep 5; \/tmp\/switchRadioTimer &amp; sleep 5; \/tmp\/checkOnlineTimer &amp;  exit 0 <\/code><\/pre>\n<p>In the directory \/tmp, we create executable script files: checkOnline, killPlayer, switchRadioTimer, playRadio, and checkOnlineTimer.<\/p>\n<p>   <\/p>\n<p>checkOnline is a script that checks whether the Google DNS server is pingable and whether madplay is running. If at least one of these conditions is not met, killPlayer is executed.<\/p>\n<p>   <\/p>\n<p>killPlayer terminates the execution of madplay and runs the playRadio script.<\/p>\n<p>   <\/p>\n<p>playRadio reads the station number to be played from the text file \/etc\/oldStationSwitchState and plays either stream #1 or stream #2 depending on the value.<\/p>\n<p>   <\/p>\n<p>switchRadioTimer is a script that, in an infinite loop, checks the state of the LAN4 LED, which lights up when our station switch is closed. Then, the script compares the read switch state with the value stored in the \/etc\/oldStationSwitchState file. If they are different, the switch state value is saved in the \/etc\/oldStationSwitchState file, and killPlayer is called.<\/p>\n<p>   <\/p>\n<p>checkOnlineTimer checks whether madplay is running every 20 seconds using the checkOnline script.<\/p>\n<p>   <\/p>\n<p>All script files have been created. We will now run playRadio, switchRadioTimer, and checkOnlineTimer.<\/p>\n<p>   <\/p>\n<p>After saving \/etc\/rc.local, we need to create a file \/etc\/oldStationSwitchState with a zero value. This can be done in the OpenWRT console using the command<\/p>\n<p> <strong><\/p>\n<pre><code class=\"bash\">echo 0 > \/etc\/oldStationSwitchState<\/code><\/pre>\n<p><\/strong>    <\/p>\n<h2>Wi-Fi internet radio receiver inside and outside<\/h2>\n<p>We will place the USB sound card, audio-frequency amplifier, volume controller, and switches inside the Wi-Fi router case. Then, we will mount the 3.5mm audio jack on the back panel:<\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2a4\/cc9\/848\/2a4cc9848a893013637fe9f28840b69f.webp\" alt=\"Wi-Fi Internet Radio Receiver in open view.\"\/><sub>Wi-Fi Internet Radio Receiver in open view.<\/sub><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>   <\/p>\n<p>Here is a Wi-Fi internet radio receiver in its assembled form:<\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fae\/7e9\/3af\/fae7e93af8796ed9231f39cff37ea10a.webp\" alt=\"Assembled Wi-Fi internet radio.\"\/><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>   <\/p>\n<p>Let&#8217;s test how a Wi-Fi internet radio receiver works:<\/p>\n<p><a href=\"https:\/\/laboratory.technology\/articles\/Wi-Fi%20internet%20radio%20from%20a%20router%20with%20station%20switching%20capability\/images\/Wi-FiRouterRadioset.mp4\" rel=\"nofollow noopener noreferrer\">Please watch the video of the Wi-Fi internet radio receiver (mp4 file)<\/a>. (I am using an old Habr editor and cannot embed a video file. The oembed tag does not support simple video file insertion.)<br \/>  This article is on my website: <a href=\"https:\/\/laboratory.technology\/articles\/Wi-Fi%20internet%20radio%20from%20a%20router%20with%20station%20switching%20capability\/\" rel=\"nofollow noopener noreferrer\">Wi-Fi internet radio from a router with station switching capability<\/a>. <sup>(With the permission of the administrators of Habrahabr.)<\/sup><\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/754150\/\"> https:\/\/habr.com\/ru\/articles\/754150\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td width=\"340\"><img decoding=\"async\" alt=\"Wi-Fi \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0440\u0430\u0434\u0438\u043e\u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a.\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/078\/60e\/453\/07860e45370890866e30c66fb523e142.webp\"\/><br \/>  ChatGPT was not used in writing this article.<br \/>  The animated image uses the webp file format instead of gif.<\/td>\n<td>In this article, you will find a complete description of how to make a Wi-Fi internet radio receiver from a router that can play mp3 streams from internet radio stations.<br \/>  It is also possible to switch between two internet radio stations. We will use OpenWRT firmware installed on the router to create a Wi-Fi internet radio. It is possible to complete this project without using a soldering iron. All the components can be placed inside the router to create a finished device \u2014 a Wi-Fi internet radio.<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>To make this, you will need: <\/p>\n<ul>\n<li>Any router with a USB port that can be installed with <a href=\"https:\/\/openwrt.org\/\" rel=\"nofollow noopener noreferrer\">OpenWRT<\/a>, a Linux-based operating system designed for embedded systems. You can check if your router is compatible with OpenWRT on this page: <a href=\"https:\/\/openwrt.org\/toh\/start\" rel=\"nofollow noopener noreferrer\">https:\/\/openwrt.org\/toh\/start<\/a>.<\/li>\n<li><a href=\"https:\/\/aliexpress.com\/wholesale?SearchText=usb+sound+card&amp;maxPrice=200&amp;g=y\" rel=\"nofollow noopener noreferrer\">A USB sound card that costs $1-$2<\/a>.<\/li>\n<li>Any passive (or active) speakers.<\/li>\n<li>Two patch cords \u2014 twisted pair crimped with <a href=\"https:\/\/en.wikipedia.org\/wiki\/Modular_connector#8P8C\" rel=\"nofollow noopener noreferrer\">8P8C connectors (also known as RJ-45)<\/a>.<\/li>\n<li>A personal computer.<\/li>\n<li>Ethernet and Wi-Fi internet connection (optional).<\/li>\n<\/ul>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-351971","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/351971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=351971"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/351971\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=351971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=351971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=351971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}