Dec-11-2018, 08:43 PM
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...
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...