Translated by Google Translate:
About Arduino yun Rev2 connection issues, such as:
"Connection closed by foreign host", "Could not connect to YunServer 146 Connection refused", "problem to access Arduino through ID serial port by wifi" and other similar problems; I want to share my "amazing" experience:
I had / have a temperature control system that worked properly and with which I could consult, through a website inside the Arduino and through the library "Bridge" the information of some temperature and humidity sensors, an interior and another exterior.
The Arduino Yun Rev2 was powered via the mini-USB connector via a USB charger, no more information or data came out through this connector; all information was transmitted over the wifi network.
One day, without any explanation, everything stopped working, the Arduino Yun Rev2, booted, apparently without problems, connected to the wifi network and could access it via ssh, by sftp, using the program Arduino ID and through its own website, however, in the latter two cases with errors such as those described in the header.
After many, many tests and a lot of searching for information on the web, by chance, I used another USB cable and miraculously all the problems disappeared, I couldn’t believe it! everything was working again, i reused the previous cable and the issues arose again.
I am an engineer by profession and I can say that if they had told me I would have told them it was a lie, but it is true !.
I have no means to be able to pinpoint what the problem was, just one detail, with the "damaged" cable the "L" LED was constantly flashing, while with the new cable not. I think that due to some problem with the "damaged" cable there was interference in the USB signal input of the connector which affected the operation of the board.
In any case, if you encounter this problem, trying my solution is very simple and cheap, for 2 or 3 € change the cable and see if this is what is happening to you.