Could not connect to YunServer 146 Connection refused

I know there's a topic asking about this, but in that topic the error has been found in the sketch, in the line that contents "server.listenOnlocalHost".

In my case, the error appears when I try to get to a web page mounted in the arduino writing the addresses in the browser. In my sketch there's no the command "server.listenOnlocalHost". What thing can be blocking the access? When a try to get to the webpage it asks me about the user and password but when I type them in automatically the error appears. I thing that it is not related to the sketch.

Thanks!!

What is the URL you are trying to access?

That error sounds like you may be trying to access a URL that should be routed to the sketch for processing, but the sketch is not answering the request.

Actually I am following this http://www.lucadentella.it/en/2014/02/10/yun-sketch-uploader/

Right now the sketchUploader is in this route: /mnt/arduino/sketchUploader

And when I try to get to there I write this address: yun_ip/arduino/sketchUploader

Then, the web browser asks me the user and password and after that it gives me the error.

I would like to make it work with other type of webpages because my objective is to make a webserver to control different functions and I want to store the webpage as I have done with the sketchUploader.

Thanks again!!

Sounds like you are using a custom application to upload the sketch, rather than the web interface provided by the built-in web pages. What sketch are you trying to upload? What type of web access are you expecting?

When you use a URL of the format "yun_ip*/arduino/*sketchUploader", the Linux web server on the Yun board is going to see the /arduinio/ portion of the request, and send what is after it to the sketch (in this case, it will send the string "sketchUploader". It is expecting the sketch to be listening for that request using YunServer and YunClient objects, like in the Bridge Example. If you don't have a YunServer listening for a connection, you will get this error.

If you are trying to access some other resources, and not pass the requests to a YunServer in the sketch, then you need a URL of a different format, one that does not start with the /arduino/ keyword that triggers this behavior. So, that brings us back to: what is the sketch, and what are you trying to access?

Ok, now I understand the problem. What I want to do is to access a webpage stored in the arduino called sketchUploader, but what I am doing is sending to arduino a request to the sketch that would have to listen for the request and sends back the webpage.

So one last question, is it possible to store a webpage in the arduino and load the webpage simply accessing an URL?? That’s what I wanted to do before. It is more simply than sending a request. The webpage would act as a webserver.

Thanks ShapeShifter!

have a look at the problem opening board folder thread - hopefully will help

gcp900: So one last question, is it possible to store a webpage in the arduino and load the webpage simply accessing an URL?? That's what I wanted to do before. It is more simply than sending a request. The webpage would act as a webserver.

The easiest way: put an SD card in your computer. On that SD card, create a folder at the root level named "arduino" and inside of that, create a folder named "www" then put the files you want to serve up in that folder. You can create sub-folders as well. Now put that SD card in your Yun. So, suppose you created a test.html file, on the SD card the path to it would be:

/arduino/www/test.html

You would access this file with the URL:

HTTP://arduino.local/sd/test.html

Note that the first "folder" in the URL is /sd/ - this tells the web server to look for the resource in the /arduino/www folder of the SD card. Of course, you would substitute your own Arduino's name or IP address for the "arduino.local" part of the URL.

That first "folder" in the URL has special meaning:

  • arduino - send the rest of the request to the YunServer/YunClient in the sketch.
  • sd - serve the resource in the /arduino/www/ folder of the SD card.
  • data/get - read a key value that was set by calling the Bridge.put() on the Yun
  • data/put - write a key value that can be read by calling the Bridge.get() on the Yun
  • mailbox - write a message to the mailbox queue that can be read by Mailbox.read() on the Yun

An excellent explanation!! I understood!!

The problem now is why my shield doesn't mount /arduino/www as /sd, cause actually I am using dragino yun shield not arduino yun, but that's another topic.

Thanks a lot!!

gcp900: The problem now is why my shield doesn't mount /arduino/www as /sd, cause actually I am using dragino yun shield not arduino yun, but that's another topic.

Everything I wrote assumes that you are using an actual Yun. When using the Dragion shield, there may be differences, including the details that I mentioned. I've not used that shield, and I can't tell you what all of the differences may be, but there are likely to be some.

On the Yun, the SD card is actually mounted as /mnt/sda1. Then, if the SD card has an /arduino folder in the root of the SD card, a link is created so that the card can also be accessed as /mnt/sd. Perhaps you can manually create such a link?

As it is written in the Yun shield wiki it would only be neccessary to create a folder in the root of the USB as in the SD card in the Arduino Yun to mount it as you’ve said, but in the practice I have had problems with that and although I have mounted the USB I could not use that feature yet.

Dragino Yun shield doesn’t have SD card reader, but in my opinion it is not neccessary having a USB. Arduino Yun is not a dropbox server and even with the USB you can get a lot of space. :smiley:

Well, then… it sounds like it’s different enough that I really can’t be of any help. I have no idea if anything I’ve written so far in this thread actually applies to your Dragino shield. You might get better answers from them.

Everything you've said is correct. The Dragino Shield works as the original but it has a couple of differences, one of them is that it has no SD card reader but only USB. Anyway it should work as the original as they have written in the wiki. I will try to find out the problem. ;)

For folks suffering connection refused by bridge sketch for geeetech iduino shield, note that after you update boards.txt with the text in the geeeteck wiki to add your board, you must run board manager and update arduino avr. Then the text takes, and a new board dropdown appears for example for iduino yun on atmega 2560.

You must not use the regular yun selection above the uno, but must see a new board and select it. Otherwise, web in usb frob arduino www directory will work fine, but bridge will reject connection when trying to set pins high or low.

Can you describe, a update of board manager in detail? I did change of boards.txt to add Dragino borad to it, but i do not see Dragino Uno board in drop down menu of Arduino IDE.