nkargas / Gen2-UHF-RFID-Reader

Gen2 UHF RFID reader with USRP and GNU Radio. Tested with USRPN200 and GNU Radio v3.7.4
GNU General Public License v3.0
220 stars 121 forks source link

Unable to read tag information #10

Closed kingyxz closed 2 years ago

kingyxz commented 4 years ago

My test environment is Ubuntu16.04 + USRP N210 + SBX, the following problems occurred, ask the author for advice. 1 2

nkargas commented 4 years ago

Did you uncomment the line self.source.set_auto_dc_offset(False) in reader.py file cd Gen2-UHF-RFID-Reader/gr-rfid/apps ?

What type of antennas are you using? Can you give some information about your setup?

Can you please follow the instructions of the Debugging section and post the output that you get?

kingyxz commented 4 years ago

Testing environment is Ubuntu16.04 + USRP N200 + WBX I uncomment the line self.source.set_auto_dc_offset(False) I am using two sucker antennas.In addtion,no other settings have changed The output of the source folder is as shown below Ubuntu -2020-01-18-15-08-18

kingyxz commented 4 years ago

The results obtained from each experiment are very different. Ubuntu -2020-01-15-17-57-52

marxwolf commented 4 years ago

@kingyxz Do you solve your problem? I am into the same problem.

marxwolf commented 4 years ago

@nkargas This is my source look like: source It looks not like your given figure.eps

kingyxz commented 4 years ago

I solved this problem by using circular polarization antenna

------------------ 原始邮件 ------------------ 发件人: "nkargas/Gen2-UHF-RFID-Reader" <notifications@github.com>; 发送时间: 2020年9月11日(星期五) 中午12:42 收件人: "nkargas/Gen2-UHF-RFID-Reader"<Gen2-UHF-RFID-Reader@noreply.github.com>; 抄送: "殷宪祯"<1475379381@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [nkargas/Gen2-UHF-RFID-Reader] Unable to read tag information (#10)

@kingyxz Do you solve your problem? I am into the same problem.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

marxwolf commented 4 years ago

@kingyxz I already use the circular polarized antennas. It does not work.

marxwolf commented 4 years ago

This is what happened:

hu@hu:~/rfid/Gen2-UHF-RFID-Reader/gr-rfid/apps$ sudo GR_SCHEDULER=STS nice -n -20 python ./reader.py [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.HEAD-0-gaea0e2de [INFO] [X300] X300 initialization sequence... [INFO] [X300] Maximum frame size: 1472 bytes. [INFO] [X300] Radio 1x clock: 200 MHz [INFO] [GPS] Found an internal GPSDO: LC_XO, Firmware Rev 0.929b [INFO] [0/DmaFIFO_0] Initializing block control (NOC ID: 0xF1F0D00000000000) [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1312 MB/s) [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1306 MB/s) [INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000000001) [INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000000001) [INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000000) [INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000000) [INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000000) [INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000000) 'Q' to quit UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU| Execution time : 13 seconds Uq


| Number of queries/queryreps sent : 1000 | Current Inventory round : 1001

| Correctly decoded EPC : 0 | Number of unique tags : 0

marxwolf commented 4 years ago

@nkargas Does the code only works for commercial Gen2 RFID Tags with FM0 line coding and 40kHz data rate (BLF)? How can I know my tag is this type or not?

marxwolf commented 4 years ago

@kingyxz How do you place the antennas and tags? Is it important to make them in the right place and orientation?

marxwolf commented 4 years ago

@nkargas self.usrp_address_source = "addr=192.168.10.2,recv_frame_size=256" self.usrp_address_sink = "addr=192.168.10.2,recv_frame_size=256" Why do you put recv_frame_size=256 here, it cause a problem, hu@hu:~/rfid/Gen2-UHF-RFID-Reader/gr-rfid/apps$ sudo GR_SCHEDULER=STS nice -n -20 python ./reader.py [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.HEAD-0-gaea0e2de [INFO] [X300] X300 initialization sequence... [ERROR] [X300] RuntimeError: System receive MTU size is less than the minimum required by the IP protocol. [WARNING] [X300] You requested a receive frame size of (256) but your NIC's max frame size is (0).Please verify your NIC's MTU setting using 'ip link' or set the recv_frame_size argument appropriately.UHD will use the auto-detected max frame size for this connection. [WARNING] [X300] For the 192.168.10.2 connection, UHD recommends a send frame size of at least 1472 for best performance, but your configuration will only allow 0.This may negatively impact your maximum achievable sample rate. Check the MTU on the interface and/or the send_frame_size argument. [WARNING] [X300] For the 192.168.10.2 connection, UHD recommends a receive frame size of at least 1472 for best performance, but your configuration will only allow 0.This may negatively impact your maximum achievable sample rate. Check the MTU on the interface and/or the recv_frame_size argument. [INFO] [X300] Radio 1x clock: 200 MHz [INFO] [GPS] Found an internal GPSDO: LC_XO, Firmware Rev 0.929b [INFO] [0/DmaFIFO_0] Initializing block control (NOC ID: 0xF1F0D00000000000) [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1319 MB/s) [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1313 MB/s) [INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000000001) [INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000000001) [INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000000) [INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000000) [INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000000) [INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000000) [WARNING] [RFNOC] Assuming max packet size for 0/Radio_0 [WARNING] [RFNOC] Assuming max packet size for 0/Radio_0 [WARNING] [RFNOC] Assuming max packet size for 0/Radio_1 [WARNING] [RFNOC] Assuming max packet size for 0/Radio_1 [WARNING] [RFNOC] Assuming max packet size for 0/DUC_0 [WARNING] [RFNOC] Assuming max packet size for 0/DUC_1 [WARNING] [RFNOC] Assuming max packet size for 0/DmaFIFO_0 [WARNING] [RFNOC] Assuming max packet size for 0/DmaFIFO_0 'Q' to quit [WARNING] [STREAMER] Requested recv_frame_size of 256 exceeds the maximum possible on this stream. Using 0

So I reset recv_frame_size=1472 or remove it, both works.

Does it affect?

kingyxz commented 4 years ago

Most tags on the market can be read successfully.Besides,the tag should face the circular polarization antenna as much as possible.

------------------ 原始邮件 ------------------ 发件人: "nkargas/Gen2-UHF-RFID-Reader" <notifications@github.com>; 发送时间: 2020年9月12日(星期六) 凌晨0:11 收件人: "nkargas/Gen2-UHF-RFID-Reader"<Gen2-UHF-RFID-Reader@noreply.github.com>; 抄送: "殷宪祯"<1475379381@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [nkargas/Gen2-UHF-RFID-Reader] Unable to read tag information (#10)

@kingyxz How do you place the antennas and tags? Is it important to make them in the right place and orientation?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

marxwolf commented 4 years ago

@kingyxz Thanks so much. I appreciate your generous help. I have another question, did you print the log information to the file? Did it work? I want to view the log to get more information.

Wangshuai8156 commented 4 years ago

I have a similar problem.Can anyone help me? My test environment is Ubuntu16.04 + USRP N210 + SBX+two circular polarization antenna.The two antennas are placed side by side with a distance of 70cm. The tags are 50cm away from the antennas.The number of tags often read is 0; Sometimes the tags can be read, but the number of times the EPC is decoded correctly is too few, as shown in the figure below. image

marxwolf commented 4 years ago

@Wangshuai8156 Can you show your plotted figure of received signal following the instruction of the debugging?

Wangshuai8156 commented 4 years ago

@Wangshuai8156 Can you show your plotted figure of received signal following the instruction of the debugging?

The source is look like this: image The gate is this: image The reader is this: image The file sink is this: image And decoder is empty.Looking forward to your help.Thank you!

Wangshuai8156 commented 4 years ago

I have attached the figure. I am looking forward to your reply. Thank you very much

---Original--- From: "Marx Wolf"<notifications@github.com> Date: Fri, Sep 25, 2020 00:14 AM To: "nkargas/Gen2-UHF-RFID-Reader"<Gen2-UHF-RFID-Reader@noreply.github.com>; Cc: "Mention"<mention@noreply.github.com>;"Wangshuai8156"<1114112081@qq.com>; Subject: Re: [nkargas/Gen2-UHF-RFID-Reader] Unable to read tag information (#10)

@Wangshuai8156 Can you show your plotted figure of received signal following the instruction of the debugging?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

marxwolf commented 4 years ago

In the debugging part, the author provides the ./misc/code/figure.eps ./misc/data/file_source_test, you'd probably to plot your received ./misc/data/source, zoom it and comparing with the plotted ./misc/code/figure.eps and ./misc/data/file_source_test to see the difference.

marxwolf commented 4 years ago

@Wangshuai8156 Try to use different combination of self.ampl and self.tx_gain, I do think there exists magic number for the combination. When you get the magic number, the code can decode all the received EPC successfully.

Wangshuai8156 commented 4 years ago

OK,thanks

------------------ 原始邮件 ------------------ 发件人: "nkargas/Gen2-UHF-RFID-Reader" <notifications@github.com>; 发送时间: 2020年10月4日(星期天) 中午11:29 收件人: "nkargas/Gen2-UHF-RFID-Reader"<Gen2-UHF-RFID-Reader@noreply.github.com>; 抄送: "心有灵犀"<1114112081@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [nkargas/Gen2-UHF-RFID-Reader] Unable to read tag information (#10)

@Wangshuai8156 Try to use different combination of self.ampl and self.tx_gain, I do think there exists magic number for the combination. When you get the magic number, the code can decode all the received EPC successfully.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Wangshuai8156 commented 4 years ago

By trying, I find a combination that allow me to decode EPC with a probability of about 70%. In addition, RN16 can be received every time, but the tags often don't return to the EPC, so that the EPC cannot be read. The distance between tags and reader is very close (less than 50cm). I wonder what causes this?  I'm  looking forward to your reply!

------------------ 原始邮件 ------------------ 发件人: "Marx Wolf"<notifications@github.com>; 发送时间: 2020年10月4日(星期天) 中午11:29 收件人: "nkargas/Gen2-UHF-RFID-Reader"<Gen2-UHF-RFID-Reader@noreply.github.com>; 抄送: "心有灵犀"<1114112081@qq.com>; "Mention"<mention@noreply.github.com>; 主题: Re: [nkargas/Gen2-UHF-RFID-Reader] Unable to read tag information (#10)

@Wangshuai8156 Try to use different combination of self.ampl and self.tx_gain, I do think there exists magic number for the combination. When you get the magic number, the code can decode all the received EPC successfully.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

marxwolf commented 4 years ago

@Wangshuai8156 The reason why the detection distance is very close is the transmission power. When tag is too far from the antenna, the power cannot activate the tags. You can use linear polarized antenna or power amplifier. The highest successfully probability is about 85%. Yes, the reason why it cannot reach 100% is also due to the possible power activation. RN16 is actually also not received sometime, but RN16 is random numbers, so the code might think the noise as RN16 here.

Wangshuai8156 commented 4 years ago

OK,thanks for your reply! My test hardware is USRP 2920 + antenna LairdS9028. The transmitting power of USRP 2920 is 30mw-100mw. The antenna is a right-handed circularly polarized antenna with an antenna gain of 9 dBic. The location of my hardware is shown in the figure below. The transmitting antenna and receiving antenna are placed side by side, and the distance between them is 50cm. Even if the tags are placed very close as shown in the figure, the EPC is often not received. However, sometimes EPC can be received, so RFID system is unstable. In addition, self.ampl and self.tx_gain The values of gain were 0.25 and 50, respectively. How can I improve my transmit power so that the reader can read the tags stably? If I want to read the tags every time, what hardware do I need to replace? To make matters worse, I added the select command and rebuilt it. As a result, the reader never received the EPC. Looking forward to your help!

------------------ 原始邮件 ------------------ 发件人: "Marx Wolf"<notifications@github.com>; 发送时间: 2020年10月11日(星期天) 凌晨0:12 收件人: "nkargas/Gen2-UHF-RFID-Reader"<Gen2-UHF-RFID-Reader@noreply.github.com>; 抄送: "心有灵犀"<1114112081@qq.com>; "Mention"<mention@noreply.github.com>; 主题: Re: [nkargas/Gen2-UHF-RFID-Reader] Unable to read tag information (#10)

@Wangshuai8156 The reason why the detection distance is very close is the transmission power. When tag is too far from the antenna, the power cannot activate the tags. You can use linear polarized antenna or power amplifier. The highest successfully probability is about 85%. Yes, the reason why it cannot reach 100% is also due to the possible power activation. RN16 is actually also not received sometime, but RN16 is random numbers, so the code might think the noise as RN16 here.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

nkargas commented 4 years ago

Hello,

Sorry I am not able to provide much help since I now work on a totally different field and it has been 5 years since I implemented this software.

When I implemented and tested the reader I had experimented only with RFX. Since then, many people have contacted me and were able to make the reader work with SBX by a minor modification mentioned in the How to run section.

There are some photos (setup+received signal) here: https://github.com/nkargas/Gen2-UHF-RFID-Reader/issues/4 I have also attached two photos with two different setups of mine and an example with a tag collision.

setup_collisions

setup

Wangshuai8156 commented 4 years ago

Thanks for your help! Your reply helped me a lot and I learned a lot from it.  The parameter for controlling the number of slots at each inventory round is set to 3 or 4.  When the reader cannot decode the EPC, there is no tag collision in the graph drawn by the source file, and there is no rn16 or EPC at all. As you said, noise is received as RN16. However, when the reader can decode EPC, EPC and RN16 appear in the figure.

In order to solve the problem, I connect the transmitter of USRP with spectrum analyzer(SA) directly. Then, I find the following two problems.

Firstly, when I run the program reader.py It is found that sometimes the transmitter does not send any signal, sometimes there is an instant disappearance signal (similar to impulse signal), and sometimes there is a continuous signal.Is your system stable? Do you have any suggestions for my question? I'm very eager for your advice.

Secondly, when a continuous signal appears, the signal power is only 7-8 dBm, as shown in Figure 1. This may not be enough for the activation tag. I want to know what the output power is when you do the experiment. However, the output power of the USRP 2920 I use can reach up to 20dbm. Is my parameter setting error as shown in Figure 2? How do you set it up? Besides,Second, the RF daughter board I use is WBX.

Looking forward for your rely! Best wishes for you!

------------------ 原始邮件 ------------------ 发件人: "nkargas/Gen2-UHF-RFID-Reader" <notifications@github.com>; 发送时间: 2020年10月12日(星期一) 凌晨1:50 收件人: "nkargas/Gen2-UHF-RFID-Reader"<Gen2-UHF-RFID-Reader@noreply.github.com>; 抄送: "心有灵犀"<1114112081@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [nkargas/Gen2-UHF-RFID-Reader] Unable to read tag information (#10)

Hello,

Sorry I am not able to provide much help since I now work on a totally different field and it has been 5 years since I implemented this software.

When I implemented and tested the reader I had experimented only with RFX. Since then, many people have contacted me and were able to make the reader work with SBX by a minor modification mentioned in the How to run section.

Apart from the three reasons mentioned in the Debugging section, you should also note that the reader may fail to decode the tags because of collisions (the default number of slots at each inventory round is 1). The parameter for controlling the number of slots at each inventory round is located at include/global_vars.h

The following is true: RN16 is actually also not received sometime, but RN16 is random numbers, so the code might think the noise as RN16 here. The reader cannot tell if there exists an RN16 or not. It will always try to decode the received signal.

If there are a lot of Os or Us at the terminal this is usually a latency issue. Either the computer needs to drop received samples or it cannot produce samples fast enough. I usually didn't have logging enabled. The easiest way to debug was to check the output of source or matched_filter block by uncommenting the corresponding lines in the reader.py file, plot the results and zoom.

There are some photos (setup+received signal) here: #4 I have also attached two figures with two different setups of mine and an example with a tag collision.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

IeohMingChan commented 3 years ago

@marxwolf hello,Have you solved the log information output problem now?I can't get any log information like "[INFO] XXXXX" neither from the terminal nor the file. According to the author's instructions @nkargas in the README , I need to add a file path to in config.conf to make the log information output to the file, but I didn't see config.conf file. I tried to create a new configuration file named config.conf and add a file path in it, although it can create a new file as I set in the file path, I didn't get any log information. Is there any requirement for the format of the log information output file? I've tried . txt, no suffix and . log in the file path, but they all don't work. Looking forward for your reply! Thank you very much!

IeohMingChan commented 3 years ago

@nkargas Hello Kargas,Thank you very much for providing me with this precious code, and I'm sorry to disturb you after five years. My current hardware is USRP N210 motherboard, UBX-40 daughter board and two VERT900 antennas. I encountered the same problem as before, that is, the terminal continuously outputs "U". should I first consider replacing the hardware? Should I replace the antenna or the daughter board first? Here is my source file when the terminal output two "U": source1 And here is the set up: 1

Thank you very much !

marxwolf commented 3 years ago

@marxwolf hello,Have you solved the log information output problem now?I can't get any log information like "[INFO] XXXXX" neither from the terminal nor the file. According to the author's instructions @nkargas in the README , I need to add a file path to in config.conf to make the log information output to the file, but I didn't see config.conf file. I tried to create a new configuration file named config.conf and add a file path in it, although it can create a new file as I set in the file path, I didn't get any log information. Is there any requirement for the format of the log information output file? I've tried . txt, no suffix and . log in the file path, but they all don't work. Looking forward for your reply! Thank you very much!

As I remember, I found a solution online. You need to add two lines in the CMakeLists.txt in the file root directory

include(GrMiscUtils)
GR_LOGGING()

I add them in the line 101, 102. I hope this can help.

IeohMingChan commented 3 years ago

@marxwolf It works, thank you very much! But the Tag ID I get is always 0, can you get the actual EPC Code of the tag? Thank you again for your help and best wishes for you!

marxwolf commented 3 years ago

@marxwolf It works, thank you very much! But the Tag ID I get is always 0, can you get the actual EPC Code of the tag? Thank you again for your help and best wishes for you!

Yes, the EPC id value output by the author is not the standard EPC id. I think he just wants to distinguish them. So if you read the code carefully, you might find in tag_decoder_impl.cc file, the vector EPC_bits stores the EPC id. You may also need to find the start index of the EPC id in EPC_bits. I hope this helps.

mariorioMa commented 3 years ago

I have encountered a problem that cannot be solved. I use USRPX310 to read tag. The enviroment is Ubuntu18.04, UHD version is 3.10.3, and Gnuradio version is 3.7.13. There are no errors when I cmake the module of Gen2. When i run the code, the terminal does not display information such as gr::log:INFO. The terminal situation is as follows.

Screenshot 2021-04-15 21:18:51 Screenshot 2021-04-15 21:02:17

fabriziogiuliano commented 2 years ago

@nkargas Hello Kargas,Thank you very much for providing me with this precious code, and I'm sorry to disturb you after five years. My current hardware is USRP N210 motherboard, UBX-40 daughter board and two VERT900 antennas. I encountered the same problem as before, that is, the terminal continuously outputs "U". should I first consider replacing the hardware? Should I replace the antenna or the daughter board first? Here is my source file when the terminal output two "U": source1 And here is the set up: 1

Thank you very much !

Same issue from my side with similar configuration, I'm using B210

ZDeeQ commented 2 years ago

@nkargas Hello Kargas,Thank you very much for providing me with this precious code, and I'm sorry to disturb you after five years. My current hardware is USRP N210 motherboard, UBX-40 daughter board and two VERT900 antennas. I encountered the same problem as before, that is, the terminal continuously outputs "U". should I first consider replacing the hardware? Should I replace the antenna or the daughter board first? Here is my source file when the terminal output two "U": source1 And here is the set up: 1

Thank you very much !

Hi @IeohMingChan ! How do you solve this prolem? I'am facing the same problem with the same configuration and hope you help. Looking forward to your reply!

ZDeeQ commented 2 years ago

@nkargas Hello Kargas,Thank you very much for providing me with this precious code, and I'm sorry to disturb you after five years. My current hardware is USRP N210 motherboard, UBX-40 daughter board and two VERT900 antennas. I encountered the same problem as before, that is, the terminal continuously outputs "U". should I first consider replacing the hardware? Should I replace the antenna or the daughter board first? Here is my source file when the terminal output two "U": source1 And here is the set up: 1 Thank you very much !

Same issue from my side with similar configuration, I'm using B210

Hi @fabriziogiuliano ! I meet the same problem. Have you ever solved it? I'll appreciate it a lot if you could give me a favor.

XGBL commented 2 years ago

@Wangshuai8156你能按照调试说明显示你的接收信号曲线图吗?

源代码看起来是这样: image大门是这样的: image读者是这样的: image文件接收器是这样的: image解码器是空的。期待您的帮助。谢谢大家!

Hello, the reader file cannot be printed successfully. Can you help me?

ForIn2you commented 1 year ago

@nkargas Hello Kargas,Thank you very much for providing me with this precious code, and I'm sorry to disturb you after five years. My current hardware is USRP N210 motherboard, UBX-40 daughter board and two VERT900 antennas. I encountered the same problem as before, that is, the terminal continuously outputs "U". should I first consider replacing the hardware? Should I replace the antenna or the daughter board first? Here is my source file when the terminal output two "U": source1 And here is the set up: 1 Thank you very much !

Same issue from my side with similar configuration, I'm using B210

Hi @fabriziogiuliano ! I meet the same problem. Have you ever solved it? I'll appreciate it a lot if you could give me a favor.

Hi @ZDeeQ ! I am also trying to use B210 to complete the configuration. Have you implemented the design using B210? I would like to ask you some questions, and I would greatly appreciate it if you could help me!

U201213632 commented 1 year ago

@fabriziogiuliano @ForIn2you @ZDeeQ I am also trying to use B210 to implement RFID READER. However, it always fails to read the tag. Any suggestions? Thanks a lot.