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
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.
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
the file was
I changed to that folder after downloading the file and ran
I used automatic and default settings. Afterwards I ran
After this, restart the computer, don't just press ctrl-alt-backspace.
After restarting run:
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
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.
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
as in the code it results in a very long lag, and I rather control the brightness on my own.
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
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
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
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.
Thursday, February 7, 2008
WRTSL54GS printing Kamikaze 7.09 and HP 5550
So I've had my share of luck with getting things to work under embedded systems such as the WRTSL54GS. Its often times hit and miss, and unless you're willing to go through code, sometimes you're just stuck. Nevertheless I've been a big fan of the work people have been doing at X-WRT and OpenWRT. Here are the steps I followed to get the WRTSL54GS to work as a print server with my older HP 5550. I also tried it with my newer HP PSC 1350, but I didn't actually test printing to it, but it did show up.
NOTE:
Make sure you connect to your WRTSL54GS using a wired connection as you may have problems getting wireless to work. I have another router working as my wireless router, so that wasn't an issue with me
Step 1.
Install the newest version of x-wrt it can be found here.
Go to your WRTSL54GS website, type in 192.168.1.1 if you haven't changed any settings on your browser. Go to the last page and click update, browse for the place where you stored the file and take a break. It takes 5-10 minutes to install and reboot. Be patient.
Step 2
Configure your router.
type in 192.168.1.1 It will reset to this IP address regardless of what it was before. Use the web interface to set up your router to your hearts desire. When you first log in it will ask for a new password. Remember this as you will need this password to ssh into the router.
Step 3
SSH into router
Use your favorite program to ssh into the router. In linux the command would be
It will then ask for the password you set earlier. Now you have to ensure you have a connection to the internet, if you. I always try pinging google as a test
Now, you actually don't need all these packages, but since you're already in the router, might as well install all the packages you need related to usb.
I know thats a bit long, but if you're not pressed for memory, it just works, and installs printer support.
Step 4
Configuration
Plug in your printer into the usb port. type
It should reply with something along these lines
Next we will check for the printer. Until this point I was following the excellent instructions located at the OpenWRT site
Here's where I differ, for some reason, my printer did not show up as
/dev/usb/lp0 but rather /dev/lp0
And I followed the instructions on adding a printer shown on the same site, under Ubuntu:
NOTE:
Make sure you connect to your WRTSL54GS using a wired connection as you may have problems getting wireless to work. I have another router working as my wireless router, so that wasn't an issue with me
Step 1.
Install the newest version of x-wrt it can be found here.
Go to your WRTSL54GS website, type in 192.168.1.1 if you haven't changed any settings on your browser. Go to the last page and click update, browse for the place where you stored the file and take a break. It takes 5-10 minutes to install and reboot. Be patient.
Step 2
Configure your router.
type in 192.168.1.1 It will reset to this IP address regardless of what it was before. Use the web interface to set up your router to your hearts desire. When you first log in it will ask for a new password. Remember this as you will need this password to ssh into the router.
Step 3
SSH into router
Use your favorite program to ssh into the router. In linux the command would be
$ssh root@192.168.1.1
It will then ask for the password you set earlier. Now you have to ensure you have a connection to the internet, if you. I always try pinging google as a test
root@OpenWrt:/# ping www.google.com
Now, you actually don't need all these packages, but since you're already in the router, might as well install all the packages you need related to usb.
root@OpenWrt:/# ipkg install kmod-usb-core kmod-usb-ohci kmod-usb-uhci kmod-usb2 p910nd kmod-usb-printer
I know thats a bit long, but if you're not pressed for memory, it just works, and installs printer support.
Step 4
Configuration
Plug in your printer into the usb port. type
root@OpenWrt:/# dmesg
It should reply with something along these lines
usb 3-1.4: new full speed USB device using ehci_hcd and address 4
usb 3-1.4: configuration #1 chosen from 1 choice
drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 4 if 0 alt 0 proto 2 vid 0x03F0 pid 0x6004
Next we will check for the printer. Until this point I was following the excellent instructions located at the OpenWRT site
Here's where I differ, for some reason, my printer did not show up as
/dev/usb/lp0 but rather /dev/lp0
uci show p910nd
p910nd.cfg1=p910ndI simply used the command
p910nd.cfg1.device=/dev/usb/lp0
p910nd.cfg1.port=0
p910nd.cfg1.bidirectional=1
p910nd.cfg1.enabled=0
root@OpenWrt:/# uci set p910nd.cfg1.device=/dev/lp0
root@OpenWrt:/# uci set p910nd.cfg1.enable=1
root@OpenWrt:/# uci commit p910nd
root@OpenWrt:/# /etc/init.d/p910nd enable
And I followed the instructions on adding a printer shown on the same site, under Ubuntu:
- Start kprinter
- Select 'Add printer'
- Select Network printer (TCP)
- Use 192.168.1.1 (the router's IP address) as the printer's IP
- Fill in the port you want to use (normally defaults to 9100)
- Pick manufacturer and model
- Pick the recommended driver
- Then you can new print a test page or change the settings of the printer further
IP release in Ubuntu
I have recently been having problems in Ubuntu with it having an extreme preference to connect to my wireless network rather than connect via eth0. I found out that the command to release the IP address an
To renew the address its the same command but without the r
If things get really bad, you can always restart the networking service.
$ sudo dhclient -r
To renew the address its the same command but without the r
$ sudo dhclient -r
If things get really bad, you can always restart the networking service.
$ /etc/init.d/networking restart
C++ errors
g++ -c -o Symmetric.o Symmetric.cpp
Symmetric.cpp:30: error: declaration of ‘virtual int Symmetric::position(int, int)’ outside of class is not definition
Symmetric.cpp:31: error: expected unqualified-id before ‘{’ token
make: *** [Symmetric.o] Error 1
This is pretty obvious to most people, but if you happen to run into this error, try taking a look at the definition of the function, it may be as simple as a out of place semicolon. In this case, the problem was in this line of Symmetric.cpp.
I just placed a semicolon on the definition of that class function.
int Symmetric::position(int i,int j);
{
...
};
This was one heck of a project this file came from. It was an exercise in inheritance. I'll post some more info on it later, as I think it was a very informative programming assignment.
Symmetric.cpp:30: error: declaration of ‘virtual int Symmetric::position(int, int)’ outside of class is not definition
Symmetric.cpp:31: error: expected unqualified-id before ‘{’ token
make: *** [Symmetric.o] Error 1
This is pretty obvious to most people, but if you happen to run into this error, try taking a look at the definition of the function, it may be as simple as a out of place semicolon. In this case, the problem was in this line of Symmetric.cpp.
I just placed a semicolon on the definition of that class function.
int Symmetric::position(int i,int j);
{
...
};
This was one heck of a project this file came from. It was an exercise in inheritance. I'll post some more info on it later, as I think it was a very informative programming assignment.
Saturday, February 2, 2008
CCTV lenses
The CCTV lenses just arrived today. I'm doing some research, trying to determine the best conditions to create a laser webcam rangefinder The reason I'm modifying it is that in my lighting conditions, unless I have most of the lights off, and do some filtering, I the red dot is never the brightest pixel. I've found that because of the IR filter used on cameras, the brightness of the laser point is greatly reduced. To remedy this, I bought a set of 6 lenses in sizes 2.8,3.6,6,8,12, and 16mm, with an F2.0. I'm currently using these on a labtec webcam pro. I bought a whole slew of them off of ebay for my CS department. I've found that the 3.6mm F2.0 lens creates an image most like the one I originally used. The reason I'm doing this is that these lenses come without an ir-filter, which basically allows you to see infrared. So if you're interested in doing the FreeTrack webcam mod for the Labtec Webcam Pro, I suggest you order the 3.6 lens. It will avoid you the problem of having to polish off the IR filter which isn't pretty. Only problem is that the original tube that allows the camera to screw on has a large space without threading, which means that although the lens will work for the camera, I had to cut the tube to make it fit. Which in my mind is much better than polishing off the filter, but if I figure out anything new I'll post it.
Subscribe to:
Posts (Atom)