1 2 Previous Next 28 Replies Latest reply on Dec 8, 2015 1:00 PM by jp49miller

    Why won't Galileo2 retain sketch when USB cable removed?

    jp49miller

      When I first got Galileo2 I could enter a sketch and remove the USB cable and as long as the power still connected it would continue to run.  I could connect Ethernet and talk to Yocto Linux.

      I then tried to install SD card.  It would retain sketch if power removed and reconnected.  But I could not get Ethernet to work despite trying half a dozen methods on internet.  I also updated firmware despite indication I had the latest.  Finally I removed SD card.  Now board will not retain sketch when USB removed even when power still on.  Sketch simply stops running.  Yes, even simple blink.

       

      Any Ideas what I'm doing wrong? 

        • 1. Re: Why won't Galileo2 retain sketch when USB cable removed?
          CMata_Intel

          Hi jp49miller,

           

          In order to upload a sketch into the board and retain it after power off you need to use an SD. Which image are you using on your board? You can run uname -a  in the Serial Terminal for this.

          Are you using 2.0 USB ports or 3.0?

           

          Regards,

          Charlie

          • 2. Re: Why won't Galileo2 retain sketch when USB cable removed?
            jp49miller

            Thanks, Charlie,

             

            I did not make my question sufficiently clear.  I know that Galileo 2 without SD will not retain sketch with power off.

             

            I leave the power plugged in and remove the USB cable and the sketch should continue or it did before I tried putting SD card in.

             

            I'm using a 9V wall wart for now but will use a battery later.

             

            I installed the latest build available on the Intel site a couple weeks ago.

             

            I just tried and I can no longer connect with Ethernet using the following two commands in a sketch.

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

              system("sud ifconfig eth0 169.254.1.103 netmask 255.255.0.0 up");

            This worked quite well before with a direct Ethernet cable and putty in telnet.

            It did not work with the SD card.

            I have no 3.3 volt serial cable.  So at the moment I can't get to Linux to get uname -a.

             

            Since putting in SD card then removing it again I have not been able to remove the USB cable with the power on without killing the sketch.

             

            I have USB 2.0 ports.

             

            So your answer is the correct answer for another question.  Not mine.

            • 3. Re: Why won't Galileo2 retain sketch when USB cable removed?
              FGT

              Hi,

               

              I'm using:

              • Galileo Gen 1
              • Windows
              • IDE 1.6.0, and I've seen some reports about newer IDEs having trouble, so I did not install any newer one/s
              • A similar configuration you describe: sketch on SD, which set the Ethernet and starts the telnetd server
              • A direct Ethernet cable connecting the Galileo to the PC (laptop, more specifically)
              • putty for telnet to the Galileo card

              Details different and/or with which I've had trouble:

              • I've not used sud, just the "plain" commands, i.e.
                • system("ifconfig eth0 <IP_NUMBER> netmask 255.255.0.0 up");  // IP_NUMBER should be in the same IP "segment" of your PC
                • system("telnetd -l /bin/sh");

                       I don't know about sud, but the sketch is run as root anyway... (if "sud" has any relationship to sudo or something similar)

              • I've had to boot the Galileo with the Ethernet cable connected to the PC, otherwise the Eth0 interface is not "up and running" (I do not recall which side, but I've had problems when the cable was not connected at Galileo start up)
              • Sometimes, depending on the Ethernet configuration on Windows, the IP number assigned to the Windows interface is not always the same... so check with something like ipconfig in a windows command line the IP number of your Ethernet in the PC. Take into account that the IP you should communicate with is not the wi-fi one (I've used to forget this when using my laptop...) but the Ethernet one, sometimes referred to as LAN or "Ethernet Ethernet" or something like that. If necessary, set the TCP/IP v4 "properties" in windows to use a fixed IP, so that you do not have to check for changes.
              • I'm usually anxious... and when I try to start putty before the Galileo ended its boot from the SD, the telnet fails... take into account that when not using the SD, the sketch starts almost immediately after it is loaded from the IDE, and it is not the case (of immediate running) when  the Galileo boots from SD, it takes about 1 minute (maybe less). I use to check the green light near the SD to stop blinking... and wait for a few more seconds...

               

              HTH,

               

              Fernando.

              • 4. Re: Why won't Galileo2 retain sketch when USB cable removed?
                CMata_Intel

                Hi jp49miller,

                 

                The problem with telnet is because the SD image do not have Inetutils, for this you can build a custom image or you can install the packages from source but for this you will need access to the Terminal Console.

                You can get the value of uname –a by adding into your Arduino sketch system("uname -a >> /dev/ttyGS0");

                Considering what Fernando said, have you tried with another Arduino IDE version? Which Arduino IDE version are you using right now?

                 

                Regards,

                Charlie

                1 of 1 people found this helpful
                • 5. Re: Why won't Galileo2 retain sketch when USB cable removed?
                  FGT

                  Justo two more comments:

                  a) I suggest you solve the issues separately: 1st Ethernet without SD, later using SD

                  b) Take into account that there are some different SD images.. at least I know two:

                  1) Making a bootable micro SD Card with Windows* | Intel® Developer Zone: "a micro SD card that contains the latest Intel® IoT Developer Kit version of the Yocto* built, Linux image." aka "the developer kit version of Linux", with instructions in the same link

                  2) Intel® Galileo Boards and Kits — SD Card Setup and Sketch Persistent: What I would call "a plain SD Card for (Arduino) Sketch Persistency", which has a different configuration software (while being a yocto Linux too), including being able to use telnet.

                   

                  HTH,

                   

                  Fernando.

                  1 of 1 people found this helpful
                  • 6. Re: Why won't Galileo2 retain sketch when USB cable removed?
                    jp49miller

                    Thanks for the answer, Fernando,

                    I am using Arduino 1.6.5. I will try going back to 1.6.0 if other steps don't help.

                    I found the "sud" on an internet site and the comments were something to the effect where you come in might not have admin privileges. But now that I think about it, it was in context of connecting to the SD card version. So, I'll try without it.

                     

                    Success: 

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

                    system("ifconfig eth0 192.168.1.103 netmask 255.255.255.0 up");

                    Gave me on Putty console:

                    Poky 9.0.2 (Yocto Project 1.4 Reference Distro) 1.4.2 clanton

                     

                    It worked when I plugged ethernet in after the board was powered up. I had changed address several times. My computer (desktop running Win10 has 192.168.1.104 on ethernet port). I went back to first settings I could find. 

                    I am breathing a sigh of relief. Card is working as before except for sketch dying and linux dying when I unplug the usb cable even with the power on. That is original question which is not yet answered.  

                    I used the image at the Intel developer zone which may be part of why I was unable to connect via telnet. I had no idea. I may try the other while I await cable.  My reasoning is that I need some kind of development environment.   I'm open to suggestions.  It seemed Intel was recommending this.  But I guess I expected the more extensive Linux would not drop features.  I'll try the other distribution.

                     

                    Again thanks

                    • 7. Re: Why won't Galileo2 retain sketch when USB cable removed?
                      jp49miller

                      Charlie

                       

                      I replied to you but don't see it.  Thank you. Sorry if I duplicated answer.

                       

                      I ran the sketch with system("uname -a >> /dev/ttyGS0");  per your suggestion and got:   Linux clanton 3.8.7-yocto-standard #1 Fri Oct 10 16:20:19 PDT 2014 i586 GNU/Linux

                       

                      Then I attempted to create the second SD card in Fernando's suggestion.  It seems right when I look at card with windows but it doesn't seem to boot properly.

                      I come up with the same version when I run uname -a from the Linux command line.  It will not retain the sketch.

                      • 8. Re: Why won't Galileo2 retain sketch when USB cable removed?
                        jp49miller

                        Charlie and/or Fernando,

                         

                        Further observation.  If I put in the SD card, power module, insert USB cable, upload blink sketch, remove USB cable the sketch immediately stops.  Remove power.  Apply power.  It does not appear to boot.  Wait several minutes. Does not appear to boot.  Insert USB cable.  it appears immediately to start booting.  About a minute later the sketch starts.  Remove USB cable.  Sketch immediately stops.  Press reboot.  Does not appear to boot.  Wait minutes. No boot.  Plug in USB cable.  Quickly starts to boot.  About a minute later sketch starts.

                         

                        It seems without USB cable plugged in board will not boot.  But it appears sketch is going into SD card.

                         

                        If I run telnet sketch I get

                        Poky 9.0.2 (Yocto Project 1.4 Reference Distro) 1.4.2 clanton  Which appears to be the original board Linux not the larger distribution.

                        This is what is on SD card which I got from the second link in Fernando's mail:

                        Capture.JPG

                        Your help is appreciated.

                         

                        JP

                        • 9. Re: Why won't Galileo2 retain sketch when USB cable removed?
                          FGT

                          jp49miller wrote:

                           

                          Thanks for the answer, Fernando,

                          I am using Arduino 1.6.5. I will try going back to 1.6.0 if other steps don't help.

                          I found the "sud" on an internet site and the comments were something to the effect where you come in might not have admin privileges. But now that I think about it, it was in context of connecting to the SD card version. So, I'll try without it.

                           

                          Success:

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

                          system("ifconfig eth0 192.168.1.103 netmask 255.255.255.0 up");

                          Gave me on Putty console:

                          Poky 9.0.2 (Yocto Project 1.4 Reference Distro) 1.4.2 clanton

                           

                          It worked when I plugged ethernet in after the board was powered up. I had changed address several times. My computer (desktop running Win10 has 192.168.1.104 on ethernet port). I went back to first settings I could find. 

                          I am breathing a sigh of relief.

                          Great.

                           

                          Card is working as before except for sketch dying and linux dying when I unplug the usb cable even with the power on. That is original question which is not yet answered.

                          I used the image at the Intel developer zone which may be part of why I was unable to connect via telnet. I had no idea. I may try the other while I await cable.

                           

                          Hmmm... sounds strange to me (and interesting, too)... I'll make this "experiment" in my own Galileo, just to see what happens...

                           

                          I know that different Linux(es) work different about handling sketches and telnet in particular, but I would not expect this difference in particular, let me confirm: after booting and connecting to telnet using the Galileo IP address set by the sketch you only unplug the USB cable and you are not longer able to connect as before, right?

                           

                          Just as a side note, more or less related: I think that what Intel calls "Intel® IoT Developer Kit version of the Yocto" is not intended to be used with Arduino sketches and Arduino IDE, and this may be at the "root" of the problems.

                           

                          I do not understand the relationship or why you mantioned " I may try the other while I await cable."... what cable? why would be any cable related to this issue?

                           

                          My reasoning is that I need some kind of development environment.   I'm open to suggestions.  It seemed Intel was recommending this.  But I guess I expected the more extensive Linux would not drop features.  I'll try the other distribution.

                           

                          Well... I don't know the exact definition for a development environment, but as I wrote above, I think that what Intel calls "Intel® IoT Developer Kit version of the Yocto" is not intended to be used with Arduino sketches and Arduino IDE (sorry about the copy-paste, but I want to avoid confusion as much as possible...), but it is intended to be used at least with Intel XDK. That said,

                          a) if you want to develop using sketches, use the Arduino IDE and the Linux "specifically made for" (carefully, this is what I think, I've not seen this in any document/site) making persistent Arduino sketches.

                          b) if you want to develop using XDK IDE, then use the so called "Intel® IoT Developer Kit version of the Yocto". And you'll be in an entirely different "world": no sketches, no telnet, etc. I think it is not necessarily (more) restricted by not having sketches-telnet-... it's just another environment, where you don't need all the Arduino-related stuff.

                           

                          Fernando.

                          • 10. Re: Why won't Galileo2 retain sketch when USB cable removed?
                            FGT

                            The following sequence seems very strange to me, please confirm (without USB cable connected):

                            Remove power.  Apply power.  It does not appear to boot.  Wait several minutes. Does not appear to boot.  Insert USB cable.  it appears immediately to start booting.

                             

                            If "Does not appear to boot" mean "no light is on" then the power is not providing power... Galileo is getting power from the USB cable (which is strongly warned against in Intel documentation), which seems confirmed by "It seems without USB cable plugged in board will not boot."

                             

                            The description

                            If I run telnet sketch I get

                            Poky 9.0.2 (Yocto Project 1.4 Reference Distro) 1.4.2 clanton  Which appears to be the original board Linux not the larger distribution.

                            This is what is on SD card which I got from the second link in Fernando's mail:

                            Capture.JPG

                            is fine, at least it is what I have for development with sketch(es).

                             

                            Fernando.

                            • 11. Re: Why won't Galileo2 retain sketch when USB cable removed?
                              FGT

                              Just to confirm what I have: I boot the Galileo as shown in the picture:

                               

                               

                              i.e. only power + SD + Ethernet (no USB in particular). The sketch starting telnet has been previously loaded with Linux in the SD card. After about 1min. (I use to check when the green light nearer the SD card stops blinking) Telnet is working (my laptop IP is 169.254.72.151):

                               

                               

                              just a difference with your setting, my Linux image is from Oct 16... I don't know if that's relevant.

                               

                              Fernando.

                              • 12. Re: Why won't Galileo2 retain sketch when USB cable removed?
                                FGT

                                I recalled now that for the SD to work you have to copy those files (preferably uncompressing to) a blank SD. I once copied those files to an SD with some extra files and it didn't work, even after deleting the extra files. I suggest you format the SD and later uncompress the image setting as destination the SD card.

                                 

                                HTH,

                                 

                                Fernando.

                                • 13. Re: Why won't Galileo2 retain sketch when USB cable removed?
                                  jp49miller

                                  Fernando,

                                   

                                  I reformat the SD card with SD formatter V4.0 .

                                  I have tried several times to unzip to the card both with WinZip and 7Zip and I always get a folder with the files below it.  

                                  The only way I have found is to unzip to a location on C: drive and copy the files to the SD card.

                                   

                                  Perhaps this in some way is the source of my problem.

                                  • 14. Re: Why won't Galileo2 retain sketch when USB cable removed?
                                    FGT

                                    jp49miller wrote:

                                     

                                    Fernando,

                                     

                                    I reformat the SD card with SD formatter V4.0 .

                                    I have tried several times to unzip to the card both with WinZip and 7Zip and I always get a folder with the files below it.

                                    The only way I have found is to unzip to a location on C: drive and copy the files to the SD card.

                                     

                                    Perhaps this in some way is the source of my problem.

                                     

                                    The last time I did ... maybe I followed the sequence:

                                    a) Unzip to a folder in the hard disk

                                    b) Copy the contents of the folder (not the folder) in the SD, i.e.

                                    boot

                                    bzimage

                                    ...

                                     

                                    so they appear as in the picture you sent in a post above.

                                     

                                    I'll try in a new SD and post the results, so it is left as "documentation"

                                     

                                    HTH,

                                     

                                    Fernando.

                                    1 2 Previous Next