Pages: [1]   Go Down
Author Topic: ÍPAddress does not name a type  (Read 1856 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using IDE 1.0. Set Mac and IP in the twitter example sketch but when I verify or upload sketch I get -"ÍPAddress does not name a type" - error plus a long list of errors beginning with - "In file included from". Hope this is clear
Thanks
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 640
Posts: 50335
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

We've got to see your code and your error messages, not a lot of handwaving.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Take your pick. Its any of the example sketches for ethernet shield. Lot of use these forums are if thats the kind of reply you are going to get. Thanks for nothing. I'll figure it out myself.
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9696
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Take your pick. Its any of the example sketches for ethernet shield. Lot of use these forums are if thats the kind of reply you are going to get. Thanks for nothing. I'll figure it out myself.

Did somebody pee in your corn flakes?  smiley-cool
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Wellington, New Zealand
Offline Offline
Sr. Member
****
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd suggest getting rid of the accent above the "I".
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the example code used, with my mac and ip info.
/*
  Twitter Client with Strings
 
 This sketch connects to Twitter using an Ethernet shield. It parses the XML
 returned, and looks for <text>this is a tweet</text>
 
 You can use the Arduino Ethernet shield, or the Adafruit Ethernet shield,
 either one will work, as long as it's got a Wiznet Ethernet module on board.
 
 This example uses the DHCP routines in the Ethernet library which is part of the
 Arduino core from version 1.0 beta 1
 
 This example uses the String library, which is part of the Arduino core from
 version 0019. 
 
 Circuit:
  * Ethernet shield attached to pins 10, 11, 12, 13
 
 created 21 May 2011
 by Tom Igoe
 
 This code is in the public domain.
 
 */
#include <SPI.h>
#include <Ethernet.h>


// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x01, 0xF5 };
IPAddress ip(192,168,1,20);

// initialize the library instance:
EthernetClient client;

const int requestInterval = 60000;  // delay between requests

char serverName[] = "api.twitter.com";  // twitter URL

boolean requested;                   // whether you've made a request since connecting
long lastAttemptTime = 0;            // last time you connected to the server, in milliseconds

String currentLine = "";            // string to hold the text from server
String tweet = "";                  // string to hold the tweet
boolean readingTweet = false;       // if you're currently reading the tweet

void setup() {
  // reserve space for the strings:
  currentLine.reserve(256);
  tweet.reserve(150);

// initialize serial:
  Serial.begin(9600);
  // attempt a DHCP connection:
  if (!Ethernet.begin(mac)) {
    // if DHCP fails, start with a hard-coded address:
    Ethernet.begin(mac, ip);
  }
  // connect to Twitter:
  connectToServer();
}



void loop()
{
  if (client.connected()) {
    if (client.available()) {
      // read incoming bytes:
      char inChar = client.read();

      // add incoming byte to end of line:
      currentLine += inChar;

      // if you get a newline, clear the line:
      if (inChar == '\n') {
        currentLine = "";
      }
      // if the current line ends with <text>, it will
      // be followed by the tweet:
      if ( currentLine.endsWith("<text>")) {
        // tweet is beginning. Clear the tweet string:
        readingTweet = true;
        tweet = "";
      }
      // if you're currently reading the bytes of a tweet,
      // add them to the tweet String:
      if (readingTweet) {
        if (inChar != '<') {
          tweet += inChar;
        }
        else {
          // if you got a "<" character,
          // you've reached the end of the tweet:
          readingTweet = false;
          Serial.println(tweet);   
          // close the connection to the server:
          client.stop();
        }
      }
    }   
  }
  else if (millis() - lastAttemptTime > requestInterval) {
    // if you're not connected, and two minutes have passed since
    // your last connection, then attempt to connect again:
    connectToServer();
  }
}

void connectToServer() {
  // attempt to connect, and wait a millisecond:
  Serial.println("connecting to server...");
  if (client.connect(serverName, 80)) {
    Serial.println("making HTTP request...");
  // make HTTP GET request to twitter:
    client.println("GET /1/statuses/user_timeline.xml?screen_name=arduino&count=1 HTTP/1.1");
    client.println("HOST: api.twitter.com");
    client.println();
  }
  // note the time of this connect attempt:
  lastAttemptTime = millis();
}   


These are the first few errors


In file included from /Users/stusmith6818/Documents/Arduino/libraries/Ethernet/Ethernet.h:5,
                 from TwitterClient.cpp:26:
/Users/stusmith6818/Documents/Arduino/libraries/Ethernet/Client.h:16: error: conflicting return type specified for 'virtual void Client::write(uint8_t)'
/Applications/Arduino-2.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
In file included from

And it highlights th IPAdress line in the sketch.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 640
Posts: 50335
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
In file included from /Users/stusmith6818/Documents/Arduino/libraries/Ethernet/Ethernet.h:5,
                 from TwitterClient.cpp:26:
/Users/stusmith6818/Documents/Arduino/libraries/Ethernet/Client.h:16: error: conflicting return type specified for 'virtual void Client::write(uint8_t)'
/Applications/Arduino-2.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
In file included from

And it highlights th IPAdress line in the sketch.
The message, though, has absolutely nothing to do with the IPAddress line.

When I open the Twit example, and compile, I get this "error":

Code:
Binary sketch size: 15666 bytes (of a 30720 byte maximum)

So, somewhere, you have put a library in the Arduino library path that you should not have put there, and it is causing your problems. I suggest that you uninstall 1.0, and reinstall it.

What's with the -2 in Arduino-2.app? What version of the IDE are you really using?

That example is not the brightest example that Arduino team has foisted off onto unsuspecting users.

Code:
const int requestInterval = 60000;  // delay between requests
Yeah, right. That's a valid int. NOT!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks reinstalled and now uploads OK.
Logged

Pages: [1]   Go Up
Jump to: