1 2 Previous Next 20 Replies Latest reply on Oct 20, 2015 4:05 PM by AdamMiltonBarker

    Connection issues

    AdamMiltonBarker

      Hi I have two Galileo Gen 1s, one is connected up to a dev kit and working fine the other one is having some weird issues, I cannot connect to it via putty anymore. ( I haven't done any work on either of the boards since I lived in France about 6 or 7 months ago. ) The IoT dev kit board is fine I updated hardware put a new image on it and the sensors etc and everything works as expected I can connect via SSH etc and no issues with the nodejs server  and sensors that are on it.

       

      The second board was a board I was given by Microsoft but I no longer want the Windows image on there because they aren't doing anything on it anymore, surprisingly they have moved to Raspberry Pi So I started to set this up with the usual linux image. I could not see the board coming up in my router, I figured maybe it is allocated an static IP that was already in use, I used this code in Arduino IDE to see if it had an ip but it didn't:

       

      void setup() {

        // put your setup code here, to run once:

      system("telnetd -l /bin/sh");

          //system("ifconfig eth0 192.168.X.X netmask 255.255.0.0 up");

      }

       

       

      void loop() {

        // put your main code here, to run repeatedly:

      system("ifconfig eth0 > /dev/ttyGS0");

      sleep(10);

      }

       

      There was no IP so I uncommented the commented line in void setup to give it a static IP, the loop then showed it had the IP I had assigned it but I still couldn't connect to it via SSH. I guessed maybe now you need a serial cable to connect as I have seen this mentioned although I thought I was strange as I have never need one before to connect to the board, either way, I swapped the serial cable over from my functioning board and rebooted, the static IP was gone but i could see in my ARP list that board was now showing. I started up the ETH0 script again and gave it the same IP, I have also assigned this IP in the router using address reservation. Still I cannot connect to the board via SSH.

       

      After working on Raspberry Pis for months and then coming back to do some work on the Galileos I remember now why I switched to Pi lol. I am still wanting to try get this resolved purely to see what the issue and why it is happening and then may consider continuing projects on the Galileo or just writing them off totally. Any help would be appreciated in getting to the bottom of this, I am hoping to get Debian installed on it which will give me more incentive to work on the board, main reason because it is annoying me lol. Cheers in advance.

        • 1. Re: Connection issues
          Intel_Peter

          Hello AdamMiltonBarker,

           

          Are you connencting through Wi-Fi? If so, try to set  with this sketch:

           

          #include <WiFi.h>
          
          char ssid[] = "YOUR_SSID";    //  your network SSID (name)
          char pass[] = "YOUR_PASSWORD";  // your network password
          IPAddress staticip(192, 168, 10, 125);
          int status = WL_IDLE_STATUS;    // the Wifi radio's status
          
          void setup() {
            //Initialize serial and wait for port to open:
            Serial.begin(9600);
            while (!Serial) {
              ; // wait for serial port to connect. Needed for Leonardo only
            }
          
            // check for the presence of the shield:
            if (WiFi.status() == WL_NO_SHIELD) {
              Serial.println("WiFi shield not present");
              // don't continue:
              while(true);
            } 
          // attempt to connect to Wifi network:
            while ( status != WL_CONNECTED) {
              Serial.print("Attempting to connect to WPA SSID: ");
              Serial.println(ssid);
              // Connect to WPA/WPA2 network:   
              status = WiFi.begin(ssid, pass);
          
              // wait 10 seconds for connection:
              delay(10000);
            }
          
            // you're connected now, so print out the data:
            Serial.print("You're connected to the network");
            WiFi.config(staticip);/////////////////////////////////////////////////////////////
            printCurrentNet();
            printWifiData();
          }
          
          void loop() {
            // check the network connection once every 10 seconds:
            delay(10000);
            printCurrentNet();
          }
          
          void printWifiData() {
            // print your WiFi shield's IP address:
            IPAddress ip = WiFi.localIP();
              Serial.print("IP Address: ");
            Serial.println(ip);
            Serial.println(ip);
          
            // print your MAC address:
            byte mac[6]; 
            WiFi.macAddress(mac);
            Serial.print("MAC address: ");
            Serial.print(mac[5],HEX);
            Serial.print(":");
            Serial.print(mac[4],HEX);
            Serial.print(":");
            Serial.print(mac[3],HEX);
            Serial.print(":");
            Serial.print(mac[2],HEX);
            Serial.print(":");
            Serial.print(mac[1],HEX);
            Serial.print(":");
            Serial.println(mac[0],HEX);
          }
          
          void printCurrentNet() {
            // print the SSID of the network you're attached to:
            Serial.print("SSID: ");
            Serial.println(WiFi.SSID());
          
            // print the MAC address of the router you're attached to:
            byte bssid[6];
            WiFi.BSSID(bssid);   
            Serial.print("BSSID: ");
            Serial.print(bssid[5],HEX);
            Serial.print(":");
            Serial.print(bssid[4],HEX);
            Serial.print(":");
            Serial.print(bssid[3],HEX);
            Serial.print(":");
            Serial.print(bssid[2],HEX);
            Serial.print(":");
            Serial.print(bssid[1],HEX);
            Serial.print(":");
            Serial.println(bssid[0],HEX);
          
            // print the received signal strength:
            long rssi = WiFi.RSSI();
            Serial.print("signal strength (RSSI):");
            Serial.println(rssi);
          
            // print the encryption type:
            byte encryption = WiFi.encryptionType();
            Serial.print("Encryption Type:");
            Serial.println(encryption,HEX);
            Serial.println();
          }
          

           

          You can also try with this other sketch found on Intel® Edison Boards — Setting Up a Static IP Address with Arduino* Sketch. Let us know if it helps.

           

          Peter.

          • 2. Re: Connection issues
            AdamMiltonBarker

            Hi thanks for the reply no I am connecting via ethernet.

            • 3. Re: Connection issues
              Intel_Peter

              I see, are you using an SD card image? Or are you using the embedded image? Either way, you should first try to update the board's firmware with the On-board Flash Firmware Updater, which you will find alongside a guide on how to use it in IoT - Intel® Galileo Board Download | Intel® Developer Zone.

               

              Then you can try the following sketch to reset your board’s Ethernet interface:

               

              void setup()
              {
                  Serial.begin(9600);
                  system("ifdown eth0");
                  delay(1000);
                  system("ifup eth0");
                  delay(1000);
              }
              void loop()
              {
                  system("ifconfig eth0 > /dev/ttyGS0");
                  delay(1000);
              }
              

              You should see your IP address in the serial monitor, you can then use it to connect through SSH. Let us know if it works.

               

              Peter.

              • 4. Re: Connection issues
                AdamMiltonBarker

                Hi thanks. If have already done the the firmware update, this time when running the script you gave the ip comes up in  my DHCP clients list but I am still unable to connect through SSH it says connection refused. At the moment just standard image on the board, I was attempting to get Debian on. After reboot still the same, connection refused and cannot ping. The com shows up fine as Galileo in device manager, I have installed all drivers and done firmware update a few times now, drivers are up to date, firmware is up to date as well.

                 

                With the sketch looping I can ping, but SSH still connection refused.

                • 5. Re: Connection issues
                  Intel_Peter

                  Is your PC connected to the same network as the Galileo? What's your PC's IP address and what's the Galileo's IP? Is it shown correctly on the serial monitor?

                   

                  Peter.

                  • 6. Re: Connection issues
                    AdamMiltonBarker

                    Yes I have 2 Galileos and 2 Raspberry Pis all on the same network same IP range, same mask, same gateway etc, yes the ip is shown correctly.

                    • 7. Re: Connection issues
                      AdamMiltonBarker

                      Actually broadcast is incorrect on the serial monitor, it is showing 0.0.0.0,

                      • 8. Re: Connection issues
                        Intel_Peter

                        Did you try using Telnet? Does it make a difference?

                         

                        Peter.

                        • 9. Re: Connection issues
                          AdamMiltonBarker

                          Hi Peter, no the device is not showing up on the network have tried angry ip as well and still no joy, not sure what is going on.

                          • 10. Re: Connection issues
                            Intel_Peter

                            That's  weird, let me do some research, I'll try to get back to you as soon as possible.

                             

                            Peter.

                            • 11. Re: Connection issues
                              Intel_Peter

                              Hi AdamMiltonBarker,

                               

                              Which version of the Arduino IDE are you using?

                               

                              Peter.

                              • 12. Re: Connection issues
                                AdamMiltonBarker

                                Hi Peter,

                                 

                                I never use the Arduino IDE anymore I just program directly on the board I only used the Arduino script above to see if using the ethernet connect script would allow me to connect via shell again, the version I used for the above script was 1.6.4, also to just refresh I have upgraded the firmware, the board is seen by my computer, but it does not come up on network, unless using the script above but even then cannot connect via shell.

                                • 13. Re: Connection issues
                                  Intel_Peter

                                  Are you using the uclibc image? If so, then try with the eglibc image, you can get it on: IoT - Intel® Galileo Board Download | Intel® Developer Zone

                                   

                                  Follow the instructions for preparing your microSD card for Windows*, OS X* and Linux* from IoT - Intel® Galileo Board Download | Intel® Developer Zone

                                   

                                  Connect your Galileo to your local network via Ethernet. Also a serial connection is needed to run the configuration steps.

                                   

                                  Start connman:

                                  root@galileo:~# systemctl start connman
                                  

                                   

                                  Enable connman:

                                  root@galileo:~# systemctl enable connman
                                  

                                   

                                  Check service status to ensure is active:

                                  root@galileo:~# systemctl status connman
                                  

                                   

                                  Get the service information:

                                  root@galileo:~# connmanctl services

                                  *AR Wired ethernet_XXXXXXXXXXXX_cable
                                  

                                   

                                  Gather the gateway information using the netstat command:

                                  root@galileo:~# netstat –nr
                                  

                                   

                                  Gather the netmask information from the enp0s20f6 device using the ifconfig command:

                                  root@galileo:~# ifconfig
                                  

                                   

                                  Now proceed to configure and set the static IP address using the service, gateway and netmask gathered:

                                  root@galileo:~# connmanctl config ethernet_XXXXXXXXXXXX_cable --ipv4 manual <ip address> <netmask> <gateway>
                                  

                                   

                                  You should be able to SSH the Galileo board using the IP address previously set. Try these steps and let us know what happens.

                                   

                                  Peter

                                  • 14. Re: Connection issues
                                    AdamMiltonBarker

                                    Hi thanks, do you have suggestions for debian on this board please, this is my ultimate goal, also how come the need for serial cable, the projects I am building are to be standalone units that will eventually be powered by battery packs and connected to via wifi, is this not possible with Intel Galileo? If so there is no point me building on one as all of my devices need to have the above functionality.

                                    1 2 Previous Next