1

I've previously used the RDM6300 with the Raspberry Pi 1 and it worked flawlessly. After switching to the Raspberry Pi 3 it won't read RFID tags anymore.

I'm certain I've connected everything correctly and the module is running. I've also edited config.txt (added enable_uart = 1) and cmdline.txt (removed console=serial0,115200).

The python script I use looks as follows:

#!/usr/bin/python
# coding=utf-8

import serial

# This is where I read the RFID tag

def read_rfid():
    ser = serial.Serial("/dev/ttyAMA0")
    ser.baudrate = 9600
    daten = ser.read(14)
    ser.close()    
    daten = daten.replace("\x02", "" )
    daten = daten.replace("\x03", "" )
    return daten

id = read_rfid()
print id

That's all I needed to get the script working on my old Pi 1. What changed from Pi 1 to Pi 3? What additional changes do I have to make?

1

/dev/ttyAMA0 is connected to Bluetooth.

Try /dev/serial0 (assuming this is connected to the Pi serial port) console=serial0,115200 should have given a hint.

You can check which devices are available in /dev/

  • Bear with me here, because I'm sure if I'm doing this right. I tried using /dev/serial0 instead of /dev/ttyAMA0, but it tells me that no such directory exists. When I try /dev/tty[1-61] I'm getting "permission denied". Am I misunderstanding something here? – dwhagawhdgajwgd Feb 9 '17 at 10:08
  • Check that /dev/serial0 exists. If you literally had enable_uart = 1 this may explain the reason it would not. Ideally you should use raspi-config to enable, rather than manually editing. See How-do-i-make-serial-work-on-the-raspberry-pi3 for more detail. – Milliways Feb 9 '17 at 10:14
-1

I have encountered the same problem when using a RPi 3B+ - changing the port to //dev/ttyS0 worked for me (yes, double // in front of the dev).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.