porting phidgets RFID_simple application to chumby one

Supporting 2.6 and up
aji

porting phidgets RFID_simple application to chumby one

Postby aji » Mon Apr 19, 2010 12:45 am

Hi,

I have Phidgets RFIDkit. With a Linux x86 machine, I am able to run RFID_simple application.

lsusb in linux box gives
Bus 001 Device 005: ID 06c2:0031 Phidgets Inc. (formerly GLAB)

When I cross compile the RFID_simple and phidget21 for arm, I am able to change the on board LED successfully, but cannot access the RFIDsection.
uname -a for chumby one gives
Linux chu 2.6.28-chumby #1 PREEMPT Tue Mar 2 16:09:35 PST 2010 armv5tejl unknown

I can see that cphidget.c/CPhidget_read returns 8000 instead of 0 (with laptop)
Also cusblinux.c/CUSBReadPacket/BytesRead returns ffff_fffe, which I think is wrong.

Could it be an ioctl() issue.

Please let me know if I should be aware of any libusb for arm porting. And also if any specific issues with linux 2.6.28

I have tried connecting a usb hub in between phidgets RFIDcard and chumby one, to check if this is a power issue. No difference.

User avatar
Patrick
Lead Developer
Posts: 3119
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: porting phidgets RFID_simple application to chumby one

Postby Patrick » Mon Apr 19, 2010 8:44 am

Shouldn't be any issues on ARM, but what version of the Phidget libraries are you using? CPhidget_read() is a function that hasn't been in the libraries for 4 years.

-Patrick

aji

Re: porting phidgets RFID_simple application to chumby one

Postby aji » Mon Apr 19, 2010 11:21 pm

Thanks Patrick for your response.

Some more observations...
----------------------------------------------------------------------------
I am using
standardC_2.1.6.20100406.tar.gz and
Phidgetlinux_2.1.6.20100406.tar.gz now.

Earlier I was using 2.1.6..0304

Do we need phidget21.h and libphidget21.o at /usr/lib and /usr/include if I am creating an executable with libphidget21.a, without need for dynamic linking.

-------------------------------------------------------------------------------
When I run RFID_simple, at the terminal I can see

Waiting for RFID to be attached....Phidget RFID 2-output 89263 attached!
PhidgetRFID
Serial Number: 89263
Version: 206
# Outputs: 2

Antenna Status: 2
Onboard LED Status: 2

Reading.....
Press any key to continue
--------------------------------------------------------------------------------
Last few lines of dmesg are...
[ 3224.180000] usb 1-1.1: new low speed USB device using fsl-ehci and address 7
[ 3224.320000] usb 1-1.1: configuration #1 chosen from 1 choice
[ 3224.380000] generic-usb 0003:06C2:0031.0004: claimed by neither input, hiddev nor hidraw
-----------------------------------------------------------------------------------
when I attach and detach the USB cable, RFID_simple app displays
Phidget RFID 2-output 89263 detached!
Phidget RFID 2-output 89263 attached!
-----------------------------------------------------------------------------------

On a x86 machine to cross compile to arm board, what all changes are required for both standardC and phidget21 scripts. Just wanted to make sure all the right things are done.

Thank you

User avatar
Patrick
Lead Developer
Posts: 3119
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: porting phidgets RFID_simple application to chumby one

Postby Patrick » Tue Apr 20, 2010 10:52 am

Antenna status == 2 means that the state is unknown. Are you enabling the antenna in your application?

-Patrick

aji

Re: porting phidgets RFID_simple application to chumby one

Postby aji » Tue Apr 20, 2010 11:11 pm

I am just running RFID_simple.c so the antenna should be on.

when I do
cat /proc/bus/usb/devices

T: Bus=01 Lev=03 Prnt=07 Port=00 Cnt=01 Dev#= 13 Spd=1.5 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=06c2 ProdID=0031 Rev= 2.06
S: Manufacturer=Phidgets Inc.
S: Product=PhidgetRFID
S: SerialNumber=89263
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 7 Ivl=18ms

But dmesg does not Phidget driver,
[ 766.830000] hub 1-1.1:1.0: USB hub found
[ 766.830000] hub 1-1.1:1.0: 4 ports detected
[ 785.870000] usb 1-1.1.1: new low speed USB device using fsl-ehci and address 8
[ 786.020000] usb 1-1.1.1: configuration #1 chosen from 1 choice
[ 786.090000] generic-usb 0003:06C2:0031.0004: claimed by neither input, hiddev nor hidraw

User avatar
Patrick
Lead Developer
Posts: 3119
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: porting phidgets RFID_simple application to chumby one

Postby Patrick » Wed Apr 21, 2010 11:04 am

Phidgets don't use a kernel driver so it wouldn't show in the list. It does sound like an issue with the board's USB driver - are you able to get similar devices (like a USB keyboard or mouse) to work?

I guess that the problem is in interrupt transfers - these are often not coded very well in some USB host controller drivers, so you may have to do some debugging / reading up on the bug lists.

As for statically linking in libphidget21.a - you would then not need to have the shared library available.

-Patrick

aji

Re: porting phidgets RFID_simple application to chumby one

Postby aji » Wed May 05, 2010 2:17 am

further progress! Thank you Patrick for your suggestions.

Now when I power on, I could read 10-12 tags, then tag reader disconnects automatically. then it reconnects, this time antenna is off and so tags could not be read. I need to power cycle

last few lines of dmesg are

[ 135.660000] usb 1-1.1: new low speed USB device using fsl-ehci and address 4
[ 135.830000] usb 1-1.1: configuration #1 chosen from 1 choice
[ 136.380000] usbcore: registered new interface driver usbhid
[ 136.380000] usbhid: v2.6:USB HID core driver

[ 1383.230000] usb 1-1.1: USB disconnect, address 4
[ 1388.840000] usb 1-1.1: new low speed USB device using fsl-ehci and address 5
[ 1388.980000] usb 1-1.1: configuration #1 chosen from 1 choice
[ 1389.030000] generic-usb 0003:06C2:0031.0001: claimed by neither input, hiddev nor hidraw



Any clues on what could be the problem. I think the issue may be at the host side, but I am a newbie to Linux.

User avatar
Patrick
Lead Developer
Posts: 3119
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: porting phidgets RFID_simple application to chumby one

Postby Patrick » Wed May 05, 2010 9:08 am

Sounds like a power issue. Try a thicker USB cable, or a powered USB hub.

-Patrick

jdavidanderson
Fresh meat
Posts: 4
Joined: Thu Mar 17, 2011 8:51 pm
Contact:

Re: porting phidgets RFID_simple application to chumby one

Postby jdavidanderson » Thu Mar 17, 2011 9:00 pm

I have this same issue. I can attach and get the serial number using simple-RFID.c and I can write to the LED. I get antenna status = 2. I get the same info in lsusb, /proc/usb and in dmesg and shown in this thread.

I have tried a powered USB hub but it has not helped. Was there any resolution to this thread, I am keen to get RFID on the chumby hacker board working.

Thanks

Dave

jdavidanderson
Fresh meat
Posts: 4
Joined: Thu Mar 17, 2011 8:51 pm
Contact:

Re: porting phidgets RFID_simple application to chumby one

Postby jdavidanderson » Sat Mar 19, 2011 10:50 am

I still have no joy,

chumby:/mnt/storage/phidget21-c-examples-2.1.7.20110203# ./RFID-simple
Waiting for RFID to be attached....Phidget RFID 2-output 105614 attached!
PhidgetRFID
Serial Number: 105614
Version: 206
# Outputs: 2

Antenna Status: 2
Onboard LED Status: 2
Reading.....
Press any key to continue

Press any key to continue

Press any key to end


I have recompiled everything and tried over but no success. Perhaps I need to give up on the library and try to talk to the device directly. Is there a protocol description document for talking to the phidget ?


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 0 guests