Google charts
- nicoverduin
-
- Berichten: 5043
- Geregistreerd: 13 Mei 2013, 20:57
- Woonplaats: Heemskerk
Re: Google charts
lijkt erop dat hij niet wil connecten of je hebt geen ethernet verbinding met je netwerk.
IP adres evt. van de server = 174.137.125.59 mogelijk moet jij dat als server gebruiken
IP adres evt. van de server = 174.137.125.59 mogelijk moet jij dat als server gebruiken
Advertisement
Re: Google charts
Hoi Nico,
Dat heeft geholpen.
Hij staat nu als een gek data te spuien, maar blijkbaar gaat er nog iets fout met het post commando.
Hieronder staat een stukje output wat ik krijg.
<html><head><title>Apache Tomcat/5.5.25 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 405 - HTTP method POST is not supported by this URL</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>HTTP method POST is not supported by this URL</u></p><p><b>description</b> <u>The specified HTTP method is not allowed for the requested resource (HTTP method POST is not supported by this URL).</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.25</h3></body></html>
disconnecting.
GET /pushingbox?devid=vB580250177BD31E HTTP/1.1
Host: api.pushingbox.com
User-Agent: Arduino
Content-Type: application/x-www-form-urlencoded
Content-Length: 8
temp=347
Sending data
HTTP/1.1 405 HTTP method POST is not supported by this URL
Date: Sun, 13 Oct 2013 09:31:08 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 1115
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
ik hoop dat jij er wat mee kan?
grtz frans![Embarrassed :oops:](./images/smilies/icon_redface.gif)
Dat heeft geholpen.
Hij staat nu als een gek data te spuien, maar blijkbaar gaat er nog iets fout met het post commando.
Hieronder staat een stukje output wat ik krijg.
<html><head><title>Apache Tomcat/5.5.25 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 405 - HTTP method POST is not supported by this URL</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>HTTP method POST is not supported by this URL</u></p><p><b>description</b> <u>The specified HTTP method is not allowed for the requested resource (HTTP method POST is not supported by this URL).</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.25</h3></body></html>
disconnecting.
GET /pushingbox?devid=vB580250177BD31E HTTP/1.1
Host: api.pushingbox.com
User-Agent: Arduino
Content-Type: application/x-www-form-urlencoded
Content-Length: 8
temp=347
Sending data
HTTP/1.1 405 HTTP method POST is not supported by this URL
Date: Sun, 13 Oct 2013 09:31:08 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 1115
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
ik hoop dat jij er wat mee kan?
grtz frans
![Embarrassed :oops:](./images/smilies/icon_redface.gif)
- nicoverduin
-
- Berichten: 5043
- Geregistreerd: 13 Mei 2013, 20:57
- Woonplaats: Heemskerk
Re: Google charts
Net nog getest:
die 'F' functie zorgt ervoor dat alle constanten in FLASH memory blijven staan en scheelt een hoop RAM gebruik Maar verder volgens mij hetzelfde.
Hoe ziet nu de laatste code bij jou eruit?
- Code: Alles selecteren
if (client.connect()) { // if success
//
// this is the POST command. DO NOT CHANGE or it will not work
// we'll put all the constant strings in FLASH memory saving RAM space
//
client.print (F("POST /pushingbox?devid=")); // setup POST command
client.print (devid); // service called
client.println (F(" HTTP/1.1"));
client.print (F("Host: "));
client.println (serverName);
client.println (F("User-Agent: Arduino"));
client.println (F("Content-Type: application/x-www-form-urlencoded"));
client.println (F( "Connection: close" ));
client.print (F("Content-Length: "));
client.println (data.length());
client.println ();
client.print (data);
client.println ();
}
die 'F' functie zorgt ervoor dat alle constanten in FLASH memory blijven staan en scheelt een hoop RAM gebruik Maar verder volgens mij hetzelfde.
Hoe ziet nu de laatste code bij jou eruit?
Re: Google charts
Hoi Nico,
Ik heb het POST commando in een get Commando veranderd, en dan lijkt mijn sketch good te werken zoals je hieronder ziet.
Alleen komt er nog geen data in de spreadsheet.
temp=346
Sending data
HTTP/1.1 301 Moved Permanently
Date: Sun, 13 Oct 2013 09:54:18 GMT
Location: http://www.pushingbox.com
Connection: close
Content-Type: text/html;charset=UTF-8
Content-Length: 0
disconnecting.
GET /pushingbox?devid=vB580250177BD31E HTTP/1.1
Host: api.pushingbox.com
User-Agent: Arduino
Content-Type: application/x-www-form-urlencoded
Content-Length: 8
temp=339
Sending data
HTTP/1.1 301 Moved Permanently
Date: Sun, 13 Oct 2013 09:54:19 GMT
Location: http://www.pushingbox.com
Connection: close
Content-Type: text/html;charset=UTF-8
Content-Length: 0
disconnecting.
GET /pushingbox?devid=vB580250177BD31E HTTP/1.1
Host: api.pushingbox.com
User-Agent: Arduino
Content-Type: application/x-www-form-urlencoded
Content-Length: 8
temp=342
Sending data
HTTP/1.1 301 Moved Permanently
Date: Sun, 13 Oct 2013 09:54:21 GMT
Location: http://www.pushingbox.com
Connection: close
Content-Type: text/html;charset=UTF-8
Content-Length: 0
Het stukje programma ziet er na modificatie nu zo uit.
if (client.connect(server,80)) { // connect to the server
// while (client.available()) { // print any return data
// char c = client.read();
// Serial.print(c);
// }
//
// this is the POST command. DO NOT CHANGE or it will not work
//
//client.print("POST /pushingbox?devid=");// setup POST command
client.print(F("GET /pushingbox?devid="));// setup POST command
client.print(devid);
client.println(F(" HTTP/1.1"));
client.print(F("Host: "));
client.println(serverName);
client.println(F("User-Agent: Arduino"));
client.println(F("Content-Type: application/x-www-form-urlencoded"));
client.println(F("Connection: close" ));
client.print("Content-Length: ");
client.println(data.length());
client.println();
client.print(data);
client.println();
grtz frans
Ik heb het POST commando in een get Commando veranderd, en dan lijkt mijn sketch good te werken zoals je hieronder ziet.
Alleen komt er nog geen data in de spreadsheet.
temp=346
Sending data
HTTP/1.1 301 Moved Permanently
Date: Sun, 13 Oct 2013 09:54:18 GMT
Location: http://www.pushingbox.com
Connection: close
Content-Type: text/html;charset=UTF-8
Content-Length: 0
disconnecting.
GET /pushingbox?devid=vB580250177BD31E HTTP/1.1
Host: api.pushingbox.com
User-Agent: Arduino
Content-Type: application/x-www-form-urlencoded
Content-Length: 8
temp=339
Sending data
HTTP/1.1 301 Moved Permanently
Date: Sun, 13 Oct 2013 09:54:19 GMT
Location: http://www.pushingbox.com
Connection: close
Content-Type: text/html;charset=UTF-8
Content-Length: 0
disconnecting.
GET /pushingbox?devid=vB580250177BD31E HTTP/1.1
Host: api.pushingbox.com
User-Agent: Arduino
Content-Type: application/x-www-form-urlencoded
Content-Length: 8
temp=342
Sending data
HTTP/1.1 301 Moved Permanently
Date: Sun, 13 Oct 2013 09:54:21 GMT
Location: http://www.pushingbox.com
Connection: close
Content-Type: text/html;charset=UTF-8
Content-Length: 0
Het stukje programma ziet er na modificatie nu zo uit.
if (client.connect(server,80)) { // connect to the server
// while (client.available()) { // print any return data
// char c = client.read();
// Serial.print(c);
// }
//
// this is the POST command. DO NOT CHANGE or it will not work
//
//client.print("POST /pushingbox?devid=");// setup POST command
client.print(F("GET /pushingbox?devid="));// setup POST command
client.print(devid);
client.println(F(" HTTP/1.1"));
client.print(F("Host: "));
client.println(serverName);
client.println(F("User-Agent: Arduino"));
client.println(F("Content-Type: application/x-www-form-urlencoded"));
client.println(F("Connection: close" ));
client.print("Content-Length: ");
client.println(data.length());
client.println();
client.print(data);
client.println();
grtz frans
- nicoverduin
-
- Berichten: 5043
- Geregistreerd: 13 Mei 2013, 20:57
- Woonplaats: Heemskerk
Re: Google charts
Gebruik jij nu het IP nummer voor de server? Want het lijkt erop dat hij nu niet meer naar api.pushingbox.com gaat.
Daarnaast heb je ook in Pushing box de service veranderd van POST naar GET?
Daarnaast heb je ook in Pushing box de service veranderd van POST naar GET?
Re: Google charts
Nico,
als ik vanuit pushingbox senarios op test druk dan komy in mijn speeadsheet onderstaande regel.
Dit lijkt me juist, of niet?
als ik vanuit pushingbox senarios op test druk dan komy in mijn speeadsheet onderstaande regel.
Dit lijkt me juist, of niet?
- nicoverduin
-
- Berichten: 5043
- Geregistreerd: 13 Mei 2013, 20:57
- Woonplaats: Heemskerk
Re: Google charts
Ja die werkt altijd. Heb je de POST ook veranderd in GET? Als jij nu test, dan wordt er gewoon een POST uitgevoerd en jij komt met een GET.
Re: Google charts
Nico,
Dit is de laatste status van het programma.
* Arduino to Google Docs
created 2011
This example code is in the public domain.
http://www.open-electronics.org
http://www.futurashop.it
https://spreadsheets.google.com/formRes ... UVp2U0E6MQ
&ifq&entry.0.single=Boris
&entry.2.single=Landoni
&submit=Submit
Original from
http://goodsite.cocolog-nifty.com/uessa ... gle-d.html
&ifq&entry.0.single=Boris
&entry.2.single=Landoni
&submit=SubmitOriginal from
Modified by John Missikos 11/6/11
Modified by Andrea Fainozzi 30/6/11
Modified by Boris Landoni 8/7/11
*/
#include <Ethernet.h>
#include <SPI.h>
byte mac[] = { 0x90,0xA2,0xDA,0x00,0x55,0x8D}; //Replace with your Ethernet shield MAC
byte ip[] = { 192,168,178,55}; //The Arduino device IP address
char serverName[] = "api.pushingbox.com"; //pushing box server
char devid[] = "vB580250177BD31E"; //device id
byte server[] = {174,137,125,59};
EthernetClient client;
void setup()
{
Serial.begin(9600);
Ethernet.begin(mac, ip);
delay(1000);
Serial.println("connecting...");
// start the Ethernet connection:
}//setup
void loop()
{
String data; // contains all the data fields
data ="";
data +="temp="; // add temp fieldname
data +=analogRead(A0); // add analog port
client.stop(); // probably redundant
if (client.connect(server,80)) { // connect to the server
// while (client.available()) { // print any return data
// char c = client.read();
// Serial.print(c);
// }
//
// this is the POST command. DO NOT CHANGE or it will not work
//
//client.print("POST /pushingbox?devid=");// setup POST command
client.print(F("GET /pushingbox?devid="));// setup POST command
client.print(devid);
client.println(F(" HTTP/1.1"));
client.print(F("Host: "));
client.println(serverName);
client.println(F("User-Agent: Arduino"));
client.println(F("Content-Type: application/x-www-form-urlencoded"));
client.println(F("Connection: close" ));
client.print("Content-Length: ");
client.println(data.length());
client.println();
client.print(data);
client.println();
//
// redundant info
//
Serial.print("GET /pushingbox?devid=");
Serial.print(devid);
Serial.println(" HTTP/1.1");
Serial.print("Host: ");
Serial.println(serverName);
Serial.println("User-Agent: Arduino");
Serial.println("Content-Type: application/x-www-form-urlencoded");
Serial.print("Content-Length: ");
Serial.println(data.length());
Serial.println();
Serial.print(data);
Serial.println();
Serial.println("Sending data");
} else {
Serial.println("connection failed");
}
//
// print any return info
//
while (client.available()) {
char c = client.read();
Serial.print(c);
}
Serial.println("");
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
}
delay(1000);
}//loop
Dit is de laatste status van het programma.
* Arduino to Google Docs
created 2011
This example code is in the public domain.
http://www.open-electronics.org
http://www.futurashop.it
https://spreadsheets.google.com/formRes ... UVp2U0E6MQ
&ifq&entry.0.single=Boris
&entry.2.single=Landoni
&submit=Submit
Original from
http://goodsite.cocolog-nifty.com/uessa ... gle-d.html
&ifq&entry.0.single=Boris
&entry.2.single=Landoni
&submit=SubmitOriginal from
Modified by John Missikos 11/6/11
Modified by Andrea Fainozzi 30/6/11
Modified by Boris Landoni 8/7/11
*/
#include <Ethernet.h>
#include <SPI.h>
byte mac[] = { 0x90,0xA2,0xDA,0x00,0x55,0x8D}; //Replace with your Ethernet shield MAC
byte ip[] = { 192,168,178,55}; //The Arduino device IP address
char serverName[] = "api.pushingbox.com"; //pushing box server
char devid[] = "vB580250177BD31E"; //device id
byte server[] = {174,137,125,59};
EthernetClient client;
void setup()
{
Serial.begin(9600);
Ethernet.begin(mac, ip);
delay(1000);
Serial.println("connecting...");
// start the Ethernet connection:
}//setup
void loop()
{
String data; // contains all the data fields
data ="";
data +="temp="; // add temp fieldname
data +=analogRead(A0); // add analog port
client.stop(); // probably redundant
if (client.connect(server,80)) { // connect to the server
// while (client.available()) { // print any return data
// char c = client.read();
// Serial.print(c);
// }
//
// this is the POST command. DO NOT CHANGE or it will not work
//
//client.print("POST /pushingbox?devid=");// setup POST command
client.print(F("GET /pushingbox?devid="));// setup POST command
client.print(devid);
client.println(F(" HTTP/1.1"));
client.print(F("Host: "));
client.println(serverName);
client.println(F("User-Agent: Arduino"));
client.println(F("Content-Type: application/x-www-form-urlencoded"));
client.println(F("Connection: close" ));
client.print("Content-Length: ");
client.println(data.length());
client.println();
client.print(data);
client.println();
//
// redundant info
//
Serial.print("GET /pushingbox?devid=");
Serial.print(devid);
Serial.println(" HTTP/1.1");
Serial.print("Host: ");
Serial.println(serverName);
Serial.println("User-Agent: Arduino");
Serial.println("Content-Type: application/x-www-form-urlencoded");
Serial.print("Content-Length: ");
Serial.println(data.length());
Serial.println();
Serial.print(data);
Serial.println();
Serial.println("Sending data");
} else {
Serial.println("connection failed");
}
//
// print any return info
//
while (client.available()) {
char c = client.read();
Serial.print(c);
}
Serial.println("");
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
}
delay(1000);
}//loop
- nicoverduin
-
- Berichten: 5043
- Geregistreerd: 13 Mei 2013, 20:57
- Woonplaats: Heemskerk
Re: Google charts
Jouw code ziet er op zich prima uit. Maar heb je die GET nu ook bij de Service erin gezet op Pushingbox.com? Ik heb zelf een ethernet kaart (is wel besteld) dus kan het hier ook niet testen. MEt de WiFly werkt ie nog steeds dus dat gaat prima. Lijkt erop dat de Ethernet shield niet lekker werkt met het vertalen van een URL-> IP want hier geen problemen.
@edit: als ik nu weer ping naar api.pushingbox.com krijg ik 213.186.33.19 die zou je nog kunnen proberen
@edit: als ik nu weer ping naar api.pushingbox.com krijg ik 213.186.33.19 die zou je nog kunnen proberen
Re: Google charts
Hallo Nico,
HET WERKT!!!!
Nadat ik het nieuwe server ip had ingetikt, en daarna weer van GET naar POST ben gegaan.
Dit was wel een erg zware bevalling.
Bedankt dat je zoveel geduld met me hebt gehad.
Ik ga het nu allemaal een beetje netjes maken, en daarna kan ik aan de slag met Google charts, want de grafiek moet dynamisch in mijn programma komen staan.
Nogmaals bedankt, en prettig weekend.
grtz frans
![Razz :P](./images/smilies/icon_razz.gif)
HET WERKT!!!!
![Laughing :lol:](./images/smilies/icon_lol.gif)
![Laughing :lol:](./images/smilies/icon_lol.gif)
![Laughing :lol:](./images/smilies/icon_lol.gif)
![Laughing :lol:](./images/smilies/icon_lol.gif)
Nadat ik het nieuwe server ip had ingetikt, en daarna weer van GET naar POST ben gegaan.
Dit was wel een erg zware bevalling.
Bedankt dat je zoveel geduld met me hebt gehad.
Ik ga het nu allemaal een beetje netjes maken, en daarna kan ik aan de slag met Google charts, want de grafiek moet dynamisch in mijn programma komen staan.
Nogmaals bedankt, en prettig weekend.
grtz frans
![Razz :P](./images/smilies/icon_razz.gif)
![Razz :P](./images/smilies/icon_razz.gif)
![Razz :P](./images/smilies/icon_razz.gif)
![Razz :P](./images/smilies/icon_razz.gif)
![Razz :P](./images/smilies/icon_razz.gif)
![Razz :P](./images/smilies/icon_razz.gif)
Wie is er online?
Gebruikers in dit forum: Geen geregistreerde gebruikers en 16 gasten