Saturday, February 9, 2013

Debug the teapot - Enabling the 418 return code

I have found a simple a way to correct the lack of 418 return code.
There are php commands to control the return code in the header.

But to use it I first had to install PHP for my lighttpd server with this command:
"sudo apt-get install lighttpd php5-cgi"

After that I had to enable it in the server with these 2 commands
"sudo lighty-enable-mod fastcgi" "sudo lighty-enable-mod fastcgi-php"

After that I have renamed my index.html for index.php and then I have added this PHP code to my page.
"<?php
header("I'm a teapot!", true, 418);
?>"

Here is the result in the Firefox debuging console


Thursday, January 31, 2013

Raspberry Pi power consumption - One month after


Here is the end of January  As promised, I'll do a checkpoint about my Raspberry pi power consumption.

My consometer measured a total power consumption of 1,8 kWh, this is absolutely very low.

I'll do another measure in two month for confirmation.




Crédit photo: M. G. Loppé [Public domain], via Wikimedia Commons

Sunday, January 20, 2013

A bug on the teapot - Firefox Debugging tools



I received an email from a visitor telling me there is a bug on the site of my teapot.
In summary, he told me that the debugger says him that my teapot it returns him a code 200 instead of a 418 code.

But how to check the presence of this bug by myself? I explored the development tools in the Firefox menu to find the option "Web Developer / Web Console".




This tool displays some technical informations about the current page in a banner that appears at the bottom (remember to refresh the page if nothing is displayed)




Indeed, the return code 200 is the code sent after a HTTP request accepted by the server. My teapot hosting a web server, it returns this return code when you visit my page.

It is also noticed traces of my usage of Google Analytics with this tool.

Now that I'm aware of this failure, I'll try to find a way to return a true 418 code in a future post.

Sunday, January 6, 2013

Raspberry Pi power consumption - One week after

Here is a first checkpoint about the power consumption of my Raspberry Pi.
Today, after one week of measuring my powermeter announces a total consumption of 0.4 kWh.
Given the low power consumption and the poor accuracy of the tool, I'll do the next measure at the end of the month.




Credit photo: Thomas Bresson (originally posted to Flickr as Eclair) [CC-BY-2.0 (http://creativecommons.org/licenses/by/2.0)], via Wikimedia Commons





Tuesday, January 1, 2013

Raspberry Pi power consumption

To start the new year, I decided to look at the power consumption of the project.

I found a power meter in my stuffs, which is probably not very accurate, but should allow me to give an idea of what consumes and costs my Raspberry Pi. I want to take into account the conversion from 240 Volts to 5 Volts.
My power meter is the MPM 50 model of brand IDK.

Due to the low consumption of Rasperry Pi, it is possible that the power meter consumption is significant. According to the manual it consumes less than 2 watts.

The experiment just started, so I have didn't accumulated cumulative consumption yet, but here are the first informations on the instantaneous data given by the device:
237 Volts
0,02 Ampères
2,5 Watts

For your information, the regulated tariff for electricity from EDF (Electricité de France) is € 0.0812 per kWh excluding taxes and € 0.1249 per kWh including taxes.

I'll try to give regular updates on measured consumption.

Tuesday, December 18, 2012

Looking for a good power adapter


As my server works 24/7, I spent a bit of time to find a good power supply for my Raspberry Pi

Recommendations for the Raspberry Pi are to use an 5V 700mA USB power adapter .

So I checked my stuff for what USB chargers I already had. I found several alimentions 500mA and 1000mA. They all work with my Raspberry Pi, but I feel these alimentations become too hot after a long usage.

So I started looking for a bit more powerful adapter, thinking that an over-sized power adapter should help to reduce heating and improve the life of the power adapter and of the Rasperry Pi

I found several chargers over 2000mA on the Internet, some with two USB ports, like this one, brand Bluestork:

Others with 1 USB port, like this one, brand Re-volt:


I have a preference for a model with one USB port, as some 2000mA models with 2 USB ports are in fact 2 x 1000mA

But ultimately, I chose this one, brand Apple:
€ 19.99 is a bit expensive for a power adapter, but it fits in the budget of the project. I found it in a local shop and I therefore saved shipping cost. In addition, the brand is well known, and I think I can benefit from the guarantee in case of problems.

After 2 days of usage, I feel this one a bit less hot than my older one.

Impact on the project: -19.90€

Monday, December 3, 2012

How to control the Raspberry Pi from Windows: Tight Vnc

TightVNC Home If the SSH console is not enough user friendly for you and if you want to remote control your Raspeberry Pi using a graphical user interface, VNC may be an good solution.

Install TightVNCServer
http://www.tightvnc.com/

TightVNCServer is a free and lightweight remote control software compatible with standard VNC software
The command to install it is:
"sudo apt-get install tightvncserver"

Start VNC server
To start the VNC Server from the Linux System, you have to execute this command:
"tightvncserver"

The system will ask you for a password (at least 6 caracters)

"You will require a password to access your desktops.

Password:
Verify:"


After that the software will ask you for an view-only password.
"Would you like to enter a view-only password (y/n)?"
You should answer no ("n") if you only need to control your system.

After that, your VNC will give you an X session number.
"New 'X' desktop is raspberrypi:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/raspberrypi:1.log"


Install TightVNCClient
You may use any VNC client, but why not continue with TightVNC?
You can download it here: http://www.tightvnc.com/download.php

When you install VNC, it may be a good idea to chose a custom installation if you don't need an VNC Server on your windows computer.




Use the VNC client 

To use VNC, you need to type the server adress and the session number.

The VNC client will ask for the password.

 Now you can use your Raspberry with the X interface.