Data Logging to NAS

Hi all,

I'm a newbee to the world of Arduino.

I have a project in mind where I want to set up my Arduino Mega to run (in part) my Marine aquarium. Part of the system will be monitoring various sensors such as water temperature and quality.

I have an Arduino Ethernet shield with SD card slot to go with my Mega.

My Question is: Can I log my sensor data direct to my NAS?

I have spent days searching forums and youtube, the only info and tutorials I seem to be able to find all log to the SD card.

My NAS is a Synology DS212j (running DSM5.0 Beta) and supports quite a few formats such as HTTP/S, WebDav & FTP + others

Also any other info / links relating to my project would be appreciated.

Many thanks in advance.

That shouldn't be a problem. If you can set up a web server interfaced to a database like MySQL, then it is possible. Use a web client sketch on the Arduino and a server set up on the NAS.

Here is my client code I run on my Mega/Ethernet shield. Maybe this will give you some ideas.
http://playground.arduino.cc/Code/WebClient

Many thanks SurferTim, I have had a look at your code and it will definitely help with my project.

Could you please explain something for me though, There are quite a few lines such as:

client.println(F("Connection: close\r\n"))

what does the F do? I cant seem to find a reference to it at beginning of code

The F() function allows your sketch to keep those static strings in program memory instead if moving them into SRAM before using them. If you use a lot of static strings, you can run out of SRAM. That will cause all kinds of weird symptoms, like your sketch rebooting or freezing.

Cool, Many thanks SurferTim.
Makes perfect sense. Much appreciated :slight_smile: