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

    i tried with python3 (by putting #!/usr/bin/env python3 in the first line) but get

    Code:
      File "test.py", line 17, in <module>
        main()
      File "test.py", line 9, in main
        RFID_input = input()
      File "<string>", line 1
        01109679
               ^
    SyntaxError: invalid token
    which in my opinion proofs that this python2

    I checked again this project:
    https://github.com/MiczFlor/RPi-Jukebox-RFID#install

    I tried the codes in the scipt folder (on tinycore) there but this requiered to many python packages (like evdev, that has certain requirements) that are not available for tinycorelinux. So at the moment I think I will just use a standard raspbian image and give it a try with the project allthoug everything I need from there is to read the code.
    Thanks for efforts anyway and sorry I cannot bring this to a good end.
    Anyway thanks for your help.

  2. #22
    Junior Member
    Join Date
    Oct 2014
    Posts
    12
    suceeded after deciding to give up...

    i used the code from the github project, reduced it to what i needed and was able to install evdev on the piCorePlayer image. Now it reads 100% of the tags correct with this code:
    Code:
    from socket import socket
    from evdev import InputDevice, categorize, ecodes, list_devices
    from select import select
    
    dev1= InputDevice('/dev/input/event0')
    keys = "X^1234567890XXXXqwertzuiopXXXXasdfghjklXXXXXyxcvbnmXXXXXXXXXXXXXXXXXXXXXXX"
    
    def send_ID(ID):
        sock = socket()
        sock.connect((IPIPIPIP', PORT))
        #sock.send(str(ID)+'\n')
        sock.send('item|rfid.received_id|'+str(ID)+'\n')
        sock.close()
    
    while True: 
            stri=''
            key = ''
            while key != 'KEY_ENTER':
               r,w,x = select([dev1], [], [])
               for event in dev1.read():
    
                if event.type==1 and event.value==1:
                    stri+=keys[ event.code ]
                    #print( keys[ event.code ] )
                    key = ecodes.KEY[ event.code ]
            print stri[:-1]
            send_ID(stri[:-1])
    I added into opt/.filetool.lst:
    Code:
    usr/local/lib/python2.7/site-packages/evdev-1.1.2-py2.7-linux-armv6l.egg
    but after reboot evdev was no more there.
    so i added the whole Folder:
    Code:
    usr/local/lib/python2.7/site-packages
    i understand that i should put as less as possible in the backup, so how can i only make this one file persistant?

    can I also delete the instalation Folder of evdev (stored in /home/tc) or do i need to keep it?


    In case not, is there any possibility to store everything as it is now?

    Thanks a lot for your help so far
    Last edited by marcov; 2018-12-29 at 16:26.

Posting Permissions

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