January 31, 2009

Google: We’re not evil? (Oops. Actually, we are. And so is everybody else)

Category: Funny, Meta — em @ 16:14

While searching Google today, I noticed something peculiar about the search results I was getting. Seems that Google’s safe search facility went on the blink. Unfortunately, it would also appear that while the safe search facility is unresponsive, the net result is that every single search result that Google provides is (tada) marked as ‘this site may harm your computer’.

Extremely useful heuristic there, Google peoples. Sure, we all get days when we figure that everybody’s out to get us… but according to what happens when I search for ‘Google’ it appears that you’re out to get us, too. And you’re even willing to admit it :-(


bbc-from-googlebrokengoogle1

brokengoogle2brokengoogle3

August 9, 2008

Usability? Why?

Category: Uncategorized — Administrator @ 23:21

Demonstrating once again the basic principles behind camouflage clothing, here is an example of poor usability, this time from Virtuoso:

Usability Problem with Virtuoso

Task: You are trying to create a new user. Where should you click?

April 1, 2008

Jarre Concert in Birmingham

Category: Music — ArTourter @ 17:41

I know I am hijacking Em’s Blog but we were there together and it was with her phone that I took these shots. Not any good by any stretch of the imagination, but great memories anyway.

Click to continue reading “Jarre Concert in Birmingham”

March 31, 2008

Gaiman on Windows Vista

Category: Opinion — em @ 17:31

From Neil Gaiman’s blog:

Sitting in an airport, getting really sick of Windows Vista on a laptop. It doesn’t work — I’m tired of waiting seconds for things to appear on the screen, of taking half a minute or more for something that ought to happen instantly to occur. The poor computer obviously can’t run Vista, and shouldn’t have been Vista certified, and the author isn’t impressed with the way that a number of things that were easy in XP have got harder, nor with the fact it took most of a day for Vista to run a search on the hard disk to find a mislaid introduction I was working on, nor with its refusal to read or copy a bunch of files on a DVD Dave McKean burned for me (I wound up dragging them from the DVD to one of Dave’s macbooks, from there to my iPod and from my iPod to the computer).
Have any of your readers suggested cures or workarounds for the Vista problem you describe in the 3-27 blog (sluggish text)? If so, please share — many of us have the same problem.
A few people have written in to suggest I get extra memory, and I might, but I’m more likely to either a) say sod it and get an Airbook. It’s heavier than the Panasonic W7 and doesn’t have a disk drive, but it has a nice operating system that works or b) keep the computer and wander over to Linux Ubuntu.
My other solution is to warn the many people who read this blog that they may want to avoid Windows Vista.

Seeing this made me smile, because my lovely new Lenovo tablet came with Windows Vista and, whilst I like the handwriting recognition, there turned out to be really nothing else to recommend the experience. True, I was planning on putting Linux on the thing eventually anyway, but the handwriting recognition was good enough that all other things being equal, I might have at least decided to keep the system dual-bootable. But there were all those other issues, such as DRM that stands on your toes when you least expect it, usually when you’re doing something that is both legal and techie, and yes, the extreme slowness of Windows Vista. Put it on high-performance mode and your battery life drops to nil. Put it on low power consumption and Vista will lose all hint of responsiveness. If you click on something you may as well pop off for a nice cup of tea because you will have the time to boil the kettle before anything happens. And it constantly churns the hard disk. All this on a tablet that is of course not the fastest device currently available, but is Vista certified. I’ve tried various suggestions and had modest success in removing some of the slowness at boot, but it still ties itself in knots regularly enough to be a problem.

I won’t be buying an Air unless I receive valid documented evidence that hell has frozen over. That’s for various reasons to do with battery life (oh, come on, non-user-replaceable battery?), lightness, ruggedness - if that is a word, and I’ m not convinced it is - the absolute necessity of lots of different ports and whatnots in doing all things electronic, and the feel of Lenovo/IBM keyboards. But it does feel better to know that unbiased individuals have given up on Vista too.

March 30, 2008

Note to self: Transferring files to gumstix via serial/rz/kermit

Category: Gumstix — em @ 21:21

This is really simple, but it took a bit of fiddling to work it out. Obviously the bootloader lets one copy files across (that being one means of copying across filesystems and so forth) but I didn’t know how to do this once linux was booted. It turns out to be this simple:

When connected to the serial console/ffuart via ckermit, go to the directory where you want the file. Type:

rz

You will see some bizarre characters appear. Ignore it. Type ctrl-shift-\, or is it ctrl-shift-|, and then ‘?’. Type U to disconnect. Then type:

set protocol zmodem

Then:

send whatever-the-filename-is.ext

Type ‘c’ to reconnect. Hopefully when you then type ‘ls’ you will see the file you just uploaded sitting in the working directory.

The full session will look something like this:

root@gumstix-custom-connex:~$ pwd
/home/root
root@gumstix-custom-connex:~$ rz
rz waiting to receive.**▒B0100000023be50
----------------------------------------------------
Press:
C to return to localhost
? or H for this message
0 (zero) to send the NUL (0) character
B to send a BREAK signal (0.275sec)
L to send a Long BREAK (1.5sec)
U to hangup and close the connection
Q to hangup and quit Kermit
S for status
! to push to local shell
Z to suspend
\ backslash code:
\nnn decimal character code
\Onnn octal character code
\Xhh hexadecimal character code;
terminate with Carriage Return.
Type the escape character again to send the escape character itself,
or press the space-bar to resume the CONNECT session.
Press a key>U
----------------------------------------------------
Hanging up (Back at localhost)
----------------------------------------------------
(/home/em/ckermit/) C-Kermit>set protocol zmodem
(/home/em/ckermit/) C-Kermit>send filename.ext
Sending: filename.ext
Bytes Sent: 7296 BPS:2554
Sending:
Ymodem sectors/kbytes sent: 0/ 0k
Transfer complete
(/home/em/ckermit/) C-Kermit>c
Connecting to /dev/ttyUSB0, speed 115200
Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
root@gumstix-custom-connex:~$ ls
filename.ext

Audiostix2, brec and arecord

Category: Gumstix — em @ 21:13

Brec seems to have gone out of fashion since the good old days of buildroot, so I’m assuming it’s all about arecord now.

Users of openembedded can get hold of the package containing arecord by looking through the Packages.gz file (http://www.gumstix.net/feeds/current/glibc/ipk/armv5te/Packages.gz) and pulling out the filename link:


ackage: alsa-utils-aplay
Version: 1.0.14-r1
Depends: libasound2 (>= 1.0.14), libc6 (>= 2.5), libgcc1 (>= 4.1.2)
Section: console/utils
Architecture: armv5te
Maintainer: Angstrom Developers
MD5Sum: c99cfb0f230ce0a963740bb099d32e89
Filename: alsa-utils-aplay_1.0.14-r1_armv5te.ipk
Source: ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.0.14.tar.bz2 file://alsa-utils-automake.p
atch;patch=1
Description: play (and record) sound files via ALSA

Get the alsa-utils-aplay_1.0.14-etc.ipk, or use bitbake to build it, copy it to your Gumstix, and ipkg install it. Those who have actually set up their Gumstix to access the net directly can of course use ipkg as it is designed to be used, instead of cheating :-P

Once installed, type arecord to record. If one also installs lame, it is possible to do something like this:

arecord -d 5 | lame - test.mp3

to record direct to MP3. Not sure how effective any of this is, as I have not yet found a microphone…! Edit: just remembered that earphones make lousy but effective enough microphones. It works, except that the default record mode for arecord causes nasty, choppy sound. This is better:

arecord -d 5 -f cd test.wav

However this produces too much data to sanely encode it realtime into mp3. Something like: arecord -c 1 -d 5 -f S16_LE -r 22050 test.wav produces a slightly more managable filesize, but even so you’re probably better off producing the wav and then mp3ing it at some quiet moment.

March 25, 2008

I2C on the Gumstix/Robostix

Category: Gumstix, Hackery — em @ 02:30

…really is as simple as they say it is. I know, it shouldn’t come as much of a shock but I guess all that buildroot fun in ages past has caused me to expect complexity where there is none.

I started with the Dallas 1307 RTC from Sparkfun — but as an aside, you can get them from Tinker.it in the UK now, which I hilariously noticed almost five minutes after opening a letter from customs reclaiming a load of tax that FedEx kindly paid at the border. As a further aside, UPS ought to take lessons from the way FedEx handle import charges. When I order Gumstix, the UPS guys just turn up at the door demanding cash on delivery, which is just plain uncouth since it means I can’t get them to deliver at the university front desk unless they’ve already failed delivery once, at which point they generally leave something saying what I owe them so that I can phone them up and pay it by credit card, the fiends. And they charge a higher fee. The fiends. Anyway, as Wooster would say, back to the res.

The classic example I2C device given on the wiki is in fact this very same device, so there is no reason to have expected any complications.

And there weren’t any. Connect the robostix to the RTC module as follows:

Robostix UARTS:

pin 16 (I2C SCL) -> SCL
pin 15 (GND) -> GND
pin 14 (+5V) -> 5V
pin 12 (I2C SDA) -> SDA

Let’s try it:

root@gumstix-custom-basix:~$ i2c –count=8 0×68 readbyte 0
0×0955000325030800
What this means:

Receive 8 bytes from the I2C bus at address 0×68

Read in this order: Second, minute, hour, weekday, day, month, year, control byte. Hence, I tested this on the 25-03-08 (a Tuesday) at 00:55:09 in the morning. Now, the problem that one is probably trying to solve by connecting an RTC at all is setting the system date, which you do manually like this:

root@gumstix-custom-basix:~$ date -s 032501092008
Tue Mar 25 01:09:00 UTC 2008
The order: Month, day, hour, minute, century and year.

The following script is a fugly five-minute hack, and if you have any time to spare you will do it properly and get a kernel that is able to read this clock directly. If you are instead in need of a fugly five-minute hack:

#!/bin/sh

#get value from RTC
datetime=`i2c –count=8 0×68 readbyte 0`

second=`echo $datetime| awk ‘{split ($0, a, “”); print a[3] a[4]}’`
minute=`echo $datetime| awk ‘{split ($0, a, “”); print a[5] a[6]}’`
hour=`echo $datetime| awk ‘{split ($0, a, “”); print a[7] a[8]}’`
day=`echo $datetime| awk ‘{split ($0, a, “”); print a[11] a[12] }’`
month=`echo $datetime| awk ‘{split ($0, a, “”); print a[13] a[14] }’`
shortyear=`echo $datetime| awk ‘{split ($0, a, “”); print a[15] a[16] }’`
year=”20$shortyear”

echo “RTC: $hour:$minute:$second $day-$month-$year”

# example of date format: date -s 032501092008
# Set date:
datearg=$month$day$hour$minute$year;
date -s $datearg

March 22, 2008

Robostix and OpenEmbedded: talking to the Gumstix

Category: Gumstix — em @ 00:13

If you are using OpenEmbedded instead of buildroot to build your gumstix’s software, then some of the documentation will look a touch outdated. The following is not necessarily guaranteed to be globally true, but works for me. The robostix modules and whatnot are in

Your Home Dir /gumstix/gumstix-oe/tmp/work/gumstix-custom-connex- angstrom-linux-gnueabi/robostix-module-1.0[whatever]/install/robostix- module/

Place them on your Gumstix in the indicated subdirectory. Don’t forget to edit /lib/modules/2.6.21/modules.dep and add the robostix.ko filename and path to it, since otherwise modprobe will not see it.

modprobe robostix to load it.

You will also be wanting the robostix command line program, that appears in your buildroot under

Home Dir/gumstix/gumstix-oe/tmp/work/armv5te-angstrom- linux-gnueabi/robostix-cmdline-1.0-r1/install/robostix- cmdline/usr/bin/robostix

The robostix is initially held in ‘reset’ mode by the gumstix. This is not a problem that needs to be fixed in hardware - it’s one of those things that you can fix by manipulating ‘GPIOs’, which incidentally are general-purpose input-output lines, which is to say, i/o wires. To turn it on, once you have installed these programs onto your gumstix, type:

robostix reset off
and Bob is your metaphorical uncle.

Alternatively take a look at the settings in the robostix /etc/init.d/robostix file:

echo “Starting robostix…”

# Make sure ttyS2 is setup
echo “AF2 in” > /proc/gpio/GPIO46
echo “AF1 out” > /proc/gpio/GPIO47

# Turn on the robostix ‘245
echo “GPIO out clear” > /proc/gpio/GPIO72

# Turn on the robostix Power
echo “GPIO out set” > /proc/gpio/GPIO70

# load driver
/sbin/modprobe robostix

# Take the robostix out of reset
echo “GPIO out set” > /proc/gpio/GPIO73
That is, basically, tell the gumstix to stop resetting the robostix and let it do its own thing.

Whatever program was installed on your robostix (say, LED flashing) should suddenly start functioning at this point. To stop it again, robostix reset on (it’s even intuitive).

To get all this to autostart symlink /etc/init.d/robostix to something like /etc/rcS.d/S97robostix

Or better still, read http://docwiki.gumstix.org/Robostix_gumstix_ISP#Installing_Driver_and_Command_Line_Tool_Permanently on the gumstix wiki

If some or all of these files don’t seem to be present in your OpenEmbedded folder that is probably because your configuration doesn’t include them. Check out .gumstix/gumstix-oe/com.gumstix.collection/conf/machine/gumstix-custom-connex.conf
assuming that is you have a connex.

The operative part is:

# if you enable robostix you will need to disable both “lcd” and “touchscreen” features
MACHINE_FEATURES += “robostix”

#MACHINE_FEATURES += “lcd”
#MACHINE_FEATURES += “touchscreen”

(If you’re using a standard openembedded binary you will have to remove these modules - anything that looks like it’s about touch screen and lcd).

Now assuming that part of the point of all of this was to have the robostix speak to the gumstix, you’ll need a few things. First, you’ll need the right jumpers, as shown here: http://docwiki.gumstix.org/Robostix_gumstix_ISP. That is, Atmel 0 Tx to PXA ST Rx and Atmel 0 Rx to PXA ST Tx. Which is to say, connecting the business ends of the AVR’s UART (ttl-level serial) to the business end of the gumstix’s UART.
Second, you’ll need to install a test such as the flash_led program, flash-led.c that writes to the UART on the robostix. Do this by flashing the AVR via the ten-pin ISP socket. REMEMBER TO REMOVE THE GUMSTIX FIRST. Then, do this:

#!/bin/sh
echo “AF2 in” > /proc/gpio/GPIO46
echo “AF1 out” > /proc/gpio/GPIO47

Set the speed to 38400, because otherwise you get the textual equivalent of technicolour gibberish:

stty 38400 < /dev/ttyS2

and

cat /dev/ttyS2

You should see:

Read: ‘ ‘
*** Press a key to continue
*** Continuing…
etc.
Or try: echo “zzzzzzzzzzzzzz”> /dev/ttyS2; more /dev/ttyS2

…which returns

‘Read: ‘z’
Read: ‘z’
Read: ‘z’
…’

Congratulations. You are now talking to your AVR. The dialogue may not be much, but hey :-)

March 21, 2008

Viewing Gumstix output (FFUART) via the robostix

Category: Gumstix — em @ 22:50

This is another one of those memo to self posts. Sorry, but if I fail to write down things like pinouts then I am doomed to have to trawl back through the Gumstix wiki the very next time it seems like a good idea.

In short, I got one of these handy FTDI TTL to USB (serial) cables, with a six-pin female header.

  • Pin 1 of the robostix header (GND) goes to pin 1 of the TTL header (black cable: GND),
  • pin 2 of the robostix header (TXD) to pin 5 of the TTL header (orange cable: RXD),
  • and pin 4 of the robostix header (RXD) to pin 4 of the TTL header (yellow cable: TXD).

I did NOT plug in pin 3 of the robostix header to pin 3 of the TTL header, because pin 3 of the TTL header is a VCC supply.Robostix pinout:

1 - GND
2 - TXD
3 - VCC
4 - RXD

smallimage.jpg

Screenshot:
smallimage2.jpg

Edit to add: the FTDI cable is recognised on Linux as a USB serial port (/dev/ttyUSBn). To view the FFUART (Gumstix console) output and to write to it, connect to the relevant port using ckermit. This doesn’t come as default, at least on Slackware 12; just download and compile it from here.

It is possible to automate the process of configuring ckermit with a script like this one (which I think I got from the Gumstix wiki):

#!./ckermit +
kermit -l /dev/ttyUSB0
set speed 115200
set reliable
fast
set carrier-watch off
set flow-control none
set prefixing all
set file type bin
set rec pack 4096
set send pack 4096
set window 5
connect

A minor advantage of this approach, incidentally: because Vcc is not required, the boot prompt appears without any need to mess around with patch wires and things - which the Gumstix wiki suggests is necessary to use a TTL converter that is powered from the robostix’s Vcc…

March 20, 2008

NKC Serial Freeduino board issues…

Category: Hackery — em @ 04:28

I bought one of these because of the serial interface. The logic: I want to talk to gumstix; gumstix like RS232 but aren’t so uniformly convinced about USB host. There are several options, of which I tried three this week: AVR plus TTL-RS232 conversion, i2c between robostix and gumstix, RS232-speaking Freeduino.

Anyway, to the point: these Freeduino boards seem to have occasional problems. This particular kit doesn’t seem to auto-reset successfully and also seems capable of confusing itself in the attempt, though aside from that it does work. Installing the Adaboot bootloader directly via an AVR ISP programmer has partly fixed this issue for me. If I press down reset for a good long time and then tell the Arduino software to upload a sketch while simultaneously letting go of the button, standing on one foot and humming the chorus of ‘Waltzing Matilda’, it generally does successfully write the sketch. Auto-reset just plain won’t behave, but if it is manually reset, run at 19200 and treated as an Arduino NG in the Arduino software (version 0010 here), it currently seems to behave more or less as expected. However, programming fails so often and is so touchy that you would always want to have an in system programmer ready at hand to rewrite the bootloader when, for whatever reason, it all breaks. The thing is that there are many possible reasons for these issues. Maybe my usb to serial conversion cable is a bit touchy. Maybe one of the components is a touch on the dodgy side. Maybe it’s user error…
But if you don’t have a great reason to go for a serial board right now but do need serial, you might want to wait for something like the version described in this thread; a Freeduino with Max232 or equivalent. Wikibooks has a great explanation of what all this means. This particular Freeduino uses a couple of transistors to get the same sort of effect. If there is no pressing need to use serial, USB Arduinos seem to work like a charm. Or an AVR on a lump of veroboard with an oscillator, a couple of capacitors, a few resistors on appropriate pins, an ISP header, a voltage regulator and a TTL converter - a.k.a. a homebuilt Arduino :-)