How to transfer log files over TinyOS WiFi

I picked up a TinyOS WiFi Shield (WiFi Shield For Arduino (802.11 b/g/n)) based on the WizFi210 module to ultimately transfer log files from a number of CNC machine centers. I'm using a Mega2560 with a custom shield that integrates the RTC, SD card, watchdog timer and 4 channel isolated inputs coming from the machine, with the WiFi shield and an LCD Keypad shield stacked on top. I have all the code working for the data logging, LCD and keypad, and am down to getting the log file transferred to a PC. The log file is a simple comma delimited text file that should typically be under 8k in length.

I have the WiFi shield setup to the point that I recieve serial data from it thru a Putty session on the PC. But I have absolutely no idea how to transfer the complete logfile.txt to the PC. I could sequentially read the data in the file, print it via serial port and reconstruct it on the PC side, but that seems awfully messy and difficult with 5 different machines. There must be a better way. Unfortunately I know next to nothing about networking. I've looked for examples and/or libraries on the net but haven't found much of anything for this particular shield.

This is my first dip in the Arduino pool and I never was very good proficient in C/C++ (hardware, I/O, and machine code was my thing in the late 70's & 80's). Any help, libraries, tutorials, etc. you might have to offer would be very much appreciated.

Regards,

Marc -

I use a FTP program for that. It was written for the w5100 ethernet shield, but the same should work with any network device with minor modifications to the setup routine.

I could sequentially read the data in the file, print it via serial port and reconstruct it on the PC side, but that seems awfully messy and difficult with different 5 machines.

Aren't the 5 machines writing to the same file in the SD card? If not, then, the fact that there are 5 machines writing to 5 separate files seems completely irrelevant. If so, the fact that there are 5 machines writing TO the file IS irrelevant, since there is only one reading FROM the file.

There must be a better way.

Why must there be? Using functions, to manage the (relatively mild) complexity of the task would help.

Unfortunately I know next to nothing about networking.

And yet you have 5 machines talking to the Arduino? Getting the Arduino to talk to one more (the PC) seems easy, by comparison.

I suspect that you are simply underestimating yourself.

Aren't the 5 machines writing to the same file in the SD card?

Thanks for taking the time to reply Paul. I apologize for the ambiguity in my description. Each machine has a seperate Arduino, card, Wifi, etc. The log file from each individual machine will be transmitted on a weekly basis. Currently I only have a single WiFi card as I'm still in the prototyping stage.

Using functions, to manage the (relatively mild) complexity of the task would help.

Within the Arduino I put most of the code in seperate functions. On the PC side, I haven't done any programming since the days of DOS and a little in Win 3.1, and it was limited to assembly (mostly device drivers and configuration utilites) and BASIC for higher level stuff. As a result, I know very little about the current Windows environment and was trying to avoid that learning curve. My 'messy' approach involves using Macro Express to automate the process of loading Putty, logging the session, dumping the data from the Arduino, then editing the putty.log file to strip the Putty header and the 'd' I send to trigger the dump from the Arduino, and finally rename the file. It works well enough but it's not very elegant or robust by any means. Would you have any recommendations for a relatively easy to learn programming environment within Windows for this process?

I use a FTP program for that.

Thanks for the link. I'll check it out and see if I can make any sense of it!

Would you have any recommendations for a relatively easy to learn programming environment within Windows for this process?

Visual C# (free from Microsoft, for non-commercial purposes) is my choice for reading from/writing to the serial port (also known as communicating with the Arduino).

Of course, it isn't the serial port that you want to talk to.

But, C# is great for internet scripting, too.

Each machine has a seperate Arduino, card, Wifi, etc.

So, the fact that there are 5 of them is irrelevant, isn't it?

Visual C# (free from Microsoft, for non-commercial purposes) is my choice...

Thanks Paul, I'll hop over and D/L a copy. I was trying to stay away from dealing with programming within the Windows environment, but it seems that's just not realistic. I have so many other irons in the fire I was hoping someone would have some some clever method that wouldn't require a lot of time to implement. Guess I can't get away with being lazy!

So, the fact that there are 5 of them is irrelevant, isn't it?

In retrospect, yes Paul it is.