#include <SPI.h>
#include <MFRC522.h>
#include <Ethernet.h>
//#define SS_PIN 10
//#define RST_PIN 9
#define RST_PIN 9
#define SS_PIN 8
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
byte mac[] = { 0x50, 0x7B, 0x9D, 0x00, 0x4A, 0xAA };
byte ip[] = {192,168,0,101};//Enter the IP of ethernet shield
char serv[] = "192.168.0.100" ;//Enter the IPv4 address
EthernetClient cliente;
void setup()
{
Serial.begin(9600); // Initiate a serial communication
SPI.begin(); // Initiate SPI bus
mfrc522.PCD_Init(); // Initiate MFRC522
Serial.println("Approximate your card to the reader...");
Serial.println();
Ethernet.begin(mac, ip);
}
void loop()
{
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent())
{
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial())
{
return;
}
//Show UID on serial monitor
Serial.println("UID tag :");
String content= "";
byte letter;
for (byte i = 0; i < mfrc522.uid.size; i++)
{
content.concat(String(mfrc522.uid.uidByte < 0x10 ? " 0" : " "));
_ content.concat(String(mfrc522.uid.uidByte*, HEX));_
_ }*_
* content.toUpperCase();*
* Serial.println(content);*
* loop1(content);*
}
void loop1(String rfid) {
* float hum = 15.0 ;//Reading the humidity and storing in hum*
float temp = 10.0;
if (cliente.connect(serv, 81)) { //Connecting at the IP address and port we saved before
* Serial.println("connected");*
* cliente.print("GET /data.php?"); //Connecting and Sending values to database*
* cliente.print("rfid=");*
* cliente.print(rfid);*
//Printing the values on the serial monitor
* Serial.print("RFID= ");*
* Serial.println(rfid);*
* cliente.stop(); //Closing the connection*
* }*
* else {*
* // if you didn't get a connection to the server:*
* Serial.println("connection failed");*
* }*
}
Currently with this code , Status is showing Connected but didn't get data in my sql.
Also how to do this if I have Website running in asp.net
i have created one web page to get the parameter from url.
Please Help ,It's Urgent
Advance Thanks