Problem with gmail lamp example

Hi all, :slight_smile:
i bought the Yun a couple of week ago and i try to use the gmail lamp sketch found hear :

I can compile and send it to the board without problems, but when the sketch is uploaded, in the Port menu i can't find the COM port , just the IP address of the Yun, so i can't see the debug message. :frowning:

I write a simple sketch to verify if there is a problem with the serial communication, but it works fine and both the COM port and the IP address can be selected in the Port menu , of course the sketch will work only with the COM port 8)

Here is the test code :

int led = 9;

void setup() {
  // put your setup code here, to run once:
pinMode(led,OUTPUT);
Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly: 
  if (Serial.available()){
    char c = (char)Serial.read();
    if( c == '1'){
    digitalWrite(led,HIGH);
    Serial.println("Acceso");
    }
    else if (c == '2'){
    digitalWrite(led,LOW);
    Serial.println("spento");}
  }
}

At the same time, i try to pass the label name via webservices with this url "arduino.local/data/put/label/label" , but i received this error : " nil socket, 146 Connection refused" .

Can anyone help me with these problems? where i'm wrong?

Thanks for you attention!

Greetings,
Fatutta Gabriele

News:
Searching in the forum i found the same code without the part of the FileIO :
http://forum.arduino.cc//index.php?topic=188596.0
Copied ,compiled and uploaded it on the board, and all works fine, the COM port is always available in the Port menu and the led turn on when I receive a mail in a particular label and off when i read it! :smiley:

I don't know why without the FileIO i haven't any problem, so i'm trying to understand this part of the code!

See you!
Fatutta Gabriele

Sorry! I found the problem and solved it

The problem is that the current sketch doesn't create the /root/gmail_settings file, and if it doesn't find it, the whole system crashes (!!!)

so, before uploading the sketch, you have to open an SSH connection to the yun

$ssh root@arduino.local

and, once you are in, manually create an empty "gmail_settings" file

$touch /root/gmail_settings

And it will magically work! ...I HOPE :slight_smile:

I ran into this same issue with a project that I'm working on. Its based on the gmail lamp example. Applied the my code and the com port would crash and I couldn't connect to the arduino side via serial. I have the setting file in /root but my arduino still isn't finding the file. I do have an SD card inserted and am going to move the settings file to my arduino directory on the SD card. Just curious if we actually lose access to the rest of the file system if we have an SD card inserted ?