3 Replies Latest reply on Aug 21, 2015 8:59 AM by JPMontero_Intel

    failed server polling after a few times

    noris1

      hello people

      i'm working on a final's project with Intel Galileo gen,1  where i using the galileo as a stand alone computer with is not connected to the PC.

      I use polling the sever via http get, it's work fine but after an hour  or less of polling the server, galileo crashes and cant connect to the server.



      any one know that couses it?

      many thanks

       

       

      #include <Ethernet.h>

      #include <SPI.h>

      #include <String.h>

      //-------------------------

      int count=0;

      char r='3';

      int i =0;

      int j =0;

      int led = 13;

      String message;

      String garb;

      boolean startRead = false; // is reading?

      char inString[20]; // string for incoming serial data

      int indx = 0; // string index counter

      //------------------------

      EthernetClient client; // Client Class parameter.

       

      String client_print()

      {

        indx=0; // start value

              memset(inString, 0 , 20);//

              while (client.available())

        {

        char c = client.read();

        if(c == '<'){ // if you hit the first char

        startRead = true;

        }else if(startRead){

        if (c != '>')

        { // end reading

        //Serial.print(c);

        inString[indx]= c;

        indx++;

        }else{

                  startRead = false;

                  delay(100);

        client.stop();

        client.flush();

                  Serial.println("disconnecting. Done reading");

                  return inString;

        }

        }

        }

      }

       

       

      String connect1(String comm)

      {

        if (client.connect("http://www.eeproject.site50.net", 80))

        {

        Serial.println("connected");

        digitalWrite(led, HIGH);

        // Make HTTP request

             

        client.println("GET /*************************** HTTP/1.0");

          client.println("HOST: www.eeproject.site50.net");

        client.println();

        //Serial.println("Sent the http request");

        return client_print();

        }

        else

        {

        Serial.println("connection failed");

        }

       

        if (client.connected())

        {

        Serial.println();

        //Serial.println("disconnecting.");

        delay(100);

        client.stop();

        delay(100);

        }

      }

       

       

        

      }

       

      void setup()

      {

      //---------------------------------------------

        system("/etc/init.d/networking restart");

        Serial.begin(9600);

        delay(2000);

       

      }

       

       

       

       

      void loop()

      {

        int vaib=0;

              Serial.println("loop start");

      message="  ";

      message=connect1("check");//Get message from sever.

      Serial.println();

      Serial.println("==================="); 

       

       

           delay(1000*60);

      }

        • 1. Re: failed server polling after a few times
          JPMontero_Intel

          Hi noris1,

           

          Make sure to have the latest firmware version for Intel Galileo board as well as an Image that matches the firmware version. I suggest you to check the status of the Ethernet connection from the Linux side of the board when the board can’t connect to the server. Once in there you can use the command tcpdump, with it you’ll be able to see if there is any traffic in the network. Also when you are going to leave the board plugged for long periods of time, make sure is on a ventilated are to avoid the board to overheat, keep track of the temperature of the board to avoid any issues caused by it. Finally, you mentioned the board crashes, do you mean there are other things in the board that stop working besides the connection with the server?

           

          Regards,
          JPMontero_Intel

          • 2. Re: failed server polling after a few times
            noris1

            hi JPMontero_Intel ,

            How can i check the status of the Ethernet connection from the Linux side?

            The board in not connected to the PC and work alone, then when i see that the board is not sendong information to the server , i try to press the reset button but nothing happens, i used a linux command to reset the sketch when there is no connection and it's not working.

            however when it is connected to the PC the reset button and the linux command work fine/

            i posted a question about it before.


            maybe you can recommend another method to connect to server that not involve polling?

            thanks.

            • 3. Re: failed server polling after a few times
              JPMontero_Intel

              Hi noris1,

               

              I apologize for the long wait for my response. You can use the command ifconfig -a to display information about the board’s network interfaces. If you are using the Arduino IDE you can use the following structure: system(“ifconfig –a > /dev/ttyGS0”); The system function uses commands from the Linux side of the board and the section “> /dev/ttyGS0” will display the output of this command in the serial console of the Arduino IDE. Do you still have issues with this or were you able to fix it?


              Regards,
              JPMontero_Intel