Robotics

Tuesday, May 22, 2007

Qc-usb

After poking around at various web cam driver projects, my hope is to find someone working on a driver for this camera for qc-usb, or just do it myself. I posted the question to the qc-usb mailing list this morning to see if anyone is doing the work already, or has any reason to believe it cannot be done.

I was able to hack the qce-usb driver to recognize the camera, but eventually it fails when sent a command, probably because the sensor is not supported, or somesuch. Probably will need to reverse engineer a windows driver to get a better idea; there are resources on the web that deal with how to do this.

Saturday, May 19, 2007

Fixing the spcacat video issue

The problem in the last post was fixed by:

$ ln -s /dev/v4l/video0 /dev/video0

Unfortunately, the driver will oops after a while.

$ ./spcacat -d /dev/video0
Spcaview version: 1.1.4 date: 27:11:2005 (C) mxhaard@magic.fr
video /dev/video0
Camera found: Logitech QuickCam for Notebooks
VIDIOCGPICT brightnes=32768 hue=0 color=0 contrast=32768 whiteness=0depth=24 palette=4
Bridge found: ZC301-2
is_spca SPCA505
is_spca SPCA506
is_spca SPCA501
is_spca SPCA508
is_spca SPCA504
is_spca SPCA500
is_spca SPCA504B
is_spca SPCA533
is_spca SPCA504C
is_spca SPCA561
is_spca SPCA536
is_spca SN9C102
is_spca ZR364XX
is_spca ZC301-2
StreamId: 0 Camera
try palette 21 depth 8
Available palette 21
try palette 15 depth 12
Available palette 15
try palette 4 depth 24
Available palette 4
try palette 3 depth 16
Available palette 3
try palette 5 depth 32
Available palette 5
probe size in
Available Resolutions width 640 heigth 480
Available Resolutions width 384 heigth 288
Available Resolutions width 352 heigth 288
Available Resolutions width 320 heigth 240
Available Resolutions width 192 heigth 144
Available Resolutions width 176 heigth 144
Format asked 15 check 4
VIDIOCSPICT brightnes=32768 hue=0 color=0 contrast=32768 whiteness=0depth=12 palette=15
VIDIOCGPICT brightnes=32768 hue=0 color=0 contrast=32768 whiteness=0depth=12 palette=15
grabbing method default MMAP asked
VIDIOCGMBUF size 2457616 frames 2 offets[0]=0 offsets[1]=1228808
Waiting .... for Incoming Events. CTrl_c to stop !!!!
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c10d8000
[00000000] *pgd=007c8801, *pmd = 007c8801, *pte = 00000000, *ppte = 00000000
Internal error: Oops: 807
CPU: 0
pc : [] lr : [] Tainted: P
sp : c50e1e74 ip : 60000013 fp : 00000000
r10: 0009205c r9 : c50e0000 r8 : 60000013
r7 : 00000000 r6 : c0362020 r5 : c1120008 r4 : c1120008
r3 : 00000000 r2 : 00000000 r1 : c112000c r0 : 00000000
Flags: nZCv IRQs on FIQs on Mode SVC_32 Segment user
Control: C000317F Table: 010D8000 DAC: 00000015
Process udhcpc (pid: 54, stack limit = 0xc50e0368)
Stack: (0xc50e1e74 to 0xc50e2000)
1e60: 00000001 c0362078 fffffff6
1e80: c03804e0 c023d770 c03cf3c0 c03804e0 00000008 c03804e0 c03804e8 c022c548
1ea0: c03cf3f0 00000000 00020004 00000009 c077b19c c6038eb8 c50e1ee8 c037195c
1ec0: c03cf3c0 ffffffed c022c704 c6038fc4 7ffffb34 c077b180 00000014 c50e1ee8
1ee0: c02e1fc8 00000000 00080011 00000002 00000000 00000000 00000001 c50e1f4c
1f00: c50e0000 00000000 c50e1f14 c0270634 c033d530 00000000 c03f9f20 00000005
1f20: c077b180 c10b31c0 c02e1360 3937315b c0005d33 c60391e4 c077b180 00000011
1f40: 00000002 c03a9c24 00000008 c50e1f2c 00000006 00000701 a0000013 c5022220
1f60: c50e1f84 0000000c 00000000 00000001 7ffffd94 00000066 c02e2a94 c02362cc
1f80: c0362000 00000005 7ffffb34 00000014 00000066 c022c704 c50e0000 00000005
1fa0: 00000002 c022c560 00000005 c0235fd8 00000002 7ffffb24 00000014 00000008
1fc0: 00000005 00000002 7ffffd94 00092054 0008a40c 00000000 0009205c 3e6f1075
1fe0: 0008aeb0 7ffffb24 00046744 2ac42b00 20000010 00000002 00000000 00000000
Backtrace: no frame pointer
Code: e5955000 1a000006 eb0400a5 e3500000 (05800000)
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing
<3>zd1205: No available buffers

Running spcacat....

$ /usr/local/bin/spcacat
Spcaview version: 1.1.4 date: 27:11:2005 (C) mxhaard@magic.fr
video /dev/video0
ERROR opening V4L interface

Googling the above error shows lots of people have run into the same problem, for various reasons. Not sure what the problem is in my case, but it will be the next thing I tackle.

Friday, May 18, 2007

Back to compiling spcacat

Compiling spcacat required the following:

zlib-1.2.3
libjpeg-6b
libpng1.2.18
libSDL1.2.11
libSDL_image1.2.5

Most required the following config line:

./configure --host=arm-linux

To get shared libs, add:

--enable-shared

SDL:

$ ./configure -host=arm-linux --disable-esd --disable-video-x11

SDL_image:

$ ./configure -host=arm-linux --enable-shared --disable-tif

PNG:

$ ./configure --host=arm-linux

environment for all of this:

typeset -x PATH=/usr/local/opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/bin:$PATH
typeset -x CC=arm-linux-gcc
typeset -x CPP=arm-linux-cpp
typeset -x AR=arm-linux-ar
typeset -x RANLIB=arm-linux-ranlib
typeset -x AS=arm-linux-as
typeset -x LD=arm-linux-ld
typeset -x NM=arm-linux-nm

Monday, May 14, 2007

Serial port pinouts

VEX Controller:

Pin1: TTL-CTS (the right most pin when looking at the front of the connector on the Vex Controller)
Pin2: + 5V out (1 Amp max from all external +5 V pins combined)
Pin3: TTL-RTS
Pin4: Ground
Pin5: TTL-RX in
Pin6: TTL-TX out (the left most pin when looking at the front of the connector on the Vex Controller)

TS-7260 COM3

NC RTS CTS NC NC
NC RXD TXD NC GND

With OP2-TTLCOM, COM3 lines become TTL and only RXD and TXD are used, and lines are available on the XDIO lines.

To connect these, a cable (RJ12 on VEX to 16 pin socket connector of some kind on TS-7260) will be needed.

http://xtronics.com/reference/10baseT.htm for info on RJ12

Friday, May 11, 2007

First wiki link

http://firstwiki.org/index.php/Resources_for_C_programming