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!
#5
If I understand correctly, the frequency (100hz) is for the data measure, wich should be different from the frequency used for the data transmission. Very often, the data sensors manage their data for sending it by blocks, once time they have some, and not as soon as they get it. Your transmission is 9600 bauds, that means arround 1000 chars by second, wich is ten times quicker than 100hz ; it's probably why you get gaps between blocks, and the only way to improve it could be to set up a higher frequency (900 hz could be good), but is it possible ? Can you tell us what is your device ? It's needed in order to tell you more.
Anyway, it's very few data, even if your computer is very slow. For instance, the smaller raspberrypi is widely enough to get all, and write it down in a file.
You can use multithread if you like to produce an excellent and sophisticated job, but I believe it's not mandatory in that case. Just start a process with a very simple and strong script, writing in a file as you did. You can change 'w' in 'a' (for append), which will keep the existing data. From time to time, close the file and open a new one. Start a second process with the processing part. This one will have all time to manage as he wants, and for instance clean up the old files. Tell us what computer you use, but I'm pretty sure I don't know any computer or micro-controller too much slow to manage all of that. The 10$ raspberrypi will be a rolls-royce ; I remember having used it for a RFID reader, getting a lot of data, and it was ok.
Nice job, anyway, this kind of stuff is allways fun...
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 jeanMichelBain - Dec-11-2018, 08:43 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 3,878 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,788 Feb-21-2022, 10:52 AM
Last Post: Gribouillis
  Reading UDP from external device without device software ikdemartijn 2 3,391 Dec-03-2019, 04:29 PM
Last Post: Larz60+
  Display device details i.e connected with more than one device shintonp 6 5,302 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