Arduino hangs on Bridge.begin()

Hello all,

Recently bought my first Arduino Yún, and worked fine until now.
I want to implement some functions wich require bridge, but can't get them to work. (also standard examples do not work)
Now I made a very basic code (see belown) to look where it goes wrong, and found out it goes wrong when Bridge.bigin() is called.
After connection the serial monitor, text "Starting bridge" is displayed and leds goes on. But then nothing happens and the led stays on.

So something goes wrong in Bridge.begin();
Does somebody has a solution to solve this issue?

Thanks

Futher information:
I removed all connections shield and SD card, so only bare arduino Yun connected to laptop.
Via wifi I can logon to arduino web interface, also programming via wifi works.

#include <Bridge.h>

int LED = 13; // Red led

void setup() {
  Serial.begin(19200);
  pinMode(LED, OUTPUT);
  digitalWrite(LED,HIGH);
  delay(10000); 
  digitalWrite(LED,LOW);
  Serial.println("Starting bridge");
  delay(5000);
  digitalWrite(LED,HIGH);
  Bridge.begin();
  digitalWrite(LED,LOW);
  Serial.println("Bridge has started succesfully");
}

Hello,

I'm really stuck, can somebody give some suggestions?

I upgraded the linino image via webinterface, but still the same issue.

Also tried YunSerialTerminal, but it doesn't work. I don't see anything booting after I press the reset button.

Should I send the Yun back to the store?

Hi Pimmernl,

I'm having Bridge problems as well. I'm running Arduino 1.5.6-rc2, are you?

I've updated the linino image as well.

Hello Radagan

Yes I'm running also on 1.5.6-rc2.
I'm really a newby to arduino, but it seems like the yun has still some issues.

Gr. Pim

Me, too! I have one of the first Yun's shipped from Italy. Timecheck just hangs.

Best regards,

Mike

Hi Pimmernl,
I too have similar problems. I feel the problem is there during start-up (Linino takes about 60 secs to start and Arduino takes few seconds) where-in the hand-shaking between the Arduino and Linono fails.

I put a delay of 60 seconds (60000 msec) at the first statement in setup() and things started working again.

delay(60000);

Also restarting the Arduino (pressing and releasing the top left button next to ethernet port after Linino is up) also solved my problem.

You can give a try if that works for you.

Thanks,
Manoj.

Hello Manoj,

Thanks for the response, tried it, but unfortunately it doesn't work for me =(

Gr. Pim

I have this issue too, and the delay in setup hasn't helped

Hi Everyone,
Sorry for getting back late. I had completely lost track of this post. My apologies...

Please try performing soft reset / manual reset of Arduino after Linux side of processor is up (after the White light glows).

  • Soft reset can be done by issuing following command on SSH:
/usr/bin/reset-mcu
  • Manual reset can be done by pressing the reset button (top left corner) on the board itself.

I use Console to log messages. I believe you have connected PC to the micro USB connection of Yun. May be good idea to wait for Serial (see code below) to come up before you start printing...

while (!Serial); // wait for a serial connection

Regards,
Manoj Rathod.

I seem to be having the same problem. I uploaded the Bridge example and the Red LED comes on and stays on, so I presume it's not starting properly.

I have not upgraded to the new image yet, could that be the issue?

Dean

I have the same problem.

The problem is caused by this line in Bridge.cpp :

uint16_t l = transfer(cmd, 5, res, 4);

Always returning "TRANSFER TIMEOUT". The program stays here :

 if (l == TRANSFER_TIMEOUT) {
      analogWrite(5,50);
      // Bridge didn't start...
      // Maybe the board is starting-up?
      // Wait and retry
      delay(1000);
      analogWrite(5,0);
      continue;
    }

But I have found no solution for this problem.

See this issue for details and solutions to transfer hanging when CPU/ar9331 is booting: Bridge usage will hang 32u4 sketch upon ar9331 reboot · Issue #2351 · arduino/Arduino · GitHub

I was having the same issue, and by specifying the baud rate I was able to get it working again:

Bridge.begin(115200);

Hello!

This is my solution.

Create a new file int '/etc/rc.d/' named 'K49stop-mcu' (Scripts that run at shutdown)

#nano K49stop-mcu

Add this content:

#!/bin/sh

echo 18 > /sys/class/gpio/export
echo "high" > /sys/class/gpio/gpio18/direction
echo 1 > /sys/class/gpio/gpio18/value
echo 18 > /sys/class/gpio/unexport

Save, exit and change permissions:

chmod 7777 K49stop-mcu

It is done.

MCU stops before restarting and so the bridge does not fail booting Linino.

alexafa:
Hello!

This is my solution.

Create a new file int '/etc/rc.d/' named 'K49stop-mcu' (Scripts that run at shutdown)

::::SNIP::::

MCU stops before restarting and so the bridge does not fail booting Linino.

@alexafa,
nice work. I'll be adding it to my list of solutions.

Here is my documentation on the Yun. Updates and additions schedule for the first months summer.

Your solution will be added there.

Jesse

@jessemonroy650 @alexafa

hi, i meet the same problem and want to try this way, but i dont know how to save and exit?

ps: i use puTTy to ssh to the arduino

HSpaigu:
::::SNIP:::

hi, i meet the same problem and want to try this way, but i dont know how to save and exit?

ps: i use puTTy to ssh to the arduino

@HSpaigu
"Save and exit" what?

Jesse

jessemonroy650:
@HSpaigu
"Save and exit" what?

Jesse

@jessemonroy650
i meet the problem that the sketch does not run bridge.begin(), at #13, @alexafa has found a solution, he says need to create a new file K49stop-mcu

but i dont know how to do this.
i ssh into the linux side, go to the directory: /etc/rc.d/
and then type

#nano K49stop-mcu

#!/bin/sh

echo 18 > /sys/class/gpio/export
echo "high" > /sys/class/gpio/gpio18/direction
echo 1 > /sys/class/gpio/gpio18/value
echo 18 > /sys/class/gpio/unexport

but after these, the file K49stop-mcu not be created

@HSpaigu
okay,
DO NOT create file in /etc/rc.d
CREATE file in /etc/init.d

After create file, chmod 755 stop-mcu;
then make link from rc.d to file. Use ln(1) to make link. Do you know how to do this?

With editor
When using nano, see bottom. You should see ^X Exit
When you press, control-x you should exit editor.
It will ask

Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?

Press button 'y'.
It will ask you to confirm the new name (or current name).
Then do

Any Questions?
Jesse

@jessemonroy650

thank you!

however the bridge.begin() still not works, the sketch run to the bridge.begin(), then hang on, ive already try many ways, but not work:

1, upgrade to the latest lininoIO
2, remove python-firmata and pyserial
3, change bridge.begin() to bridge.begin(250000)
4, create stop-mcu in /etc/rc.d or /etc/init.d

almost give up, find arduino yun has so many problems