Pages: [1]   Go Down
Author Topic: Read & Write Serial COM Port File to a Folder on PC  (Read 1002 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey all,
i m new to this forum and i m an electronics student ..i m gng to use arduino uno in my final year project.
i want to if their is any way to write and read text file from serial monitor..
actually i want to write a txt file everytime my phone is tapped on reader so i want to do that in loop everytime phone is tapped txt file is created with the serial data coming on the com port ...and i m gng to send that txt file to a web server..
i worked with 8051 earlier and i m new to arduino plz help me...and suggest if any other method is easy for this task..
Thanks! smiley
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can't do it "in the serial monitor".

However, you can do it either with your own software (it's just serial, after all) or with a different serial terminal emulator that offers logging to a file.

Most people around here seem to use C# for writing their own serial clients.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

can u send me a link for the thread of someone who wrote his own serial client using C#.?
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

can u send me a link for the thread of someone who wrote his own serial client using C#.?
No, I can't, because I don't know of any threads.  They exist though, but how they would help you I don't know.  Their project isn't your project.

If you want to use C# then maybe this would be a starting point: http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12534
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The solution you describe seems a bit contrived to me (redirecting log messages to a text file and then posting the text file to a web server). If you want to log the events, it would IMO be more sensible to log them as they occur.

Anyway, the writing-to-local-text-file could be done by redirecting all the serial output to a text file using any of the common serial clients such as PuTTY or RealTerm. If you're on Windows, you could also use GoBetwino to read and write to text files and execute arbitrary commands. Whatever platform you're on, you can write your own PC application to receive messages from the serial port and log them however you want. (Writing them directly to a database would IMO be the most sensible starting point.)
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
can u send me a link for the thread of someone who wrote his own serial client using C#.?
PM me with an e-mail address. I have a C# application that communicates with the Arduino.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
can u send me a link for the thread of someone who wrote his own serial client using C#.?
PM me with an e-mail address. I have a C# application that communicates with the Arduino.
Now now, no signing him up to those naughty sites... What have we told you about that...  smiley-twist
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The solution you describe seems a bit contrived to me (redirecting log messages to a text file and then posting the text file to a web server). If you want to log the events, it would IMO be more sensible to log them as they occur.

Anyway, the writing-to-local-text-file could be done by redirecting all the serial output to a text file using any of the common serial clients such as PuTTY or RealTerm. If you're on Windows, you could also use GoBetwino to read and write to text files and execute arbitrary commands. Whatever platform you're on, you can write your own PC application to receive messages from the serial port and log them however you want. (Writing them directly to a database would IMO be the most sensible starting point.)

how should i write data directly to database?? i tried searching that but i didnt got any results so decided to post a text and opening that text file on server..
however i have thought to use ethernet shield and send data directly to server as i get from my Pn532
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The usual way is to use the ethernet shield to post the data to a web page, which then inserts the data into the database.  You can then write the database side in whatever favourite web programming language you like.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Czech Republic
Offline Offline
Sr. Member
****
Karma: 3
Posts: 311
Absolute Beginner, yet.
Newbie in Arduino
since May 2013
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

actually i want to write a txt file everytime my phone is ...
Before you write and debug your own program to capture serial data, you may try this little trick:

-close IDE or close Serial Monitor
-download the program named Termite, install and configure it to communicate with your Arduino (COM port and speed)
-check and double click to the Plug-in "LogFile" (put filename)

Now you will grab incoming data to logfile you specified.
Logged

Arduino Uno R3, Arduino Mega 2560 R3, Ethermega (R3), and some Ethernet Shields (R3), Chronodots, TMP36 sensors, DS18B20 sensors, LCDs/TFTs, RS232C to learn and play...

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12534
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

how should i write data directly to database??

The options depend on what type of connection you have between the Arduino and the host where the database runs. They also depend what operating system that host runs.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: [1]   Go Up
Jump to: