Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8946161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:26:22+00:00 2026-06-15T12:26:22+00:00

I am trying to slap together a Python data logger and am looking for

  • 0

I am trying to slap together a Python data logger and am looking for some advice. Here is my situation.
I don’t want any user intervention. Just plug in and record. So far I am using the PySerial module and am able to record all serial data to a text file just fine. I read one line, store in a variable, then write that variable to a file in append mode.

Now I would like to transmit this data to the web for graphing. Here is where my headache comes in. Should I try and send this to a SQL server or just to a text file? I am using a 3g module, but speeds/bandwidth are limited. Data is streaming to the logger at 1 sample every .25sec Here is an example:

1 324 23454 2342 0 233 0 0 12223 66453 443 33 33 20 0 0 0 0

So I don’t think I need to send EVERY sample, maybe just one line per second or every other second.

The logger will only run for about 5 days then all data will be recorded. Now my questions are, are there any recommendations on how/where I should send the data? SQL or Text file? And next, if I have this data online, is there an easy to way to plot this data in real-time while it is streaming?

And for the icing on the cake, sometimes the raw data will be space delimited, sometimes tab delimited, and sometimes comma delimited.

Any input would be appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:26:23+00:00Added an answer on June 15, 2026 at 12:26 pm

    Ok so you have a bunch of questions/issues here. I will try and address each of them:

    Database

    keep each line in a table in a database. It will make your life much easier. I recommend use something that can handle big loads like MySQL or Postgres. I could suggest the following table design. line is your data, uploaded is a flag which indicates whether or not this line has been uploaded to the server yet. line_date can record the exact date time that the reading was taken, that might be useful to capture. If your data lines are variable and you don’t want to set a fixed length change the varchar(200) to text. I recommend you keep this table on the client side and use the uploaded field as a flag to indicate whether or not this line has been uploaded to the server. That way you won’t have any data loss during any network connectivity issues, and you can keep track of which lines are still pending an upload. You can then have one script that just inserts lines, another script or thread that reads the list of not uploaded rows and uploads them every second or so. You can also have pretty much the same table design on the server for simplicity.

    CREATE TABLE data_lines (
        id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
        line VARCHAR(200),
        uploaded INT,
        line_date DATETIME
    );
    

    Parsing lines

    You mentioned the raw data will be space delimited, sometimes tab delimited, and sometimes comma delimited. This simple line of code can handle all those cases.

    >>> line = "1,2 3\t4"
    >>> print line.replace(',', ' ').split()
    ['1', '2', '3', '4']
    

    Real-Time graphs

    Flot is the way to go. They do really great web-based real time graphs. you can see an example of one here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to find some information on this but am unable to get any results
So I'm playing around with Jython, trying to slap together a generic GUI. Nothing
I'm trying to convert some data from long to wide using the reshape2 package,
Trying to copy the msdn refernce here doesn't work and gives an error I
Trying to get a wildcard search to pick up on any text in org_name
Trying to setup an SSH server on Windows Server 2003. What are some good
Trying to find some simple SQL Server PIVOT examples. Most of the examples that
Trying to install py-bcrypt on win7. Python is 64bit. First error unable to find
Trying to display a message if no results found in the search query. Here
I'm trying to rehost the designer, but every time I slap a workflow into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.