Bridge lost after linux reboot or crash

I would recommend to add this in /etc/rc.local, just before the exit 0:

Restart the ATmega ... just to recover bridge

/usr/bin/reset-mcu

Hi Prochat,
I had the same problem with my Yun, I lost bridge after Linux reboot, but I can't understand what do you mean with:

...to add this in /etc/rc.local, just before the exit 0:

Restart the ATmega ... just to recover bridge

/usr/bin/reset-mcu

This is a good suggestion. I've noticed that if you reset Linux out from under the sketch, the sketch will have problems with the Bridge interface until the sketch re-initializes the Bridge. Automatically resetting the sketch when Linux reboots is a good solution, and adding that command to /etc/rc.local is the first thing I do on a Yun.

There is a discussion about various ways to improve reboot stability, and this sketch reset is one of those options: How to improve reboot stability

Fluvius:
but I can't understand what do you mean with:

On the Linux side, there is a file /etc/rc.local that is run as one of the last steps of the Linux boot process. If you edit that file, you can add your own commands, and prochat is recommending adding a line that causes the Linux processor to reboot the AVR sketch processor. This will restart the sketch from the beginning, making it run the setup() function again, and start up the Bridge interface all over again.

You can log onto the Yun's Linux command line using SSH and edit the file directly using command line commands, or you can modify the file through the Yun' web interface:

  • Log onto your Yun through the web interface.
  • On the welcome page, click the "Configure" button.
  • At the top of the configuration page, click the "advanced configuration panel (luci)" link.
  • On the top row of tabs, click the "System" tab.
  • On the second row of tabs, click the "Startup" tab.
  • At the bottom of the page is a "Local Startup" section with a large edit box - this is your /etc/rc.local file. Add the "reset-mcu" command, but make sure it is before the "exit 0" line - anything after that line won't be executed.
  • Click the "Submit" button in the bottom right corner of the page to save your changes.

No more words ...perfect.
Thank you guys.

Sorry for bringing this up again, but I tried and it doesn't seem to be working. This is what I have in /etc/rc.local

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

# wifi-live-or-reset

# Changing bootloader name in LUA executable

FILE=/usr/bin/merge-sketch-with-bootloader.lua
BOARD=`cat /proc/cpuinfo | grep machine | awk {'print $4'}`

case $BOARD in
    'One'|'Lei'|'Chiwawa'|'Yun-Mini')
        sed -i -e "s/Caterina-Yun.hex/Caterina-$BOARD.hex/g" $FILE
        ;;
	*)
		exit 0
		;;
esac

# Restart the ATmega ... just to recover bridge
/usr/bin/reset-mcu
exit 0

I've tried by rebooting Linux via reset button, ssh and sketch code and nothing... am I doing something wrong?