Go Down

Topic: Suggestions on how to move a file from SD card to the PC (Read 3 times) previous topic - next topic

tas-99

billroy,

I'm not sure how to take the data from the terminal program and make it into a useful file.

Tom

tkbyd

Silly question, I suppose... but couldn't you put the sensor(s) on longer wires... have the Arduino in an upstairs room, to make SD card available for "sneakernetting" data to PC?

Having it (Arduino) outdoors, even in enclosure, is asking for trouble, anyway!

tas-99

Too many sensors, too many wires.

The Arduino is in an enclosure, temp and moisture controlled box and has been working fine for almost a year. I currently remove the card monthly and transfer the data but with the snow it's a lot more difficult to make the trip onto the roof.

But thanks for the suggestion.

spatula

Since you are writing your logs on the SD card you should already know how to write (and read) from it. My understanding is that you have a USB connection. So, in principle, you may transfer the file by repeatedly reading the file and calling serial.write(). The process would be started by the PC sending some message to the Arduino over the serial port.

A basic "protocol" could be:
- send a command (e.g., GET) from the PC to start the transmission (no need to specify a file name, the PC will save the data under a local file name of your choice);
- answer by sending your data divided in small binary chunks (same length, may even contain a checksum);
- for each chunk of data sent, wait for the PC to send an ACK (and define what to do if no ACK is received within a certain amount of time);
- send an EOF when you have sent the last chunk of data.

This would be pure serial transmission so you shouldn't interpolate the usual debugging messages.

tas-99

Ok,

It seems like communicating through the USB to the PC is the answer but I have a couple of questions.

I understand what spatula is suggesting but was wondering if I can use the log file that I can create using the terminal program "Putty" and just appending to it for each cycle would work. If so, I'm not sure how to designate the serial.write be directed to Putty (com1) and not the serial monitor in the Arduino user interface (com5).

Thanks,

Tom

Go Up