Cannot get incoming data from rfid reader

I have a rfid reader connected to Jetson ( reComputer J1010). Following are the connection details.
“type”: “rfid-reader”,
“connection_type”: “usb”,
usb_port": “3”,
“port”: “/dev/ttyUSB0”,
“baudrate”: 19200,
“timeout”: 2,

The reader is connected properly and I can locate it at /dev/ttyUSB0. I have given permission to the reader using chmod 777 ttyUSB0 so that it has all the permissions it needs. The task is to create a csv file of all the tags it picks up at specific time.

The serial port is open for the rfid reader when connected with the jetson. The jetson shows there is no incoming data from the rfid reader. But when the rfid reader is connected to laptop, its picking up all the tags that are passing by.

The python code is as follows
def rfid_reader(ser, today, time_string, rfid_file_path, rfid_reader_queue, RFID_reader):

while ser.is_open:
    incomingByte = ser.readline(25)
    try:
        if (incomingByte != b''):
            raw = codecs.encode(incomingByte, 'hex').decode('ascii')
            hexa = codecs.encode(incomingByte[5:13], 'hex').decode('ascii')
            reversedorder = "".join(reversed([hexa[i:i + 2] for i in range(0, len(hexa), 2)]))
            binarystring = bin(int(reversedorder, 16))[2:]
            binarystring = binarystring.zfill(64)
            binaryID = binarystring[26:64]
            binaryCountrycode = binarystring[16:26]
            IDnumber = int(binaryID, 2)
            Countrycodenumber = int(binaryCountrycode, 2)

            Dict = {'Date': date.today().strftime("%d/%m/%Y"), 'Time': datetime.now().strftime('%H:%M:%S'),
                    'Countrycode': Countrycodenumber, 'EID': IDnumber, 'RAW': raw}

            df = pd.DataFrame(Dict, index=[0])

            # if file does not exist write header
            if not os.path.isfile(rfid_file_path):
                df.to_csv(rfid_file_path, header=('Date', 'Time', 'Countrycode', 'EID', 'RAW'))
            else:  # else it exists so append without writing the header
                df.to_csv(rfid_file_path, mode='a', header=False)
    except:
        print('RFID data type is wrong')
        RFID_reader.RFID_is_running = False
        run_shell_command(
            'echo RFID_status_not_running > /home/pi/RFIDstatus.txt', require_output=False)

It is coming inside the try block and checks the incoming byte. since the incoming byte is b’', it’s not creating the csv file. Could someone please help me to solve the error?

Hi tamilselvi9621,

It seems you are using the custom carrier board for TX2.
What’s your Jetpack version in use?

Have you tried to check if there any message coming from /dev/ttyUSB0 with the following command?

# cat /dev/ttyUSB0 &

We could not help with checking your custom python application.
Do you mean that you could receive the data but the content is not expected so that the csv doesn’t be created?

Package: nvidia-jetpack
Version: 4.6-b197

The message I received is “25276”

I mean, I am not receiving any data from the RFID reader.

That is just the PID running in the background.

Have you also tried to measure if there any data send from RFID to Jetson though UART-RX?

What’s your driver for RFID reader?

USB driver. Its in /dev/ttyUSB0

No, I have tried. Could you suggest me how to do it?

Please use oscilloscope to measure if there’s any data on the UART-RX of the board.
There should be some data output from RFID to the board through UART-RX.

Yeah, there is data output from the RFID reader

Which serial port (UART interface) are you using to receive the data from RFID reader?

SL031

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Sorry that I’m not clear about SL031 mapping to which UART interface.
Could you share more detail of your UART interface? (which pins?)