Good day, I have this problem with my simple project. I have a database with all RFID number of employee. What I want to do is to use an rfID to check if it is registered in the database. If it is, it would return a value of 1 else would be a value of 0.
I tried with arduino HanRun Ethernet shield. I was able to get a response from the php web server to the serial monitor. Tried the seeedrfid it successfully get the rfcard number. However, when i tried to combine the two, it would hang on Ethernet.begin(mac, ip) initialization. My code is below.
#include <Ethernet.h>
#include <SoftwareSerial.h>
#include <SeeedRFID.h>
#define RFID_RX_PIN 10
#define RFID_TX_PIN 11
SeeedRFID RFID(RFID_RX_PIN, RFID_TX_PIN);
char state = '0';
char c;
byte mac[] = {0x60, 0xF8, 0x1D, 0xBA, 0x1D, 0x52};
IPAddress ip(192, 168, 20, 228);
EthernetClient client;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Serial set up");
Ethernet.begin(mac, ip);
Serial.print("My IP Address: ");
Serial.println(Ethernet.localIP());
}
void loop() {
long rfID;
// put your main code here, to run repeatedly:
if (RFID.isAvailable()) {
rfID = RFID.cardNumber();
Serial.println(rfID);
}
}
Serial.println(rfID) is not executed unless I remove the Ethernet.begin(mac, ip). Can anybody point me to the right direction?
-
It's NOT a HanRun Ethernet Shield! It's an unbranded Ethernet Shield happens to use a HanRun HR911105A RJ45 Socket with Integrated Magnetics on it. kosmodrom.com.ua/pdf/HR911105A.pdfMajenko– Majenko2017年08月23日 10:02:29 +00:00Commented Aug 23, 2017 at 10:02
-
What pins did you connect the RFIC board to?Avamander– Avamander2017年08月25日 15:02:13 +00:00Commented Aug 25, 2017 at 15:02
1 Answer 1
The Arduino Ethernet shield uses pins 4, 10,11,12,13. You have a conflict with the RFID pins.
-
SPI pins can overlap, SS should be independent. There's not too much info about the chipset used though.Avamander– Avamander2017年08月25日 15:01:12 +00:00Commented Aug 25, 2017 at 15:01
-
can they overlap with software serial RX/TX?2017年08月26日 05:08:43 +00:00Commented Aug 26, 2017 at 5:08
-
1SPI can't overlap with softserial.Avamander– Avamander2017年08月26日 11:28:33 +00:00Commented Aug 26, 2017 at 11:28