[SOLVED] Arduino Yun: Webserver without SD card

Hello All,

I need to create a small webpage in my Yun, displaying some values from a very small database on the Linino.

I think, the best way will be one, or a small set of PHP-pages or so. (I'm open to better options)
They will be so small, I do not need extra memory space, hence no need for an SD-card in the Yun/Linino.
However.... Looking for webserver examples, I only find examples, uploadable to the SD-card.

And so, my question is: How do I create a webserver without an SD-card?
And..... coming with this: How do I put files like pictures and so on the Linux machine, if not possible via the IDE?

Friendly greetings,
Rens

I think it is not such a good idea. The memory of the Yun itself can only be written a limited number of times (well the SD card as well, but much more often). I would just buy the smallest possible SD card there is, if I were you.

NewLine:
I think it is not such a good idea. The memory of the Yun itself can only be written a limited number of times (well the SD card as well, but much more often). I would just buy the smallest possible SD card there is, if I were you.

+1
Considering the read/write limitation to the Yun's Linino flash ROM, I would not go without a SD card. Unless it's not a problem to keep the "database" in RAM, with the option to loose the contents when the power cuts...

Ralf

On a Linux box to transfer files you just do this in a terminal window:
scp filetotransfer root@arduino.local:/root and its in the /root directory on the yun. I think Federico has posted instructions for similar utilities on windows.

If you are dealing with human operations, writing to flash will take a long, long time to wear it out. A program that writes every minute or so may do it in a month or two. SD cards aren't hard to replace the flash on the Yun would require some vey advanced soldering skills and then you would need to reload the linino system.

Thanks guy's.

(couldn't help to have a quick peak on x-mas day. :))
(Happy x-mas to all of you)

The database will be accessed just a few times a day, so it might be just okay to use internal memory.
(How often can the internal memory be written and read?)

I'm looking (will be looking after x-mas) for the instructions the Federico wrote.
(Does somebody have a link?)

Friendly greetings,
Rens

RensD:
Thanks guy's.

(couldn't help to have a quick peak on x-mas day. :))
(Happy x-mas to all of you)

The database will be accessed just a few times a day, so it might be just okay to use internal memory.
(How often can the internal memory be written and read?)

That's regular DRAM, so there shouldn't be any practical limitation. You just loose the contents when the power cuts, so maybe save it to flash or external storage in greater intervals as a backup...

Friendly greetings,
Rens

Happy Holidays!

Ralf

PCWorxLA:

RensD:
How often can the internal memory be written and read?

That's regular DRAM, so there shouldn't be any practical limitation. You just loose the contents when the power cuts, so maybe save it to flash or external storage in greater intervals as a backup...

Hi Ralf,

thanks for your answer.
By "Internal memory", I mean "Not the SD-card". :slight_smile:

The database will be accessed something from 1 to 3 times a day to 1 to 3 times a week.
With each action, a status will be read and than be updated.
I guess, this can continue for a few years, before the flash wears out I think, isn't that so?

How many read/write operations will wear it out? Is there a known number?

noblepepper:
On a Linux box to transfer files you just do this in a terminal window:
scp filetotransfer root@arduino.local:/root and its in the /root directory on the yun. I think Federico has posted instructions for similar utilities on windows.

And thank you as well noblepepper.
I figured it out for Windows.

In the putty program directory, there is a small executable called pscp.exe. That did the trick.
From the cmd-prompt:

pscp -scp FileToTransfer root@arduino.local:/PathToTransferTo/FileToTransfer 
(Enter password when prompted)

Mark the '-scp' option. Without, it will not work, and you have to name the file in the last part of the statement as well.

Thanks for the tip.

RensD:

PCWorxLA:

RensD:
How often can the internal memory be written and read?

That's regular DRAM, so there shouldn't be any practical limitation. You just loose the contents when the power cuts, so maybe save it to flash or external storage in greater intervals as a backup...

Hi Ralf,

thanks for your answer.
By "Internal memory", I mean "Not the SD-card". :slight_smile:

I know, that's exactly the reason why I gave you the above answer... :wink:

However, we need to be clear that there are several types of "internal memory". As far as the Linino side goes, this is
a) the flash RAM (16MB) that contains the actual Linino code/programs, this has a limited number of write cycles
b) the DRAM (64MB), in which part of the Linino code is copied to execution and for a RAM drive, where for example /tmp resides, and this one doesn't have any write cycle limitation

The database will be accessed something from 1 to 3 times a day to 1 to 3 times a week.
With each action, a status will be read and than be updated.
I guess, this can continue for a few years, before the flash wears out I think, isn't that so?

Well, yes and no. You need to consider that there are other process also more or less often writing to the flash ROM, for example quite intensively when you do any updates to the Linino distro via apt-get.

Depending on the use, the flash ROM drive ("USB sticks") that I use at work for various purposes last partially for less than a year before they seem so start getting flaky and I rather replace them.

Honestly, don't know what the big deal about using a small SD card is, 2GB SanDisk Micro-SD is about $5 around here. I rather spend that and possibly replace it when this nears its end-of-life than wasting my Yun, on which the flash ROM isn't replaceable... :roll_eyes:

Ralf

About the SD-card… The product I’m preparing should have a selling price as low as possible.
€5,- added to the price does not help in this case. :slight_smile:

Thanks for all answers guys.

Friendly greetings
Rens.

As the others have said, you can put your files under the /www folder of the yun. If you need to execute php or python scripts you have to either put them under cgi-bin (and you're done) or wherever but you'll also need to configure /etc/config/uhttpd to enable extension based script execution

To start lean, begin putting some files under /www and fetch them with your browser (http://arduino.local/mytestfile.html for example)

And just for the record, I confirm every example you'll find will use the SD card in order to avoid wearing out the on board flash