Compare commits

..

No commits in common. "638f7141291651c2c77305364505549ae17bb64c" and "7c7d322839302193179d2d83ad42cafcbc581bed" have entirely different histories.

3 changed files with 7 additions and 9 deletions

2
.gitignore vendored
View file

@ -20,5 +20,3 @@
*APIKey.h *APIKey.h
*APIKey.php *APIKey.php
*~ *~
config.inc.php

View file

@ -2,5 +2,5 @@
String thingtweetAPIKey = "myThingspeakKey"; String thingtweetAPIKey = "myThingspeakKey";
String serverAPIKey = "myserverAPIKey"; String serverAPIKey = "myserverAPIKey";
String pingGetAPIKey ="pingGetApiKey"; String pingAPIKey ="pingApiKey";

View file

@ -25,7 +25,7 @@ byte mac[] = { 0xD4, 0xBA, 0xD9, 0x9A, 0x7C, 0x95 }; // Must be unique on local
EthernetClient client; EthernetClient client;
// Twitter response variables // Twitter response variables
#define SERVER_DOMAIN "spaceapi.it-syndikat.org" // URL char serverName[] = "it-syndikat.org"; // URL
String currentLine = ""; // string to hold the text from server String currentLine = ""; // string to hold the text from server
// Specific variables // Specific variables
@ -279,11 +279,11 @@ void readServerStatus(int mode) {
void TriggerServerReq(String s, int mode) { void TriggerServerReq(String s, int mode) {
// attempt to connect, and wait a millisecond: // attempt to connect, and wait a millisecond:
if(debug){Serial.println("connecting to server... Status req");} if(debug){Serial.println("connecting to server... Status req");}
if (client.connect(SERVER_DOMAIN, 80)) { if (client.connect(serverName, 80)) {
if(debug){Serial.println("making HTTP request...");} if(debug){Serial.println("making HTTP request...");}
// make HTTP GET request to server: // make HTTP GET request to server:
client.println("GET "+ s +" HTTP/1.1"); client.println("GET "+ s +" HTTP/1.1");
client.println("HOST: " SERVER_DOMAIN); client.println("HOST: it-syndikat.org");
client.println("Connection: close"); client.println("Connection: close");
client.println(); client.println();
readServerStatus(mode); readServerStatus(mode);
@ -335,12 +335,12 @@ void setup()
void TriggerServerUpdate(boolean stat) { void TriggerServerUpdate(boolean stat) {
// attempt to connect, and wait a millisecond: // attempt to connect, and wait a millisecond:
if(debug){Serial.println("connecting to server... Update Req");} if(debug){Serial.println("connecting to server... Update Req");}
if (client.connect(SERVER_DOMAIN, 80)) { if (client.connect(serverName, 80)) {
if(debug){Serial.println("making HTTP request...");} if(debug){Serial.println("making HTTP request...");}
// make HTTP GET request to server: // make HTTP GET request to server:
String s =(stat?"true":"false"); String s =(stat?"true":"false");
client.println("GET /api/update.php?open=" + s + "&apikey="+serverAPIKey+" HTTP/1.1"); client.println("GET /api/update.php?open=" + s + "&apikey="+serverAPIKey+" HTTP/1.1");
client.println("HOST: " SERVER_DOMAIN); client.println("HOST: it-syndikat.org");
client.println("Connection: close"); client.println("Connection: close");
client.println(); client.println();
readServerStatus(0); readServerStatus(0);
@ -364,7 +364,7 @@ void readButtons(){
} }
void RequestPing() { void RequestPing() {
TriggerServerReq("/api/ping-get.php?apikey="+pingGetAPIKey,1); TriggerServerReq("/api/ping-get.php?apikey="+pingAPIKey,1);
} }
void launchUpdate(){ void launchUpdate(){