Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22
  1. #11
    Junior Member
    Join Date
    Oct 2014
    Posts
    12
    thanks for your help!
    The test-Raspberry is a Raspberry A
    when I read it rigth bluethooth is disabled by default since piCorePlayer 3.22
    the rfid Reader is not connected through serial but through USB as a keyboard

    lsusb Returns:
    Code:
    lsusb
    Bus 001 Device 003: ID 16c0:27db
    which I think means it is a Keyboard

    Driver Information (i unpluged / pluged the device):
    Code:
    dmesg | grep usb
    [    0.000000] Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:BD:B0:33 vc_mem.mem_base=0x1fa00000 vc_mem.mem_size=0x20000000  tz=CET-1CEST,M3.5.0,M10.5.0/3 dwc_otg.fiq_fsm_mask=0xF host=piCorePlayer dwc_otg.lpm_enable=0 console=tty1 root=/dev/ram0 elevator=deadline rootwait quiet nortc loglevel=3 noembed smsc95xx.turbo_mode=N noswap consoleblank=0 waitusb=2
    [    0.091435] usbcore: registered new interface driver usbfs
    [    0.091499] usbcore: registered new interface driver hub
    [    0.091629] usbcore: registered new device driver usb
    [    0.646198] usbcore: registered new interface driver smsc95xx
    [    0.674114] dwc_otg 20980000.usb: base=0xf0980000
    [    1.074767] dwc_otg 20980000.usb: DWC OTG Controller
    [    1.074811] dwc_otg 20980000.usb: new USB bus registered, assigned bus number 1
    [    1.074864] dwc_otg 20980000.usb: irq 56, io mem 0x00000000
    [    1.075188] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    1.075199] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    1.075206] usb usb1: Product: DWC OTG Controller
    [    1.075212] usb usb1: Manufacturer: Linux 4.14.81-pcpCore dwc_otg_hcd
    [    1.075219] usb usb1: SerialNumber: 20980000.usb
    [    1.077116] usbcore: registered new interface driver usb-storage
    [    1.081356] usbcore: registered new interface driver usbhid
    [    1.081362] usbhid: USB HID core driver
    [    1.492201] usb 1-1: new low-speed USB device number 2 using dwc_otg
    [    1.786870] usb 1-1: New USB device found, idVendor=16c0, idProduct=27db
    [    1.786886] usb 1-1: New USB device strings: Mfr=1, Product=0, SerialNumber=0
    [    1.786893] usb 1-1: Manufacturer: HXGCoLtd
    [    1.804354] input: HXGCoLtd as /devices/platform/soc/20980000.usb/usb1/1-1/1-1:1.0/0003:16C0:27DB.0001/input/input0
    [    1.872773] hid-generic 0003:16C0:27DB.0001: input,hiddev96,hidraw0: USB HID v1.10 Keyboard [HXGCoLtd] on usb-20980000.usb-1/input0
    [   15.060625] usbcore: registered new interface driver brcmfmac
    [  292.552313] usb 1-1: USB disconnect, device number 2
    [ 1305.402147] usb 1-1: new low-speed USB device number 3 using dwc_otg
    [ 1305.636776] usb 1-1: New USB device found, idVendor=16c0, idProduct=27db
    [ 1305.636792] usb 1-1: New USB device strings: Mfr=1, Product=0, SerialNumber=0
    [ 1305.636799] usb 1-1: Manufacturer: HXGCoLtd
    [ 1305.658059] input: HXGCoLtd as /devices/platform/soc/20980000.usb/usb1/1-1/1-1:1.0/0003:16C0:27DB.0002/input/input1
    [ 1305.723118] hid-generic 0003:16C0:27DB.0002: input,hiddev96,hidraw0: USB HID v1.10 Keyboard [HXGCoLtd] on usb-20980000.usb-1/input0
    if you need any other output let me know

  2. #12
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    16,644
    Simple first thing to try with "flaky" USB devices is to try with a USB hub - in case power or incompatibility of some sort.

    According to website which gathers USB ids ID 16c0:27db - it is a "Free USB HID/PID pair for use with V-USB projects" and should be driven by an open source driver. V-USB devices use a micrcontroller.

    AFAIK PCP only has a subset of drivers (and I think fewer than Tinycore) and perhaps the one which is included for generic HID is not quite compatible with the device althoiugh it looks like VUSB is widely used.

    What is the USB device driver used on Tinycore which you tested and worked OK - the following will show possible modules lsmod | grep hid

    If lsusb is available (may need to be run with sudo) - see if there a difference between tinycore and pcp with lsusb -v -d 16c0:27db

  3. #13
    Junior Member
    Join Date
    Oct 2014
    Posts
    12
    sorry for bombing my own thread, but after just using a diffrent piZero (with the same sd card) this one does not seam to have the problem
    Code:
    sudo cat /dev/tty0
    001025213
    001625213
    001025213
    001625213
    0016025213
    0016025213
    0016025213
    0016025213
    0016025213
    0016025213
    0016025213
    0016025213
    0016025213
    0016025213
    001025213
    0016025213
    0016025213
    001025213
    0016025213
    0016025213
    0016025213
    but if I run my python code:

    Code:
    from socket import socket
    
    def main():
    
        with open('/dev/tty0', 'r') as tty:
            while True:
                RFID_input = tty.readline()
                if len(RFID_input) == 10:
                    print "Access Granted" 
                    print "Read code from RFID reader:{0}".format(RFID_input)
                    sock = socket()
                    sock.connect(('xxxxxxx', xxxxxx))
                    #sock.send(str(RFID_input)+'\n')
                    sock.send('item|rfid.received_id|'+str(RFID_input)+'\n')
                    sock.close()
                    print "Send RFID: " + RFID_input 
                    print len(RFID_input)
                else:
                    print 'wrong length'
                    print "RFID: " + RFID_input 
                    print len(RFID_input)
    
        tty.close()
    main()
    i still don┤t get usable results:

    Code:
    sudo python read.py
    wrong length
    RFID: 01602213
    
    9
    wrong length
    RFID: 01602521
    
    9
    wrong length
    RFID: 0016252130016025213
    
    20
    wrong length
    RFID: 0010252130016025213
    
    20
    wrong length
    RFID: 00102521
    
    9
    wrong length
    RFID: 0016252130016025213
    
    20
    wrong length
    RFID: 00102521
    
    9
    wrong length
    RFID: 00162521
    
    9
    wrong length
    RFID: 00162523
    
    9
    wrong length
    RFID: 00162521
    
    9
    wrong length
    RFID: 0016252130016025213
    
    20
    wrong length
    RFID: 0016252130016025213
    
    20
    wrong length
    RFID: 00102521
    
    9
    wrong length
    RFID: 0016252130016025213
    
    20
    wrong length
    RFID: 00162521300602523
    
    18
    wrong length
    RFID: 0016252130016025213
    
    20
    wrong length
    RFID: 0016252130016025213
    
    20
    Access Granted
    Read code from RFID reader:001605213
    
    Send RFID: 001605213
    
    10
    Last edited by marcov; 2018-12-27 at 16:01.

  4. #14
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    16,644
    After you plugin the rfid device - are there then two "keyboards" plugged into the Pi or are you accessing the pi over network ?

  5. #15
    Junior Member
    Join Date
    Oct 2014
    Posts
    12
    I┤m accesing through network (wireless) and there is only one keybord (the rfid Reader) connected and Nothing else
    About the other suggestions from your side, I will check tomorrow but allready thank you for your efforts

  6. #16
    Junior Member
    Join Date
    Oct 2014
    Posts
    12
    Quote Originally Posted by bpa View Post
    What is the USB device driver used on Tinycore which you tested and worked OK - the following will show possible modules lsmod | grep hid
    no output both on tinylinux and piCoreplayer image:
    Code:
    tc@piCorePlayer:~$ lsmod | grep hid
    tc@piCorePlayer:~$
    Code:
    tc@box:~$ lsmod | grep hid
    tc@box:~$
    Quote Originally Posted by bpa View Post
    If lsusb is available (may need to be run with sudo) - see if there a difference between tinycore and pcp with lsusb -v -d 16c0:27db
    tinylinux:
    Code:
    tc@box:~$ lsusb -v -d 16c0:27db
    Bus 001 Device 001: ID 1d6b:0002
    Bus 001 Device 003: ID 0424:ec00
    Bus 001 Device 002: ID 0424:9512
    Bus 001 Device 004: ID 16c0:27db
    picoreplaer:
    Code:
    tc@piCorePlayer:~$ lsusb -v -d 16c0:27d
    Bus 001 Device 001: ID 1d6b:0002
    Bus 001 Device 002: ID 16c0:27db

  7. #17
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    16,644
    Very odd lsusb did not give verbose info about USB such as
    Code:
    minitower:/mnt/hddrive/home/xxxx14.04$ lsusb
    Bus 002 Device 002: ID 8087:8000 Intel Corp. 
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 002: ID 8087:8008 Intel Corp. 
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 005: ID 0bc2:3312 Seagate RSS LLC SRD00F2 Expansion Desktop Drive (STBV)
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 004: ID 7392:a812 Edimax Technology Co., Ltd 
    Bus 003 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
    Bus 003 Device 003: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    minitower:/mnt/hddrive/home/xxxx14.04$ sudo lsusb -v -d 046d:c077
    [sudo] password for xxxx: 
    
    Bus 003 Device 003: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass            0 (Defined at Interface level)
      bDeviceSubClass         0 
      bDeviceProtocol         0 
      bMaxPacketSize0         8
      idVendor           0x046d Logitech, Inc.
      idProduct          0xc077 M105 Optical Mouse
      bcdDevice           72.00
      iManufacturer           1 Logitech
      iProduct                2 USB Optical Mouse
      iSerial                 0 
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength           34
        bNumInterfaces          1
        bConfigurationValue     1
        iConfiguration          0 
        bmAttributes         0xa0
          (Bus Powered)
          Remote Wakeup
        MaxPower              100mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         3 Human Interface Device
          bInterfaceSubClass      1 Boot Interface Subclass
          bInterfaceProtocol      2 Mouse
          iInterface              0 
            HID Device Descriptor:
              bLength                 9
              bDescriptorType        33
              bcdHID               1.11
              bCountryCode            0 Not supported
              bNumDescriptors         1
              bDescriptorType        34 Report
              wDescriptorLength      46
             Report Descriptors: 
               ** UNAVAILABLE **
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x81  EP 1 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0004  1x 4 bytes
            bInterval              10
    Device Status:     0x0000
      (Bus Powered)
    Last edited by bpa; 2018-12-28 at 02:42.

  8. #18
    Senior Member
    Join Date
    Sep 2005
    Posts
    2,752
    Quote Originally Posted by marcov View Post
    sorry for bombing my own thread, but after just using a diffrent piZero (with the same sd card) this one does not seam to have the problem
    what kind of python is picore running 2.7 or 3?

  9. #19
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,153

    issues with reading rfid (missing digits)

    > what kind of python is picore running 2.7 or 3?

    From the extensions I see 3.4-3.6 available for installation.

    --

    Michael

  10. #20
    Senior Member
    Join Date
    Sep 2005
    Posts
    2,752
    Quote Originally Posted by mherger View Post
    > what kind of python is picore running 2.7 or 3?

    From the extensions I see 3.4-3.6 available for installation.

    --

    Michael
    thx.
    than i would start with something like this instead of closing tty - that seems the problematic part

    Code:
    def main():
    
            while True:
                RFID_input = input()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •