My Arduino hangs on Bridge.begin()

I’m using an Arduino Uno with a Dragino Yun Shield and I’m trying to do as basic of a sketch as I can to test out networking stuff, but I can’t get it to get past Bridge.begin(); When I try to connect to it with the serial monitor or telnet, it says “Connection closed by foreign host”

Here’s the example code I’m using:

#include <Console.h> //use Console class for Arduino IDE debug over WiFi, similar to Serial class,
String name;
 
void setup() {
  // Initialize Console and wait for port to open:
  Bridge.begin();
  Console.begin();
 
  // Wait for Console port to connect
  while (!Console);
 
  Console.println("Hi, what's your name?"); //Data flow: Arduino --> Yun Shield --> Arduino IDE
}
 
void loop() {
  if (Console.available() > 0) {
    char c = Console.read(); //read the next char received, data flow: IDE --> Yun Shield--> Arduino
    // look for the newline character, this is the last character in the string
    if (c == '\n') {
      //print text with the name received
      Console.print("Hi ");
      Console.print(name);
      Console.println("! Nice to meet you!");
      Console.println();
      // Ask again for name and clear the old name
      Console.println("Hi, what's your name?");
      name = "";  // clear the name string
    }
    else {  	 // if the buffer is empty Cosole.read() returns -1
      name += c; // append the read char from Console to the name string
    }
  }
}

I’ve even tried something more simple to see that it’s Bridge.begin that’s causing it to hang:

#include <Console.h>
int led = 13;
 
void setup() {
  // Initialize Console and wait for port to open:
  Bridge.begin();
  pinMode(led, OUTPUT);
  digitalWrite(led, HIGH);
}
 
void loop() {

}

With that code it doesn’t turn on the led.

I’ve tried everything I could think, such as adding delays at the beginning to give it time to boot up, changing the my Arduino IDE or Bridge library versions to all that I could find, and nothing helps at all. Does anyone have any ideas?

I’m using Arduino IDE 1.6.4, the Bridge Library 1.0.5, my Yun Shield is on firmware version Dragino-v2 common-2.0.4, and I’m using Windows 8.1 if that matters.

Thanks.

krej:
I’ve tried everything I could think, such as adding delays at the beginning to give it time to boot up, changing the my Arduino IDE or Bridge library versions to all that I could find, and nothing helps at all. Does anyone have any ideas?

I use a 60 seconds delay before Bridge.begin();

Upload the code with the delay, then restart Dragino and Arduino, so it can boot properly.

Did you follow the installation instructions where Dragino says to short a couple pins on the Uno board? If you don't do this, pins 0 and 1 will be connected to both the Yun shield and the USB interface at the same time, and neither of them will work properly.

PS: thank you for including all of the version information in your well written post. It's very helpful to have a complete picture.

Shapeshifter - thanks for taking time like you do to solve peoples problems. Your suggestion to bridge the two pins has solved a nagging problem of mine. I guess I just ignored the initial warning to do that when I received the YUN Shield because I've seen so many times how literature was out of date while hardware and software had resolved the problems anyway.

So I no longer get the "Closed by foreign...." but something odd is happening and I'll post it here in a minute so as not to confuse this post...