Python Forum
I need a serial device expert!
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need a serial device expert!
#2
First of all, I am writing as I am thinking, so take this as something to think about rather than verbatim.
One thing that I notice is your baud rate is 9600.
If the data is being sent at 100 Hz, then the baud rate is fast enough to capture everything.

You need to read up on several things.

I think that you need to have the read routine running all the time in a thread, filling a FIFO (First in, First Out) buffer continuously as it reads.

Then you need another thread that will take data from the FIFO in chunks and transfer to either a process that will analyze it in whatever fashion you need, or to write the data to files of a certain size (starting a new one whenever sizes bytes are read. The data appears to have a well structured format, and I'm guessing each item is terminated with a newline. If this is the case, files should contain only whole records.

Now you can label the files with timestamps so that you know what order to process them in.

Finally, you can have multiple threads running that process the data. This will allow you to stay ahead of the flow.

Something to think about.
Reply


Messages In This Thread
I need a serial device expert! - by Caesars_10th - Dec-05-2018, 12:04 AM
RE: I need a serial device expert! - by Larz60+ - Dec-05-2018, 12:51 AM
RE: I need a serial device expert! - by Larz60+ - Dec-11-2018, 08:07 PM
RE: I need a serial device expert! - by Larz60+ - Dec-14-2018, 02:58 AM
RE: I need a serial device expert! - by Larz60+ - Dec-14-2018, 12:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pyserial/serial "has no attribute 'Serial' " gowb0w 9 5,944 Aug-24-2023, 07:56 AM
Last Post: gowb0w
  How would you (as an python expert) make this code more efficient/simple coder_sw99 3 1,924 Feb-21-2022, 10:52 AM
Last Post: Gribouillis
  Reading UDP from external device without device software ikdemartijn 2 3,574 Dec-03-2019, 04:29 PM
Last Post: Larz60+
  Display device details i.e connected with more than one device shintonp 6 5,494 May-10-2017, 06:00 AM
Last Post: shintonp

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020