Hey
I'm having a problem using a String as the URL (in place of an IP address) when connecting to a server. For example,
#include <SPI.h>
#include <Ethernet.h>
#include <Client.h>
#include <Server.h>
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x89, 0xC9 };
byte ip[] = { 192, 168, 0, 14 };
char server[] = "www.wetdreams.org.uk";
But the following code always prints out the 'Failed Connection #2" string -
if(client.connect(server, 80)){
Serial.println("connected");
client.println("GET /UI/get_test.php?input_val=45 HTTP/1.0");
client.println("HOST: www.wetdreams.org.uk");
client.println();
}
else{
Serial.println("Failed connection #2");
}
Having looked at the Arduino site, I don't think char[]'s can be used as an input parameter to client.connect(), however I saw some code on here cited as working that used a string, like what I have.
The issue that I have is that I can't use an IP address to connect to the server* (I have no idea why) so I'm trying a URL in its place, so in the event that a String can't be used, does anybody know of a workaround where I don't have to use the IP?
- ping www.wetdreams.org.uk returns 193.238.80.90, but when you visit that IP, it isn't resolving to a URL. I have FTP access but nothing more, so don't know what to do.
Ps: The site is a kayaking website, but the URL alone might make it NSFW