6 Replies Latest reply on Apr 22, 2015 5:15 PM by LeonY

    galileo gen 2 connecting to wifi network

    leo1234

      hi guys

      1,i want my galileo to connect to wifi via a wireless card(i have N 6025 wireless card)

      2,when i power on board and connect galileo with my pc via a ftdi line. And open the putty, i type  lspci -k | grep -A 3 -i "network" but nothing happened. also, i can not use the command "connmanctl".

      ps:i use sd-card image in my sd card and my pc os is windows 7. should i use lot devkit image in my sd card?

      regards

      leo

        • 1. Re: galileo gen 2 connecting to wifi network
          Intel_Alvarado

          Hi,

           

          If you already have connected the wireless card to the Intel ® Galileo and have access to Linux use the command ifup wlan0 to enable the interface. Then type ifconfig to display the network interfaces to see if you have an IP address assigned. And what do you mean you can’t use connmanctl, are you getting any errors?

           

          Sergio

          • 2. Re: galileo gen 2 connecting to wifi network
            leo1234

            hi Alvarado

            there are some detail for you:( i followed this Linux Tutorial For Intel® Galileo Gen 2)

            clanton login: root

            root@clanton:~# ssh root@169.254.81.162

            ssh: connect to host 169.254.81.162 port 22: Network is unreachable

            root@clanton:~# ifconfig wlan0

            wlan0     Link encap:Ethernet  HWaddr 00:15:00:62:AE:9B

                      UP BROADCAST MULTICAST  MTU:1500  Metric:1

                      RX packets:0 errors:0 dropped:0 overruns:0 frame:0

                      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

                      collisions:0 txqueuelen:1000

                      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

             

             

            root@clanton:~# ifup wlan0

            udhcpc (v1.20.2) started

            Sending discover...

            Sending discover...

            Sending discover...

            No lease, failing

            root@clanton:~# connmanctl

            -sh: connmanctl: command not found

            root@clanton:~#

             

            and IoT - Connecting to a Wi-Fi Network | Intel® Developer Zone

             

            root@clanton:~# lspci -k | grep -A 3 -i "network"

            root@clanton:~#

             

            when i type this "lspci -k | grep -A 3 -i "network"" nothing happened.

             

            and then i do not know what should i do to connect wifi?

            • 3. Re: galileo gen 2 connecting to wifi network
              LeonY

              Hey Leo,

              Have a read of this Intel Galileo Meets Wireless - Malinov Family Web Presence

              Follow those intructions and you will get your WIFI working. It looks like you already have the drivers so just start at 1

              • 4. Re: galileo gen 2 connecting to wifi network
                leo1234

                hi leonY

                thank you. and now i have connected my board with wifi. but how can i control my board to light a led via web.  and  when i try thisIntel® Galileo Boards and Kits — SimpleWebServer Arduino Example, in the serial monitor, it alway show me ”connecting to a wifi“ repeatedly。

                regards

                leo

                • 5. Re: galileo gen 2 connecting to wifi network
                  Intel_Alvarado

                  Hi,

                   

                  Is your IDE updated to the latest firmware? In case it isn’t take a look at the “Intel® Galileo Firmware Updater Tool” from Intel® Galileo Boards and Kits — Software Downloads . Also make sure you are choosing the correct board and port on the IDE. Also for this example to work the Galileo and your computer have to be on the same network, what is your board’s and your computer’s IP address?

                   

                  Sergio

                  • 6. Re: galileo gen 2 connecting to wifi network
                    LeonY

                    Leo,

                    The example code that Intel provides with the IDE is wrong.

                    Im going to refer you to the original example:

                    arduino-library-files/SimpleWebServerWiFi.ino at master · codebendercc/arduino-library-files · GitHub

                    This is what the code SHOULD look like if you have ALL READY connected your wifi via linux:

                     

                    #include <SPI.h>
                    #include <Ethernet.h>
                    
                    
                    Ethernet server(80);
                    
                    
                    void setup()
                    {
                      Serial.begin(9600);      // initialize serial communication
                      pinMode(9, OUTPUT);      // set the LED pin mode
                      server.begin();                           // start the web server on port 80
                    }
                    
                    
                    
                    
                    void loop() {
                      Ethernet client = server.available();   // listen for incoming clients
                    
                    
                      if (client) {                             // if you get a client,
                        Serial.println("new client");           // print a message out the serial port
                        String currentLine = "";                // make a String to hold incoming data from the client
                        while (client.connected()) {            // loop while the client's connected
                          if (client.available()) {             // if there's bytes to read from the client,
                            char c = client.read();             // read a byte, then
                            Serial.write(c);                    // print it out the serial monitor
                            if (c == '\n') {                    // if the byte is a newline character
                    
                    
                              // if the current line is blank, you got two newline characters in a row.
                              // that's the end of the client HTTP request, so send a response:
                              if (currentLine.length() == 0) {  
                                // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
                                // and a content-type so the client knows what's coming, then a blank line:    
                                client.println("HTTP/1.1 200 OK");
                                client.println("Content-type:text/html");
                                client.println();
                    
                    
                                // the content of the HTTP response follows the header:
                                client.print("Click <a href=\"/H\">here</a> turn the LED on pin 9 on<br>");
                                client.print("Click <a href=\"/L\">here</a> turn the LED on pin 9 off<br>");
                    
                    
                                // The HTTP response ends with another blank line:
                                client.println();
                                // break out of the while loop:
                                break;         
                              } 
                              else {      // if you got a newline, then clear currentLine:
                                currentLine = "";
                              }
                            }     
                            else if (c != '\r') {    // if you got anything else but a carriage return character,
                              currentLine += c;      // add it to the end of the currentLine
                            }
                    
                    
                            // Check to see if the client request was "GET /H" or "GET /L":
                            if (currentLine.endsWith("GET /H")) {
                              digitalWrite(9, HIGH);               // GET /H turns the LED on
                            }
                            if (currentLine.endsWith("GET /L")) {
                              digitalWrite(9, LOW);                // GET /L turns the LED off
                            }
                          }
                        }
                        // close the connection:
                        client.stop();
                        Serial.println("client disonnected");
                      }
                    }
                    

                     

                    The above code is designed for Arduino compatible boards that are NOT pre connected to WIFI

                    There are a ton of Examples that Intel packages with the Arduino IDE that do not work out of the box, its really frustrating.

                     

                    Also depending on what Gen galileo you have and what image you are running, you may not be able to SERVE the page via port 80! so if the above fails change the port to 81 or something else.