Friday, March 27, 2009

FORTISSIMO!

A quick note: today I updated flatpress to version 0.8 (finally!)
It is nice and works smoothly, and now I have CAPTHAs!

Saturday, January 24, 2009

Oops! I broke it!

I have a nice TI extensa 500 notebook, which I still use for PIC programming (via serial!) and as a DCC contol station (SCRP, DDL, DDW & company).
This lil ‘putie worked very well, with the windows-software and the internets. Until the RCT battery died. For some strange and perverted reason once the RTC batt dies the computer dies too! It barely powers on! I had an external video attached, and the machine kept not powering up. An hour later and after much googling, I diagnosed the problem. Disassembling the machine is simple, once you now how to do it, and once you find the repair manual… The battery is a vulgar CR1220, wich, obiously, is imbossible to find in stores (in my city, at least). Fortunately a little search on ebay showed plenty cr1220 and a couple days later I had my replacement batt.
The first step is to disassemble the machine:
DSCN9820.JPG
DSCN9819.JPG
Simple, once you know how to do it…
DSCN9802.JPG
Almost done…
At this point, the disaster happened. The RTC batt holder is made with very low quality plastic… and it broke! These are the remains (note that the batt did not come off…)
DSCN9804.JPG

Obviously, the holder is SMD, so it is not possible to resolder it (at least, not that simple)… So it is surgery time!
DSCN9806.JPG
The remains of the torn holder…
DSCN9807.JPG
…and the sodered cable…
DSCN9808.JPG
and the holder glued back again.

This is how it looks with the battery:
DSCN9815.JPG

Horray! it boots again!
DSCN9817.JPG

Thursday, August 7, 2008

QCad & Friends

I needed to draw a bridge for my model train layout. So I started searching for a nice cheap (free?) CAD program. I first found CADintosh which is nice, but with many glitches (why it is not possible to trim ellipses intersecting with lines? and other annoying things, like no auto alignment). I then found the demo of QCad, which seemed nice, and a free community edition existed too! The only catch is that you have to compile it yourself. Oh well, an ordinary task. Or so it seemed.

The prerequisites are simple: GCC compiler and QT > 3.3. This is when I fid out that the MacPorts package of qt3mac is broken and needs a patch. Better switch to fink, where it works and is binary (so I don’t have to wait 3 days for it to compile). To compile QCad, all the qt3mac* packages (except -doc) are necessary, or it will not compile!

apt-get install qt3mac qt3mac-apps qt3mac-shlibs

Now, after downloading and unpacking QCad we apply a nice patch found here (check the blog for some info on compiling qcad). This patch basically modifies che compile script so it points to the correct qt location. With this patch alone it will NOT compile, we still have to modify a couple files.

cd $QCADDIR
patch -p1 < ../qcad-2.0.5.0-1-fink-qt3mac.patch #assuming patch is in ../

Then modify the files:
mkspecs/defs.pro

remove the lines:

QMAKE_CC = gcc-3.3
QMAKE_CXX = g++-3.3

if you wish to use GCC 4 (as I did). These are actually added by the patch.

scripts/build_qcad.sh

Modify the lines:

QTDIR=/sw/lib/qt3mac/
QMAKESPEC=/sw/share/qt3mac/mkspecs/macx-g++

to:

export QTDIR=/sw/lib/qt3mac/
export PATH=$PATH:$QTDIR/bin
export QMAKESPEC=/sw/share/qt3mac/mkspecs/macx-g++

and at line 37 modify

elif [ "x$OSTYPE" == "xdarwin8.0" ]

to

elif [ "x$OSTYPE" == "xdarwin9.0" ]

ONLY IF you are running MacOS X 10.5 (it tried it only on this).

Before continuing we have to make sure we are using the right QT’s uic and qmake. For some reason in my system I already have qmake 4.2 and uic 4.2 in /usr, and the script used those. Check for the right ones:

$ which uic
/usr/bin/uic
$ which qmake
/usr/bin/qmake

Argh, these are incorrect! Since on my sistem they are simply links…

$ ls -l /usr/bin/uic
lrwxr-xr-x  1 root  wheel  7  6 Ago 15:13 /usr/bin/uic -> uic-4.2
$ ls -l /usr/bin/qmake
lrwxr-xr-x  1 root  wheel  9  6 Ago 15:14 /usr/bin/qmake -> qmake-4.2

I simply erase them…

$ rm /usr/bin/uic /usr/bin/qmake

I will restore them when finished. Now qmake and uic should point to the right place (you probably will need to export again $PATH to point to QTDIR/bin).

$ which uic
/sw/lib/qt3mac/bin/uic
$ which qmake
/sw/lib/qt3mac/bin/qmake

Now we are all set! cd to the QCAD dir and starup compilation!

cd $QCADDIR/scripts
./build_qcad.sh notrans

And voila’! it should compile! The executable is in $QCADDIR/qcad/QCad.app. If it works, remember to restore the links in /usr…

qcad_horray.jpg

and yes, QCad rocks!

Sunday, August 3, 2008

Bookbinding part III, SqueezeCenter adventures

Urgh, almost two months without updates. Too much work and study, and then I was sick. sigh. Now that I am finally feeling better, I restarted some projects.
Finally, I managed to finish binding my book! horray! obviously my cam died while I was doing it, so I just have a couple photos of the application of the cover. Finished book to come!

DSCN9183.JPG
Corner marks!

DSCN9184.JPG
Pasting the covers

SqueezeCenter Adventures
This needs a paragraph per se.
Some time ago, while sick in bed, I decided it was time to replace my trusty old synology DS101g+ with something newer and more standard. Yes, I have enough of hacking the poor synology’s firmware, and it has waay too little ram, just 64 megs. I started looking for an alternative, and initially I choose a mini-itx. But with my great disappointment che 800mgz C3 on board gave me more or less the same performance of the 266 PPC 603 on the syno! ARGH! we call this CESSO in italian! And I did not calculate the fact it does NOT have a case, and every case I saw was:

1) HUGE
2) UGLY
3) EXPENSIVE! how can a stupid case cose 70$$????

So it was time to find and alterative. To my astonishment it seems that small computers tend to be UGLY and COSTLY, sigh! But a friend gave me an idea… and used mac mini! The first generation mac minis with a PPC G4 are easy to find and quite cheap. And they are a blast. Debian on this machine is.. wow! I’m really satisfied with the performance, and the machine is small and quiet too!.
One of the reasons for getting a real machine is to run squeezecenter (and other goodies too). SqueezeCenter is nice, and pkgs exist for debian. i386 that is, no ppc! On ppc it requires a manual installation. Oh well!

The installation is quite simple, except for some caveats. It wants gcc, g++, libc-dev, msql, libmysqldev. And loads of perl pkgs. Some of this can be installed via apt:

libalgorithm-c3-perl
libclass-c3-perl
libclass-data-accessor-perl
libclass-inspector-perl
libdata-dump-perl
libdbix-class-perl
libmp4-info-perl
libpath-class-perl
libproc-background-perl
libsql-abstract-limit-perl
libsql-abstract-perl
libxml-simple-perl
libyaml-perl
libyaml-syck-perl

(Note, I got the list form the debian pkg for i386. These are the only ones that exist on ppc).

For the others, it is necessary to use the included script

$SQEEZE/Bin/build-perl-modules.pl
.

Watch out for errors, as the program WILL fail. Ah, BEFORE running the program setup CPAN:

$ cpan

and setup regional settings, etc.

Once the build-perl-modules.pl is done, squeezecenter it will not work. For some strange reason it failed to install Compress::Zlib. Yes, it downloads and compiles it, but it did NOT install it! So, assuming you used /tmp for dowloading the temp archives:

Welcome to the Slim Devices perl module installer.
	
These packages are needed for SqueezeCenter to function.
You will need a C compiler (gcc), make, and perl installed.
	
You will need development libraries for MySQL. eg: libmysqlclient
	
You will need development libraries for expat. eg: libexpat1-dev
	
*** Ignore any warnings about AppConfig. ***
	
Please enter a perl binary to use (defaults to /usr/bin/perl)
This must be the same perl binary that you ran this program with --> 
Please enter a directory to download files to --> /tmp
Downloads will use /usr/bin/wget to fetch tarballs.
	
Downloading Compress-Zlib-1.41.tar.gz to: /tmp

And install it:

cd /tmp/Compress-Zlib-1.41
make install

Now squeeze is a bit more happy, but not too much. In fact the logs may say this:

 [ERROR] Error message file '/root/squeezecenter-7.1/MySQL/errmsg.sys' had only 463 error messages,
but it should contain at least 608 error messages.
Check that the above file is the right version for this program!
Slim::Utils::MySQLHelper::createSystemTables (433) FATAL: Couldn't connect to database: [Can't connect to local MySQL server through socket '/root/squeezecenter-7.1/Cache/squeezecenter-mysql.sock' (2)]

It means we have to link errmsg.sys with the one provided by the current installation of mysql:

cd $SQUEEZE/MySQL
mv errmsg.sys errmsg.sys.old
ln -s /usr/share/mysql/english/errmsg.sys errmsg.sys

Now it works! No, it does not! You will have to install the GD libraries, version 2.35 EACTLY. The build-perl-modules.pl script does not do this! After some research I found that you NEED version 2.35 EXACTLY. It will NOT work with versions > 2.35 (CPAN at this moment has 2.39). The error you may find is:

The following CPAN modules were found but are too old to work with SqueezeCenter:
GD (loaded 2.35, need 2.35)
	
To fix this problem you have several options:
1. Install the latest version of the module(s) using CPAN: sudo cpan Some::Module
2. Update the module's package using apt-get, yum, etc.
3. Run the .tar.gz version of SqueezeCenter which includes all required CPAN modules.

This happened to me while having 2.39 installed from CPAN. First, install GD libraries:

apt-get install libgd2-noxpm libgd2-noxpm-dev

Then get GD from CPAN and install it:

wget http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.35.tar.gz
tar -xvzf GD-2.35.tar.gz
cd GD-2.35
perl Makefile.PL
make
make install

It will probably moan for missing perl modules. I did like this:

1) install GD 2.39 from CPAN (cpan GD)
2) overwrite it with 2.35

but after this, squeezecenter works! horray!

Tuesday, June 17, 2008

Mini ITX

Two or three weeks ago the two Mini ITX boards I ordered in Australia (!) arrived. The idea is to substitute my Synology with something more standard for a small home server. This week the pwr supplies and the big 500GB disk arrived. The little challange here was to install the system on the disk without a monitor…
But thanks to Saint Serial Port the problem is fast resolved! ahh!

DSCN9132.JPG
My floor is multi-function

DSCN9134.JPG
Ahh the mess!

DSCN9136.JPG
Obviously the connector in the power supply is NON STANDARD and I had to substitute it. Uff!