# PiicoDev RFID module, programming issues

**URL:** <https://forum.core-electronics.com.au/t/piicodev-rfid-module-programming-issues/22410>\
**Category:** Product Questions\
**Created:** [8 May 2025 03:14 UTC](https://forum.core-electronics.com.au/t/piicodev-rfid-module-programming-issues/22410 "2025-05-08T03:14:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olle185132](https://avatars.discourse-cdn.com/v4/letter/o/35a633/32.png) [@Olle185132](https://forum.core-electronics.com.au/u/Olle185132)\
**Post date:** [8 May 2025 03:14 UTC](https://forum.core-electronics.com.au/t/piicodev-rfid-module-programming-issues/22410/1 "2025-05-08T03:14:49Z")

</div>

Hi,  
I am trying to get the PiicoDev RFID module to work. Current setup is a RPi5 with Python 3.11.2 and all the hardware connected.  
What is happening is that I have all the required Python packages in one folder and when I run the read\_id.py program in Thonny, a number of errors and warnings come up. I’m a complete novice to Python and it might have been something in the setup or version of the programs. Can anyone give me a leg up please.  
Cheers,  
Olle  
Here are the errors I get when I’m running the read\_id.py file:

> > %Run read\_id.py  
> > /home/olle/PiicoDev/PiicoDev\_RFID.py:72: SyntaxWarning: “is” with a literal. Did you mean “==”?  
> > assert max(asw) \<= 1 and min(asw) \>= 0 and len(asw) is 2, “asw must be a list of 1/0, length=2”  
> > Traceback (most recent call last):  
> > File “/home/olle/PiicoDev/read\_id.py”, line 4, in   
> > rfid = PiicoDev\_RFID() # Initialise the RFID module  
> > File “/home/olle/PiicoDev/PiicoDev\_RFID.py”, line 69, in **init**  
> > self.i2c = create\_unified\_i2c(bus=bus, freq=freq, sda=sda, scl=scl)  
> > File “/home/olle/PiicoDev/PiicoDev\_Unified.py”, line 187, in create\_unified\_i2c  
> > i2c = I2CUnifiedLinux(bus=bus, suppress\_warnings=suppress\_warnings)  
> > File “/home/olle/PiicoDev/PiicoDev\_Unified.py”, line 127, in **init**  
> > self.i2c = SMBus(bus)  
> > File “/usr/lib/python3/dist-packages/smbus2/smbus2.py”, line 280, in **init**  
> > self.open(bus)  
> > File “/usr/lib/python3/dist-packages/smbus2/smbus2.py”, line 310, in open  
> > self.fd = os.open(filepath, os.O\_RDWR)  
> > FileNotFoundError: [Errno 2] No such file or directory: ‘/dev/i2c-1’
> > 
> > > errors I get:

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [8 May 2025 03:41 UTC](https://forum.core-electronics.com.au/t/piicodev-rfid-module-programming-issues/22410/2 "2025-05-08T03:41:41Z")

</div>

Hi @Olle185132  
Welcome Welcome.

Ah I can guess what’s going on here.

Because your raspberry pi doesn’t know what i2c\_1 is yet it’s struggling to make sense of what `is` could mean. To personify awfully, The script is asking _“what am I supposed to be comparing to?”_

We need to activate the i2c\_1 bus so your script can access and identify it.

This error below is trying to tell you that you haven’t activated the i2c bus on your raspberry pi5. `/dev` is short for _devices_

> FileNotFoundError: [Errno 2] No such file or directory: ‘/dev/i2c-1’

If your using the desktop version of raspberry pi os, I believe there is a gui that can help you. I had to search up where it is, apparently you can find it at:  
**Pi Start Menu** \> **Preferences** \> **Raspberry Pi Configuration**.

In there you should find a radio button to activate your i2c.

→ Does this fix your problem?

If not, come back and let us know because there are still other things to check in the /boot/config.txt file of your operating system. 🙂  
Good luck.  
Pix ❣

Further detail:  
The line of code that’s flagging flairing up is this line of code.

```python
assert max(asw) <= 1 and min(asw) >= 0 and len(asw) is 2, "asw must be a list of 1/0, length=2"

```

Not what I was expecting. Don’t know how the program made it to that line. Not a big deal because the trace-back correctly identifies the larger problem of missing the bus. That being said @Liam I’m not sure this is intended behavior?

---

<div class="post-metadata">

**Author:** ![Dan](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/dan/32/10815_2.png) [@Dan](https://forum.core-electronics.com.au/u/Dan)\
**Post date:** [8 May 2025 06:03 UTC](https://forum.core-electronics.com.au/t/piicodev-rfid-module-programming-issues/22410/3 "2025-05-08T06:03:47Z")

</div>

Hey @Olle185132

Looking at the error you’ve got there it’s likely as Pix mentioned that the I2C interface isn’t enabled.

In the getting [started guide](https://core-electronics.com.au/guides/raspberry-pi/piicodev-rfid-module-guide-for-raspberry-pi/) that we have for the RFID module we have the below photo that will show you how to enable it.

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/f/f603c757907b9492a84dee19f4be55225f0da720.jpeg)

---

<div class="post-metadata">

**Author:** ![Olle185132](https://avatars.discourse-cdn.com/v4/letter/o/35a633/32.png) [@Olle185132](https://forum.core-electronics.com.au/u/Olle185132)\
**Post date:** [8 May 2025 07:11 UTC](https://forum.core-electronics.com.au/t/piicodev-rfid-module-programming-issues/22410/4 "2025-05-08T07:11:51Z")

</div>

Hi Dan,

I thought I had turned on the I2C, but when I checked, it was not on. After turning it on, the RFID module reads the FOBs.

Thanks,  
Olle

---

<div class="post-metadata">

**Author:** ![Samuel](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/samuel/32/11763_2.png) [@Samuel](https://forum.core-electronics.com.au/u/Samuel)\
**Post date:** [9 May 2025 00:55 UTC](https://forum.core-electronics.com.au/t/piicodev-rfid-module-programming-issues/22410/5 "2025-05-09T00:55:00Z")

</div>

Hey @Olle185132,

That’s awesome to hear! Glad it was a quick fix for you.

Hopefully, it’s smooth sailing for the rest of this project! 🙂
