Show Posts
Pages: [1]
1  Topics / Home Automation and Networked Objects / Re: Implementing the WebClient Sketch from the Arduino-0022 Examples on: June 20, 2011, 06:19:57 am
Thank you everyone. A very helpful, useful forum!!
2  Topics / Home Automation and Networked Objects / Re: Implementing the WebClient Sketch from the Arduino-0022 Examples on: June 19, 2011, 05:37:34 pm
Wow. That worked.

I use a LinkSys WRT54G router. Can't find any reference to my Arduino in it


Thanks
3  Topics / Home Automation and Networked Objects / Re: Implementing the WebClient Sketch from the Arduino-0022 Examples on: June 19, 2011, 03:40:03 pm
Thank you for your advice on the use of the forum. As you can see I'm new at it.

you are right about the router IP address. I made a typo in the post, not the sketch. It is 192.168.1.1

I used your sketch and altered only the following:

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x50, 0xDD };
byte ip[] = { 192, 168, 1, 1 }; // Arduino IP address

I still get a connection failed message. I'm not suere where to look for an Arduino entry in my router info. The DHCP active IP table doesn't show the Arduino's MAC
4  Topics / Home Automation and Networked Objects / Implementing the WebClient Sketch from the Arduino-0022 Examples on: June 19, 2011, 12:23:17 pm
I just got my Ethernet shield and am trying to get something to work. I am entering the shield's MAC address into the script. Not sure which IP address to enter. I tried my Router's IP (198.1.168.1), various addresses within the supported range (198.168.100 - 149) and even the external IP from the ISP. All I ever get on the monitor is "connecting ...", "connection failed" and "disconnecting."

Any ideas what I'm doing wrong?
5  Using Arduino / Programming Questions / Re: Sketch using Ethernet shield on: June 18, 2011, 01:41:00 pm
Sorry:

http://blog.jordanterrell.com/post/Arduino-DHCP-Library-Version-04.aspx
6  Using Arduino / Programming Questions / Re: Sketch using Ethernet shield on: June 18, 2011, 12:50:20 pm
It came the jordan.terrell blog called Arduino DHCP Library V0.4 (just now realized the entry is labedl April 2009, so it may be dated). I moved it into the arduino-0022\library.
7  Using Arduino / Programming Questions / Re: Sketch using Ethernet shield on: June 18, 2011, 12:01:28 pm
No, the utility/types.h file is nowhere to be found and I did recognize this as the core issue. I guess I wonder where to get that from and why it wouldn'd have been part of the DHCP library that called for it.

Thanks for responding!
8  Using Arduino / Programming Questions / Sketch using Ethernet shield on: June 18, 2011, 10:52:15 am
I'm just learning about Arduino and specifically the Ethernet library and the DHCP library I downloaded. I thought I'd copied the example of this script correctly, but i keep getting errors such as:

In file included from DHCP_Test.cpp:9:
C:\Users\Impresario\Documents\Arduino\arduino-0022\libraries\DHCP/Dhcp.h:8:29: error: utility/types.h: No such file or directory
In file included from DHCP_Test.cpp:9:
C:\Users\Impresario\Documents\Arduino\arduino-0022\libraries\DHCP/Dhcp.h:120: error: 'u_char' does not name a type
C:\Users\Impresario\Documents\Arduino\arduino-0022\libraries\DHCP/Dhcp.h:121: error: 'u_char' does not name a type

Here is the short sketch. I would be ever so grateful for any help!

#if ARDUINO > 18
#include <SPI.h>
#endif
#include <Client.h>
#include <Ethernet.h>
#include <Server.h>
#include <Udp.h>

#include "Dhcp.h"

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x50, 0xDD };
// IP addressing automatic
byte server[] = { 209, 85, 229,104}; // Google

Client client(server, 80);

void setup()
{
  Serial.begin(9600);
  if(Dhcp.beginWithDHCP(mac) == 1) // begin method returns 1 if successful
  {
    Serial.println("got IP address, connecting...");
    delay(5000);
  }
  else
  {
    Serial.println("unable to acquire ip address!");
    while(true) ; // do nothing
  }

  if (client.connect())
  {
    Serial.println("connected");
    client.println("GET /search?q=arduino HTTP/1.0");
    client.println();
  }
  else
  {
    Serial.println("connection failed");
  }
}

void loop()
{
  if (client.available())
  {
    char c = client.read();
    Serial.print(c);
  }
 
  if (!client.connected())
  {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
    for(;smiley-wink ;
  }
}
Pages: [1]