Friday 8 February 2019

Fixing an unreliable NFS mount

I store my music,  photos and documents in a central location so that I can access them via any of my systems.

Since I don't use any windows systems at home I can use NFS as a sharing method rather than SMB (or SAMBA).

This has always meant that the share seems quite a bit faster and more reliable.  Recently,  however,  the mapping as set out in my /etc/fstab file has not always been working.  Sometimes I get a waiting symbol rather than the regular icon for network manager just after logon: and on these occasions I find that the mapping has not been done.

After some research I found a package that fixed the issue for me (given that I use network manager).

The fix involves enabling a service on bootup:

systemctl enable NetworkManager-wait-online.service

Credit goes to the Arch WIKI for this little nugget

Saturday 26 January 2019

Setting up a music player using PiCorePlayer and Bluetooth speakers

I've used LMS (Logitech Media Server) for quite some time.  I stared off running it on a windows machine many years ago.  It was where I already had my music files and the service seemed quite light running.

I'd been on the search for an easy way to play my MP3s via my stereo system rather than my crappy computer speakers for ages.  The Logitech range of hardware helping you do so seemed ideal. 

I started off with the Squeezebox Duet:
As you can see you have a rather nice remote with just enough screen to show off your lovely album art and another small box:  which turns out to be the interface between your data (in my case on the computer connected through the network) and my stereo system.

Joy abounded: for quite some time.  And then.....well the hardware got older.  I stopped using the remote because it kept disconnecting and the battery degraded.  So,  when setting things up again I had to configure the squeezebox in a headless fashion as I was no longer using the remote: it can be done,  but easy its not.   If anyone is interested in how this is done: comment on the piece and I'll see if I can remember.

Then (still aeons ago!) I moved over to Linux,  so I needed a way of keeping my system going using a new operating system for the server.

My home server runs on vanilla debian: and there is a version of the server software which runs just fine on there : after some persuasion.  So,  once you get the service running you can do the rest from the web interface:


To bring things up to date,  this was all fine,  but it only connected to my main stereo in the front room.

For my bedroom upstairs I had a squeezebox radio:


This worked fine,  and doubled up as a handy alarm clock too.

However,  the darn thing gave up the ghost a short while ago leaving me bereft of sounds upstairs.

So,  in went my old LED alarm clock again (I convince myself it has a retro look) and I started to look at alternatives.

I've long been a fan of all things Raspberry Pi and as a result of this I had an old Pi 2 lying around not doing anything.

This is easily fast enough to convert into a standalone player which can expand your already existing LMS ecosystem. 

I've tried a number of music players running on this Raspberry Pi 2 before (because its fun and I'm sad) but I settled on PiCorePlayer this time.

My plan was to get up to date and use a bluetooth speaker with the player.  To this end I chose a soundbar eventually,  in fact this one,  the Azatom Studio Soundbar 2.1.  Its not bad,  for the approx £50 I shelled out,  but nothing special. 

So: how to do it?

The Build


  • Download the image file you require first.  As of writing,  this can be found here
  • Write the image file onto your SD card that is to be placed into the Pi.  You really don't need a large SD card,  4GB would be easily big enough.  Remember,  we are not putting any music on this thing,  that stays on the server.  I used USB image writer on my distro (currently ArcoLinux Openbox) to write the image onto the card.
  • Put the SD card into the PI.
  • I added a bluetooth dongle via USB so the Pi could connect to the soundbar.  The one I used was a Rocketek,  and it seemed to work fine.  I did check first and Amazon suggested it was fine to work with Linux and a Pi.  
  • The Pi will need to connect to the network (to find the server service and also "see" the music files) so I connected it via ethernet.  I've read warnings about using WiFi and bluetooth concurrently in this setup,  so a good old wired connection seemed a good idea (it was).  
  • Googling around suggested that the newest versions of PiCorePlayer would now work with bluetooth connections so once I had my hardware connected together I fired the thing up.
  • This is another piece of hardware with a web interface,  but to use this you need to know its assigned IP address.  I found this out by going into my router and looking at what was currently connected to the network.  
  • Once you know the IP you can open up your browser and check out the interface.  Once you are in,  click on the button labelled "main page" and have a look at the bottom of the page.  Here,  you will find a way to display the more exotic controls via the "beta" controls,  so make sure you have this selected as below:



  • By default only the player software "squeezelite" will be running.  You can use the PiCorePlayer to run a full version of LMS and make the unit a whole sound system in itself.  I've done this before with great success,  using a USB stick attached to the PI to hold the MP3 files.  However,  for this example we just need the player running.  
  • Lets have a go at setting it up.  My first port of call was expanding the image on the SD card so that the software could make full use of the space available on the SD card.  There's a button for this on the interface under "main page" and "advanced mode operations": like this

  • I decided to get everything up to date next,  so I did an update.  This is also on the main page,  under "main Pi Core operations":

  • With this done,  its a good idea to give it a restart.  You can see the button for this in the picture above as well.
  • You may want to take one of the other options on these dialogs as well: to set a fixed IP address for the player: this means that if you need to get onto the interface in the future,  you don't have to go rooting around in your router's settings to find its IP again.  
  • Given we are using an ethernet connection in this example,  I wanted to turn the WiFi off.  This is quite easy as you can see below:

  • Now we need to see if we can get things going with bluetooth.  This was the bit I was afraid of,  TBH.  I had done quite a bit of googling around in preparation,  but the help available on this was rather spartan as its quite a new feature.  There are some help pages available from the PiCorePlayer people,  but I was getting confused.  
  • I worked out that I had to change the output of the squeezelite player, but only after I had enabled my bluetooth setup.  There were references to the "squeezelite settings" tab on the interface,  but I couldn't for the life of me find where I could input these settings.
  • Eventually I did twig it: there is a small box labelled "Card Control" and that is where we have to head:

  • If you actually click on this box (which was non obvious,  to me) you see:

  • If you study the picture above you'll see that my bluetooth is recognised,  as is the soundbar (you can see that in the picture above and the one above that,  too),  but the devices are not currently connected.  You need to click on the "scan" buttons to get the bluetooth on your Pi to "see" the soundbar. 

Conclusions


Its quite a nice setup,  the Pi is tiny and can be kept out of the way (although not too far from the bluetooth device you want it to connect to) and it seems to run for ages with no errors. 

I run OrangeSqueeze on my android phone and tablet,  and on that you now only have to swap players to output music from the Pi to the bluetooth speaker. 

For music enthusiasts: you may wish to get a better bluetooth speaker than I did with my soundbar.  I'm not attacking the Azatom device here,  for the price I paid its excellent: but I would have liked something with slightly higher quality sound and a more reliable bluetooth connection.  I get bluetooth cutting out occasionally,  but its not a deal breaker at this stage. 

Saturday 12 January 2019

Thoughts on the TP-Link RE200 Wireless Booster

A little while ago I went over to a friend's house to install at TP-Link RE200 wireless booster as his wireless signal gets pretty weak upstairs.

It all turned  into a bit of a saga.....

In theory it should have been a doddle.  All I needed to do was to go through a simple WPS process to get the RE200 talking to his existing router and all should have been well.

Initially things looked like they were going well,  once the WPS buttons had been pressed on both router and the RE200 lights started turning on and my hopes were high.  However,  only 2 of the lights on the range extender came on and when I tried to connect to the new wireless network I could not get an internet connection.

So I gave up on WPS and looked at the "manual method" as suggested in the paperwork that came with the product.  This involves disconnecting from any current wireless network and connecting a laptop (or other device) to the RE-200.  When you turn it on it will create a wireless network of its own,  called something like TP-Link_Extender.  At this stage you are supposed to open a web browser and to go to http://tplinkrepeater.net or http://192.168.0.254.  At that stage you should be able to use the router's credentials to log in: then you can further configure your RE-200.  I was just not getting any reply from either page.

After much googling (and even  more muttering and chuntering from myself) I finally sorted out what had happened.

My friend's router was giving out addresses in the 192.168.1.x range but the extender wanted to use an address on the 192.168.0.x range......so they were not talking to each other.

So if you come across something similar: there is a way round the issue.  Turn on your extender and let it settle down for a minute or so.  They you will need a laptop and an ethernet cable.  Disconnect any automatically connecting wireless connection that may have started with the machine.  Run the ethernet between the laptop and the RE-200.  Now you will need to check to see what IP address is being given to that connection to the ethernet port of your laptop.  Chances are, if you are having the same issue as I had, the address will be in the 192.168.0.x range.  Assuming your router is working on the 192.168.1.x range then you will need to set a static address on this port so that you can get things going.  I was using a windows laptop so I could just right click on the connection and change its properties.  You can do the same in linux with network manager.  I gave the connection the address of 192.168.1.253 as a static IP and then disconnected the cable and rebooted the RE-200.  You can then connect it up again and with the ethernet between your laptop and the RE-200 you should now be able to get onto the webpage via its ip address,  ie http://192.168.1.253 : now finally you will get the prompt for the router's authentication and once you enter this you will be able to see and alter its settings via the web interface.  I went straight into its network settings and changed them all round to reflect the new IP range and at last,  the range extender was talking properly over the network and its 2 new wireless networks had proper access to the internet.

So,  all in all,  a bit of a pain in the backside,  to be honest.  To be fair to TP-Link there have been no issues with the unit subsequently.  I checked out their support site and there does seem to be a quite new firmware package for the RE-200.  Once of the fixes listed for this new firmware is: "Fixed the issue that extender can't obtain IP address in a few special situations" so perhaps newer units will not suffer from this annoying defect.  There is no real reason why the device could not adjust to different IP ranges used by different routers (as its competitors seem to do without bother) so this is consumer unfriendly to say the least.  I've had good experiences in the past with TP-Link products so I don't wish to be overly critical: but this is something that should be fixed for the sake of the less technical users out there.