harald

 

Gestern hat mein Sohnemann Hefeteigbrötchen gebacken um etwas über Hefe und Brot zu lernen. Ich habe etwas Hefeteil weggenommen und anstatt es im Ofen zu backen, in einen Topf mit Wasser gegeben um daraufs Germnknödel mit Vanillesosse zu machen. War lecker, aber etwas zu lange gekocht.

Egal, ich bin auf den Geschmack gekommen und möchte mehr von dem machen was meine Oma gekocht hat: Leckereien (viele aus Böhmen) wie:

Weia, ich kriech Hunger…

 

 
Rooting your Milestone 2

Without any good reason and no actual need and more for because-I-am-curious, I rooted my Milestone 2 (v2.3.4).

Instructions came mostly from here which pointed me into the right direction:

The actual commands I used were:
  1. Turn on the USB debugging on the Milestone: Settings/Applications/Development/USB Debugging must be checked
  2. Connect Milestone 2 via USB to my Linux machine
  3. Run “adb devices” as root. This starts the adb local server which connects to the phone via USB.
  4. adb push Exploit/zergRush /data/local/tmp
  5. adb shell
  6. cd /data/local/tmp
  7. chmod 777 zergRush
  8. ./zergRush
It’s fun to watch and in the end it said it has done its deed, and it closes the adb shell.
Back on the Linux machine:
  1. adb kill-server
  2. adb devices
  3. adb shell
and I had the # prompt in front of me. It’s that easy.
Now making it permanent:
  1. See what block device is used via: cat /proc/mounts
  2. In my case /system is mounted from /dev/block/mmcblk1p21
  3. mount -o remount,rw /dev/block/mmcblk1p21 /system
  4. exit
  5. adb push Dependencies/busybox /system/bin/busybox
  6. adb push Root/su-v2 /system/bin/su
  7. adb install Root/Superuser.apk
  8. adb shell
  9. chmod 4755 /system/bin/busybox
  10. chmod 4755 /system/bin/su
  11. mount -o remount,ro /dev/block/mmcblk1p21 /system
  12. exit
  13. adb reboot

The phone reboots here and it’s done. Next time I log in via “adb shell” I simply type “su” and I am root.

 

 
Programming AVRs - Part 2

I used to use the FT245R chip to program my AVRs but I was looking for something more comfortable. Like the Bus Pirate. Works great. No special configuration needed for avrdude. Simply say it’s using now a Bus Pirate and which USB port it shows at.

 

Update: It’s too slow, so I flashed the STK500v2 firmware, which means I tell avrdude I got an STK500v2. While it loses all the features of the real Bus Pirate, it’s magnitudes faster (and I have the AVR extended patches and updated the Bus Pirate firmware to 6.1, but it was still too slow for larger programs).

 
CrashPlan - Another attempt to do proper backups

As I wrote here I am using Wuala. I mostly like it. I don’t like not be anymore able to give away some storage space for others and in return be able to use other people’s storage space. It was a neat point of Wuala, but that was “fixed” last year, and then it’s either pay or stop using it (beside the small initial space everyone gets).

Welcome to CrashPlan. It’s quite similar compared to Wuala but with 2 differences which I like a lot:

  1. You can back up to your own disks or friends disks
  2. If you pay, it’s unlimited data and deleted files are kept

That sounds like a good deal, but with prices for 2TB disks (even after the disaster in Thailand) at about US$150, it probably works out fine for them.

I’ll have to test this a bit more, but so far, it looks like a good backup method. Time to upgrade our ADSL line…

PS: Picture taken from the Italian Wikipedia.

 

 
More 16 Segment LED Fun

I continued to look for a 16 Segment Font, alas, there seems to be none. The best I found are two videos on YouTube. So I finally made my own one, and for the benefit of the world, here the code for all printable 96 ASCII characters:

#include <avr/pgmspace.h>

// Segment bit order is (MSB) A1 A2 B C D1 D2 E F G1 G2 H I J K L M (LSB)
const uint16_t uiCharacterMap[96] PROGMEM =
{
 // SPACE ! " # $ % & '
 0x0000, 0x0300, 0x0110, 0x0fd2, 0xddd2, 0x95db, 0x8eb4, 0x0010,
 // ( ) * + , - . /
 0x000c, 0x0021, 0x00ff, 0x00d2, 0x0001, 0x00c0, 0x0004, 0x0009,
 // 0 1 2 3 4 5 6 7
 0xff09, 0x3008, 0xec41, 0xdc48, 0x01d2, 0xcd84, 0x1fc0, 0xc00a,
 // 8 9 : ; < = > ?
 0xffc0, 0xf1c0, 0x8080, 0x8081, 0x0c09, 0xc0c0, 0x0c24, 0xe142,
 // @ A B C D E F G
 0xfe83, 0x3049, 0xfc52, 0xcf00, 0xfc12, 0xcfc0, 0xc3c0, 0xdf40,
 // H I J K L M N O
 0x33c0, 0xcc12, 0x3e00, 0x038c, 0x0f00, 0x3328, 0x3324, 0xff00,
 // P Q R S T U V W
 0xe3c0, 0xff04, 0xe3c4, 0xddc0, 0xc012, 0x3f00, 0x0309, 0x3305,
 // X Y Z [ | ] ^ _
 0x002d, 0x002a, 0xcc09, 0x8b00, 0x0024, 0x7400, 0x0120, 0x0c00,
 // ` a b c d e f g
 0x0020, 0x8e92, 0x0b82, 0x0a80, 0x0e92, 0x0a81, 0x40d2, 0x8992,
 // h i j k l m n o
 0x0382, 0x0a00, 0x0812, 0x001e, 0x0412, 0x12c2, 0x0282, 0x0a82,
 // p q r s t u v w
 0x8390, 0x8192, 0x0280, 0x0444, 0x04d2, 0x0e02, 0x0201, 0x1e02,
 // x y z { | } ~ DEL
 0x002d, 0x3450, 0x0881, 0x4492, 0x0012, 0x8852, 0x0128, 0x00ff
 };

Note the PROGMEM extra attribute which is helpful on a Harvard CPU like the ATmega are. Without it, the table will be copied and used in RAM. 192 Byte in total does not sound too bad, unless you use an ATmega168 which has only 1 kByte. To access this type of special memory, you need the include file and to access the array, a special function is needed:

a=pgm_read_word_near(&(uiCharacterMap[i]));

It’s all documented here. On a normal CPU (more RAM, no Harvard architecture) you would not bother.

I thought about adding “spinning things”, but those are trivial to make and I thus leave those as an exercise to the reader.

 
Motorola Milestone 2 and Gingerbread!

Unbelievable, but my Milestone 2 has received its update to Android 2.3 AKA Gingerbread. When I bought it with Android 2.2 (Froyo) I though “Surely Motorola will bring out an update as soon as they can, as it will create brand loyality if the company shows after-sales support, so people will want to buy Motorola again.” Well, that turned out to be nonsense and Motorola did not even commit to any updates. I gave up all hope, but for fun I checked, and lo-and-behold: There’s an update available here.

Worked fine. Have patience and follow the instructions. There are 2 times when you think “now it crashed”, but it’s not. The full process takes about 20 min. Afterwards no loss of data (in my case), except my Bluetooth headset wanted to be authorized again. Everything is snappier now and looks better at the same time. It’s a worthy update and if it had some 6 months ago and announced when Gingerbread came out, it would have made me a Motorola fan.

That being said, Samsung is not better. So I guess the next phone or tablet will be a Nexus.

 
RC Helicopter Fun

It looked like fun to do and it turned out to be a lot of fun: flying a remote controlled helicopter. The are hard to control, and if you lose control, they break easily.

Having seen that and ignoring the crashing part, it still looked like fun. And smaller RC heli’s don’t break so easily anymore, and with gyros built-in nowadays, they are reasonably stable to fly. And the very small ones (like 20cm rotor diameter)  are so light, if they fall on the floor, they don’t damage anything severely and don’t get damaged.

I got mine from http://www.hobbyking.com (look for the HK-190 for surprisingly cheap US$30). It’s certainly not high end and not collective pitch, but at that price, who’s to complain? Get some extra batteries (the 160mAh Turnigy are ok).

It’s as much fun as I expected!

Lots of resources available on the web. Example is  http://www.rchelicopterfun.com/ and http://rchelicopterguide.blogspot.com/2009/08/beginner-rc-helicopter-flying-training.html and http://www.swashplate.co.uk/ehbg-v17/ehbg_index.html and there are many more.

 

 

 

 

 
EAGLE - First Impression

EAGLE is probably the most common software used for PCB creation. Many years ago I saw a professional using it on DOS. Looked good and not simple at all. Back then creating PCBs was quite expensive too, so I never thought about making them myself. For most of my purposes a breadboard works well enough. For a bit more permanent things I have those which is just the same layout and connections, but for soldering.

For a bit more complex things though the problems of breadboards become an issue:

Distressing as it may sound, solderless breadboards can be very flakey, especially as they age. If you’re having problems with your circuit, it could be that the little metal clips on the inside aren’t working well. Try poking it with your finger, or moving it to a different section.

It’s still great for small tests, but for permanent things, expect a  low reliability.

Anyway, for a large clock using those quite large 16 segment LEDs, breadboards don’t work well: a single digit is too large and needs 2 breadboards, with some gap between. The next digit will have a lot of gap between the previous digit. All in all, not optimal.

In the end, and because that clock will be permanent, some soldering is needed. Soldering without PCB is not fun: lots of burned fingers, a messy layout and errors are my experiences. A PCB would be sooo much nicer.

Enter the world of low-cost PCB manufacturing. The low price is done by merging small PCBs onto one larger one, which splits the setup costs by many users. In the end, a 5cm by 5cm board with 2 layers of copper, solder stop mask, silk screen is amazingly US$10. Larger ones get a bit more expensive, but it’s still cheap. And I get 10 boards. There is some extra delay of course as all those small boards needs to get pooled to one large PCB.

What does it have to do with EAGLE? EAGLE is the program which is recommended to create the PCBs from. Other programs work too (e.g. KiCAD), but most tutorials are for EAGLE and most services can handle EAGLE files, either directly or indirectly. EAGLE also runs on Linux.

So I downloaded EAGLE v5.1 as

aptitude install eagle

did not work.

And then the steep learning curve of EAGLE started. At first I could not do anything at all; this is an old program and it shows: hardly anything works as expected. This tutorial helped me to get started. It stops where the layout starts though, so here my additions:

  • If you want to fill a plane (e.g. with GND), make a polygon on the board layout of where you want it. RMB (right mouse button) will show the properties of it. Add Isolate to have a distance from signals. 0 is a stupid default value.
  • Use the name command (RMB on the polygon) to merge it with the GND signal (of whatever signal you want to have connected).
  • To start the autorouter, click on the autorouter button (yeah, it sounds very straightforward). Any signals which could not be connected will be air-wires (thin yellow lines).
  • To rip up one trace, use RMB and delete.
  • To rip up all traces, click on the ripup button, then on the go icon (the traffic light next to the STOP icon).
  • Click on ratsnest to see the polygon being poured.
  • It’s fun to watch the autorouter on slightly complex layouts. If your design is complex or space is too limited, you might end up with some air wires. Try to relocate some components.
  • The rules file document dictate what the manufacturer can do. E.g. available drill sizes or capabilities like thinnest possible traces etc. The default values are quite conservative. To load, click on Edit/Design rules and load the rules for your service.
  • The CAM file creates the layers (copper per layer, silk screen, solder stop masks). It creates all the needed Gerber files.
  • gerbv is a nice utility to display those created Gerber files layer for layer. Use it recommended. While you’ll unlikely stop small errors (e.g. a single traces missing), you’ll find layers completely missing.
  • Never only open schematics or board view. Always have both open, as otherwise you create inconsistencies which are not fun to manually fix. As long as both are open, any modification on one window will update the other one.
  • The free version of EAGLE is limited to 8cm by 10cm and 2 layers. Good for small stuff. For hobby use (non-commercial) you can get the standard edition (10cm by 16cm, 6 layers) for modest US$125. I doubt I’ll need those capabilities, but if I do, I know there’s a cheap upgrade path.
TODO on my side:
  • Understand the bus feature. That will clean up the schematics a lot.
  • Name signals
  • Create library items (e.g. for the MCP23017 I found no usable library so I had to use a generic 28 pin DIL socket with no proper names and no knowledge of what is input or output or GND or Vcc.
 
GLANTANK - Resurrected

I have not used my GLANTANK for quite a while. Now it has a new purpose: I use as a server for lsync. lsyncd is what I was looking for for a while: it synchronizes directories a la rsync (it’s actually using rsync for that), but it is using the inotify feature of the Linux kernel which informs a process that a file has changed. So instead of scanning every (say) 1h thousand of files, it copies the ones which are modified much sooner and does not need a full scan of all files except on startup.

The old Debian installation was outdated, so I wanted to re-install Debian Linux on the GLANTANK first. I used the same instructions in the past and it worked as expected. So I was hopeful this time too. ssh never started up though.

The only way to see something happening then is to use a serial console. See also here for some pictures. Pins are 1:3.3V,  2:RxD, 3:TxD, 4:GND. 115200 bps and 8N1.

And the problem is that the latest kernel 2.6.32-5-iop32x has no driver for the GLANTANK disk interface, and that stops the installation process. The fix is on the Debian bug list and that solves it.

Next problem are the not-so-quiet fans. There’s a program to control them called fanctld. Needs kernel header files and gcc-4.3 to create a working fandrv.ko kernel module.

Update: Plugging in and out of disks with a cable which is soldered to the mainboard is a bad idea: the cable broke and no disk worked afterwards. Well, it was fun while it lasted.  Which was until now.

 

While cleaning up some directories on my computer, I found my first (and my only) commercial web page I created when I was at university. Of course it’s updated now, but here is an old copy. The current one for reference is here.

© 2011 Harald's Random Stuff Suffusion theme by Sayontan Sinha