Pages: [1] 2   Go Down
Author Topic: Some help with Serial connection  (Read 2161 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 4
Posts: 218
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm looking for an understandable clear explanation of what goes on when a serial connection is opened.

I have a chip producing output on /dev/ttyusb4 and when I open a serial terminal there comes the data as expected. If I change the port to ttyUSB3 I will see the data coming from the mobile modem through which I connect.

Alex at insidegadgets.com used VUSB in his Standalone Voltage and Temperature Logger  and this works in such a way that when I have an application like a spreadsheet open the data comes into the spreadsheet automatically.

A site I posted recently uses a python module to prepare and receive serial data and that is sent to a web page .

So whats happening ? What can I do to put the serial data coming in into a spreadsheet automatically?
« Last Edit: September 13, 2012, 04:35:40 am by april » Logged

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

Quote
What can I do to put the serial data coming in into a spreadsheet automatically?
Write an application on the PC to do that.
Logged

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

An easy route would be to dump it to a comma separated text file - in other words, your microcontroller would print (without line feeds) a value, a comma, a value, a comma, etc, then println(",") to end that row with a comma.

The computer end - You can send that to hyperterminal and write the results to a .txt file, rename it to .csv and import it directly into excel. If you want it to be automated, take a look at Visual Basic 2010 - You should be able to piece together some sample code to write the serial directly to a .csv. You can open them with excel, but you have to open excel first, then open the file from within excel, and it will launch a wizard to import your data.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 19
Posts: 3114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
/dev/ttyusb4
Would suggest the OP is not using Windows, so
Quote
take a look at Visual Basic 2010
isn't going to work.

It's a pity Mikmo can't port Gobetwino to other platforms.
Logged

0
Offline Offline
Full Member
***
Karma: 4
Posts: 218
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Write an application on the PC to do that.
Are you EVER going to read the posts before your cynical responses?
Quote
I have a chip producing output on /dev/ttyusb4 and when I open a serial terminal there comes the data as expected.
You are getting less and less helpful so why post?
« Last Edit: September 13, 2012, 04:39:10 am by april » Logged

0
Offline Offline
Full Member
***
Karma: 4
Posts: 218
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You should be able to piece together some sample code to write the serial directly to a .csv. You can open them with excel, but you have to open excel first, then open the file from within excel, and it will launch a wizard to import your data.
If you go see the templogger page here:-http://www.insidegadgets.com/2012/08/13/standalone-temperaturevoltage-logger-updated-to-v1-1/
you will see that somehow whatever application you have open -spreadsheet , text write ,notepad etc when the button is pressed on the device which is plugged into the USB then data flows into the application?

He used to use  V-USB which I assume is a small program library included with his arduino code.Now he uses a "SATVLTransfer code which does the same thing. I do not understand how it gets into the applications automatically?
Yes I do not use Windows or any silly VB code
« Last Edit: September 13, 2012, 04:53:07 am by april » Logged

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

Quote
Are you EVER going to read the posts before your cynical responses?
I don't know what you are talking about, but I won't be responding to you anymore.
Logged

0
Offline Offline
Full Member
***
Karma: 4
Posts: 218
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Are you EVER going to read the posts before your cynical responses?
I don't know what you are talking about, but I won't be responding to you anymore.
Jeez I hope not
Logged

0
Offline Offline
Full Member
***
Karma: 4
Posts: 218
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the Python approach . A Server is started which serves the data received to a web page updating each second. See pic attached if I can get it there   http://NMEAScreens.jpg - 108 KB

That rapidshare is a pain
Here is a link to his site
http://www.holdentechnology.com/component/content/article/69-wifi-nmea-server-with-nook-display
« Last Edit: September 13, 2012, 12:07:15 pm by april » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24450
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote from: PaulS on 13-09-2012, 12:58:10
Quote
Are you EVER going to read the posts before your cynical responses?
I don't know what you are talking about, but I won't be responding to you anymore.
Jeez I hope not

Ladies, please - keep it civil.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
Full Member
***
Karma: 4
Posts: 218
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Look no swear words -you dont get more civil than that!
Logged

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

Now he uses a "SATVLTransfer code which does the same thing. I do not understand how it gets into the applications automatically?
Yes I do not use Windows or any silly VB code
[/quote]

Still not quite sure what you're asking, so pardon me if this is obvious - the serial characters come across the usb connection, and the satvltransfer.exe apparently receives them and saves them to a file. Is that the part you're asking about - save them to a file? I would assume they are just taking the data in whatever format it's coming over in, separating out the different variables, and formatting the data into a .csv format, and saving it to a file on your computer. If you're not familiar, .csv stands for comma separated values. You just write a text file that contains all of your data, separated by commas, with a newline character between rows. Rename it to .csv, and you can open it with open office or excel.

Example of the formatting...

139756,546.53,0.00,425,5,302,7,426,7,
139756,546.51,0.00,430,5,308,7,438,7,
139752,546.53,0.00,424,5,303,7,405,7,
139760,546.53,0.00,440,5,310,7,427,7,
119788,546.51,0.00,437,5,311,7,429,6,
139752,546.51,0.00,427,5,305,7,439,7,
139764,546.53,0.00,426,5,310,7,406,7,
139752,546.53,0.00,433,5,310,7,432,7,
139756,546.53,0.00,430,5,303,7,422,7,
Logged

0
Offline Offline
Full Member
***
Karma: 4
Posts: 218
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks
I understand all of the .cvs and file stuff OK . What I don't follow is he says "whatever application you have open when the device is plugged in and the send button pressed the data will transfer into it"

That .exe program obviously does that but I have asked him how and he has not revealed how.
The V-USB program was used in the previous SATVL project before this SATVLtransfer.exe and it did the same thing but this is what I am unable to pinpoint how at this stage.

So I'm thinking that there might be something obvious I am missing when it comes to putting data straight into applications -can you help at all?
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just skimmed through the announcement found here:

http://www.insidegadgets.com/2012/08/13/standalone-temperaturevoltage-logger-updated-to-v1-1/

which says, in the last lines:

Quote
It will generate a file name based on the current date and time and show you the data being transferred.

So I don't see the logger program injecting data directly into any app, just writing data into a file (like the csv approach others have told you about).

Maybe with Visual Basic one could write a serial-to-excel program that uses excel api to open a spreadsheet and control it (just guessing). Maybe Openoffice has some similar capability too (don't know OOo Basic that well, either).
Logged

0
Offline Offline
Full Member
***
Karma: 4
Posts: 218
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks - That's now using SATVLtransfer.exe which is what he uses now and unfortunately won't disclose any more about it except he got the idea from a friend. It writes to a file and I do not have that device.

I have the version before that on my device which writes direct to any application that is open when the device is plugged in. It uses a program called V-USB to do the transfer, which I have ,but the bit I am asking for detail of is the fact that it puts data into whatever application is open. I don't understand how it does that? I should state  it is all in the programming on the attiny45 chip that is supplied with the device
« Last Edit: September 19, 2012, 04:00:19 pm by april » Logged

Pages: [1] 2   Go Up
Jump to: