Can I transfer a CSV file from the Arduino to a PC?

Hello, I did a "little" Google search without much success on the possibility of transferring a file stored on the SD card of an Arduino (SD or Ethernet shield) to a PC (without using the serial monitor .. )

Indeed I would like (if possible) ask the Arduino Mega to send once a month the information file that it has stored on its SD via Ethernet ...

The ideal being to make an automatic copy of this file on the PC ...

Anyone any idea?
Thank you :slight_smile:

Of the top of my head would it not simply be a matter of reading each line of the file using the methods available in the SD library, and then using Serial to send them out the USB? Then on the PC instead of the IDE's monitor (connected to COMx) displaying the data you have your PC application read that COMx instead, and do what you like with it.

I don't think the issue here is at the Arduino end; it's more how you would snag and use the data coming in at the PC.

A few years ago I dabbled with using Python and also Processing to read COMx where I used Serial on the Arduino to send stuff out. I didn't save anything to a file, but that's surely a task that would be easily programmed on the PC.

edit, but I see you would rathe use Ethernet, I have no knowledge there.

But what do you mean when you say "without using the serial monitor .. "? You wouldn't use the monitor anyway; do you mean you don't want to use Serial?

Thank you for your answer.
I actually forgot to say a little more about my project.
The Arduino Mega is used to capture information every 30 seconds on a hive (weight, temperature, humidity, rain, brightness), it stores this information in a monthly file named, for example, january.csv. And an Ethernet shield sends this every 30 seconds to the ThingSpeak server.
So I don't have a nearby USB connection (serial monitor), just the network. And taking out the SD card every month to copy to a PC is not too practical.
So I'm looking to see if there is a way for the Arduino once a month via Ethernet to send a copy of this file. Or failing to transfer this file line by line which should nevertheless contain 90,000 lines ...
Thank you

This is what threw me:

USB connection (serial monitor)

The use of usb doesn't mean you have to use the IDE's serial monitor, but I get that you actually mean not to use Serial.

I guess someone will have some thoughts on other methods.

There are multiple ways to do it. The tricky bit is that you'll need something on the PC that knows how to receive it.

There is an FTP client program in the Arduino playground, so you could probably adapt that to send the file to an FTP server running on the PC.

You could write some custom program that receives the data over TCP or UDP. You could run it on demand and have it ask the arduino for the data.

Given that you're already sending the data to Thingspeak, I would think that you could find a way to get it from there - I see it supports MQTT for example.

Do not double post across forums please

The filedump example included in the IDE should be all you need. The method of transport to PC is a separate matter. You should be able to get it from Thingspeak, as suggested.
You should be able to use a PC terminal on the network. I just stand beside the Arduino and download the files to the phone via Bluetooth.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.