esitarski / CrossMgr

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

TagReadWrite Reset connection settings not working on Windows #137

Open mr-exz opened 2 months ago

mr-exz commented 2 months ago

Configured MIN possible values for Read/Write antenna. Tried found where settings saved to remove it - no success. It would be nice to know where this settings stored to reset it, uninstall tool not helped.

------------------------------------------------------------
********************************************
2024-06-12_23:04:45: TagReadWrite 3.0.8-20240609124549 Started.
------------------------------------------------------------
Handing exception...
Traceback (most recent call last):
  File "MainWin.py", line 447, in doReset
  File "TagWriterCustom.py", line 72, in Connect
  File "pyllrp\TagInventory.py", line 86, in Connect
AssertionError: SET_READER_CONFIG Configuration fails:
SET_READER_CONFIG_RESPONSE(
  MessageID=5,
  Parameters=[
    LLRPStatus(
      StatusCode=StatusCode.M_FieldError,
      ErrorDescription='LLRP [420] : //RFTransmitter/ChannelIndex : out-of-range',
      Parameters=[
        ParameterError(
          ParameterType=222,
          ErrorCode=StatusCode.P_ParameterError,
          Parameters=[
            ParameterError(
              ParameterType=224,
              ErrorCode=StatusCode.P_FieldError,
              Parameters=[
                FieldError(
                  FieldNum=2,
                  ErrorCode=StatusCode.A_OutOfRange,
                ),
              ]
            ),
          ]
        ),
      ]
    ),
  ]
)
kimble4 commented 2 months ago

I believe this is a bug in the pyllrp library. The library sends a ChannelIndex of 0 when specifying a transmit power, causing this error. If you modify the code to send a ChannelIndex of 1, the error doesn't happen and it appears to change the power level as intended.

The Errata for 9.2.4.1.2.1 1 and 9.2.4.1.2.2 in https://www.gs1.org/sites/default/files/docs/epc/llrp_1_0_1-standard-20070813.pdf suggest that ChannelIndex starting at 1 wasn't made clear in previous versions of the standard.

To the OP: The configuration is stored using wx.Config, which on Windows uses the registry to store the settings. I don't have a Windows machine to hand, but try searching the registry for "TagReadWrite" using regedit.

mr-exz commented 2 months ago

Will try today, and will write result here, ty.

esitarski commented 2 months ago

With LLRP, it's always complicated. 12.2.52 RFTransmitter Parameter states:

12.2.6.2 RFTransmitter Parameter This Parameter carries the RF transmitter information. The Transmit Power defines the transmit power for the antenna expressed as an index into the TransmitPowerTable (section 1819 1820 1821 1822 1823 1824 1825 9.2.4.1.1). The HopTableID is the index of the frequency hop table to be used by the Reader (section 9.2.4.1.2.1) and is used when operating in frequency-hopping regulatory regions. This field is ignored in non-frequency-hopping regulatory regions. The ChannelIndex is the one-based channel index in the FixedFrequencyTable to use during transmission (section 9.2.4.1.2.2) and is used when operating in non-frequency-hopping regulatory regions. This field is ignored in frequency-hopping regulatory regions.

So, I am guessing that if you are in a "non-frequency-hopping regulatory region", Channel Index is used and must be non-zero. Since North America is a "frequency-hopping regulatory region" Channel Index is ignored, so a 0 value is OK. That's consistent with the value range of the Channel Index, which is inconsistently stated to be 0-255.

Is that possible? Are you in a non-frequency-hopping regulatory region?

There doesn't seem to be any harm in making Channel Index non-zero, so I changed it to 1 in pyllrp, and updated CrossMgr and RaceDB.

I am not familiar with how to configure the LLRP in "non-frequency hopping regulatory regions". Is 1 the correct value? If not, what value should it use?

On Thu, Jun 13, 2024 at 7:39 AM Nik Il @.***> wrote:

Will try today, and will write result here, ty.

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

--

Edward Sitarski

mr-exz commented 2 months ago

Don't know, i just tried make read power smaller as much as possible, i'll check that questions Are you in a non-frequency-hopping regulatory region in short i don't know )

btw. Open RegEdit and in path Computer\HKEY_CURRENT_USER\SOFTWARE\C:\Users\User\AppData\Roaming \TagReadWrite\TagReadWrite.cfg i deleted ReceiveSensitivity_dB and TransmitPower_dBm after that was able to connect back to reader.