Categories
General

Sustainable Software

When we are talking about free software, the point is often that this is more sustainable than proprietary software because everyone can edit the code and even if your company goes bankrupt someone else can take over and go on coding. Actually, in many open source projects there is only one person doing most of the developing work and there is also the risk of abandonware, software that used to be maintained, but the maintainer has moved on and does other stuff now. Still, no one else is taking over the code due to several reasons like bad documentation, complex code, lacking skills. So at the end the whole programm is written new from scratch in the next project (I see this quite a bit in science). Luckily there are institutions like the software sustainability institute tackling some if these especially technical issues, but I want to put more emphasis on social issues.

So actually the question we have to ask: how do we make software more sustainable? I see one crucial point that is true for software as well as any other voluntarily work (be it sports clubs or cultural/political groups): how easy do you attract people and how easy is it to participate in your project? Often, it is only one person working on a project. If this person stops, the whole project goes down. So what should happen? I think there are three more social than technical levels in which many projects might need some improvement:

  1. Community building: it should be easy to join your project. Connect, network with others, show that the atmosphere you do things is nice. Threat people reporting bugs nicely, talk to people and show that you are a person or group of persons it is fun to work with. Remember, people do this often in their free time
  2. Documentation: Make it easy on a technical side to join your project. It should not be easier to re-write the whole software than working on existing code. If you are a political group or other, also document what you do and what you did and why you did it. If you write code, also do this. Also track decisions, you do not want other people to make the same mistakes again.
  3. Financing: yes, financing. How do you expect people to work on things when they still have to pay rent? Therefore it is important to have your project on a stable ground, if you want to have it running. This does not mean that you sell out or try to get rich from ripping of your users, but it means that you think if you want to spend a reasonable amount of your time (or support someone else to spend a reasonable amount of their time for your project and think about putting some money in this). In software this also tackles licenses (another boring topic, I know, but there is also help.)

Summing up, I think we need to talk more about these things when developing free software and I also know that it is not the tasks most programmers are good at, but might be some skills to acquire in the future or attract people having these skills for our projects or software. I also want to show that if you are not a programmer, you can still do very important work in this background.

And even if you do not want to become active in open source software development, there are a lot of clubs, sports teams, political groups that will be happy to use your input and exptertise

Categories
General

How to make your own Raspberry Pi Musicbox

This is not about NLP, but I think it is worth sharing, so here we go 😉

I really like the project PiMusicbox, the raspberry pi is just the perfect device to host a music server, especially the model B1, which is also a little bit slow when it comes to video playback. But there are a few drawbacks, like that updates are quite hard and you cannot easily customize it. So I just set up the system in a different way, directly from scrath on Raspbian. In the next steps I show you how.

Thoughts before you start

This is what comes to my mind if someone asks me if she whether should take the normal version of PiMusicbox or mine.

Pros

  • You can update all the time. PiMusicbox you have to reinstall with every new release.
  • You can customize it as you want. The normal PiMusicbox does not provide Podcasts or Files.

Cons

  • Configuration is done manually. You should be able to connect to your pi via ssh. Alternatively use the Websettings package.
  • You do not have a way shutdown button integrated. But you can use RaspiCheck.
  • It is slower. In PiMusicbox a few tweaks are done to improve booting of the system. I did not do that.

Download Raspbian minimal image

You can get this directly from the website of Raspbian: https://www.raspberrypi.org/downloads/raspbian/

Install mopidy + run as system service

In order to start it when the system boots, you only have to type (source)

sudo systemctl enable mopidy

Install add-ons

I used Spotify, Podcast and files, because these are all I use with the raspi. You can get an overview at the documentation of Mopidy. Generally speaking you can download all extensions either via pip or via apt, depending on in which repo they are. This makes it sometimes a little bit confusing, but you’ll find everything, I am sure 😉 You can find all of the extensions for playback (the documentation calls them backend-extensions in the mopidy-documentation).

Also, you need an extension for a HTML-frontend. I used the one made for the PiMusicbox. An overview can be found here.

Mounting your external storage automatically

For this I used usbmount, which is a small programm that just mounts external storage devices automatically. This can of course be done via scripts as  well, but I did not want to mess around with scripts, so I used this approach.

Configurations

The config file for mopidy can be found at /etc/mopidy/mopidy.conf, if you run it as a system service, not in your user’s directory. To shorten this paragraph I just paste my config file here and make some comments:

[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy

[logging]
config_file = /etc/mopidy/logging.conf
debug_file = /var/log/mopidy/mopidy-debug.log

[local]
data_dir = /var/lib/mopidy/local
media_dir = /var/lib/mopidy/media

[m3u]
playlists_dir = /var/lib/mopidy/playlists

[musicbox_webclient]
enabled = true


username = # your username
password =  # your password
bitrate = 320 # better sound quality

[http]
hostname=0.0.0.0 # VERY important. Otherwise you cannot reach it from outside

[mpd]
hostname=0.0.0.0 # VERY important. Otherwise you cannot reach it from outside

[podcast]
enabled = true #only need to activate it. 
browse_root = #Path where your .opml-file with all your podcasts is

[file]
enabled = true
media_dirs = /media/usb #this is where your external storage is mounted via usbmount
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

I hope this tutorial helped you.

Bonus: Setting up SMB share

If you have a hard disk connected to your Raspi, you can easily share the files in all your network. I used the tutorial given by putokaz to install and configure it. I just configured it like the share for the torrent files at the end of the tutorial, but this is up to you.