Go Down

Topic: Sketch freezes on Bridge.begin() with Arduino Yun (Read 1 time) previous topic - next topic

alanschaeffer

Hi,

I have the Arduino 1.5.7 with a Yun and trying to send an HTTP request. I can't get past the Bridge.begin(), the led remains HIGH indefinitely.

Source from: http://arduino.cc/en/Tutorial/HttpClient
Code: [Select]

#include <Bridge.h>
#include <HttpClient.h>

void setup()
{
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);
Bridge.begin();
digitalWrite(13, LOW);
Serial.begin(9600);
while(!Serial);
}

void loop() {
  HttpClient client;
  client.get("http://arduino.cc/asciilogo.txt");

  while (client.available()) {
    char c = client.read();
    Serial.print(c);
  }
  Serial.flush();

  delay(5000);
}


Thanks for your help! :)

alanschaeffer

It works now! :)
I pressed the Wifi reset button for 30 seconds, un-replugged the USB, and suddenly it works...

federicofissore

Code: [Select]

while(!Serial);

I bet 1 euro you were using the wifi port (with the IP address, not the serial COM or tty). while(!Serial); makes the sketch waiting for you to open the serial monitor. If you use wifi/network, you need to use Console instead of Serial

Go Up