1

I am trying to build a NFC reader. I bought a PN532 and connected it to the pi with the diagram shown below. I ran the code below and got AssertionError:"Bus number must be 1 or 0". I then went to terminal and did i2cdetect 1 and i2cdetect 2.The second one responded but cannot use 2 in the code how can I change the bus number to 1?

enter image description here

enter image description here

enter image description here

4
  • 4
    Please post text, not pictures of text! Oct 10, 2020 at 13:05
  • You might find my following two answers to PN532 on StackOverflow helpful: (1) Problem with detecting badge with PN532 and Raspberry Pi stackoverflow.com/questions/60819793/… (2) How can Rpi read a PN532 NFC Module? stackoverflow.com/questions/61165652/…. Good luck. Cheers.
    – tlfong01
    Oct 10, 2020 at 14:22
  • @Mats Karlsson, sorry that I am posting screen captures. I know text files are easier for others to copy, edit and repeat the situation. However, I think if I post pictures then others might have more confidence that I have not missed copying and pasting anything important. My screen captures are usually a complete record of what I have successfully done to solve the problem. I usually highlight the user commends, system messages, and application message in different colours,hoping users can find which CLI commands to use, and the exact system and application replies to expect. Cheers.
    – tlfong01
    Oct 10, 2020 at 14:33
  • Having said the above, for longer programs I think the askers might like to try out themselves, I almost always use Rpi3/4 IDLE/Thonny python demo programs, in a style recommended by StackOverflow: MCVE (Minimal, Comprehensive, Verifiable, Examplar). I usually tell the asker that my demo program is sort of "Plug n Play", ie, copy, paste, run (no external programs, other than Rpi pre installed GPIO modules etc to import). I also almost always append a sample output at the end of my demo program, often with time stamps. So asker just copy, paste, run, & compare their results with sample output.
    – tlfong01
    Oct 11, 2020 at 1:27

1 Answer 1

1

It's not possible, the readers have the same I2C address. From the manual below "The PN532 is configured with I2C address 0x48"

From the manual https://www.electrodragon.com/w/images/2/21/PN532_NFC_RFID_Module_Manual.pdf

You could change the interface type and communicate with the reader over another interface.

1
  • 1
    Hi, i am not asking to change the address, just asking how i can make the PN532 appear on i2cdetect -y 1 as opposed to '2'
    – Joshua
    Oct 11, 2020 at 11:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.