Posts from ‘Raspberry PI’

Dec
26

Well the last few days have been interesting for me, here is a brief overview of what went on.

the old rubish design

The Old Design

Bodged together

A lot of my blog posts are cobbled together in around 10-20min with a bit of effort put in but nothing really too taxing, in one of my latest posts I decide to write a brief list on “30 cool ideas for your Raspberry PI project”. As you can see in the screenshot it was a fairly boring bullet point list of 30 things with links to external sites where you can read up in more detail on a project of choice.

Well after a few days the traffic started coming in from Google and I was quite content with my new blog post, while trawling through Google Analytics I noticed a bounce rate of around 90% for that page, well that sucks! First page on Google for “Raspberry Pi Ideas” but no one wants to actually read the content.

The website had also been submitted to a few social sites with similar disappointing interest, however to be honest I completely understand why! only one other up-vote on the screenshot below:

Old Hacker News

Revamp time!

So the plan was to revamp the page and see how that affected the bounce rate, basically I got some pictures for each of the 30 things and put them in a clean and simple HTML table, it did look considerably better for only a few minuets more work, how about another screen shot for comparison? Ok there you are at the right.

the updated design

The new design, with pictures!

As I finished updating the layout I decided to resubmit the page to one social news site (hackernews), then monitored the traffic using Google Analytics real time to get a better idea of what people are doing.

Two active visitors, Ten, Thirty, cool people are actually looking at the content now and not bouncing straight away to another site!…. Eighty visitors now, Two Hundred active visitors…. What’s going on here??

Well it turns out people did like the new design/layout even though the underlying content was exactly the same, and I was now on the front page of hacker news, peaking around number 3 and averaging around number 6 most of the time.

New hacker news

real-time-madness

Everything Broke when the internet arrived

Over the next few hours I was battling trying to keep the server online, I might go into this a bit further in another post once I get some more metrics. However the basics are that CloudFlare (CDN function) didn’t really help because it was PHP based CPU load that was killing me, not throughput. W3cache using a Memcache backend really saved the day, NewRelic is awesome for monitoring my configuration change effects in real time, and finally CDN77 has 100GB of free bandwidth which is also nice when you need some help ?

Even More traffic now…

Just as the site was back on it’s feet people started flooding in from Twitter, Reddit (Raspberry_Pi) and also Google +1, people actually use Google +1 well that was news to me! Actually it’s just edged out reddit for the second spot in Social traffic sources.

Another thing I have noticed, while the hackerne.ws traffic is fairly dependant on been on the front page it appears Reddit and Google are much more stable (so far), I expect this is because they have less churn of stories in their respective sections.

reddit post

The site has now been fairly stable since the recent changes, and there is still a steady flow of traffic from some of the sources.

48 hour visits

48 hour social breakdown

(Stats for last 36 hours only)

Conclusion
  • Put more effort into design, people like nice pictures and layouts
  • CloudFlare + Nginx isn’t a solution on a slow server, get caching on there (memory not disk)
  • CDN’s don’t really help with CPU usage too much
  • As always, keep your solution simple (Memcache > Varnish)
  • Will do a more technical post soon!
  • Front page of Reddit for a few min
  • Front page of hackernews for 24 hours+

If you got this far, please don’t forget to comment or even vote on HN or Reddit, Thank you 🙂

Dec
23

Screen Shot 2012-12-23 at 13.26.05The Raspberry Pi has many great features straight out of the box,  unfortunately WiFi is not one of them, in this guide I’ll show you how I WiFi equipped my Raspberry PI for only a fiver.

We will be assuming that you have a head less setup (without a monitor) so the guide should work for everyone, either via SSH (remote) or via a local terminal session if you do have a monitor.

Also its worth noting that some WiFi adapters will require a powered USB hub between the Raspberry PI and the USB module, the one used below doesn’t due to it’s power consumption assuming you don’t have anything else drawing large currents from the USB power.

1. What you will need…
  • Raspberry Pi, with Wheezy
  • Internet Connection (via the ethernet port to begin with)
  • WiFi network to test on
  • USB WiFi Dongle, either of the below work:
2. Update the OS

There are so many times you will run into a bug when installing something new and find out that it would have worked if your system was up to date, taking no risks here so get your system updated

sudo apt-get update
sudo apt-get upgrade

Due to the RAM/CPU power on the Pi’s, this might take a while, brew anyone?
;

3. Reboot

Power down the device, install your WiFi USB module and turn it back on.

4. Setup the interface configuration
sudo nano /etc/network/interfaces

Normally your base configuration will look something like this

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Assuming you have a DHCP server on your LAN (normally your DSL/Cable router) use the following configuration, your SSID and password will be put in the wpa_supplicant.conf later on in this guide.

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

If you don’t have a DHCP server, or if you want to just statically assign the IP address you can use the following, however update the IP, Netmask and Gateway to match your network.

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
5. Setup the WPA configuration

Finally you will want to edit the WPA configuration as below, don’t forget to update it for your SSID and WPA password!

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="SSID-GOES-HERE"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="WIFI-PASSWORD-GOES-HERE"
}
6. Final Reboot

Ok that should be it, do a final reboot remove the wired ethernet cable and your IP should automatically come onto the network as a normal WiFi device.


Problems?

First

This device should work out of the box, if for any reason it doesn’t you will want to do the following:

sudo wget http://dl.dropbox.com/u/80256631/install-rtl8188cus-latest.sh -O /boot/install-rtl8188cus-latest.sh
sudo /boot/install-rtl8188cus-latest.sh

Now go back to step 3 and try again.

Second

Run the below command, you should see your WiFi device there? If not there could be an issue with the hardware, try it in another PC…

lsusb

You should see a line that looks like this:

Bus 001 Device 005: ID 0bda:8189 Realtek Semiconductor Corp. RTL8187B Wireless 802.11g Network adapter.
Still got issues?

Leave a comment and i’ll get back to you 🙂

Dec
21

Although the Raspberry Pi comes with a HDMI port most projects are ‘head’ less (without a display), this means you spend a lot of time using either VNC or SSH to access the operating system, if it’s the latter you will normally get the most basic and boring login banner, this login banner is your MOTD (Message of the day, Linux term).

Theres a great post on the Raspberry PI forums, where someone has created the below dynamic banner for each time that you login.

rasplogin

Hopefully one day this might get included into the standard operating system, if you can’t wait like me it’s fairly simple to get it installed.

Note; See the comments for some tips on a better place to put this script

First you need to edit your profile:

sudo nano /home/pi/.bash_profile

Then just past in the code below, anywhere within that file:

let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
let secs=$((${upSeconds}%60))
let mins=$((${upSeconds}/60%60))
let hours=$((${upSeconds}/3600%24))
let days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`

# get the load averages
read one five fifteen rest < /proc/loadavg

echo "$(tput setaf 2)
.~~.   .~~.    `date +"%A, %e %B %Y, %r"`
'. \ ' ' / .'   `uname -srmo`$(tput setaf 1)
.~ .~~~..~.
: .~.'~'.~. :   Uptime.............: ${UPTIME}
~ (   ) (   ) ~  Memory.............: `cat /proc/meminfo | grep MemFree | awk {'print $2'}`kB (Free) / `cat /proc/meminfo | grep MemTotal | awk {'print $2'}`kB (Total)
( : '~'.~.'~' : ) Load Averages......: ${one}, ${five}, ${fifteen} (1, 5, 15 min)
~ .~ (   ) ~. ~  Running Processes..: `ps ax | wc -l | tr -d " "`
(  : '~' :  )   IP Addresses.......: `/sbin/ifconfig eth0 | /bin/grep "inet addr" | /usr/bin/cut -d ":" -f 2 | /usr/bin/cut -d " " -f 1` and `wget -q -O - http://icanhazip.com/ | tail`
'~ .~~~. ~'    Weather............: `curl -s "http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=EUR|UK|UK001|NAILSEA|" | sed -n '/Currently:/ s/.*: \(.*\): \([0-9]*\)\([CF]\).*/\2°\3, \1/p'`
'~'
$(tput sgr0)"

Source: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=23440

Dec
03

So my Raspberry Pi came a few months ago and I have been thinking of projects to use it for, I am still not 100% sure however I have made quite a big list of other projects for some inspiration, which I have included below.

If you have any ideas that I have missed off please leave a comment, and I will update this post!

I have some other posts on Raspberry PI’s

Please follow me on twitter (@ThePingBin), we will tweet when this page is updated!

RaspberryPi-WebServer RaspberryPi-HomeAutomation RaspberryPI-Bittorrent RaspberryPi-WebCam
Web Server Home Automation BitTorrent Server Web Cam Server
RaspberryPi-WeatherStation Raspberry-Pi-Tank  Pi-Quad-Copter RasberryPi-VoIP PBX Asterisk
Weather Station Make a cool Tank QuadCopter VoIP PBX
RaspberryPi-XMBC RaspberryPi-AudioBook RaspberryPi-Arduino
RasberryPi-NAS Server
Media Server XMBC Audio Book Player Arduino Shields NAS Server
time-machine-shot RaspberryPi-Tor-Realy  Raspberry-pi-VPN pi-gps
Apple Time Machine support Tor Relay, be careful! Home VPN Server GPS Tracker, with 3G!
advice Raspberry_PI-Analog Input  Pi-Super-Computer RaspberryPi-Kindel Screen
Advice Machine, useless but cool! Analog Input Super Computer Kindle Screen
PIC-Programmer-RaspberryPi
PenTesting-RaspberryPi
RaspberryPi- Running-Android Raspberry-Pi-Traffic-Light

PIC Programmer PenTesting/Hacking Android anyone? Check your network status
SolarDataLogger-RaspberryPi RaspberryPiInTheSky RaspberryPi-Coffee-Machine RaspberryPI-BitCoin
Solar Data Logger Send me to space! Coffee  BitCoin Wallet
 RaspberryPi-WiFi
;
 
touch-screen-kiosk-icon
RasberryPi-NodeJs
Photo Frame? Give it WiFi OpenSource Kiosk Node JS
traffic_feat 
 how-to-overclock-raspberry-pi-2
 FH3OQXTH8RVCY10.LARGE

control-raspberry-pi-with-an-iphone
Traffic Monitoring Overclock It! Personal Cloud on a Pi Control with an iPhone

wearable-raspberry-pi-goggles 
raspberry-pi-git  
raspberry-pi-html5-canvas
 
raspberry-pi-print-server
Wearable Computer Git Server HTML5 Canvas Print Server for IOS
retro mail-server IMG_1050 beetbox
RetroArch on the PI Mail Server Mini Arcade Cab Beet Box… Strange!

Any other ideas? Leave a comment below.

Also, I have some other posts on Raspberry PI’s

 

Jul
31

Munin is a great open source tool for graphing performance metrics (amongst other things) of your linux hardware.

It’s not the most intuitive of tools to use and some others like cacti might be a bit easier on the eyes, however the functionality is great and the application is fairly light weight which really helps on this hardware.

Also there are a great selection of graphs created by default for your device such as; CPU Load, Memory Usage, Disk Usage, Disk Latency, Network Throughput, Network Errors,

To all munin installs there are two seperate programs:

  • Munin – The server that does all the graphing and polling of your nodes
  • Munin-Node – The agent installed on your server(s) that you want to graph data from.

Installing Munin-Node

Ok so on my raspberry pi I want to install the munin-node, I already have a munin server so there isn’t really a need to install that again.

apt-get install munin-node

Ok so that’s the software installed, now to configure…

nano /etc/munin/munin-node.conf

Now enter the following line into the file, where the IP address is of your central ‘munin’ server that will be polling this device.

allow ^10.10.10.10$

To apply your configuration reboot the munin-node service on the raspberry pi

sudo service munin-node restart

Now go to your munin server and in the configuration add a reference to your raspberry pi:

Note; if you don’t have a munin server please read this guide.

/etc/munin/munin.conf
[RaspberryPi.mydomain]
    address 22.22.22.22
    use_node_name yes

That should be it, wait 5min for the next poll to come around and you should have some graphs.

Our Sponsors