[HowTo] Use a WR1043ND (v4) or similar Router as WLAN-Squeezeplayer
(And please excuse my not-so-perfect english as I'm german.)
Background: I really liked my little red SqueezeBox Radio from Logitech and was very sad, when they dropped production. I had set up a LMS already on my little Homeserver and over time added a Raspberry Pi (piCorePlayer) and an Android Tablet (Squeeze Player, which is not free, sadly).
As the ancient tablet was getting slower and slower due to app upgrades (I think?), I started looking for a replacement. A Raspberry Pi is still quite expensive and I had some TP-Link TL-WR1043ND and a VIGO Supreme USB-Soundcard laying around, which is known to work in Linux.
So, my goal was to get the WR1043ND running as a Squeezeplayer using the WLAN. I knew that there was a squeezelite package, but was astonished that no one seemed to have written a tutorial - and setting this up was not that self-explanatory.
So, here it is, a little HowTo.
In our example, the normal network is setup at 192.168.1.0/24 with a Router that acts as DHCP- und DNS-Server at 192.168.1.1.
Hardware used:
- TP-Link WR1043ND v4 (any WLAN-Router with 8 MB flash should work, though)
- USB-Soundcard supported by Linux (e.g. Speedlink Vigo Supreme used, Speedlink Vigo works as well)
- Some speakers
- Perhaps an amplifier (I use a Lepai LP-2020 with the android tablet and really like it)
We start with a freshly flashed OpenWRT 19.02.7.
Connect your computer to the router using a LAN-Cable. Do not connect the Router to the LAN itself, as OpenWRT uses the Network 192.168.1.0/24 and IP 192.168.1.1 as default.
Open your webbrowser, access http://192.168.1.1 and set your password.
Got to “Network” -> “Interfaces”, select “LAN” “Edit” and change “IPv4 address” to an IP in another subnet like “192.168.2.1”. Click on “Save”, then the DropDown Arrow “near “Save & Apply”, select “Apply unchecked” and click on that red button.
Disconnect the LAN cable, wait around ten seconds and connect again. Your computer will get a new IP address in the 192.168.2.0/24 range.
Now we’ll set up the WLAN. Close and open your webbrowser again and access http://192.168.2.1 (or whatever you entered in the step before), the new IP of your router. Click on “Network” -> “Wireless”, “Remove” your current SSID. Select “Scan” and select your WLAN with “Join Network”.
At “Joining Network” check “Replace wireless configuration”, enter your “WPA passphrase” and make sure that “Assign firewall-zone” is set to “wan”. At the next page you can leave everything as it is and “Save”. Lastly, click “Save & Apply”. Congratulation! Your computer and your router should now be able to reach the internet!
Now it’s time to get USB-audio running. Select “System” -> “Software”, “Update lists…” to get the package list. Check for errors and “Dismiss” (if there are errors, you probably messed up while connecting to the WLAN). Filter for “kmod-usb-audio” and “Install…” this package. You’ll get a short overview of the packages that will be installed and confirm by clicking “Install”. Check for errors again and “Dismiss”.
Lastly we install squeezelite itself: Filter for “squeezelite” and install “squeezelite-full” using “Install…”. Confirm clicking “install” again, check for errors and “Dismiss”.
Connect your speakers / amplifier to the USB-Soundcard and put it into your USB port of the router.
If you would restart the router now, squeezelite would start at Startup but would only scan the LAN-interface for your Squeezeserver instead or the WLAN-interface (i.e. it scans the 192.168.2.0/24 range while the LMS will be at 192.168.1.0/24). Sadly, there is no luci-interface for squeezelite and not even a manual at the packages homepage at https://github.com/openwrt/packages/tree/openwrt-19.07/sound/squeezelite . But I figured it out myself (sigh):
Connect to your router using SSH (Windows users will normally refer to PuTTY or MobaXterm). Remember your routers IP (which should be 192.168.2.1 if you have stuck to this HowTo). Now, you have to know the IP of your LMS (which you should know when you use one). Let’s assume the Logitech Media Server runs at 192.168.1.254.
While connected to your router, use the commands
uci set squeezelite.options.server_addr='192.168.1.254'
uci commit squeezelite
to add the server-adress to your squeezelite installation. You can check with
uci show squeezelite
if it was entered correctly. And while we’re at it, you can check with
squeezelite -l
if your soundcard was recognized correctly.
Finally, Reboot your router using LUCI “System” -> “Reboot” -> “Perform Reboot” or at the ssh with a simple
reboot
You may disconnect your computer now and pray, that everything works correctly.
Final thoughts: Perhaps it is useful for future access to add Port Forwards for the ports 80 (HTTP, LUCI) and 22 (SSH) to your localhost / 192.168.2.1. Otherwise you had to connect each time using a LAN-cable.