just another web log

17 Mar 2013:
Raspberry Pi spreads out on SD TV RCA
As I have mentioned before we do not have a HDTV to plug the Raspberry Pi into, which is fine for RasMBC.
RasMBC also has a decent display setup meaning I could centre and resize the screen to fill the entire TV, but the standard Raspbian does not and the LXPanel desktop window manager just fails if you try and setup the 'Monitor'.
This means both the Desktop and the CLI boot tty is pretty unusable, with the prompt lost to the left hand side of the screen and no menu and hardly any buttons on the Desktop.
A solution does exist, but I only found it after fixing my problem with Minecraft Pi. There are extras settings for Top,Bottom,Left and Right overscan.
sudo vi /boot/config.txt
After a lot of playing about by SD TV needs

and I could have sworn that I had those number almost right, changed one parameter and then had to fiddle them all to get back to something sensible.
Annoyingly each change required a reboot and to start up X11, which was a pain because the my USB mouse dies each time X11 starts, fix is to unplug and replug.
14 Mar 2013:
Cory Doctorow and the Seven trials
I thought I would finally provide the Cory Doctorow book reviews I promised last year, mainly because the the pile of seven books seems to take over.
The pile is only there to remind me to post the reviews, afterwards they go into storage ... ready for the next generation.

I think this was the order I read them, not that its important, what is note worthy is I bought most of them for £0.01 (+P&P)from Amazon You can download all of them for free from his website in various ebook/etext formats.

I actually read this on my phone on my daily commute, but also bought the paperback version, cannot remember in what order.
Makers is all about reusing, initially technology that has been cast away and then 3D printers that can even print 3D printers.
This subject is very close to my heart and I long to understand enough about electronics to be able to tip out the huge collection of odds and ends, motors and sensors, chips and wires I have accumulated over the last ten+ years.
The story is well woven and highly readable I love the way it evolves from mucking about with electronics and sell the odd item on eBay to creating a movement that Disney want to get in one.

Down & Out in the Magic Kingdom
This one is harder to summarise, there are virtual consciousnesses, rival gangs, murder(ish) and whuffie.
whuffie became a recognised thing, but had died now.
Not as good as some of his others, but still worth a read.

Someone Comes to Town, Someone Leaves Town
This is amazing, there are mountains, a winged love interest, golems, washing machines, brothers who ingest each other and so much more.
Oh and by the way they are the main characters, yes all of them, including the mountain and the washing machine. Yet somehow it all comes together into a highly readable adventure that you can not predict.
So recommended.

Little Brother
This one is true cyber punk, there is technology coming out of everything, but yet there is heart humanity and a possibility of a terrible dystopian future.
Aimed at young adults, this a thrill ride fun read.

Not fiction, but a collection of essays regarding copyright and freedom of information.
As mentioned previously this is a true *YOU MUST READ THIS BOOK* title, please for love of everything decent read this book and then get everyone on the planet to do the same.

Eastern Standard Tribe
This is the most forgettable of the collection. I remember snippets, like the transfer of of songs when you drive by other vehicles and the economics that go with that, or the sanatorium roof.
I remember thinking it was good...<shrug />

For The Win
This book is really really well written, highly imaginative with lots of plot, story, characters and locations. I wonderfully blend of Asian and American cultures within cyberspace and out in the real world. From the prison type factories to the WOW grinders and gold farmers, to police brutality and gang warfare.
Recommend and recommended again.

I got Pirate Cinema from a Humble Bundle of ebooks and graphic novels. Not sure when I will read it. Currently trying to find time to read Flatland which was originally printed in 1884.

12 Mar 2013:
Magic stairs in the land of Raspberry Pi Minecraft
Raspberry Pi Minecraft.

I wanted to show my oldest that you could do programming on the Raspberry Pi and I know how much he loved playing Minecraft on the iPad. Not in survival mode but just creating his own house adding doors, paintings, bridges etc.
Minecraft Pi is available for free download so I thought I would give it a whirl.
Step one download and install
Then run it, oh the mouse has stopped working after selecting a game from the menu ...
Keyboard still works and nothing else is running, ESCping back to the menu shows the mouse working fine ...
After many hours of digging I hit on a tiny foot note at the bottom of a post about the screen being misaligned, which it was.
So it is all because we do not have an HDTV!!
Still, after disabling overscan I now cannot read the terminal prompt but Minecraft runs fine.
Next job, find out how to program in Minecraft ... go to http://pi.minecraft.net/ and follow the links "get started", "official site" and "dedicated wiki".
But, alas no, those are generic links to the Raspberry Pi standard web pages, nothing about programming Minecraft.
There are a few blog posts so I started with the headline catcher "Analog clock in Minecraft Pi".
I expected a in game console window like in quake '~' anyone? but instead you run python scripts that "connect" to running Minecraft sessions.
Being as this a low resolution non-HDMI setup this proved quite problematic, I could run Minecraft or a terminal window, not both, ALT+TAB did nothing.
I did find a way of moving to the second desktop with ALT+TAB(nothing visual changed but then I could) CTRL+ALT+[Right arrow], this gave a me a clean desktop which I could run terminal.
Now the trick was to run the python scripts and then switch back to desktop one to watch the fun, CTRL+ALT+[Left arrow].
After getting Hide and seek (hides a block and then tells you if you are warmer or colder trying to find it and finally the API demo which shows examples of most type of commands, add, delete, change, move, wait, print etc.
Now I needed a mini project I could work on with the boy...
In the end we opted for a simple staircase routine, move forward, move up, add brick, rinse repeat, instant staircase reaching for the sky.
#Raspberry Pi, Minecraft Stairs
# By Alex Davis 2013/03/11

import minecraft.minecraft as minecraft
import minecraft.block as block
import time

if __name__ == "__main__":
    mc = minecraft.Minecraft.create()
    mc.postToChat("Hi, Welcome to Alex's Stairs ")
    playerPos = mc.player.getPos()
    stairsPos = minecraft.Vec3(int(playerPos.x), int(playerPos.y), int(playerPos.z))

    for up in range(0, 50):
    stairsPos.y = stairsPos.y + 1
    stairsPos.x = stairsPos.x + 1
        mc.setBlock(stairsPos.x, stairsPos.y , stairsPos.z, block.DIAMOND_BLOCK)

    mc.postToChat("Your staircase is finished, enjoy")

screen shot of the stairs script run in Raspberry Pi Minecraft
FYI I tried scrot and import to take the above screenshot but both returned black rectangle where Minecraft was.
now for our next project...
05 Mar 2013:
Cheap USB temp sensor for Raspberry Pi graphing CSV
I had heard some bad stories about ordering cheap USB devices from China on eBay but for £4 inc P&P I would take the risk.
To my surprise the package came just 4 days later...
Plugged it in and using dmesg found the id of the device New USB device found, idVendor=0c45, idProduct=7401 which I could then Google on.
Found lots, but settled on
http://bitplane.net/2012/01/temper1-ubuntu/ as it seemed to be the simplest requiring no dependencies.
Other candidates included
How easy you ask...
git clone https://github.com/bitplane/temper.git
cd temper/
sudo ./temper

05-Mar-2013 22:21,25.253262
And there is a handy continuous logging script.
sudo ./log.sh | tee templog.csv
(tee echos the output and also saves it to a file, 'T' for T-Junction).

Strange thing was the temperatures being recorded seemed rather high, normally 8-10 degrees more than I expected (gauging from the central heating panel in the hall).
This went on for a couple of days, was the USB gadget faulty, or even fake ?
No, the Raspberry Pi was running about 10 degrees hotter than the ambient temperature and the USB temperature logger was acting like a heat sink!
Unplugged it, added a short USB cable (30cm) and the logged temperatures are back to what I expect and the logger is cool to the touch.
So how to view all this temperature data ?
One of the previous temperature logging drivers/apps had a detailed explanation of using the csv data to power a GNUPlot graph.
GNUPlot is designed to be the single point of focus for any kind of graph you can imagine, from basic line, bar and scatter to 3D, recursive and Fractal 3D.
This in turn means that it is not the easiest of things to start with. After numerous attempts I finally created a .GP script that works with the files created earlier.

#set terminal png size 1200,800
set term png size 1200,800 enhanced font '/usr/share/fonts/liberation-fonts/LiberationSans-Regular.ttf' 12
set xdata time
set timefmt "%d-%b-%Y %H:%M"
set output "room_temp.png"
# time range must be in same format as data file
#set xrange ["29-Jan-2013 00:00":"20-Feb-2013 00:00"]
#set yrange [0:50]
set grid
set xlabel "Time"
set ylabel "Temp"
set title "Room Temp"
set key left box
set datafile separator ","
plot "templog.csv" using 1:2 title "Office Temp" #with lines

(note the xrange and yrange are optional)
Now I have a room_temp.png which looks like
temperature graph from GNUPlot
This was directly after I attached the USB cable and you can see the temperature plummet as it cools, away from the Raspberry Pi The two dips are when the window was open. The trick will be to track trends...

loading results, please wait loading animateloading animateloading animate
[More tags]
rss feed



flog archives

This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk
In fact I'm not responsible for anything ever, so there!

[Pay4Foss banner long]