Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
1,291 Views

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

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?

28 Replies
Highlighted
Employee
45 Views

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

0 Kudos
Highlighted
Novice
45 Views

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.

0 Kudos
Highlighted
Honored Contributor I
45 Views

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 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.

0 Kudos
Highlighted
Employee
45 Views

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

0 Kudos
Highlighted
Honored Contributor I
45 Views

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) https://software.intel.com/en-us/programming-blank-sd-card-with-yocto-linux-image-windows 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) http://www.intel.com/support/galileo/sb/CS-035033.htm 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.

0 Kudos
Highlighted
Novice
45 Views

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

0 Kudos
Highlighted
Novice
45 Views

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.

0 Kudos
Highlighted
Novice
45 Views

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:

Your help is appreciated.

JP

0 Kudos
Highlighted
Honored Contributor I
45 Views

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.

0 Kudos
Highlighted
Honored Contributor I
45 Views

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:

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

Fernando.

0 Kudos
Highlighted
Honored Contributor I
45 Views

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.

0 Kudos
Highlighted
Honored Contributor I
45 Views

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.

0 Kudos
Highlighted
Novice
45 Views

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.

0 Kudos
Highlighted
Honored Contributor I
45 Views

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.

0 Kudos
Highlighted
Honored Contributor I
45 Views

The complete sequence:

1) Download the so-called

"Intel® Galileo Board and Gen 2 Linux Operating System Image

Image enables the Wi-Fi drivers and sketch persistent."

which is the file

SDCard.1.0.4.tar.bz2

from http://www.intel.com/support/galileo/sb/CS-035101.htm Intel® Galileo Boards — Software Downloads

2) Format SD (FAT32 format)

3) when uncompressing the .bz2 with 7z I first obtained

SDCard.1.0.4.tar

and using 7z on that file, I obtained a folder

image-full-galileo

with contents

boot

bzImage

core-image-minimal-initramfs-clanton.cpio.gz

grub.efi

image-full-galileo-clanton.ext3

i.e. those shown in the picture you sent before.

4) Copy the contents (not the folder/s in which those contents are) to the formatted SD card

5) Boot Galileo, only the Ethernet cable is plugged in

6) Plug the USB cable

7) Starts Arduino IDE, and load the following sketch to the Galileo card:

/*

Sketch running on Intel Galileo

Starts Ethernet-TCP/IP with a specific IP

Starts telnetd so that it's possible to use PuTTY telnet client

Blinks the LED (pin 13) so that it's clear when the card completed the boot process

Fernando G. Tinetti

Dec. 4th, 2015

*/

/***************************************************************/

void setup()

{

// Start Ethertnet-TCP/IP subsistem

system("ifconfig eth0 169.254.72.152 netmask 255.255.0.0 up");

// Start telnet server

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

// initialize digital pin 13 as an output.

pinMode(13, OUTPUT);

}

void loop()

{

digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)

delay(1000); // wait for a second

digitalWrite(13, LOW); // turn the LED off by making the voltage LOW

delay(1000); // wait for a second

}

8) LED is blinking and PuTTY telnet works

9) Unplug the USB cable, LED is blinking and PuTTY telnet works

10) Power off

11) Boot Galileo, only the Ethernet cable is plugged in

12) LED starts blinking

13) PuTTY telnet works

and that's it, I think.

Please follow the same sequence and tell me if something fails.

HTH,

Fernando.

0 Kudos
Highlighted
Novice
45 Views

Thanks Fernando. To answer your questions:

I think the sequence is exactly correct. The power plug from the wall wart is connected before the USB is connected and then the USB is disconnected before removing the power connector.

I have several USB to serial cables all with RS232 voltages from +/-9 to +/-5 V. And I have an RS232 port on my computer. None of these are suitable for the Galileo2. I have ordered a USB to serial 3.3V TTL cable.

In your previous answer you mentioned two sources of SD card images. I had previously tried one. Now I have tried the other.

I wanted to develop programs - preferably on my PC rather than on the card for use on the card. I have developed a number of programs for other Arduino cards using Arduino environment including a simple one reading an I2C temperature sensor using this Galileo2.

 

read LM75B, an I2C temperature sensor

1345 temperature = 22.78 °C 73.00 °F 0 00:00:00

 

2362 temperature = 22.70 °C 72.86 °F 0 00:00:01

 

3363 temperature = 22.77 °C 72.97 °F 0 00:00:02

 

4362 temperature = 22.73 °C 72.92 °F 0 00:00:03

 

5363 temperature = 22.70 °C 72.86 °F 0 00:00:04

I thought about C or variations and/or Python eventually logging load currents in industrial battery installations. So I thought I would try the "Intel® IoT Developer Kit version of the Yocto" . I had not run across anything that indicated it was not intended to support the Arduino sketch. I think I am caught in a number of assumptions based on my previous experience with Arduino boards.

Behavior that I think is booting. I use waffle words because I have not yet had with high confidence experienced a successful boot to an SD card. I don't know what variation from this sequence might be OK and what might be indicative of failure:

  • On LED is "on"
  • USB LED comes "on" after a few seconds
  • SD LED flickers several times over about 30 seconds
  • L LED flickers a couple times very dimly
  • Eventually if Blink sketch was previously loaded the L LED blinks.

Behavior when it does not boot.

  • On LED is "on" or "on with periodic blink off"
  • USB LED is "on"
  • Others remain "off"

L"...et 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?" RIGHT. With no SD card.

With the SD card after a boot if I had previously loaded the telnet sketch I can get connection via Telnet but the Linux looks like the original non-SD sketch.

In all cases when I disconnect the USB cable the sketch stops and the Linux stops - no more com via Telnet.

I hope I covered all your questions.

JP

0 Kudos
Highlighted
Honored Contributor I
45 Views

Hi JP,

Cross posting again (look at the date/time posts...).

Please try the last sequence of steps I sent, and let me know.

I think you are right in that your card is not booting from SD.

Fernando

0 Kudos
Highlighted
Honored Contributor I
45 Views

Hi again,

Just a few comments on

I thought about C or variations and/or Python eventually logging load currents in industrial battery installations. So I thought I would try the "Intel® IoT Developer Kit version of the Yocto" . I had not run across anything that indicated it was not intended to support the Arduino sketch. I think I am caught in a number of assumptions based on my previous experience with Arduino boards.

I've not started to experiment "at large" with the "Intel® IoT Developer Kit version of the Yocto", but the few experiments I've seen indicate that no interaction with Arduino IDE/IDE development is supported, it seems to be "javascript only" development, aided by XDK.

I've been caught in a number of assumptions based on my previous experience with Arduino boards too. And in most cases I've had trouble to re-use working Arduino code (and working Arduino interfacing hardware). I'm using Galileo (not Galileo Gen 2) and maybe one that is a source of the problems I found, what I would call it as "compatibility"... but everything depends on too many details to explain, and many of those details are relatively unknown to me (I'm just guessing in too many cases...).

Fernando.

0 Kudos
Highlighted
Novice
45 Views

Fernando, Thanks for your attention to this matter,

Steps 1-8 OK I used a different IP address.

Step 9, LED stops blinking, Cannot talk to card through telnet.

Step 10, OK.

Step 11, ON led is on but blinks off briefly at about 1.5 sec intervals.

When ON LED blinks off L LED blinks on very faintly.

After minutes still doing this.

Step 12, NO

Step 13, NO

Let me add a step:

Step 14, Plug in USB cable - no upload of sketch. Just connect USB.

  • USB LED comes on about 2 seconds later.
  • ON LED comes on continuously
  • SD LED flickers
  • L LED blinks after about a minute
  • Telnet works.

 

Poky 9.0.2 (Yocto Project 1.4 Reference Distro) 1.4.2 clanton

sh-4.2#

sh-4.2# uname -a

Linux clanton 3.8.7-yocto-standard # 1 Thu Oct 16 16:06:45 PDT 2014 i586 GNU/Linux

sh-4.2#

Is this the correct display for the SD card Linux?

JP

0 Kudos