Show Posts
Pages: 1 ... 156 157 [158] 159 160 ... 400
2356  Using Arduino / Programming Questions / Re: Everything seems fine but arduino won't reach internet on: July 07, 2013, 08:50:47 am
Sounds like a firmware or library problem. Someone else may recognize the symptoms and know what you should do.
What version IDE are you using? That seems to be an issue in some cases, just by a quick forum search.
2357  Using Arduino / Programming Questions / Re: Everything seems fine but arduino won't reach internet on: July 07, 2013, 08:33:13 am
You said the web server example works? I've helped others with WiFi shield code, and it seems to do ok as a client.
http://playground.arduino.cc//Code/WiFiEmailClient
What version IDE are you using?

edit: There does not seem to be any more detailed error checking, except if the shield runs out of sockets, it should display a "No Socket available" serial message. Otherwise, for all other errors, it just returns 0. This is the connect function from WiFiClient.cpp.
Code:
int WiFiClient::connect(IPAddress ip, uint16_t port) {
    _sock = getFirstSocket();
    if (_sock != NO_SOCKET_AVAIL)
    {
     ServerDrv::startClient(uint32_t(ip), port, _sock);
     WiFiClass::_state[_sock] = _sock;

     unsigned long start = millis();

     // wait 4 second for the connection to close
     while (!connected() && millis() - start < 10000)
     delay(1);

     if (!connected())
       {
     return 0;
     }
    }else{
     Serial.println("No Socket available");
     return 0;
    }
    return 1;
}
2358  Using Arduino / Programming Questions / Re: Everything seems fine but arduino won't reach internet on: July 07, 2013, 08:08:51 am
Does your router have a html setup page? Should be
http://192.168.1.1
Can you connect to that ip with the Wifi shield?
2359  Using Arduino / Programming Questions / Re: Everything seems fine but arduino won't reach internet on: July 07, 2013, 08:04:42 am
What does the "IP Address:" show when you start the Arduino?
2360  Using Arduino / Storage / Re: Storage card micro SD and internet W5100 working together on: July 07, 2013, 05:36:29 am
You are probably running out of SRAM. Try using the F() macro to keep the static strings in program memory. And call Serial.begin() only once.

Here are examples from your code. Do the same to all other static strings in your code. See if that helps.
Code:
  Serial.println(F("DHT11 TEST PROGRAM "));
  Serial.print(F("LIBRARY VERSION: "));
  Serial.println(DHT11LIB_VERSION);
  Serial.println();
  Serial.print(F("Initializing SD card..."));
  if (!SD.begin(4)) {
   Serial.println(F("initialization failed"));
   return;
  }
  Serial.println(F("Initialization done"));
2361  Using Arduino / Networking, Protocols, and Devices / Re: ntp and sd card write, incompatible? (probably solved) on: July 07, 2013, 05:23:40 am
Below is size of sketch after compilation, could be this a problem? What the strategy for optimization.
 31.072 bytes (din maxim 32.256 bytes)
Are you using an Uno? If so, you may be running out of SRAM. If you are close to using all the program memory, it is probable that you are running low on SRAM.

Post the sketch code.

edit: If this is a post with your code, stay on that thread.
http://forum.arduino.cc/index.php?topic=175889.0
2362  Community / Website and Forum / Ethernet library reference change #2 on: July 06, 2013, 07:27:59 am
As long as you are in the ethernet library reference, the following pages need an addition.
http://arduino.cc/en/Reference/ClientWrite
http://arduino.cc/en/Reference/ServerWrite

The pages are missing one of the most useful functions if you plan on sending any NULL (zero) bytes.
client.write(dataString,count);
server.write(dataString,count);

Parameters
dataString: the array to write (byte or char array pointer)
count: the number of bytes of the dataString array to write (int)

edit: Corrected dataString parameter to "byte or char array pointer".
2363  Using Arduino / Storage / Re: Storage card micro SD and internet W5100 working together on: July 06, 2013, 05:44:50 am
The best thing to do is post your sketch code and mention which Arduino you are using.

edit: My bad. I see you mentioned the Uno. You have probably run out of SRAM. Post your code.

2364  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet shield DHCP/Static IP error on: July 05, 2013, 11:28:56 am
Can we please get back to the original topic about andrepcg's problem?  I have the same setup: Aduino Uno + ethernet shield + LCD keypad shield.  There is no SD card inserted in the ethernet shield. 

If I remove the LCD shield DHCP works just fine.  I can even ping my setup without any additional code to handle ICMP ping packets.  However, if I add the LCD shield back onto the stack DHCP works unreliably.  I print the ethernet board's IP address to the LCD screen and I get different addresses everytime or none at all.
Then this is not the same problem and topic as the OP. That part was solved, as it appears it is with your's. Now you have a LCD conflict problem. I recommend starting a new thread with the following info:
Your sketch code.
What LCD shield are you using?
How are you powering all this? The ethernet shield takes a bit of power on its own.
2365  Using Arduino / Networking, Protocols, and Devices / Re: webClient example problem on: July 05, 2013, 06:24:21 am
Most of the defaults are covered on the Ethernet.begin() reference page.
http://arduino.cc/en/Reference/EthernetBegin
I suggested adding the default dns server here:
http://forum.arduino.cc/index.php?topic=175768.0
2366  Community / Website and Forum / Ethernet library reference change on: July 05, 2013, 06:22:02 am
This reference page should be changed to reflect the default setting for the dns server in the function Ethernet.begin(mac,ip).
http://arduino.cc/en/Reference/EthernetBegin
Here is the requested change:
Quote
ip: the IP address of the device (array of 4 bytes)

dns: the IP address of the dns server (array of 4 bytes). optional: defaults to the device IP address with the last octet set to 1

gateway: the IP address of the network gateway (array of 4 bytes). optional: defaults to the device IP address with the last octet set to 1

subnet: the subnet mask of the network (array of 4 bytes). optional: defaults to 255.255.255.0

edit: Changed wording. My bad.  smiley-red
2367  Using Arduino / Programming Questions / Re: Send email and send data to Emoncms in the same sketch on: July 05, 2013, 05:08:47 am
If you are using an Uno, you are probably running out of SRAM.

I recommend using one email send function and both code sections use that same email send function. I have an example email sketch in the playground. It uses an 'e' sent by the serial moitor as a trigger, but you could change that to suit your needs.
http://playground.arduino.cc/Code/Email

Call Ethernet.begin() in setup(), not in loop().
2368  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet library modification on: July 04, 2013, 12:48:24 pm
Quote
arduino settings are for 4 sockets and 2K memory per socket, I think that if we can change this setting for 4 sockets but 4K,2K,1K,1K memory per socket, we can improve the rate transfer, in my attempt I got double speed but no stability (the begining of the file is ok and after garbage data...)
I am not surprised at all, especially if any UDP functions are being used, like dhcp, dns, ntp. One of those could get your big socket. Then the library will use the next socket. You can end up rotating through all the sockets over a period of time.

You could modify the crap out of this library, or write your own, that uses specifically that one socket. But then you are limited to that one socket for your "big stuff".
2369  Using Arduino / Networking, Protocols, and Devices / Re: webClient example problem on: July 04, 2013, 12:00:41 pm
So, there are expectations built into the library as to what the gateway, DNS server, subnet mask, etc. are that are not explained in the documentation.

These expectations are not necessarily the same expectations built into the other library, and are most likely not valid for OPs situation.
Yes and yes. But the second should be no. It should be so easy to change that one last call in the last begin function to a 28J60 setup call. It is all there for you, regardless of the processor you are about to initialize.
2370  Using Arduino / Networking, Protocols, and Devices / Re: webClient example problem on: July 04, 2013, 11:38:02 am
This is from Ethernet.cpp. Note how each constructs the next ip and calls the next begin() below it. The dns server ip is constructed the same as the gateway.
Code:
void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip)
{
  // Assume the DNS server will be the machine on the same network as the local IP
  // but with last octet being '1'
  IPAddress dns_server = local_ip;
  dns_server[3] = 1;
  begin(mac_address, local_ip, dns_server);
}

void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server)
{
  // Assume the gateway will be the machine on the same network as the local IP
  // but with last octet being '1'
  IPAddress gateway = local_ip;
  gateway[3] = 1;
  begin(mac_address, local_ip, dns_server, gateway);
}

void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway)
{
  IPAddress subnet(255, 255, 255, 0);
  begin(mac_address, local_ip, dns_server, gateway, subnet);
}

void EthernetClass::begin(uint8_t *mac, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
{
  W5100.init();
  W5100.setMACAddress(mac);
  W5100.setIPAddress(local_ip._address);
  W5100.setGatewayIp(gateway._address);
  W5100.setSubnetMask(subnet._address);
  _dnsServerAddress = dns_server;
}
Pages: 1 ... 156 157 [158] 159 160 ... 400