After programming some regular arduino megas without any problems, I got an Arduino yun.
After I programmed it with a blank sketch (just an empty setup(){}) It is no longer recognized on my windows machine. When I plug it in: it shows up as unrecognized in device manager.
I tried different cables, different usb ports, and also a different computer. To no avail...
Improtant: I have not connected anything to the YUN board except for the microUSB programing cable.
The Linux chip still works fine. It logs on to WLAN, and I can SSH into it. Is there anything I can do to diagnose/fix this, or is the board dead?
Did you select the right board type in the Arduino IDE? Unlike many Arduino boards that have a separate chip that implements the USB connection, the USB interface for the Yun is part of the sketch's processor. The bootloader code needs to be linked into the sketch for the USB interface to be set up properly. If you have the right board type selected, that happens automatically. But if you have selected a different board, for example if it is still set to Mega, then the required bootloader is not included in the sketch.
I would suggest trying to load the standard Blink example over the network. There are a couple ways to do it:
- Select Yun as the board type, and then select the Yun's network address off of the Port menu. Upload the sketch normally.
- Select Yun as the board type, and build the Blink sketch, and find the .hex file that was generated. Then use a web browser to connect to the Yun's management pages, and on the first page after logging in, there should be a button you can click to upload a sketch
Either of those methods should load a sketch that includes the bootloader, and will hopefully get your USB connection back.
Another possibility is that you are using a USB cable that is only intended for charging. Some manufacturers of battery powered devices save a few pennies by including USB charging cables that don't include the data wires. If you use one of these cables, the board will power up, but will not be recognized by your computer. Try a different cable.
Thanks for the help. You were right about the bootloader.
That fixed it.
However I was unable to find the flash button on the web-console.
So instead I used this method to do it via SCP:
This summerizes the upload method if anyone hits this problem in the future
*It is very important to select the hex file with the bootloader
C:\temp>scp b.hex "root@192.168.0.29:Blink.ino.with_bootloader.hex"
C:\temp>ssh root@192.168.0.29
root@myYun:~# run-avrdude Blink.ino.with_bootloader.hex.hex