sd card not work, cant find the file or directory in browser

hi, i meet a problem when upload the sketch to the yun.

the process is ok, and when i SSH my yun(use PuTTy), i see my html file has already in the directory mnt/sda1/arduino/www

but when i try to run it in the browser(chrome) use address: YUNlocal/sd/filename
it says there is no such file or directory

i dont know what happens

ps: my yun is linino(does this affect?)

@HSpaigu,
with the Arduino Yun, sometimes you must make sure to push the SD all the way in. Sometimes it does not make good contact. On the original, sometimes the spring that pushes the SD card against the frame is bent, check that also.

Jesse

jessemonroy650:
@HSpaigu,
with the Arduino Yun, sometimes you must make sure to push the SD all the way in. Sometimes it does not make good contact. On the original, sometimes the spring that pushes the SD card against the frame is bent, check that also.

Jesse

hello, im pretty sure the sd card is ok and connect to the arduino yun,

i use puTTY to check it:

root
password
cd /
cd mnt/
cd sda1/
cd arduino/
cd www/
cd sketchname/
ls

and i find my index.html is there and it is green, but when i run http://arduino.local/sd/mysketch or http://192.168.xx.xx/local/sd/mysketch, it says : No such file or directory

@HSpaigu,
doing a directory listing proves nothing. Use df, and post those results.
you said

and i find my index.html is there and it is green

What do you mean "it is green"?

Jesse

@jessemonroy650
the result after df is like this

root@1520yun:~# df
Filesystem           1K-blocks      Used Available Use%    Mounted on
rootfs                        4864      1028      3836    21%      /
/dev/root                   9984      9984         0    100%       /rom
tmpfs                      30568       156     30412      1%       /tmp
tmpfs                         512         0       512         0%      /dev
/dev/mtdblock3            4864      1028      3836   21%     /overlay
overlayfs:/overlay        4864      1028      3836   21%      /
/dev/sda1              7753728       736   7752992   0%       /mnt/sda1

i upload a video on youtube to show what happens: - YouTube

@HSpaigu,

Your SD card is not being seen. What do you mean when you say "it is green"?

Here is the output from my Yun:

BusyBox v1.19.4 (2014-11-13 19:03:47 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------


root@Arduino:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                 5696352    239220   5171488   4% /
/dev/root                 7680      7680         0 100% /rom
tmpfs                    30560       100     30460   0% /tmp
tmpfs                      512         0       512   0% /dev
/dev/sda2              5696352    239220   5171488   4% /overlay
overlayfs:/overlay     5696352    239220   5171488   4% /
/dev/sda1              2043984         4   2043980   0% /mnt/sda1

Jesse

@jessemonroy650
thank you, i mean the html file i upload, its color in puTTY is green,
and i dont find the difference between your df and my df

root@arduinoyun:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                    4864       508      4356  10% /
/dev/root                 9984      9984         0 100% /rom
tmpfs                    30568       108     30460   0% /tmp
tmpfs                      512         0       512   0% /dev
/dev/mtdblock3            4864       508      4356  10% /overlay
overlayfs:/overlay        4864       508      4356  10% /
/dev/sda1              7753728       192   7753536   0% /mnt/sda1

and because im afraid not describe the problem clearly, so i upload the problem on youtube, pls help me find what happens.

the youtube address is :

@HSpaigu,
I am convinced that the SD is not making contact. If you look at the output and compare it to your, you will see:

/dev/sda2              5696352    239220   5171488   4% /overlay

This means the operating system sees a second storage device named /dev/sda2.

Whatever is green I don't see anything important about it. You say it has something to do with Putty. I use putty, i don't see anything important about it. In any case, SD is not being seen by the operating system, so the color does not matter.

In short, your subject line says, "sd card not work". This is correct. Push the SD card in and check the metal pin inside the holder to see if it is correct, THEN take a picture of the SD while it is installed. Post the picture, other case see it also. Please use the markup.

Thanks
Jesse

jessemonroy650:
@HSpaigu,
I am convinced that the SD is not making contact. If you look at the output and compare it to your, you will see:

/dev/sda2              5696352    239220   5171488   4% /overlay

This means the operating system sees a second storage device named /dev/sda2.

I believe the difference is that you have probably run the YunDiskExpander, which creates two partitions on the SD card:

  • One is a regular data partition (/dev/sda1) that mounts as /mnt/sda1
  • One is an ext partition (/dev/sda2) that is an overlay of the system root that mounts as /overlay

In HSpaigu's case, it looks like he did not expand his system drive onto the SD card: it has a single data partition (/dev/sda1) that mounts as /mnt/sda1. I think this is correct.

Looking at the video, it appears the SD card is being recognized and is working properly. This looks like a web server or sketch setup problem, not an SD card problem. The final proof would be to "cat index.html" from the command line to see the file contents and make sure the file is not corrupted.

At one point in the video, after you try to open 192.168.0.104/sd/ajax, you then edit the URL to 192.168.0.104/local/sd/ajax - what are you trying to accomplish there?

What is in index.html? (It doesn't happen to just display "No such file or directory", does it? :wink: )

What happens if you just double click the index.html file locally on your computer. Does it load properly in the browser?

What happens if you just try 192.168.0.104/sd? Do you get a directory listing of the /mnt/sda1/arduino/www directory?

Please post your sketch and your index.html file, something in there might be triggering the error.

One final thought... what output do you get if you issue a [color=blue]ls /mnt[/color] command at the SSH command line? The SD card is actually mounted as /mnt/sda1, but if the card has an /arduino folder at the root of the card, the Yun is supposed to automatically create a link to the card as /mnt/sd in addition to the physical connection at /mnt/sda1. Perhaps that link is not being created? It is that link that the web server is accessing. If you [color=blue]cd /mnt/sd[/color], you should end up at /mnt/sda1 - do you?

@ShapeShifter
thank you so much,

i try 192.168.0.104/local/sd/ajax because one of the tutorials i see use this(http://scuola.arduino.cc/lesson/b4EoRkV/Arduino_Yn_Intro_to_web_server)

in index.html is two buttons, it can be loaded properly in the browser

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>arduino yun demo</title>
<script type="text/javascript">
function send2arduino(){
        var xmlhttp;
        xmlhttp=new XMLHttpRequest();
        element1=document.getElementById("light1");
	element2=document.getElementById("light2");

        if (element1.innerHTML.match("Turn on"))
          { 
                  xmlhttp.open("GET","?on",true);
          }
        if (element2.innerHTML.match("Turn off"))
          { 
                  xmlhttp.open("GET","?off",true); 
          }
        xmlhttp.send();        
}
</script>
</head>
<body>
<div align="center">
<h1>Arduino Web Server</h1>
<button id="light1" type="button" onclick="send2arduino()">Turn on</button>
<button id="light2" type="button" onclick="send2arduino()">Turn off</button>
</div>
</body>
</html>

if i just try 192.168.0.104/sd, it also says: no such file or directory

my sketch:

#include <Bridge.h>
#include <BridgeServer.h>
#include <BridgeClient.h>

int LEDPIN = 3; // your LED PIN
BridgeServer server;

String http_req=""; 

void setup() {
  // Start our connection
  Serial.begin(9600);
  pinMode(LEDPIN,OUTPUT);
  digitalWrite(LEDPIN,HIGH); // turn on Led while connecting
  Bridge.begin();  

  // Show a fancy flash pattern once connected
  digitalWrite(LEDPIN,LOW); 
  delay(150);
  digitalWrite(LEDPIN,HIGH); 
  delay(150);
  digitalWrite(LEDPIN,LOW); 
  delay(150);
  digitalWrite(LEDPIN,HIGH); 
  delay(150);
  digitalWrite(LEDPIN,LOW); 
  delay(150);

  // Disable for some connections:
  // Start listening for connections  

  server.listenOnLocalhost();
  server.begin();

}

void loop() {
  // Listen for clients
  BridgeClient client = server.accept();
  // Client exists?
  if (client) {
    // Lets process the request!
    process(client);

    client.print("***");
    client.print(http_req);
    client.print("***");

    client.stop();
    http_req=""; 
  }
  delay(50);
}

void process(BridgeClient client) {
  // Collect user commands
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        http_req += c;
        if (c == '\n') {
          Serial.println(http_req);
          //check on, turn on the led
          if(http_req.indexOf("?on") >0) {
            digitalWrite(LEDPIN, HIGH);
            Serial.println("Led On");
            break;
          }
          //check off, turn off the led
          if(http_req.indexOf("?off") >0) {
            digitalWrite(LEDPIN, LOW);
            Serial.println("Led Off");
            break;
          }
          break; 
        }        
      }
    }




}

HSpaigu:
i try 192.168.0.104/local/sd/ajax because one of the tutorials i see use this(http://scuola.arduino.cc/lesson/b4EoRkV/Arduino_Yn_Intro_to_web_server)

I see that on that page: "(or 192.168.x.x/local/sd/mysketch)"

I believe that is an error on the page. Either of these formats make sense:

  • boardname.local/sd/mysketch
  • 192.168.x.x/sd/mysketch

The two versions use two different board addresses (boardname.local or 192.168.x.x) but they both have the same folder path after the address (/sd/mysketch.) Having a URL that starts with /local/ after the address does not make sense with a standard Yun server setup.

if i just try 192.168.0.104/sd, it also says: no such file or directory

That tells me it's not your sketch or web page that's at fault. It's either a web server configuration problem, or a problem with the /mnt/sd link that should point to /mnt/sda1.

What happens when you try this:

ShapeShifter:
what output do you get if you issue a [color=blue]ls /mnt[/color] command at the SSH command line?

I see the link sdshow up in light blue, and the folder sda1 show up in dark blue. What do you see?

If you give the command [color=blue]cd /mnt/sd[/color] where do you end up?

ShapeShifter:
::::SNIP::::

In HSpaigu's case, it looks like he did not expand his system drive onto the SD card: it has a single data partition (/dev/sda1) that mounts as /mnt/sda1. I think this is correct.

::::SNIP::::

No. Regardless of using the expander or not, the SD will be seen as a separate device. As such, df will show mounted devices. Beyond that

Google: linux show unmounted storage

When you do this, you'll see the other options. However, when you update the software version on the Yun, you are "highly advised" to use the disk expander. This is because the update take more room that is available on the default Yun.

As such, if the OP updated without the disk expander, then everything fails, and one must start from go again.

Questions?
Jesse

jessemonroy650:
No. Regardless of using the expander or not, the SD will be seen as a separate device.

His SD card does show up as a device: /dev/sda1 mounted on /mnt/sda1.

Because you ran the expander, your SD card shows up as two devices: /dev/sda1 mounted as /mnt/sda1, and /dev/sda2 mounted as /overlay.

Assuming that he has not run the expander, I think his df listing is correct. And he can see the files on the SD card, as his /mnt/sda1/arduino/www/ajax/index.html file is there, as expected. I think the SD card is working, but the web server is not finding the files. (Because it's using the /mnt/sd link, and maybe the link is not working?)

However, when you update the software version on the Yun, you are "highly advised" to use the disk expander. This is because the update take more room that is available on the default Yun.

As such, if the OP updated without the disk expander, then everything fails, and one must start from go again.

This is interesting. Where is it said that it's recommended to run the disk expander? I'm not questioning you, I just haven't heard this before.

It's interesting to note that the OP's system is apparently updated, at least compared to yours and mine Yuns: His SSH sign-on screen (briefly visible in his video) is dated 2016-06-01, and is a Linino version (presumably from arduino.org?) Yours and mine is dated in 2014, and is an OpenWRT version (presumably from arduino.cc.)

When you say one should run the expander with the update, is that before or after? My (limited) understanding is that if you update the system on your Yun, you should re-do the disk expansion. I hear problems can happen if you perform a system upgrade while you have an expanded SD card active?

ShapeShifter:
::::SNIP::::

This is interesting. Where is it said that it's recommended to run the disk expander? I'm not questioning you, I just haven't heard this before.

It's interesting to note that the OP's system is apparently updated, at least compared to yours and mine Yuns: His SSH sign-on screen (briefly visible in his video) is dated 2016-06-01, and is a Linino version (presumably from arduino.org?) Yours and mine is dated in 2014, and is an OpenWRT version (presumably from arduino.cc.)

When you say one should run the expander with the update, is that before or after? My (limited) understanding is that if you update the system on your Yun, you should re-do the disk expansion. I hear problems can happen if you perform a system upgrade while you have an expanded SD card active?

I don't recall where I read it, but I recall when I updated - I questioned the entire process at that point. I did a lot of background work - which is when I found out exactly how the overly file system works.

Your remaining question bring up very good point. We all (the Yun portion of the Arduino community) have been avoiding the one question we must deal with.

What will happen to Yun when the split is complete?

Doing a quick look this weekend, I found Yun is no longer available for purchase on arduino.cc.
However, the Yun, the Yun Mini, the Tian and something called UNO wireless are all available on arduino.org.

Now the group with .cc has already stated (via press release) they have a new hardware partner, but to me it is not clear what will happen with the Yun, and if I really want to support it any longer. The lack of communication from .cc group does not lend to the situation.

The last thing I should say - if not apparent, all the new users seem to be buying the Yun from the .org group, and since we don't own those new boards our hand will slowly be tied.

Your thoughts.
Jesse

jessemonroy650:
What will happen to Yun when the split is complete?

Doing a quick look this weekend, I found Yun is no longer available for purchase on arduino.cc.
However, the Yun, the Yun Mini, the Tian and something called UNO wireless are all available on arduino.org.

I'm torn about this whole situation. I hate taking sides, but I feel more sympathetic to the .cc side of the feud, as the attitude and actions of the .org side don't feel right. But on the other hand, looking at the product offerings, it seems like the .org side keeps coming out with newer and more interesting products, while the .cc side seems to be somewhat stagnant in comparison.

I bought my Yuns (four of them) shortly before the split. I liked them from the beginning, and I like them more with each project I work on - as I learn more and more about the system's capabilities, I like the platform even more. (I still use the Bridge library, but the more work I push down onto the Linux side, the more satisfied I am with the overall system performance and capability.) So I think the Yun is still a desirable platform. From a philosophical viewpoint, I have a hard time moving to a .org product, but from a technical side I guess it doesn't really make a difference? There seems to be some differences with the .org firmware (maybe that has something to do with the current topic?) but I don't know that it makes it better or worse - just different. And the Ciao library looks to be interesting on the surface, although I haven't looked at it closely.

The classic Yun still appears to be available on the .org site, at least for now. While the classic Yun is a great prototyping configuration, the Yun Mini seems very interesting for including into a finished project - one that you prototype with the classic configuration, and then build a custom board that uses the smaller form factor Yun Mini. My big reservation with the Yun Mini is that it doesn't include an SD card socket, and that's a show stopper for me - I'm not particularly interested in putting the required USB interface/driver chip and SD card socket on the board I design: it detracts from the appeal of the Yun Mini's smaller size. The Arduino Industrial 101 also looks interesting from a smallness point of view, but it again has the same limitation as the Yun Mini as far as the SD card goes.

So, at least for me, that makes the classic Yun the most logical platform, which means going to arduino.org. There is a new forum section here for a Yun Shield, and there are pages on this .cc site about it, so that might be an option for those wanting to stay with .cc. But I don't see it listed anywhere in the products or store pages of this site?

The Uno Wireless from .org sounds interesting. I've heard a lot of about the ESP8266 recently, and it could be an interesting combination. There are quite a few new products out there, like the ESP8266, which offer easy integration withe smartphone apps and similar infrastructure. I've been a little leery about them as many seem cloud based - their smartphone/IoT integration only works if you have an active Internet connection that allows communications to pass through their servers. I have a problem with that, I need something that doesn't require any outside connections. My reasons are varied: in some of my applications, I have no Internet access. And at home, my access is over an expensive Cellular connection - I don't have unlimited bandwidth (I'm out in the boonies - my only options are expensive semi-fast cellular, or expensive slow satellite: I don't even have dial-up as an option.) But my bigger concern with cloud based services is what happens when the company decides that they are not going to support it any longer - the project just turned into a useless brick. But a recent project I've read about states that the ESP8266 does not need an Internet connection to integrate with a smartphone app, so it might be worth a try. Although I think the Yun will still be more powerful and flexible with the full Linux processor. (One of these days I've got to look more deeply into PhoneGap that you keep mentioning, but I'm not really interested in writing a full phone application.)

@ShapeShifter
sorry not reply these days, my yun burned few days ago, and i bought a new one.

now the new one works well and have no problems, i didn't change my steps to set up my new yun, but there are no problems, feel good about this one

one of people reply my video on youtube, he said it maybe the problem of linux software of arduino, the burned yun i upgrade it to the latest version, so i thought it maybe the latest version has some mistakes, anyway, i can not prove it, as it burned

@jessemonroy650 @ShapeShifter
i found the solution, it is the problem of latest version of linino, the latest linino version may need have some other setting(or just it has problem), i dont want to try and find it.

my new arduino yun(the old one burned) has old linino version and my html works(no change, the same as before), but when i upgrade my arduino yun to latest linino version, it shows: no such file and directory.

so now i decide to downgrade my yun to old version. Now, i just dont know downgrade to witch one, dont want the original version, it is too old to use. also fear to try many times, dont want my yun burned again

Hi everyone, i am working on a project on Arduino Yun. I need to send web page to web browser (client). I followed many youtube tutorial for sending web page from sd card. But in my case i am not able to browse web page on browser, it gives error "No such files or directory". In putty SSH window i am able to all necessary files in path (/mnt/sda1/arduino/www/YUNtest) . Mine YUN Arduino OS version 2.03 .Please help me