Now I just get:
sketch_feb19a.cpp: In function 'void setup()':
sketch_feb19a:21: error: 'RTC' was not declared in this scope
sketch_feb19a:22: error: 'DS1307_HR' was not declared in this scope
sketch_feb19a:23: error: 'DS1307_MIN' was not declared in this scope
sketch_feb19a:24: error: 'DS1307_SEC' was not declared in this scope
sketch_feb19a:25: error: 'DS1307_MTH' was not declared in this scope
sketch_feb19a:26: error: 'DS1307_DATE' was not declared in this scope
sketch_feb19a:27: error: 'DS1307_YR' was not declared in this scope
sketch_feb19a.cpp: In function 'void loop()':
sketch_feb19a:55: error: 'RTC' was not declared in this scope
I got it to connect but I only recieve:
starting simple arduino client test
connecting...
connected
0 34 10 0 18 2 2011
634
A
H1 34 10 0 18 2 2011
634
A
T2 34 10 0 18 2 2011
634
A
T3 34 10 0 18 2 2011
634
A
P4 34 10 0 18 2 2011
634
A
/5 34 10 0 18 2 2011
634
A
16 34 10 0 18 2 2011
634
A
.8 34 10 0 18 2 2011
634
A
19 34 10 0 18 2 2011
634
A
10 34 10 0 18 2 2011
634
A
211 34 10 0 18 2 2011
634
A
012 34 10 0 18 2 2011
634
but I only recieve:
And what did you expect to receive?
I expected to recieve the Time and Date, and the feed a feed that includes the weather and my email count.
Well, I think I can see a date in February (maybe yesterday) in there, but maybe if we could see your code, maybe we could help.
Yeah, you'll have to interpret the other data you're getting.
Why not comment out the client stuff to start, get the time/date in recognizable format, then work the rest.
Not clear to me that you're passing the if conditions for some of them to be active or not.
This is the code:
#include <WProgram.h>
#include <Wire.h>
#include <DS1307.h>
#include <SPI.h>
#include <Ethernet.h>
String readString, readString1;
int x=0;
char lf=10;
int rtc[7];
byte data[56];
byte mac[] = {
0x90, 0xA2, 0xDA, 0x00, 0x22, 0x8A };
byte ip[] = {
192, 168, 0, 104 };
byte server[] = {
97, 74, 166, 239 };
Client client(server, 80);
void setup()
{
Serial.begin(9600);
RTC.stop();
RTC.set(DS1307_HR,10);
RTC.set(DS1307_MIN,34);
RTC.set(DS1307_SEC,1);
RTC.set(DS1307_MTH,2);
RTC.set(DS1307_DATE,18);
RTC.set(DS1307_YR,11);
RTC.start();
for(int i=0; i<56; i++)
{
RTC.set_sram_byte(65,i);
}
byte gateway[] = {
192, 168, 0, 1 };
Ethernet.begin(mac, ip, gateway);
Serial.println("starting simple arduino client test");
Serial.println();
Serial.println("connecting...");
if (client.connect()) {
Serial.println("connected");
client.println("GET /processedfeed.aspx?feedcode=%5Bbc_u1%5Dhttp%253A//pipes.yahoo.com/pipes/pipe.run%253F_id%253D6d2c0b97b3c18eba6be661489a35c9c3%2526_render%253Drss%5B/bc_u1%5D%5Bbc_m1%5D3%5B/bc_m1%5D%5Bbc_o%5D0%5B/bc_o%5D HTTP/1.0");
client.println();
}
else {
Serial.println("connection failed");
}
}
void loop()
{
RTC.get(rtc,true);
for(int i=0; i<7; i++)
{
Serial.print(rtc[i]);
Serial.print(" ");
}
Serial.println();
Serial.print(RTC.min_of_day(true));
Serial.println();
delay(1000);
//RTC.get_data(data);
//for(int i=0; i<56; i++)
//{
//Serial.print(data[i]);
//Serial.print(" ");
//}
Serial.print(RTC.get_sram_byte(29));
Serial.println();
if (client.available()) {
char c = client.read();
Serial.print(c);
if (c==lf) x=(x+1);
if (x==14) readString += c;
readString += c;
}
if (!client.connected()) {
client.stop();
Serial.println("Current data row:" );
Serial.print(readString);
Serial.println();
readString1 = (readString.substring(41,43));
Serial.println();
Serial.print("DPD sec: ");
Serial.println(readString1);
Serial.println("done");
for(;;);
}
}
This post may help explain the feed side of what I want to do.
http://arduino.cc/forum/index.php/topic,52048.0.html
ARRRRGHHH!!! I cant get it to work. I can get each sketch working in serial monitor seperatly but when I put them into one sketch it just displays that weird time code and nothing else, not even the weather and email feed.
system
February 20, 2011, 2:02am
30
I can get each sketch working in serial monitor seperatly but when I put them into one sketch it just displays that weird time code and nothing else, not even the weather and email feed.
What a bummer. Maybe, just maybe, if you posted the code, we could help you figure out what is wrong.
Here is everything that was used in my sketch.
Combined Feed.zip (98.3 KB)
system
February 20, 2011, 3:19am
32
Combined.pde in that zip file is an empty sketch. I think I found your problem.
combined.pde is the following:
#include <WProgram.h>
#include <Wire.h>
#include <DS1307.h>
#include <SPI.h>
#include <Ethernet.h>
String readString, readString1;
int x=0;
char lf=10;
int rtc[7];
byte data[56];
byte mac[] = {
0x90, 0xA2, 0xDA, 0x00, 0x22, 0x8A };
byte ip[] = {
192, 168, 0, 104 };
byte server[] = {
97, 74, 166, 239 };
Client client(server, 80);
void setup()
{
Serial.begin(9600);
RTC.stop();
RTC.set(DS1307_HR,10);
RTC.set(DS1307_MIN,34);
RTC.set(DS1307_SEC,1);
RTC.set(DS1307_MTH,2);
RTC.set(DS1307_DATE,18);
RTC.set(DS1307_YR,11);
RTC.start();
for(int i=0; i<56; i++)
{
RTC.set_sram_byte(65,i);
}
byte gateway[] = {
192, 168, 0, 1 };
Ethernet.begin(mac, ip, gateway);
Serial.println("starting simple arduino client test");
Serial.println();
Serial.println("connecting...");
if (client.connect()) {
Serial.println("connected");
client.println("GET /processedfeed.aspx?feedcode=%5Bbc_u1%5Dhttp%253A//pipes.yahoo.com/pipes/pipe.run%253F_id%253D6d2c0b97b3c18eba6be661489a35c9c3%2526_render%253Drss%5B/bc_u1%5D%5Bbc_m1%5D3%5B/bc_m1%5D%5Bbc_o%5D0%5B/bc_o%5D HTTP/1.0");
client.println();
}
else {
Serial.println("connection failed");
}
}
void loop()
{
RTC.get(rtc,true);
for(int i=0; i<7; i++)
{
Serial.print(rtc[i]);
Serial.print(" ");
}
Serial.println();
Serial.print(RTC.min_of_day(true));
Serial.println();
delay(1000);
//RTC.get_data(data);
//for(int i=0; i<56; i++)
//{
//Serial.print(data[i]);
//Serial.print(" ");
//}
Serial.print(RTC.get_sram_byte(29));
Serial.println();
if (client.available()) {
char c = client.read();
Serial.print(c);
if (c==lf) x=(x+1);
if (x==14) readString += c;
readString += c;
}
if (!client.connected()) {
client.stop();
Serial.println("Current data row:" );
Serial.print(readString);
Serial.println();
readString1 = (readString.substring(41,43));
Serial.println();
Serial.print("DPD sec: ");
Serial.println(readString1);
Serial.println("done");
for(;;);
}
}
I still am stumped I have tried everything. Can someone possibly download the files and see why it has been not working?
Well, yes, we could download things, but without identical hardware, the exercise would be pointless.
You could examine what you mean by "working"
So you are saying I am totally on my own?
system
February 20, 2011, 7:18pm
37
I don't have an ethernet shield, so I can't do it. I do have an RTC, and I know that that code works for dealing with the RTC.
It appears that loop simply dumps some data from the RTC, then echos whatever the client request consists of, if a connection occurred. If no connection occurred the code goes into an infinite loop.
Without the ethernet shield, it is impossible to see what output you are getting, and you haven't bothered showing that.
So, yes, I guess you are on your own.
So you are saying I am totally on my own
The other way of looking at it is that you're a pioneer.
This is what the feed returns when not combined with the rtc code:
connecting...
connected
HTTP/1.1 200 OK
Connection: close
Date: Sat, 19 Feb 2011 00:29:08 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Set-Cookie: ASP.NET_SessionId=5islarucaamueazver445bed; path=/; HttpOnly
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 1480
<?xml version="1.0"?><rss version="2.0"><channel><title>Emails </title><description>Pipes Output </description><item><title>Emails</title><description>5</description><guid isPermaLink="false">6d2c0b97b3c18eba6be661489a35c9c3_d41d8cd98f00b204e9800998ecf8427e</guid></item><item><title>Current Conditions from Notre Dame HS, Sherman Oaks, CA</title><link>http://web.live.weatherbug.com/Common/home.aspx?zcode=z4641&zip=91423&units=0&rnd=Obs021820111900</link><description><div><b>Temperature:</b> 50.2 &deg;F<br /> <b>Humidity:</b> 99 %&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Dew Point:</b> 50 &deg;F <br /> <b>Wind Speed:</b> 10 mph SE &nbsp;&nbsp; <b>Gusts:</b> 26 mph ESE<br /> <b>Pressure:</b> 29.78 " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>Rain Today:</b> 0.07 "<br /> </div> <br /> <em> <a rel="nofollow" target="_blank" href="http://web.live.weatherbug.com/Common/home.aspx?zcode=z4641&zip=91423&units=0&more=1">More Observations</a> </em></description><guid isPermaLink="false">Current-Sat, 19 Feb 2011 00:00:00 GMT</guid><pubDate>Fri, 18 Feb 2011 16:00:00 -0800</pubDate></item></channel></rss>
Current data row:
HTTP/1.1 200 OK
Connection: close
Date: Sat, 19 Feb 2011 00:29:08 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Set-Cookie: ASP.NET_SessionId=5islarucaamueazver445bed; path=/; HttpOnly
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 1480
<?xml version="1.0"?><rss version="2.0"><channel><title>Emails </title><description>Pipes Output </description><item><title>Emails</title><description>5</description><guid isPermaLink="false">6d2c0b97b3c18eba6be661489a35c9c3_d41d8cd98f00b204e9800998ecf8427e</guid></item><item><title>Current Conditions from Notre Dame HS, Sherman Oaks, CA</title><link>http://web.live.weatherbug.com/Common/home.aspx?zcode=z4641&zip=91423&units=0&rnd=Obs021820111900</link><description><div><b>Temperature:</b> 50.2 &deg;F<br /> <b>Humidity:</b> 99 %&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Dew Point:</b> 50 &deg;F <br /> <b>Wind Speed:</b> 10 mph SE &nbsp;&nbsp; <b>Gusts:</b> 26 mph ESE<br /> <b>Pressure:</b> 29.78 " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a
DPD sec:
Temperature: (In this it is 50.2) and Emails: (In this it is 5)
What more do I need to show you guys?