Go Down

Topic: Some help with Serial connection (Read 2609 times) previous topic - next topic

april

Sep 12, 2012, 11:51 am Last Edit: Sep 13, 2012, 11:35 am by april Reason: 1
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?

PaulS

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.

andTo86

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.

dxw00d

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.

april

#4
Sep 13, 2012, 11:34 am Last Edit: Sep 13, 2012, 11:39 am by april Reason: 1

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?

april

#5
Sep 13, 2012, 11:46 am Last Edit: Sep 13, 2012, 11:53 am by april Reason: 1
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

PaulS

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.

april


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

april

#8
Sep 13, 2012, 06:49 pm Last Edit: Sep 13, 2012, 07:07 pm by april Reason: 1
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

AWOL

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.
"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.

april

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

andTo86

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,

april

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?

tuxduino

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).

april

#14
Sep 19, 2012, 10:53 pm Last Edit: Sep 19, 2012, 11:00 pm by april Reason: 1
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

Go Up