Tuesday, February 19, 2008

Ubuntu utime error

I haven't quite figure this one out, but if you happen to run into a utime error. Check if its on a shared partition. Like a FAT32 partition shared between Windows and Linux. I was trying to compile BLAS today and it wouldn't work. I kept getting utime errors. Well I ended up copying everything over to my home directory under root and it worked from there.

Wednesday, February 13, 2008

Printer update

I had to reinstall my printer as a part of some testing...

Well, anyways, I made an update to the previous post I made, you also have to change the enabled state of the printer. I also found out that when using uci, its very particular. The following line was missing


root@OpenWrt:~# uci set p910nd.cfg1.enabled=1
root@OpenWrt:~# uci commit p910nd
root@OpenWrt:~# /etc/init.d/p910nd enable


That first line was the most important, the second line makes it permanent between reboots, and the last line makes it so that it loads the p910nd daemon on boot. Notice how there is no space in the pnd.cfg1.enabled=1 This is required and it won't work otherwise.

Tuesday, February 12, 2008

Ubuntu dual screen, multiple monitors, R52

UPDATE:
I have since updated to Gutsy Gibbon, don't necessarily recommend it other than being able to read Windows files. Well, today I was trying to show a friend how to use aticonfig to setup two screens and I went to System->Administration->Restricted Drivers Manager and selected and unchecked the Enabled block for the ATI driver. I tried re-installing it but aticonfig simply wouldn't work. I had plenty of xorg backups as aticonfig does this on every change, but it simply wouldn't work, here is the solution:

First, download the newest driver from ati and store it in a folder I stored it in

/home/santiago/ATIDRIVERS

the file was

ati-driver-installer-8-8-x86.x86_64.run

I changed to that folder after downloading the file and ran

sudo sh ./ati-driver-installer-8-8-x86.x86_64.run

I used automatic and default settings. Afterwards I ran
sudo aticonfig --initial -f

After this, restart the computer, don't just press ctrl-alt-backspace.

After restarting run:
sudo aticonfig --dtop=horizontal

And now press ctrl-alt-backspace

and if you have a second monitor plugged in it should come to life!



If you happen to have a version of Ubuntu before Gutsy Gibbon, you know there isn't a GUI for setting up multiple monitors, and if you have ever been unlucky enough to try configuring your own xorg.conf file, you know that one little mistake can leave you with a terminal on startup until you manage to reload the backup. Anyways, if you're lucky enough to have an ati video card driver, the command in Ubuntu to setup a dual head system is


$sudo aticonfig --initial=dual-head


At this point press ctrl-alt-backspace which restarts X, log back in and you'll have a two head setup. This is also only temporary, so when you restart you'll have your normal settings back.

Sunday, February 10, 2008

Linux frame grabber

For some of my robotics research, I have been trying to implement a vision based system using webcams. I got the webcams working with spca5xx, I'll put up a post later how I managed to get it to work with multiple cameras off the same root hub. But if you need to do video analysis and need a simple linux frame grabber, I high recommend
http://www.mjmwired.net/kernel/Documentation/video4linux/v4lgrab.c
It was relatively simple to use. The only thing I recommend is to not use the READ_VIDEO_PIXEL function, just address the pointer as an array and use indexing, its faster, and also,

leave out the call to

int get_brightness_adj(unsigned char *image, long size, int *brightness) {
long i, tot = 0;
for (i=0;i tot += image[i];
*brightness = (128 - tot/(size*3))/3;
return !((tot/(size*3)) >= 126 && (tot/(size*3)) <= 130);
}


as in the code it results in a very long lag, and I rather control the brightness on my own.

OpenWRT Kamikaze 7.09 image loading

IMPORTANT: Before doing any of the following be sure you have boot wait turned on. You should already, but atftp won't load an image to the router without it.

Loading a new image of OpenWRT does not seem to be supported via webif in Kamikaze 7.09. I found that atftp works well. There are plenty of examples on how to do this, but I find that the procedure that works best is to cd to the directory with the image you want to load, then open up to terminals.
In the first terminal

$ping 192.168.1.1

Assuming that the router address is set to 192.168.1.1.
It will continously ping the router
In the second terminal, cd to the directory and then

$atftp

Then the atftp terminal pops up

tftp> connect 192.168.1.1
tftp> mode octet
tftp> trace
tftp> put openwrt-wrtsl54gs-squash.bin

NOTE: don't press enter on the last line just yet
Where you will substitute the image you want to upload for openwrt-wrtsl54gs-squash.bin
At this point you should have the put line typed in on one window and the router responding to pings in the first window. At this point unplug the router's power, watch for the pings to stop and plug the router back in. As soon as the router responds, press enter on the last line and several lines like the following should appear:

sent DAT
received ACK


Then wait at least 2 minutes and the router light should stop blinking.

Saturday, February 9, 2008

USB drive on WRTSL54GS

Made some more progress tricking out my router. I managed to get my 160GB external to show up. I hope to set this router up as a print server and as a webcam/recorder server.

Well, after some fiddling and some searching on OpenWRT forums, I found that the command that allowed me to mount the drive was

mount -t vfat /dev/sda1 /mnt

Friday, February 8, 2008

OpenWRT Kamikaze Printer Sharing Windows XP update

If you follow the guide on printer sharing I mentioned yesterday about how my usb printer showed up as /dev/lp0. Well, another helpful hint is that if one of the client computers you're setting the print service up on has a printer already installed, uninstall it. Simply adding a TCP port after the fact doesn't allow windows to recognize that the printer is ready to print. If the printer was installed as a local USB printer, Windows will continue to look for a USB connection in order for it to believe that the printer is ready to print. So just delete your printer and follow the guide and you'll be alright.