wabson / chafon-rfid Goto Github PK
View Code? Open in Web Editor NEWRead RFID data from Chafon UHF readers
License: MIT License
Read RFID data from Chafon UHF readers
License: MIT License
I've found your repo as I'm trying to connect to a chafon 6403 reader
I've only been able to write a socket to the reader on port 27011 ip 192.168.0.250 and get the device name I set up with a at command. Afterwards I tried to send a well formated command for getting reader info 0x04 0xff 0x21 (which is displayed as ! in the screen shot) but no answer from the device!.
The example below is calculated with the checksum function I found in your code.
Previously I tried with mine but it was not working also.
I saw a previous post of someone trying also to use the same reader but nohing more to be sure that the reader works well or not with your code.
The chafon 6402 appears to be in the working device list, I hope that the 6403 could also work?
Do you think/know if your code can run for that device?
I tried to run the get-reader-info first but I got an error.
Which value may I add in order to let the coding working better?
The issue I've is the folowing (I've added trace comment in the code)
Perhaps because the device is not declared in the class ReaderType?
Which value could fit? How can I calculate it?
Thanks a lot for reading
Hello guys
What are your expperience on these RFID-Module's range? I got my RFID reader from Chafon up and running but the range is too short. On their website it is stated that it can reach 15mbut mine barely did 5m.
Hey guys,
Congrats on this awesome project!
I am using the Product Model:CF-RU5112 through serial port (directly connected to gpio txd/rxd) on the raspberry pi 3b.
I installed the libs and enabled serial connection through raspi-config but when i try to get reader info:
sudo python3 get-reader-info.py /dev/ttyS0
sudo python3 get-reader-info.py /dev/ttyAMA0
I am gettting unkown reader type: response must be at least 5 bytes.
Any idea what i am missing? Btw. The device shows a red light, i assume once it does a read the light will turn green for a sec.
As mentioned in #2
Hi, I've been working on continuous-read.py from example folder and working good so far, everything is working I'm able to update the scanned cards through google spreadsheet. Im using a reader with capable of connecting 4 antenna, however the continous-read.py only works with a single antenna connected to it. Is there a way to tweak on the script so that 4 antennas can work at the same time?
Thank you.
Hi Will,
When I am trying to run a single-read.py in the example I am getting the following error.
File "single-read.py", line 21, in
reader_info = ReaderInfoFrame(runner.run(get_reader_info))
File "{PYTHONPATH}:$(pwd)/chafon_rfid/base.py", line 31, in run
self.transport.write(command.serialize())
File "{PYTHONPATH}:$(pwd)//chafon_rfid/transport.py", line 33, in write
self.write_bytes(byte_array)
File "{PYTHONPATH}:$(pwd)//chafon_rfid/transport.py", line 55, in write_bytes
self.socket.sendall(byte_array)
BrokenPipeError: [Errno 32] Broken pipe
Could you please explain the usage of the examples in brief ?
Thanks
We have a project where we want to read multiple tags at once.
Using the Chafom Reader.exe program on Windows and connected via USB to a CF-RU5309 (I think) it all works as expected.
But my code based on this library running on an Arduino Nano talking to a custom board via USB which talks to the reader via serial only reads 1 tag at a time (it briefly read 2 tags but that seems to have been an anomaly).
Per the SDK, I send an Identify command 0x53, 0x57, 0x00 ,0x03 ,0xFF ,0x01, 0x53
per the manual and I get back 1 tag.
Their Reader.exe software sends 0x53, 0x57, 0x00 ,0x06 ,0xFF ,0x01, 0x00, 0x00, 0x00, 0x50
which appears to contain dummy data (the last 3 0x00 bytes) which (a) is different and (b) doesn't work for me at all.
Has anyone had any success with using serial comms to talk to their reader?
I know this is kinda outdated tech but the project I'm working on requires USB for output from the board and serial to talk to the RFID reader.
Any help would be greatly appreciated...
I'm getting this error when first trying to request info from the reader:
ValueError: 16 is not a valid ReaderType
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 16, in
main()
File "main.py", line 10, in main
reader_info = ReaderInfoFrame(runner.run(get_reader_info))
File "/home/dylan/ProgrammingProjects/HomeAutomation/inventory/lib/python3.8/site-packages/chafon_rfid/base.py", line 90, in init
self.type = ReaderType(self.data[2])
File "/usr/lib/python3.8/enum.py", line 304, in call
return cls.new(cls, value)
File "/usr/lib/python3.8/enum.py", line 595, in new
raise exc
File "/usr/lib/python3.8/enum.py", line 579, in new
result = cls.missing(value)
File "/usr/lib/python3.8/enum.py", line 608, in missing
raise ValueError("%r is not a valid %s" % (value, cls.name))
ValueError: 16 is not a valid ReaderType
I'm using this reader: https://www.aliexpress.com/item/32848525319.html?spm=a2g0s.9042311.0.0.7a934c4dVwbCiA
connected over USB via the interface board on the same page.
I've tried to strip my code down to what I think is the absolute minimum to connect and get the info based on the examples. It looks like this:
from chafon_rfid.base import CommandRunner, ReaderCommand, ReaderInfoFrame
from chafon_rfid.command import CF_GET_READER_INFO, G2_TAG_INVENTORY
from chafon_rfid.transport_serial import SerialTransport
def main():
get_reader_info = ReaderCommand(CF_GET_READER_INFO)
get_inventory_uhfreader18 = ReaderCommand(G2_TAG_INVENTORY)
transport = SerialTransport(device='/dev/ttyUSB1')
runner = CommandRunner(transport)
reader_info = ReaderInfoFrame(runner.run(get_reader_info))
print('Reader info: type %s version %d.%d, power %d dB ' % (reader_info.type.name, reader_info.firmware_version[0], reader_info.firmware_version[1], reader_info.power))
print('Frequency info: region %s, %.1f-%.1f MHz' % (reader_info.frequency_band.name, reader_info.get_min_frequency(), reader_info.get_max_frequency()))
if __name__ == "__main__":
main()
I initially attempted to solder some wires to the reader via the connections on the edges. They are separate from the serial cable it is connected to now but I definitely scorched the edge connections a little before I gave up on soldering it, broke down and ordered the interface board. So I'm concerned there may be some hardware damage and I'm getting garbage data.
However, I tried connecting to another USB serial port for an unrelated device and it gave me a different error a bit earlier in the connection:
ValueError: Checksum does not match
which makes me hopeful that might not be the issue.
Another possibility that's occurred to me is just that the format is a little different. I do have the specs for the reader and I'm a programmer by trade (though not a specialist in Python) so I'm not averse to trying to patch the library.
Traceback (most recent call last):
File "get-reader-info.py", line 46, in
print_reader_info(sys.argv[1])
File "get-reader-info.py", line 32, in print_reader_info
reader_info = get_reader_info(runner)
File "get-reader-info.py", line 15, in get_reader_info
reader_info = ReaderInfoFrame(runner.run(get_reader_info))
File "/usr/local/lib/python3.8/dist-packages/chafon_rfid/base.py", line 31, in run
self.transport.write(command.serialize())
File "/usr/local/lib/python3.8/dist-packages/chafon_rfid/transport.py", line 33, in write
self.write_bytes(byte_array)
File "/usr/local/lib/python3.8/dist-packages/chafon_rfid/transport.py", line 55, in write_bytes
self.socket.sendall(byte_array)
BrokenPipeError: [Errno 32] Broken pipe
I feel really dumb to ask this but how can I connect the CF-MU804 to PC or microcontroller without the interface board from Chafon? I found the pinout on their website so theoretically I can just connect the right pins into a Rs232 adapter right? Or are there any power issues?
I can see that you're adjusting the RF power setting for the reader in the continuous-read.py example, but do you happen to know what the command frame is for adjusting the RF power setting per antenna please?
I've been provided a copy of a Windows SDK for a UHFReader288MP type reader which allows the RF power for each antenna to be set independently, and their included C# user manual references this ability too, but I can't find any reference to the byte command that achieves this functionality.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.