esitarski / CrossMgr

Cyclo Cross Management Application
MIT License
40 stars 20 forks source link

RFID input documentation #92

Closed jezza323 closed 2 years ago

jezza323 commented 2 years ago

Is your feature request related to a problem? Please describe. Is there any documentation available for custom RFID inputs to crossmgr? I am working on a proof of concept wireless RFID system and would like my output to be crossmgr compatible. What data in what formats can I utilise as crossmgr inputs?

Describe the solution you'd like If possible some documentation, or direction to best appropriate code to reverse engineer a solution. As there are many supported inputs which I'm not familiar with some guidance would be appreciated

Describe alternatives you've considered If nothing is possible I will try to chase up impinj output documentation and implement this protocol

Additional context Thanks for the software 👌

esitarski commented 2 years ago

All CrossMgr code is available here: https://github.com/esitarski/CrossMgr On the github page, there are instructions for how to run CrossMgr yourself.

CrossMgr supports a number of real-time RFID interfaces. Because I can't afford all the RFID systems out there, I wrote "simulators" (clients) to test each system ;)

What you will be doing is writing your own "client" that "speaks" one of the RFID protocols understood by CrossMgr.

Take a look at JChipClient.py at the line "# Connect to the CrossMgr server.". This is the main "while" loop:

  1. First, it goes into a loop trying to connect to CrossMgr.
  2. It then sends a unique name to identify itself, the 'N0000<>' comment. CrossMgr accepts an unlimited number of reader connections with unique names.
  3. It waits for a 'GT' cmd (GetTime) from CrossMgr, then responds with its local time. CrossMgr uses the local time to compute a time correction between the reader and the CrossMgr computer. This solves the problem when the reader's clock doesn't match the CrossMgr computer's clock.
  4. It waits for a 'S0000' cmd (Send) from CrossMgr, indicating it is ready.
  5. It then sends 'DJ' (DataJChip) commands when it has data to send. Multiple data commands can be sent together in one string, or each cmd can be its own send call.
  6. If it loses the socket connection, it goes back to the top of the loop to connect to CrossMgr with the same name. When CrossMgr gets a new connection with the same name, it closes the old connection and switches to the new one. The same 'GT' handshake is then repeated.

Use the logic in JChipClient as a starting point. Your code also needs to manage unsent data, caching it until a connection can be established with the CrossMgr computer, then sending it all then. This is easiest with two threads - one to continuously cache reads, one to send the reads to CrossMgr when it is available (see CrossMgrImpinj for details). Once sent, data does not need to be sent again. If you send duplicate data, CrossMgr will ignore it. It will also ignore data with timestamps outside of the running race.

The advantages of the JChip protocol is that (a) it supports a time correction between the computer and the reader and (b) it is a "push" protocol;, the reader pushes results to CrossMgr when available rather than CrossMgr having to "poll" for results periodically, which is inefficient. JChip protocol is a bit old (the company doesn't seem to be around anymore) and has some useless characters in the messages. See JChipClient.py for formatting details. When you write your own client, you can easily test it by putting CrossMgr into RFID Test mode and selecting the JChip protocol (this also works with JChipClient.py).

Alternatively, you can use the MyLapsClient.py. This protocol is a bit simpler with no time correction. You have to be careful to keep your reader synced to the same external network source as your computer. On the plus side, it is a "push" protocol.

Best of luck with your project.

On Fri, Jun 24, 2022 at 10:13 PM jezza323 @.***> wrote:

Is your feature request related to a problem? Please describe. Is there any documentation available for custom RFID inputs to crossmgr? I am working on a proof of concept wireless RFID system and would like my output to be crossmgr compatible. What data in what formats can I utilise as crossmgr inputs?

Describe the solution you'd like If possible some documentation, or direction to best appropriate code to reverse engineer a solution. As there are many supported inputs which I'm not familiar with some guidance would be appreciated

Describe alternatives you've considered If nothing is possible I will try to chase up impinj output documentation and implement this protocol

Additional context Thanks for the software 👌

— Reply to this email directly, view it on GitHub https://github.com/esitarski/CrossMgr/issues/92, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABGXKKYDE2KJHFMPG7P37LVQZTLNANCNFSM5ZZPONLA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Edward Sitarski

jezza323 commented 2 years ago

Thats perfect, thanks for the info