Solved - File fun = FileSystem.open from SD Card hangs with ext. power supply-

Hi guys,

I have a very strange behavior on my yun. In the setup, I read a file from SD card. If the yun is connected with my mac
everything works fine. Is the yun connected with external power supply(USB), it is not possible to come over the statement
File functionFile = FileSystem.open("/mnt/sd/arduino/function.txt", FILE_READ); with other words FileSystem.open hangs.
I am switching the LED 13 to off to indicate when the open is finished. But nothing happens.

#include <Process.h>
#include <Bridge.h>
#include <YunServer.h>
#include <YunClient.h>
#include <SoftwareSerial.h>
#include <FileIO.h>

//Pins for relais
#define doorOpenerPin 5             //Pin for Door opener  
#define doorBuzzerPin 7             //Pin for door buzzer

// RFID Reader Settings
#define sOutPin 8
#define enablePin 2
#define txPin 9                     //useless only for SoftwareSerial

#define buzzerTime 8                //8s time buzzer
#define openerTime 4                //4s time for opener
#define udpTime 2                   //2s do udp broadcast  
#define getTempTime 60 		    //60s get actTemp 							 
#define tempPin  0                  //analogRead Pin 0   



boolean mustSwitchDoorBuzzerOff = false;
boolean mustSwitchDoorOpenerOff = false;

//Amount of rfid keys
int  keyCount = 0;

float actTemp; 

// Status
char stat_off[8] = "@off";
char stat_on[8] = "@on";
char stat_t[8] = "@";

SoftwareSerial rfid = SoftwareSerial(sOutPin, txPin);

YunServer server;
String sText = "python /$HOME/send_udp.py";      //Python call string

char**  rfidKeys;                                 //Keys auf der SD Card two dimensional array

void setup()
{

  //delay(80000);
  // Bridge startup
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  Bridge.begin();
  digitalWrite(13, HIGH);  

  Serial.begin(9600);   // Initialize the Serial
  // Wait until a Serial Monitor is connected.
  while (!Serial);

  // Listen for incoming connection
  server.listenOnLocalhost();
  server.begin();

  pinMode(sOutPin, INPUT);                 	// Set SOUT from RFID pin
  pinMode(enablePin, OUTPUT);              	// Set enablePin as OUTPUT to connect it to the RFID /ENABLE pin

  digitalWrite(enablePin, LOW);            	// Activate the RFID reader

  pinMode(doorBuzzerPin, OUTPUT);              //door buzzer
  pinMode(doorOpenerPin, OUTPUT);              //door opener
  Serial.println("vor readFunctions");
  readFunctions();
  /*
  Serial.println("vor readkey");
  boolean b = readkey();
  rfid.begin(2400);
  Serial.println("nach rfid.beginn");
  */
}

void loop()
{
}

Any suggestions?

Thanks for your help
Andreas

pl3g921:

  // Wait until a Serial Monitor is connected.

while (!Serial);

This will wait forever when you use a power supply.