How to change bus number of NFC reader on pi
Ask QuestionAsked todayActive todayViewed 15 times1
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?



i2cnfcshareedit follow close 2flag asked 12 hours agoJoshua1111 bronze badge New contributor
- 3Please post text, not pictures of text! – Mats Karlsson 12 hours ago
- 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 11 hours ago
- @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 10 hours ago
- 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 just now Edit
1 Answer
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.shareedit follow flag answered 12 hours agoMats Karlsson60799 bronze badgesadd a comment
.END
Categories: Uncategorized