EMS-TU-Ilmenau / sllurp

LLRP interface implemented in Python
GNU General Public License v3.0
19 stars 7 forks source link

Socket reading timeout at commit 7e839a637 (fixed stopping liveReports and re-designed data parsing) #5

Closed deantonccns closed 1 year ago

deantonccns commented 1 year ago

Hello all,

I am currently conducting a project using your sllurp lib for RFID tag reading. It is stable and works properly, thanks for all your decent work. My device is Impinj Speedway Revolution R420.

Recently I synced the latest commits from the repository and found a timeout exception when reading data from the socket https://github.com/EMS-TU-Ilmenau/sllurp/blob/e49ca5ddbe990159a33de855f2fe6cbad747efd4/sllurp/llrp.py#L149

Though the tag seems to be recognized correctly. This issue happens since the commit mentioned in the title.

Here is the log from my application:

INFO:     2023-04-22 19:24:21 [rfid_client.py:24] Initialize connection to RFID client...
INFO:     2023-04-22 19:24:22 [llrp.py:286] Using default mode (index 0)
INFO:     2023-04-22 19:24:22 [llrp.py:339] stopping politely
INFO:     2023-04-22 19:24:22 [rfid_client.py:27] Successful started RFID client on host: 192.168.3.3
INFO:     2023-04-22 19:24:22 [llrp.py:329] starting inventory
INFO:     2023-04-22 19:24:23 [llrp.py:339] stopping politely
ERROR:     2023-04-22 19:24:28 [rfid_client.py:156] timed out
INFO:     2023-04-22 19:24:28 [rfid_client.py:158] FINAL TAGS: []
INFO:     2023-04-22 19:24:28 [rfid_client.py:90] Disconnecting RFID client
INFO:     2023-04-22 19:24:28 [llrp.py:339] stopping politely
READER_EVENT_NOTIFICATION
GET_READER_CAPABILITIES_RESPONSE
Connected to reader
DELETE_ROSPEC_RESPONSE
DELETE_ACCESSSPEC_RESPONSE
ADD_ROSPEC_RESPONSE
ENABLE_ROSPEC_RESPONSE
1 unique tags detected
RO_ACCESS_REPORT
RO_ACCESS_REPORT

rfid_client.py is my client code and you can see timed out when calling to detectTags in sllurp/reader.py I can provoke it always instead of happening from time to time. I am wondering you guys have the same issue also or not. Or do I miss some changes in my client for this commit? Do you have any idea about it? It would be highly appreciated if you have some hints for me.

Thanks in advance and looking forward to your response.

deantonccns commented 1 year ago

Update:

I tried to use the example code in the readme and I got exactly the same results. Seems to me that the commit 7e839a637 somehow breaks the scan.

beustens commented 1 year ago

Yes, I have the same issue. You can checkout the code before the commit for now while I try to fix it.

beustens commented 1 year ago

The problem is that the DELETE_ROSPEC_RESPONSE is not recognized by the message handler, because a RO_ACCESS_REPORT is coming along with the TCP packet.

llrp_wireshark

beustens commented 1 year ago

Fixed now