7 Replies Latest reply on Nov 26, 2014 6:02 AM by DiegoV_Intel

    Ethernet Connection Issue (WebClient Example)

    advitya

      I have been trying to get this to work for days and I have tried all of the suggestions mentioned in the following posts:

      https://communities.intel.com/thread/51969?wapkw=ethernet+issues+galileo

      Problems with Web Client Example

       

      However, none of these solutions seem to fix the problem. The example code provided by the example sketches in the Arduino IDE was working a couple of months back.

      Now, it has just seemed to stop working. Is this because of a firmware update or some other issue related to the board (like I have some hardware configuration set incorrectly that is causing this problem).

       

      It would be great if some of you could provide your knowledge into the matter. I have tried this on a couple of Galileo boards and it seems not to be working on either.

        • 1. Re: Ethernet Connection Issue (WebClient Example)
          DiegoV_Intel

          Hi advitya,

           

          I have some questions for you:

          • What exactly is your issue?
          • Could you please provide a detailed explanation about it?
          • Is it a compiling error?
          • Which firmware version are you using?

           

          Regards,

          Diego.

          • 2. Re: Ethernet Connection Issue (WebClient Example)
            advitya

            Thank you for your response. I have the following code (it is just copy-pasted from the Example Arduino Sketch):

             

            #include <SPI.h>

            #include <Ethernet.h>

             

            // Enter a MAC address for your controller below.

            // Newer Ethernet shields have a MAC address printed on a sticker on the shield

            byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

            IPAddress server(173,194,33,104); // Google

             

            // Initialize the Ethernet client library

            // with the IP address and port of the server

            // that you want to connect to (port 80 is default for HTTP):

            EthernetClient client;

             

            void setup() {

            // Open serial communications and wait for port to open:

              Serial.begin(9600);

               while (!Serial) {

                ; // wait for serial port to connect. Needed for Leonardo only

              }

             

              // start the Ethernet connection:

              if (Ethernet.begin(mac) == 0) {

                Serial.println("Failed to configure Ethernet using DHCP");

                // no point in carrying on, so do nothing forevermore:

                for(;;)

                  ;

              }

              // give the Ethernet shield a second to initialize:

              delay(1000);

              Serial.println("connecting...");

             

              // if you get a connection, report back via serial:

              if (client.connect(server, 80)) {

                Serial.println("connected");

                // Make a HTTP request:

                client.println("GET /search?q=arduino HTTP/1.0");

                client.println();

              }

              else {

                // if you didn't get a connection to the server:

                Serial.println("connection failed");

              }

            }

             

            void loop()

            {

              // if there are incoming bytes available

              // from the server, read them and print them:

              if (client.available()) {

                char c = client.read();

                Serial.print(c);

              }

             

              // if the server's disconnected, stop the client:

              if (!client.connected()) {

                Serial.println();

                Serial.println("disconnecting.");

                client.stop();

             

                // do nothing forevermore:

                for(;;)

                  ;

              }

            }

             

            The issue is that after compiling the code (which it does successfully). It prints out on the console:

             

            "Connecting..."

            "connection failed"

            "disconnecting"

             

            Essentially, I am the condition client.connect(server, 80) is not ever becoming true. However, I had this code compiling and running as desired a couple of months back. Now, it just fails to ever connect. As I had mentioned on the previous post, I have found other people having issues with this as well:

             

            https://communities.intel.com/thread/51969?wapkw=ethernet+issues+galileo

            Problems with Web Client Example

             

            However, the solutions found have not seemed to fix the problem. I have also tried to change the mac address to the one printed on my galileo; that does not fix it as well. My current firmware is also up to date (just updated the firmware). So, I don't know perhaps an upgrade may have caused the issue.

            • 3. Re: Ethernet Connection Issue (WebClient Example)
              DiegoV_Intel

              Hi advitya,

               

              I'll try to reproduce it in my Galileo board, and as soon as I get some result I will report them here, just let me know what Galileo are you using, Gen 1 or Gen 2?

               

              Regards,

              Diego.

              • 4. Re: Ethernet Connection Issue (WebClient Example)
                advitya

                Thank you for your reply. It is an Intel Galileo Gen 1.

                 

                Advitya

                • 5. Re: Ethernet Connection Issue (WebClient Example)
                  DiegoV_Intel

                  Hi advitya,

                   

                  I tested the WebClient example and I was able to run it with no problems. See the screenshot below. I used the WebClient example on File>Examples>Ethernet>WebClient. I am using the latest version of the Arduino IDE (1.0.4) and the firmware version of mi Gen 1 is 1.0.4 too. I noticed there are two Ethernet examples: "Ethernet" and "EthernetShield". Make sure you are selecting the WebClient sketch from the "Ethernet" examples.

                   

                  EthernetClientOutput.JPG

                   

                  I was able to get the same output you got but only when there wasn't Internet connection, so my suggestion is to check your Internet connection and make sure you are actually connected.

                   

                  Regards,

                  Diego.

                  • 6. Re: Ethernet Connection Issue (WebClient Example)
                    advitya

                    I have tried that. It does not seem to work, as well. The Internet Connection is fine, as I am getting the Ethernet connection to work on my laptop.

                    • 7. Re: Ethernet Connection Issue (WebClient Example)
                      DiegoV_Intel

                      Hi advitya,

                       

                      I apologize for the delay in my response. I've had problems with the Galileo Board with WiFi networks which SSID has spaces in its name. Make sure the name of your network access doesn't have spaces in its name. I'll suggest you to try the ScanNetworks example to know if your network is being recognized by the Galileo.

                       

                      I'm sorry I forgot you are using Ethernet connection. One thing you can try is to connect the Galileo board directly to the router and then, in the router configuration you can check for the MAC address of the Galileo board and what address is being assigned to it if your are using DHCP. Let us know if the MAC address is listed in the client list when you connect the board directly to your router.

                       

                      Regards,

                      Diego.