how to config using of pn532 via i2c​

  • i connected pn532 via i2c, please advise me what should i write in doorpi.ini, because like that doesn't work
    [keyboards]
    testsystem = gpio
    virtuell = filesystem
    nfcreader = pn532


    [nfcreader_keyboard]
    device = pn532_i2c:/dev/i2c-1

  • Thank you, Andreas!
    i have installed my pn532 on orange pi following exactly this instruction you've sent. And my device found it and can see it, but via i2c.
    and now i don't know what should i write in doorpi.ini instead of "device = tty:AMA0:pn532".
    the reply on command sudo nfc-list is:
    nfc-list uses libnfc 1.7.1NFC device: pn532_i2c:/dev/i2c-0 opened.


    can you help me please?
    Danke.

  • Try this:

    The numbers "12345678" and "87654321" must be replaced with your ID from tag.

  • Thank you, Andreas!
    unfortunately it didn't help...
    now i'm thinking : the file from_pn532.py shouldn't be changed by any way? what should i change if so?
    Danke.

  • Hey Brunh,
    dont change the file from_pn532.py. This keyboard works well with serial conection and, i think so, with I2C. But i have not yet been tested.


    Have you changed the doorpi.ini with the content in post 4?

  • Ich muss das Thema mal nach oben ziehen. Ich weiß Jahre später.... wollte. mit dem PN532 erweitern um per AIrTag aufschließen zu können.


    Soweit Installation durchgekämpft- Ist für das alte System und ic2 nicht ganz so einfach aber ich sag mal der PN532 läuft.
    Nur im DoorPi bekomme ich die Meldung beim Start und ich habe gerade null Ideen mehr.


    Code
    2023-08-25 21:11:27,342 [TRACE]      [doorpi.conf.config_object] get_string for key device in section nfcreader_keyboard (default: tty:AMA0:pn532) returns pn532_i2c:/dev/i2c-1
    2023-08-25 21:11:27,344 [DEBUG]      [doorpi.conf.config_object] parse string "pn532_i2c:/dev/i2c-1" to "pn532_i2c:/dev/i2c-1"
    2023-08-25 21:11:27,345 [INFO]      [nfc.clf] searching for reader on path pn532_i2c:/dev/i2c-1
    2023-08-25 21:11:27,346 [ERROR]      [nfc.clf] no reader available on path pn532_i2c:/dev/i2c-1
    2023-08-25 21:11:27,346 [ERROR]      [doorpi.main] Exception NameError: [Errno 19] No such device
    Traceback (most recent call last):

    Alle Checks soweit durch. Reader wird gefunden und mit nfc-list auch Tag lesbar.


    nfc-scan-device -v

    Code
    nfc-scan-device uses libnfc libnfc-1.8.0-65-g42de50f
    1 NFC device(s) found:
    - PN532 board via I2C:
        pn532_i2c:/dev/i2c-1
    chip: PN532 v1.6

    DoorPi.ini

    Code
    [keyboards]
    ...
    nfcreader = pn532
    
    [nfcreader_keyboard]
    device = pn532_i2c:/dev/i2c-1
    bouncetime = 1000
    [nfcreader_InputPins]
    .....

    Kann es sein das das Keyboard nicht mit ic2 läuft? Hat das einer am laufen?