Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Junior Member
    Join Date
    Oct 2014
    Posts
    12

    issues with reading rfid (missing digits)

    I┤m trying to build a player for my 2 years old son. I found some ideas like "jukebox 4 kids" on the web, but I┤d like to integrate it in my Squeezebox setup.
    I bought a pi zero w and a hiffiberry for pi zero, i used picoreplayer (version 4.1.0) and used a python script that should read the rfid tags and just send them thought the network to a my server where i can then add action to the tags.
    I have bought a neuftech RFID reader, which was recomended to use for the jukebox 4 kids project. The reader behaves as a keybord, it puts the 10 degitis of the tag + enter. I have the problem now that with the picoreplayer image there are often missing digits, even if I just do it with
    Code:
    sudu cat /dev/tty0
    I┤d say this is the case in 80%
    It is working in the same setup with other images, anyway I prefer using picoreplayer. So I wonder wheather I can add any extension that will improve the reading from tty. By the way, I tried the same with a keyboard and no input was ever missing, so it might be a power issue as well but caused by picoreplayer image.
    My pythoncode is:
    Code:
    import time
    import sys
    from socket import socket
    
    def main():
    	while True:
    		sys.stdin = open('/dev/tty0', 'r')
    		RFID_input = raw_input()
    		sock = socket()
    		sock.connect(('xxxx', xxx))
    		#sock.send(str(RFID_input)+'\n')
    		sock.send('item|rfid.received_id|'+str(RFID_input)+'\n')
    		sock.close()
    
    		print "Send RFID: " + RFID_input
    main()

  2. #2
    Senior Member
    Join Date
    Sep 2005
    Posts
    2,751
    Quote Originally Posted by marcov View Post
    The reader behaves as a keybord, it puts the 10 degitis of the tag + enter. I have the problem now that with the picoreplayer image there are often missing digits
    Always check the input before doing something !!
    Code:
    if len(RFID_input) == 10:
       do something

  3. #3
    Junior Member
    Join Date
    Oct 2014
    Posts
    12
    Thanks for your reply and suggestion. I was thinking about this, but this would mean that you┤d need to hold the tag about 5 times in front of the Reader before you will receive the correct tag.
    So I was wondering if it has to do with the drivers of Tiny core Linux or with the powermanagement, and would like to fix it "clean", because with other Images I get valid readings in 99%.

  4. #4
    Senior Member
    Join Date
    Sep 2005
    Posts
    2,751
    I would say its not a driver but a latency issue.
    Did you tried tinycore already?

    Thats the base of picore but doesnt run in ram.

  5. #5
    Junior Member
    Join Date
    Oct 2014
    Posts
    12
    thanks for your reply. I was not able to set up wifi on tiny core but will try again and see if this will work better.
    I wonder if it is a problem about the latency if it will be possible to stay with picoreplayer and solve this issue or if this is due to the system design and cannot be fixed.

  6. #6
    Senior Member
    Join Date
    Sep 2005
    Posts
    2,751
    Quote Originally Posted by marcov View Post
    thanks for your reply. I was not able to set up wifi on tiny core
    You didnt need wifi to check the "keyboard" sends 10 digits

  7. #7
    Junior Member
    Join Date
    Oct 2014
    Posts
    12
    yes but I need Wifi or a monitor output (on a pi zero) to be able to login etc as I have not monitoradapter, I need wifi.
    Anyway I just tried with tinycore 9.0.3 on an older raspberry with lan port and it reads like the raspian image:
    Code:
    login as: tc
    tc@192.168.10.133's password:
       ( '>')
      /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY.
     (/-_--_-\)           www.tinycorelinux.net
    
    tc@box:~$ cat /dev/tty0
    cat: can't open '/dev/tty0': Permission denied
    tc@box:~$ sudo cat /dev/tty0
    01049
    06268
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    you see the first two readings are not correct but all the following ones are. So I now wonder what is the diffrence from this to picoreplayer 4.0.1

  8. #8
    Junior Member
    Join Date
    Oct 2014
    Posts
    12
    so I now double checked again with piCoreplayer 4.0.1 on the old raspberry and the result was okay, the first two readings where incomplete the others where complete. So I got back to the piZero and here I see the problem again:
    Code:
    tc@piCorePlayer:~$ sudo cat /dev/tty0
    0016024698
    001624698
    01602698
    001024698
    0016024698
    0016024698
    0016024698
    0016024698
    001024698
    0016024698
    0016024698
    001024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    00102698
    0016024698
    001624698
    001624698
    0016024698
    001024698
    00102698
    001624698
    001624698
    001624698
    016024698
    001624698001624698
    0016024698
    001624698
    00102698
    So i guess it is an issue with the piZero -> can it be cause by the cable? I tried diffrent usb cables but I only have one adapter caple from USB A to micro usb that is not specified for piZero
    Last edited by marcov; 2018-12-27 at 09:48.

  9. #9
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    16,638
    Quote Originally Posted by marcov View Post
    so I now double checked again with piCoreplayer 4.0.1 on the old raspberry and the result was okay, the first two readings where incomplete the others where complete. So I got back to the piZero and here I see the problem again:
    Code:
    tc@piCorePlayer:~$ sudo cat /dev/tty0
    0016024698
    001624698
    01602698
    001024698
    0016024698
    0016024698
    0016024698
    0016024698
    001024698
    0016024698
    0016024698
    001024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    0016024698
    00102698
    0016024698
    001624698
    001624698
    0016024698
    001024698
    00102698
    001624698
    001624698
    001624698
    016024698
    001624698001624698
    0016024698
    001624698
    00102698
    So i guess it is an issue with the piZero -> can it be cause by the cable? I tried diffrent usb cables but I only have one adapter caple from USB A to micro usb that is not specified for piZero
    With a serial device it looks like flow control of the data from the USB device is not being managed.
    What is the usb device and vendor id of the rfid reader ? Which device driver is it using ?

  10. #10
    Senior Member
    Join Date
    Sep 2005
    Posts
    2,751
    Quote Originally Posted by marcov View Post
    So i guess it is an issue with the piZero -> can it be cause by the cable? I tried diffrent usb cables but I only have one adapter caple from USB A to micro usb that is not specified for piZero
    The Zero is tricky and it only gots a single usb Port.
    Is the "old" RPI a V3?
    Did you disable Bluetooth and the zero?

Posting Permissions

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