Closed lglowania closed 3 years ago
There is a simple bug when retrieving the antenna gain - the value is contained in bits 4:6 and I am not doing a bit shift in the AntennaGain.forValue method. I will push 1.2.3 tonight that includes this fix - this will at least allow you to verify that the config register is being updated correctly. Reading this it would appear that the antenna gain has to be set before turning on the antenna (and possibly some other configuration) - I have included another change that allows the gain to be specified in the constructor. It would be great if you could test this as I don't have one wired up right now.
Please test with 1.2.3 and let me know if it fixes the issue.
Yes, getAntennaGain() now returns the expected result.
Excellent, thank you. Did it make a difference in range?
Sorry for the late response. I had no time to investigate further. In my experiments it did not make any difference in range, but when i used mfrc522.setAntennaGain(AntennaGain.DB_48)
i frequently received read errors when placing the transponder. I don't remember exactly the error-output. It was something like read error on 0x01
. I will comment my insights here in the future.
I'm trying to increase the reading-range of my MFRC522. By using
MFRC522.getPiccType(sak);
i determined my picc is a MIFARE_1K. The data sheet (https://www.mouser.com/datasheet/2/302/MF1S503x-89574.pdf) says:Operating distance up to 100 mm depending on antenna geometry and reader configuration
So i assume the antenna gain setting is available in general. But using
mfrc522.setAntennaGain(..)
seems to do nothing, the reading-range remains at ~20mm, no matter what AntennaGain-enum is passed. Andmfrc522.getAntennaGain()
returns always null.Do you have a hint? Thank you.