Awesome! Thank you so much!
Any idea how long it will take before the webIDE will work? I just tried it and I still get the SOS lights.
!!! Iāll have to test again! Make sure you pull the latest version in your app.
i just got my RFID today and tested it with your new version and it definitly works on my photon (0.45). ⦠Good Timing i guess and Thank you for porting it!
In case someone else could use a quick and easy code to just get the Cardās ID as a string (i saw someone asking anywhere in this Thread) - this works fine for me:
void loop() {
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}
String cardID = "";
for (byte i = 0; i < mfrc522.uid.size; i++)
{
cardID += String(mfrc522.uid.uidByte[i] < 0x10 ? "0" : "");
cardID += String(mfrc522.uid.uidByte[i], HEX);
}
Serial.println(cardID);
Particle.publish("pushover", cardID + " scanned", 60, PRIVATE);
mfrc522.PICC_HaltA();
}
How does one āpullā the latest version in to an app?
@anlek, if you are using the web IDE, remove the library and then re-add it again. Also make sure you are compiling for latest 0.4.5
.
Understood, Thanks!
So I created a new project (I also removed and re-added the MFRC522
library and still getting SOS lights (on the latest 0.4.5
firmware).
#include "MFRC522/MFRC522.h"
#define SS_PIN SS
#define RST_PIN A1
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
Any other ideas? Iām quite lostā¦
On the webIDE it still states: MFRC522 0.1.1
and not 0.1.2
I think I got it refreshed⦠sorry for the messages.
Hi, I am working on a time-keeping project using an arduino uno, a lcd display and⦠a rfid reader RC522.
But I have a problem because the rfid reader uses the same pins as lcdās . So I was wondering if I could connect RC522 using just the SOUT pin, or maybe there is another possibility to connect these two devices together.
Hi guys, @peekay123, @korneel
I am newbie to spark, i have found the library in the particle IDE and Pin are configure as per the in app comment.
Could you please point me out how to see output data from the card which i place on the MFRC522 chip.
also, Please point me some easy way to send this data to my server url as json data (something like webhook) for the card which i place on the MFRC522.
Thanks in advance
If you plug your Particle device into your computer via USB and open a serial monitor application (e.g. PuTTY) you can attach to the respective COM port an see the Serial
output.
And if you have a line like this in your code
Particle.publish("pushover", cardID + " scanned", 60, PRIVATE);
You can go to https://dashboard.particle.io/user/logs and see the output there.
If you want to use a webhook to relay this event to your server youād best look at the webhooks docs first
https://docs.particle.io/guide/tools-and-features/webhooks
Thanks for reply. i will look this webhook docs
BTW: If you were a bit quick with posting a reply, you donāt need to delete the post and create a new one.
You can just hit the pencil icon in the bottom line of the post to edit your own posts.
@peekay123 Iāve been reading through this thread, and have downloaded your code from GitHub (RC522_RFID). But Iām getting errors when I compile.
Admittedly, this is my first time using libraries and SPIā¦Iām new to Particle, but have experience with Arduino (you helped me on my first post in fact, Arduino vs. Particleā¦thank you!).
Here are the errors:
RFID.cpp: In member function āvoid RFID::halt()ā:
RFID.cpp:512:13: warning: variable āstatusā set but not used [-Wunused-but-set-variable]
uint8_t status;
^
RFID.cpp: In member function āuint8_t RFID::softSPITranser(uint8_t)ā:
RFID.cpp:532:38: error: āstruct GPIO_TypeDefā has no member named 'BSRRā
PIN_MAP[_mosiPin].gpio_peripheral->BSRR = PIN_MAP[_mosiPin].gpio_pin; // Data High
^
RFID.cpp:534:38: error: āstruct GPIO_TypeDefā has no member named 'BRRā
PIN_MAP[_mosiPin].gpio_peripheral->BRR = PIN_MAP[_mosiPin].gpio_pin; // Data Low
Any thoughts? Iām thinking maybe Iām not doing something right in the build.particle.ioā¦my App shows the three files:
RC522-RFID.INO
RFID.CPP
RFID.H
Am I missing something?
Thanks so much, in advance!
J-
You can replace these calls with the respective commands pinSetFast()
/ pinResetFast()
and pinReadFast()
to get rid of the error messages.
for (uint8_t bit = 0; bit < 8; bit++) {
if (data & (1 << (7-bit))) // walks down mask from bit 7 to bit 0
pinSetFast(_mosiPin); // Data High
else
pinResetFast(_mosiPin); // Data Low
pinSetFast(_clockPin); // Clock High
b <<= 1;
if (pinReadFast(_misoPin))
b |= 1;
pinResetFast(_clockPin); // Clock Low
}
Wow, thanks @ScruffR! That did it! What a quick response, and what an earlybird!
Really appreciate it!
Best-
Jeremy
Thatās the advantage of a global community - itās 2:10pm for me already