PiicoDev RFID Module and Node Red

I have a raspberry pi 4, the PiicoDev Adapter for Raspberry Pi, the PiicoDev RFID Module (NFC 13.56MHz) + a couple of tags/cards/etc. for reading. I would like to get the information on the tags (e.g. tag ID) through Node Red to a MongoDB database. How do I go about doing this?
I have tried to use the “rpi - gpio in” node, but the pins I can select from never actually turn green, but instead show “OK” and are yellow.
Anybody who has tried something similar? Would appreciate any support.

1 Like

Hi @Jacob258201 - welcome to the forums :slight_smile:

Unless node red supports using the RFID Module’s chip directly (MFRC522) you will have to find another way to drive the node red transactions.

Is there a way to trigger events in node red from an external python script?

This tutorial seems to show how to execute arbitrary Python code from NodeRed - it might be a start

Hi Michael,

thank you very much for your quick response. There actually is a MFRC522 palette on node red, which gives me a node to use (node-red-contrib-mfrc522-rfid (node) - Node-RED), but I am not sure how the wiring is on the PiicoDev adapter and which pins to use. As a default, the CS pin (don’t know what that is) is set to 24. Any tips for this?

@Jacob258201 - that node has been set up to use the SPI interface of the MFRC522 which is the most commonly used interface. It won’t work with PiicoDev, which uses the I2C interface so that boards can be daisy chained together.

I regret to say that the simplest way to move forward might be with an alternative MRFC522 module that uses SPI - which ought to integrate very easily.

Barring that, you may be in for a deep dive on how to use arbitrary hardware with node red using eg. scripting - something I am not familiar with but seems like it should be possible.

I believe there is a Python flow for nodeRED so you can write Python in your flows but I can’t remember if it supports importing modules.

1 Like

Another workaround would be to run a Python script to listen to incoming MQTT messages with the paho-mqtt package and use NodeRED’s built-in MQTT module to communicate with Python and Piicodev.

1 Like

Thank you all for the support. I opted to directly send the data via python script to MongoDB via pymongo. This way I can use the piicodev RFID reader.