Tell A Friend

Tell a Friend

Using the Raspberry Pi as a Server for the Home Network – Part 2

One of the neat features of the Raspberry Pi is that the whole operating system and applications run out of a Micro SD card. This allows to quickly switch from one setup to another by simply swap the card.

However, this feature is also its greatest weakness when the RPi is used as an always on server, because a Micro SD card can be written at the same location only a limited amount of times.

SD cards employ an internal algorithm (wear levelling) to use different memory blocks at different times at every write, even if the memory address is the same. This helps in distributing the writing operations across the whole memory chip, and the greater is the capacity of the memory, the longer is the lifetime of the chip. (If you are interested in more details, here is a technical white paper from Sandisk, and here is a high level description of the most used algorithms).

In the case of the Raspberry Pi, the whole Micro SD card is used to store the Linux distribution with all its components. It is also used to store data, like you usually do with any computer. So, as long as you experiment with the RPi and use the system every now and then, the Micro SD card lifetime is not a big issue. However, if you use the RPi as an always on server, the memory storage gets used much more often, and its life expectancy decreases greatly. I read of several people reporting their RPi was behaving erratically, or even stop working at all, after a few weeks that they were using it constantly.

Since in my case I had to build a server for the home network, and I wanted it to be reliable and durable, I obviously had to solve that problem.

My server, in fact, is supposed to stay up all the time, to satisfy any need 24/7.

The way I approached the solution for the problem was to use an external USB drive in combination with the Micro SD card. I left the partitions containing data that rarely change on the memory card, along with the boot partition, and moved all the partitions holding data that I expected to change frequently on an external USB hard disk.

Next time, I will show you the procedure to install the Raspbian distribution on a RPi 2B using a mix of the Micro SD card and a hard disk connected through one of the available 4 USB ports. I will describe more extensively only those steps of the procedure that differ from a regular Raspbian installation done through the NOOB image. If you need more details on the basic parts of the installation, please refer to the Raspberry Pi web site, which provides plenty of information.

Using the Raspberry Pi as a Server for the Home Network – Part 1

I recently acquired a Raspberry PI 2B (the latest model) to play with it and see if there was any real use besides learning and experimenting. In fact, in the past, I read some good articles on possible applications on the LJ magazine, not to mention the various projects that one can find on the WEB.

RPi2BNeedless to say, I ended up finding the RPi a very capable piece of technology. Although it doesn’t have the computing power to do some heavy lifting, it is still a very good system that can be successfully used for several non-demanding applications, to the point that I decided to use it for most of the servers in my home network. Applications like DNS, WEB, Proxy and DLNA servers work very well with a Raspberry Pi 2B in a home environment, where the only users are the family members. In addition, the RPi uses very little electric energy and switching to one or two of these little devices from a power hungry 4-core I7 system (the one I used for the home network necessities) provides a lot of savings on the electric bill.

In the next several weeks I will present some articles to describe what I did in my home network. I hope you will find them very interesting. Also, if you have also played with the RPi and used it for some other projects, I would like to hear from you about that and, maybe, we could co-write an article together on that topic.

DZgameEngine and Distribution Licenses

When I started the DZgameEngine project I wanted it to be open source, so that anybody could freely use it to experiment with game development and accelerate the learning stage for understanding the insides of a game engine, from drawing to the screen to generating sounds.

Soon I realized that I needed to provide some sort of distribution license. Not doing so would have put my code in the position of being indirectly copyrighted and no one could really use it to eventually publish his/her own game. As usually things go, I didn’t put much thought on it, so I ended up using the same license used by the Linux Kernel. I thought: “if it works for Linus Torvalds, it can work for me too”.

But, recently, I started thinking on that a little more, and I started doing some research. I came to understand that the GPLv2 license ultimately could constitute a barrier for people to use my game engine. In fact, with such a license, people would be forced to make their own game totally open source. And if they wanted to get some money out of it, they probably couldn’t. A game is not a product on which you can easily charge for maintenance contract or other services. Once in the hands of a gamer, it gets used as is, and later discarded. Nobody is going to pay anything for it.

I needed something that could give the developer a choice, which seemed more fair than forcing him/her to open source the game.

I needed something that a developer could use to either release his/her game completely open source, or completely in binary form, for a fee. At the same time, I needed something I could use to ask the developer to release to the open source whatever change was made to my own code, the game engine itself.

And finally I realized the Lesser GPL does exactly that: what ever someone makes changes to the DZgameEngine library, it has to release the code changes so I can keep improving the library. But, at the same time, the developers can keep their own code closed, so that they could sell the product of their brain, if so they please.

So, at the end, that’s what I did, I changed the distribution license for my DZgameEngine library, making it more available to developers the way they want it fit for their own purposes.

Was this the right decision? Will it ever DZgameEngine be something that other people will use? Will people be more willing to use it now that I have changed the license to something that I think is more appealing? I think so, but really only time can tell. And if you out there have any thought, one way or another, would you be willing to post a comment and let me know?