-
Notifications
You must be signed in to change notification settings - Fork 0
/
mySQL.ino
59 lines (47 loc) · 1.24 KB
/
mySQL.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
char mySQLServer[] = "192.168.41.11";
void mySQLAdd()
{
if (!client.connected())
{
if (client.connect(mySQLServer, 80))
{
client.print("GET /smartcoop/add.php?outsideTemp=");
//Serial.print("GET /smartcoop/add.php?outsideTemp=");
client.print(temperature);
// Serial.print(temperature);
client.print("&insideTemp=");
// Serial.print("&insideTemp=");
client.print(insideTemperature);
// Serial.print(insideTemperature);
client.print("&hum=");
//Serial.print("&hum=");
client.print(humidity);
// Serial.print(humidity);
client.println();
//Serial.println();
client.println("Host: 192.168.41.11");
client.println("Connection: close");
client.println();
}
client.stop();
}
}
void mySQLAddTimes() // this needs testing
{
if (!client.connected())
{
Serial.println("!CONNECT");
if (client.connect(mySQLServer, 80))
{
client.print("GET /smartcoop/addTimes.php?sunrise=");
client.print(sunrise);
client.print("&sunset=");
client.print(sunset);
client.println();
client.println("Host: 192.168.41.110");
client.println("Connection: close");
client.println();
}
client.stop();
}
}