Hey guys , hope you are doing well!
I have connected RC522 RFID with arduino and I want to output the tag values on a webserver, actually I have no idea about HTML and those stuff, I found a tutorial in outputting temperature values data in a webpage, then I changes it to output RFID data, the problem is that everything works pretty fine the tag serial number and the response from the server are displayed in the serial monitor but the tag serial number is not displayed in the webpage (it is of string form ) , however if I use a sensor that outputs a number it will be outputted, here is the code if you have any solutions please help
#include <SPI.h>
#include <Ethernet.h>
#include <MFRC522.h>
#include <String.h>
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };// Enter the IP address for Arduino, as mentioned we will use 192.168.0.16
// Be careful to use , insetead of . when you enter the address here
IPAddress ip(192,168,1,200);
#define RST_PIN 5 //this is configurable and it stands for RST pin of the RFID tag
#define SS_PIN 7 //this is configurable and it stands forchip select pin of the RFID tagMFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
// Initialize the Ethernet server library
EthernetServer server(80);
String read_RFID;
String A ;
void setup() {pinMode(7,OUTPUT);
pinMode(10,OUTPUT);
pinMode(53,OUTPUT);
digitalWrite(53,HIGH);
// Serial.begin starts the serial connection between computer and Arduino
Serial.begin(9600);
digitalWrite(7,HIGH);
delay(10);
while(!Serial); // Do nothing if no serial port is opened just wait
SPI.begin(); // Initialize SPI bus
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);
server.begin();
Serial.print("Arduino server IP address: ");
Serial.println(Ethernet.localIP());
digitalWrite(10,HIGH);
digitalWrite(7,LOW);mfrc522.PCD_Init(); //Initialize MFRC522
}
void dump_byte_array(byte buffer , byte buffer_size)
{
read_RFID = "";
for (byte i = 0 ; i < buffer_size ; i++)
{
read_RFID = read_RFID + String(buffer,HEX);*
- }*
}
void loop() {// photocellReading = analogRead(photocellPin); // Fill the sensorReading with the information from sensor
digitalWrite(10,HIGH);
digitalWrite(7,LOW);
if ( ! mfrc522.PICC_IsNewCardPresent())*
{*
return;*
}*
// Select one of the cards*
//in this it will check if it can read the card or no if it can then it will not enter the if and continue the execusion of the program otherwise it will quit the program*
if ( ! mfrc522.PICC_ReadCardSerial())*
{*
return;*
}*
dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);*
Serial.println(read_RFID);*
A = read_RFID;*
digitalWrite(7,HIGH);*
digitalWrite(10,LOW);*
EthernetClient client = server.available(); // Listen for incoming clients*
if (client) {*
// When a client sends a request to a webserver, that request ends with a blank line*
boolean currentLineIsBlank = true;*
while (client.connected()) {*
if (client.available()) {*
char c = client.read();*
// This line is used to send communication information between Arduino and your browser over Serial Monitor*
Serial.write(c);*
// When the request has ended send the client a reply*
if (c == '\n' && currentLineIsBlank) {*
// We send the HTTP response code to the client so it knows that we will send him HTML data*
// and to refresh the webpage every 5 seconds*
client.println("HTTP/1.1 200 OK");*
client.println("Content-Type: text/html");*
client.println("Connection: close");*
client.println("Refresh: 5");*
client.println();*
// Here we write HTML data (for the page itself) which will be sent to the client.*
// The HTML includes Javascript which fills the data*
client.println("");*
client.println("");*
client.println("");*
client.println("Arduino sensor data");*
client.println("");*
client.println("");*
client.println("");*
client.println("*
");client.println("
value measured from the sensor is:
");*client.println("
");*client.println("");*
client.println("");*
break;*
}*
if (c == '\n') {*
// Check if a new line is started*
currentLineIsBlank = true;*
}*
else if (c != '\r') {*
// If a new line was not strated*
currentLineIsBlank = false;*
}*
}*
}*
// Give the client some time to recieve the data (1ms)*
delay(100);*
// In the end close the connection*
client.stop();*
}*
}[/quote]
a type of the output in the serial monitor

