Hello, I'm having a real head ache because of a MFR522 chip reader, first of all i want to mention it was working before in a different domain, basically all i want is to scan the id info stored in some chips to print a registry in this domain 1condotbtc/demo and have access to a users profile that i created before (linking the registry database with other containing profiles url's), i have linked an ftp user with a database and its proper user in my personal domain (and hostingspace). this part seem to be working i have tested and everything is fine
but when i try to read the chip and store the information in the sql database nothing shows up, that means nothing is reaching the database, i think the reader is not working because it should be printing "OK" in the serial monitor when the information is uploaded, but i can't be really sure if that is the problem because i recently change mfrc522 library i'm actually using 2(MFRC522-1.3.6.zip) and IDE1.6.13 and i'm a little bit confused with it, i don't how can i test the reader without dismounting everything? any suggestions for my code? am i calling the reader wrong? Help me please!!
Links:
1https://www.condorbtc.como/demo
2https://www.arduinolibraries.info/libraries/mfrc522
#include <SPI.h>
#include <Ethernet.h>
#include <MFRC522.h>
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x01 };
EthernetClient client;
#define SS_PIN 7
#define RST_PIN 6
MFRC522 mfrc522(SS_PIN, RST_PIN);
byte readCard[4];
String rfidUid = "";
char server[] = "www.condorbtc.com";
void setup()
{
pinMode(7, OUTPUT);
digitalWrite(4, HIGH);
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
Serial.begin(9600);
if (Ethernet.begin(mac) == 0) {
Serial.println("No se ha podido configurar el DHCP");
}
SPI.begin();
mfrc522.PCD_Init();
Serial.println("¡Listo!");
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
}
void loop() {
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}
if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}
for (byte i = 0; i < mfrc522.uid.size; i++) {
rfidUid += String(mfrc522.uid.uidByte[i] < 0x10 ? "0" : "");
rfidUid += String(mfrc522.uid.uidByte[i], HEX);
mfrc522.PICC_HaltA();
}
if(1 == 1)
{
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
if (client.connect(server,80)) {
client.print("GET /demo/Lectura.php?");
client.print("Placa=1&Dato="+rfidUid);
client.println( " HTTP/1.1");
client.println( "Host: www.condorbtc.com" );
client.println("Content-Type: application/x-www-form-urlencoded");
client.println( "Connection: close" );
client.println();
client.println();
Serial.println("Ok");
}
if (client.connected())
{
client.stop();
}
}
else
{
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
}
delay(3000);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
rfidUid = "";
}