My Raspberry Pi recipe

my 'to read' pileIn my room, I have three bookshelves, one for technical/study books, one leisure shelf, and one “to read” *ahem* pile. Today I had enough and finally bought a bookstand. It now looks much better which makes me happy.

It’s a family thing. My mother always had projects around the house. I remember thinking “Why is she putting in all this effort? It’s all fine like it is.” But since I started living on my own I’ve been fixing and improving things with a vigour never seen before. Now, if you’re more into software like me, there is still enough tinker around with. Especially within the UNIX ecosystem, there is an ungodly amount of tinkering and customising that you can do, which you should! Controlling your environment makes you happy. Which is why I bought a Raspberry Pi to do just that.

Don’t you mean a raspberry pie?

A naked PiNope, that’s not a typo. If you don’t know what a Raspberry Pi is, it’s a computer about the size of a credit card. As you can expect from a computer that small it’s no powerhouse but it has a few distinct advantages. It is very low in power consumption, making it a good option for something that has to be always on like a mini server. It is (relatively) cheap, at just 47€. And finally, it’s designed to be general purpose. That means that people use it for just about anything and everything. A few examples include emulating old arcade games, controlling robots and controlling your house.

The Pi also has Bluetooth, WiFi, and 40 GPIO (General Purpose Input/Output) pins. Those GPIO pins are interesting. They are essentially just pins on the Pi that can either output or receive a limited current through. This is the way the Pi can physically interact with other devices, but I’ll get back to that.

So no pie then? :(

Stop it, you’re making me hungry. So one of the things I’d like to do with it is to turn it into a music streaming box. I have some decent speakers on my computer. Sometimes though, I want to take the music elsewhere, like the kitchen. In that case, I’ll just use my headphones. My computer, however, can’t connect to it because it doesn’t have Bluetooth. That’s where the Pi comes into play. Though it isn’t a beast the Pi still packs a surprising punch for its size. So I can just install Spotify on it. Then when I want to I’ll just connect my headphones to the Pi and stream the music from there.

The Pi has its own operating system (called NOOBS), which is based on a Linux variant. This means that I might have to rig it together with Wine, to get Spotify to work. I’m hoping to avoid this, if possible. Firstly because extra layers always take a hit on performance. While this usually isn’t a problem I’m not sure how much of an impact it will have in a relatively low-performance environment like this. Secondly, I just don’t like wine that much. That’s not because it’s a bad program, certainly not if you’ve got no other choice. It’s just not very elegant to have to simulate a system inside another one. Of course, I could just install a different operating system but for now, I’d like to stick with NOOBS.

Little butler

Pi's webcam I’ve often dreamt of having a butler. Problem is, butlers are expensive so I’ll have to settle for the next best thing. Luckily you can come a long way with a Pi. Firstly I need a way to talk to it. To keep down the cost a bit I went for a relatively cheap USB webcam, which has an integrated mic. It might save me some money down the line if I ever want to do anything with video (like home security). I’d also like it to talk back to me, so I’ll need some speakers for it. Here I can do two things. Luckily the Pi does have an audio jack so I can just hook my old speakers up to it. They are a bit bulky, though. They also need an extra power outlet, which is a bit annoying. The other option is to have a smaller, battery-powered Bluetooth speaker that I can hook up to it when I’m not using the headphones. I’m still undecided which I’ll actually do. I’ve already got both options, so I’ll probably just try them both out and see when of the two options I like best.

Next is the software side. Writing my own voice recognition software is a bit ambitious, even for me. Luckily there already is a lot out there to do the heavy lifting for me. Two big components are the TTS (Text-To-Speech) and STT (Speech-To-Text) engines. I’ll want to port the audio to the STT and then perform the desired action based on the output thereof. After which I just have the TTS give me the feedback about the operation. Luckily there already is a framework to put all of this together. It’s called Jasper. The advantage of it is that they’ve designed it quite modular. So not only can I hook it up to my engines of choice, but I can also define my own operations, which is pretty cool. I’d like to be able to control my music with it, set alarms on it and have it routinely shout “You people have too much money!” (100 bonus MW points if you got that reference).

My personal cloud

The Pi all hooked upLet me be honest about myself for a second. I am lazy and impatient, it comes with the territory. Since I want to move into artificial intelligence , I sometimes have to run simulations. When I do this I’m not willing to wait very long for it, so I need lots of performance. The problem is is that performance means bulky, heavy, power hungry laptops. I’m waaaaay too lazy to carry one of those around. So how do I solve this? By buying a smaller portable laptop and sending the heavy jobs to my powerful PC at home. This raises another problem though. Powerful means power hungry, so I don’t want to leave my PC on all the time if I don’t need it. That’s where the Pi comes in. The Pi has a very low power consumption (compared to the PC) so just leaving it on is no problem at all. Because the Pi has WiFi capability, I can just SSH to it and then tell it to turn on the PC. After the PC is turned on I can just ssh into it (or use TeamViewer depending on the OS but I’ll get to that in a minute), and then turn it off when I’m done.

How I’m actually going to get the Pi to turn on the PC while it’s completely powered off I’m not sure yet. I’ll have to do some more research on it. If my motherboard has Wake-On-Lan (WOL), that might provide an easy solution. I’m just hoping to avoid having to fiddle with wires and electronics since I don’t know anything about that. I’m afraid that I’ll fry the Pi if I don’t know what I’m doing.

But all of this isn’t ambitious enough for me. The thing is that my PC is going to serve two purposes. Running simulations and gaming. The games I need to run in Windows. Here is the thing though, running simulations in Windows is a pain. So ideally I have to find some way to have the Pi make my PC boot into Linux when I want to run simulations and just boot it into Windows when I want to use it for other stuff. Now dual booting the PC is not going to be a problem, I’ve done that before. The challenge is going to be influencing what OS the PC is going to boot into remotely. This is going to be a bit tricky but I like a good challenge.

Keepin’ y’all out a my home

One downside to the solution I’ve just described, is that I’m going to have to expose my Pi to the outside internet. Now this in and of itself isn’t a problem but it does mean that I’m going to have to think about securing the thing. A lot of people don’t think about this but secring your IoT devices is very important. There is a search engine called Shodan which crawls the web looking for unsecured IoT devices and it is astonishing what people leave unsecured. Aside from the things I already described, it is truly astonishing what a hacker can do with just one device. There is a practice called pivoting. This means that if you gain access to just one device on a network you can use that device to gain access to all others. And then I haven’t even mentioned the fact that I’m just going to hook it up with a webcam with a microphone in it. I don’t know a whole lot about security so I’m going to have to learn about that. But that’s the fun part!

So what do you think of my projects? Are there any cool projects I didn’t think of but should definitely try? Is there something I overlooked in my plans? Let me know, I’m interested to hear what you have to say.

Like, Share, subscribe:
RSS
Facebook
LinkedIn
Google+
http://modernwizardry.xyz/raspberry-pi-recipe/