Pages

Showing posts with label open source. Show all posts
Showing posts with label open source. Show all posts

Thursday, April 5, 2018

Maintaining the Raspberry Pi Squeezebox server (aka Logitech Media Server)

Introduction

I wrote earlier about the Logitech Media Server (LMS), open source software that I've used to turn a Raspberry Pi into a music server for my Squeezebox devices. I'm using my Raspberry Pi based Logitech Media Server a couple of months and I've grown very fond of it. What started as an experiment now has become a device I'm starting to rely on. I guess that eventually I have to replace it with something like the WD PiDrive Node Zero. In the meantime however I do need to maintain the LMS. In this blogpost I'll explain how I add and remove music files from the LMS and create a simple backup of your music files. Finally I provide a tip to debug problems with the Logitech Media Server. All software that I used for this project is free and open source.

My Raspberry Pi turned into an LMS with 3D printed case on my desk.

Adding, changing and deleting music files

I partly ripped my CD collection and still add new albums. All the ripping is done on my Thinkpad T40 laptop using Asunder, a low resource ripper for Linux, on the Puppy Linux operating system. In the beginning I unmounted the USB hard disk from the LMS, removed it and connected it to the laptop and copied the new albums. This proved to be be a clumsy method and I quickly found myself looking for an alternative.

I decided to use FTP to transfer files over the network to the Raspberry Pi. FTP is a network protocol to transfer files between a client and a server. The software that I'm using is either FileZilla or gFTP. They have basically the same functionality but gFTP is not available for Windows while FileZilla is available for GNU/Linux, OSX and Windows. Working with both is easy enough the only problem that I had was to set the ownership for the USB hard disk on the Raspberry Pi. Only root was able to write to the disk. The reason is a bit technical and maybe confusing but I had used the Windows FAT filesystem for the USB hard disk and when I mounted it on my Linux laptop (Puppy Linux distro), ownership of all files was changed by Puppy Linux to root. At this point it was impossible to change ownership and permissions with chmod and chown from the media server. To solve this problem I had to unmount and mount the USB hard disk using the following general command:
mount device mount-point -o uid=foo -o gid=foo
or in my case
mount  /dev/sda1 /media/usb-drive -o uid=pi -o gid=pi
This command sets the ownership of all files on the USB hard disk to pi instead of root enabling me to use FileZilla and gFTP.

Creating a backup of the music collection

I invested a lot of time in ripping my CD collection so it would be a shame if I lost my music files due to a hard disk crash. I therefore use a very simple backup method, largely copied from the Raspberrypi.org website to ensure that my files are safe.
cd /home/media/usb-drive
sudo tar czf usbdrive.tar.gz
This creates a file 'usbdrive.tar.gz' that contains files in /media/usb-drive, the mounting point of my USB drive and places it in the same map. Next I use (again) Filezilla to move the backup file to my desktop computer.

Debug problems with the Logitech Media Server (tip)

I didn't encounter much problems with the LMS but if you do take a look into the log file of the server. This can be done opening a terminal on your PC and login into the Rasperry Pi with:
ssh pi@<your_network_ip_address_of_the_server>
cat /var/log/squeezeboxserver/server.log
The sudo ssh command prompts for the password of the Raspberry Pi.  Now look for anything suspicious in the log, copy it and do an internet search with your preferred search engine. Chances are someone already encountered the same problem.

Earlier posts about the Logitech Media Server:

Setting up a Raspberry Pi Logitech Media Server
https://eribuijs.blogspot.nl/2017/08/creating-raspberry-pi-squeezebox-server.html

3d printed enclosure for the Raspberry Pi Logitech Media Server
https://eribuijs.blogspot.nl/2017/11/raspberry-pi-squeezebox-server-with-3d.html

Wednesday, November 1, 2017

Raspberry Pi Squeezebox server with 3d printed enclosure

The need for a enclosure

Back in August I created a Squeezebox server using a Raspberry Pi 2 and a USB harddrive I had both lying around. I quickly had the server up and running and I'm using it ever since but I didn't have a enclosure. A 3D printed enclosure would enable me to give the server a more permanent place and at the same time I'm getting rid of these components and cables lying around on my desk.

The Squeezebox server sitting nicely into the 3d printed enclosure that I designed for it.

Solvespace for the enclosure

As a 3D CAD tool to design the enclosure I choose Solvespace. Solvespace is free and open source available for Windows, OSX and Linux. I use Solvespace a lot and it has it's limitations but I felt it was fully capable for this job and indeed it didn't disappoint. Before starting I made a couple of simple drawings with pen and paper, I measured the size of the harddisk and the Raspberry Pi. I also used a template for the Raspberry Pi mounting holes that I found online.

With all this information I started drawing with Solvespace. The power of Solvespace (and other 3D CAD programs) is that's it's very easy to make changes to the 3D design. While working on the design I noticed that USB harddisk can become hot so I figured it needed to be cooled. In the drawing I elevated the harddisk a bit by adding four supports one on each corner of the disk and made four ventilation slots in the bottom of the enclosure thus allowed air to flow freely around the harddisk. The Solvespace files of this enclosure are here. Make sure to adjust the size to the USB HDD you're using.

The 3D design I came up. The printed parts, bottom and lid, are grey, the green part is the Raspberry Pi and the red part is the USB harddrive.

3d printing and assembly

I printed all the parts on my Hephestos 2 printer using black PLA filament and the result looks pretty good. Assembly of the parts is simple. First I used 2.5mm bolts and nuts to mount the Raspberry Pi upside down to the lid of the enclosure. Next I insert the USB HDD into the bottom placing it on the elevated supports.  The enclosure is fastened with four bolts 5x60mm and 5mm nuts. The nuts fall nicely into the hexagonal cavity of the feet. Finally the USB cable of the HDD is connected with the Raspberry PI and the ethernet cable is connected from my router to the Pi. The server has run for several weeks in the 3d printed enclosure without any problem. For those that want more information I made a YouTube video about this project.

Wednesday, August 16, 2017

Spotify silently and remotely deleted app from Squeezebox devices

Spotify removed

Spotify silently and remotely deleted the Spotify app from the Squeezebox devices I found out after returning from vacation (Yes, they did post an article on their help pages I found out but I wasn't notified). I own a Squeezebox Radio and a Squeezebox Touch that I both use heavily to listen to music with the Spotify app. I even have a Spotify Premium Family account that enables me to play Spotify on multiple devices. I understand that support for hardware, such as the Squeezebox, is limited and will end some day. However what outrages me is that Spotify remotely removes software on a device that I own. Spotify makes it very clear that they control the software that they provide for the device and not the user. With that they control the functionality of my devices.

The Logitech Squeezebox Radio, one of several types of Squeezebox devices, now without Spotify (photo from https://en.wikipedia.org/wiki/Squeezebox_(network_music_player)).

The Squeezebox music player

The Squeezebox device is a network music player from Logitech. The devices are versatile and have excellent hardware. The Squeezebox can be used in two different ways; as a player that works with an online service, mysqueezebox.com, or with a private server called Logitech Media Server. I preferred to use my Squeezebox devices with the online service mainly for its ease of use and because some streaming services such as Spotify and Deezer are available as an app. The apps are very convenient to stream music just with a remote control. The Squeezebox hardware was discontinued in 2012 but  but, to it's credit, Logitech maintains the online service to this very day.

I didn't mention the best thing about Squeezebox, both the server and player software are non-proprietary and can be installed on several different operating systems. This enables all users to make build their own Squeezebox clients and servers.

Choices

With the removal of the Spotify app I have a choice to make. Will I continue to be using the my Squeezebox devices with the online server using Deezer instead of Spotify or will I set up my own private server? The latter is of course more of a hassle since it involves installing and maintaining the Logitech Media Server, ripping CD's to mp3's and storing them on the server. Nevertheless I may choose to create my own private server. I recently decided to move the software on my iMac from proprietary to non-proprietary so creating the private server for my Squeezebox would also make sense. I happen to have a Raspberry Pi 2 lying around and in the coming weeks I'll try to set it up as a Logitech Media Server.


Thursday, August 10, 2017

Replacing Contacts, Calender and Mail with Thunderbird on OSX

Introduction

I prevously wrote about the reason why I prefer open source software above proprietary software for my DIY projects. This time I'd like to take it a step further by replacing all proprietary software on my iMac with open source or non-proprietary software. This is of course not possible because the OSX operating system itself is proprietary but I'm replacing as much programs on it as I can. This will ultimately make it easier to move to the Linux operating system.

Thunderbird the replacement for Contacts, Calender and Mail on OSX.

 

Thunderbird

Today I replaced the proprietary Contacts, Calender and Mail, that come with OSX, with Mozilla's Thunderbird (v52.2.1). Most important are my mails. I have three email accounts from which two migrated without program. Not suprisingly I was unable to migrate my iCloud account. Not a huge problem since I want to abandon this account anyway.

All contacts from OSX Contacts were imported during the installation of Thunderbird. Next I exported my Calender data as an .ics file. Thunderbird imported this file without problem (Events and Tasks/Import).

After just a couple of hours of usage I can't provide a opinion of the Thunderbird software but that is not relevant. Even if Thunderbird would lack certain features or the user interface is not as pretty as the other programs the more important point is that I gained more freedom today. I unchained myself from three proprietary OSX programs and I'm slowly freeing myself from the Apple ecosystem.

Further down the road

Next on the agenda are Quicktime and iMovie which I use extensively for my video tutorials. Possible candidates are OpenShot and Kdenlive. I've heard that both programs can have stability issues so that may be a challenge also the Kdenlive version of OSX is outdated according the Kdenlive website.

Even further down the road is OSX Photos. I have thousands of photo's and as you can imagine they're precious to me. Finding an non-proprietary image organizer for OSX is not easy. My son uses Shotwell on his Ubuntu system but I haven't found an OSX version of it. Another alternative is digiKam. This program appears to be maintained very well so I might want to give it a try.

Any comments on migrating from proprietary to non-proprietary programs are welcome as well as any comments on proprietary versus non-proprietary in general. In the future I'll regularly write an update on how I'm faring with the transition.

 

Tuesday, June 20, 2017

Line and Polyline modules in OpenSCAD

Polygon in OpenSCAD

The polygon function of OpenSCAD is very cool but for some applications it just doesn’t cut it. For instance when polygon is used to draw a Starpolygon, a self intersecting polygon, the space between the polygon lines is filled, an undesired effect that cannot be negated. In case of the Starpolygon we just want to see the lines.

Line and Polyline

Luckily we can create our own polygon module in OpenSCAD that meets our needs. However before we can create a polygon we need to be able to create a single line. Also a single line can be created in OpenSCAD, actually in several ways. In the YouTube video below I'll show one such approach.

A Vase created with line, polyline and rotate_extrude in OpenSCAD.

Furthermore I’ll show how to create a line module and a polygon module that fit our needs but it doesn’t stop there. With the line and polyline a complete 2D-library in OpenSCAD can be created. Also, in combination with linear_extrude and rotate_extrude 3D objects can be created that are impossible to create with CSG alone.



In a next blogpost I’ll show you how to create a Bezier Spline with line and polyline. This Bezier Spline can then be used to create a smooth curve needed in a 3d printable vase for example.

I want to mention Justin Lin here. He has a great website www.openhome.cc where he, not only shares his OpenSCAD work, but also explains it in great detail. I think it’s a very useful resource for OpenSCAD.

The file of this video can be downloaded with the following link: https://drive.google.com/open?id=0Bwg0RBbuN0fMVkJISXdDQV9sekE

OpenSCAD is open source (GPLv2 license) and is well maintained by Marius Kintel et al. Besides the stable releases for Windows, OSX and Linux, development snapshots are available. I recommend using these development snapshots since they have all the latest features. 

Wednesday, March 29, 2017

Creating interactive 3D models in your browser with Solvespace

Interactive 3D model

It may be convenient to view a interactive model made in Solvespace using a webbrowser. For instance if you want to share the model with someone who hasn't Solvespace installed. Luckily Solvespace has an option just for this under File -> Export Triangle Mesh. Now in the dialog window select Three.js-compatible mesh with viewer (html). Save the file. An html file is now available that can be viewed in the browser (I only had succes with Firefox, Chrome wouldn't show me the model). The html file created by Solvespace consist for a large part on Javascript and relying on the Three.js Javascript library. All the points, edges and faces of the 3D model are included in this file.

Screenshot of the html file created by Solvespace and opened in the Firefox browser.

When the html file is opened the 3D model can be rotated (left mouse button), moved (right mouse button) and zoomed (scroll wheel). The options are activated by a mouse click in the frame. Clicking on the scroll wheel deactivates these options.

One step further

This can be taken one step further. The model can be integrated in a website. The simplest way is to use the <iframe> tag in html. Below is a simple example where cube.html is the file that has been generated by Solvespace.

<!DOCTYPE html>
<html>
    <head>
    <title>
    This is a cube
    </title>
    </head>
    <body>
        <iframe src="cube.html", height="600", width="800"></iframe>
    </body>
</html>

That's it, the interactive model will show up in the webpage which is a pretty cool Solvespace feature. BTW: I didn't bother demonstrating it in Blogger because I think it's to much of a hassle editing the template.

For this tutorial I used Solvespace 2.3 on OSX.

Solvespace is open source (GPLv3 license) and is available for Window, OSX and Linux. It is developed by Jonathan Westhues and maintained by Whitequark and others. It can be downloaded here: http://solvespace.com/download.pl.

Thursday, September 29, 2016

Switching from FreeCAD to Solvespace?

Introduction

For my current project, a laser engraver, I initially choose FreeCAD as my 3D CAD program. I had some excellent experiences with it so it was the obvious choice for me. However contrary to previous work this project required a lot of CAD assembly. This is where I became frustrated with FreeCAD. Assembly in the current version (0.16) just isn't well implemented unnecessarily extending my time spent with FreeCAD. The next version of FreeCAD (0.17) will have a separate assembly workbench but I wasn't willing to wait for it's final release.

When reading the Hackaday website I came across Solvespace. Given the problem that I have with FreeCAD I was immediately interested. Solvespace is a parametric modeler just like FreeCAD. The interface looks archaic which put me off a little at first but I found it surprisingly easy to work with. The last month I worked intensely with Solvespace v2.1 and I want to share the experience that I had with the program.

The Solvespace GUI looks archaic but is easy to work with.

Saturday, September 10, 2016

Puppy Linux Tahrpup on my Thinkpad T40

Introduction

In November last year I decided to revive my very old (2003) Thinkpad T40 with Puppy Linux. Back then I was thrilled by the ease of installation and the speed of this Linux distro on this ancient laptop. Now eight months later I'll give an update on Puppy Linux on my PC. Am I still happy with Puppy Linux? 

The standard TahrPup desktop with the beautiful stylized Ardis icons.

Thursday, September 1, 2016

Why I use open source for my DIY projects and you should too

Introduction

I've been a user of proprietary products for a very long time without giving it much thought. In fact I'm writing this on an iMac with OSX as the operating system. I own this iMac for at least 5 years and it is a nice machine but as time went by something kept nagging. I used to believe that for good reliable software you had to pay money. If software was free (as in gratis) it was probably unstable, user unfriendly and unpolished that it wasn't worth any money. At least that is what I thought.
Logo of the open source initiative. By Open Source Initiative official SVG - Simon Phipps, former president of OSI, CC BY 2.5, https://commons.wikimedia.org/w/index.php?curid=1853734