hello,
ethernet.begin()
I deleted it.
Adding doesn't work.
this is my code
#include <SPI.h>
#include <Ethernet.h>
#include <LiquidCrystal.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //Setting MAC Address
#define DHTPIN 8
#define DHTTYPE DHT11
LiquidCrystal lcd( 11, 12, 5, 4, 3, 2);
DHTdht(DHTPIN,DHTTYPE);
float humidityData;
float temperatureData;
IPAddress server(10,0,0,30);
IPAddress ip(10, 20, 0, 95);
IPAddress gateway(10, 20, 0, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress myDns(8, 8, 8, 8);
EthernetClient client;
/* Setup for Ethernet and RFID */
void setup() {
Serial.begin(9600);
dht.begin();
lcd.begin(16,2);
**Ethernet.begin(mac, ip, gateway, subnet, myDns);**
delay(1000);
}
//--------------------------------------------------------------------------------
/* Infinite Loop */
void loop(){
humidityData = dht.readHumidity();
temperatureData = dht.readTemperature();
Sending_To_phpmyadmindatabase();
delay(1000); // interval
lcd.clear();
lcd.setCursor(0,0);
lcd.print("ID01 TEMP:");
lcd.print((float)temperatureData);
lcd.print("C");
lcd.setCursor(0,1);
lcd.print("ID01 NEM:");
lcd.print(humidityData);
lcd.print(" %");
}
void Sending_To_phpmyadmindatabase() //CONNECTING WITH MYSQL
{
if (client.connect(server, 80)) {
Serial.println("connected");
// Make a HTTP request:
Serial.print("GET /testcode/dht2.php?humidity=");
client.print("GET /testcode/dht2.php?humidity="); //YOUR URL
Serial.println(humidityData);
client.print(humidityData);
client.print("&temperature=");
Serial.println("&temperature=");
client.print(temperatureData);
Serial.println(temperatureData);
client.print(" "); //SPACE BEFORE HTTP/1.1
client.print("HTTP/1.1");
client.println();
client.println("Host: 10.0.0.30");
client.println("Connection: close");
client.println();
} else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
}
I'm waiting for your help
Adding
