raspishake / rsudp

Continuous visual display, sudden motion monitoring, and historical replay of Raspberry Shake data
https://raspishake.github.io/rsudp/
GNU General Public License v3.0
55 stars 32 forks source link

Data not saving in the output directory, even when enabled true in the json file. #23

Closed navneetercse closed 2 years ago

navneetercse commented 3 years ago

There is an issue with the output data (MINseed). I have tried with two linux machines and I was facing the same issue that the data was not being written in the output directory. When backtracked the issue, I found following errors File "/home/navneet/miniconda3/envs/rsudp/lib/python3.7/site-packages/rsudp/c_write.py", line 126, in write outfile = self.outdir + test TypeError: unsupported operand type(s) for +: 'bool' and 'str'

On further debugging I found that the outdir has been intialized to data_dir and data_dir has been initialized with a boolean value False. When the c_write.py is accessing these global variables initialized in init.py , it is getting the default value rather than the updated value and that is where the issue arises. I think most probably this a multithreading issue and these variables needs to be made thread safe.

To resolve this I manually initialized the variables to my output directory in the init.py file. Somewhat like this ->

output_dir = "/home/navneet/rsudp" odir = output_dir data_dir = os.path.join(odir, 'data') scap_dir = os.path.join(odir, 'screenshots')

#output_dir = False #data_dir = False #scap_dir = False

and then it started saving the files. Please fix this bug, it is specifically for the linux machines running Linux 5.4.0-81-generic x86_64 kernel

iannesbitt commented 2 years ago

Hi @navneetercse, thanks for reporting this issue. This issue should be fixed in this commit. If you install from master after this merge, you should no longer experience this problem. Let me know if otherwise. Thanks again.