Pi

Sep. 14th, 2013 12:19 am
davidn: (savior)
[personal profile] davidn
As alluded to elsewhere, I ordered a Raspberry Pi! I'm hoping to use it as a home server and perhaps experiment with some automation. Here is a picture of our two new computers running side by side.


Even though you know it's a miniature computer when you order it, it's amazing how tiny it is when you take it out of the box - it's a computer that would have been regarded as a ninja PC just nine or ten years ago on a circuit board the size of a box of chewing gum. It runs off a micro-USB cable - fortunately I had one in the form of my Windows phone charger.

I work a lot with Linux at work, but I hadn't set a Unix-based system up from first principles before and was fairly daunted by the prospect. They provide you with a good amount of assistance, though - you download an image of the OS on to an SD card (the default is a customized version of Debian) and then it does most of the basic setup for you. Wireless networking was the one major hurdle to get over, because you have to find a compatible USB dongle or be prepared to spend ages going through the Linux drivers - fortunately, by coincidence, the local hardware shop had one of the models that was said to work straight out of the box, a D-Link DWA-131.

Of course, "out of the box" has a very different definition on Linux from the one it has on Windows, and I was confused by the number of options and utilities for setting it up, especially as I was trying to get it to connect to our antiquated WEP network with a space in its SSID. On the day I got it I didn't have much luck with the instructions for setting up the /etc/network/interfaces file, but I ran some command line iwconfig things that I copied from the Internet and that seemed happy enough.

To get it to connect on startup - as well as feel that I was using a middleman that knew what he was doing - I downloaded the wicd tool, and that was all very impressive, but it produced a connection that was inexplicably down about half the time - it would be absolutely fine for a while, then would drop all connections and wouldn't respond to ping for five minutes, then continue as if nothing had happened. I imagine there must have been some sort of conflict with another networking service there - so I uninstalled that and had another go of the /etc/network/interfaces file, where I realized that my mistake was removing the "auto wlan0" line, believing it to mean "attempt to automatically set up this device" and not "connect this device on startup".

So I installed a lightweight HTTP server, nginx (which is pronounced "llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch") and wrote a little monitoring page to verify that I could leave it running uninterrupted.


Like any other heartbeat monitoring page, this prints a randomly-oriented banana every time it finds that the service is still reachable. Through this (including a couple of negative tests where I turned the server off and then on again), it looks - so far - like the connection is stable.

The next step, I think, will be to install PHP!

Date: 2013-09-14 05:55 am (UTC)
From: [identity profile] dr-dos.livejournal.com
My pi has become my own little webserver and fileserver at home and it's pretty great at it for the cost. I got one of the earlier models with only 256 megs of ram though so I'm constantly on the verge of running out of memory. But it's just so nice to have a development webserver that actually mirrors the structure of the actual one rather than me previously having to constantly throw in if LOCAL then path = C:\www\whatever all over my code.

I can't imagine how excited I would've been to get the equivalent of it as a kid growing up.

Expand Cut Tags

No cut tags

May 2020

S M T W T F S
     12
3456789
1011121314 15 16
171819 20 212223
24252627 28 2930
31      

Most Popular Tags

Style Credit

Page generated Jan. 1st, 2026 08:37 am
Powered by Dreamwidth Studios