Prevent two observations running in parallel
Hi,
I've seen a few instances where one observation doesn't stop, another one starts and is unable to lock the SDR so outputs a blank waterfall, and eventually the first instance fills up the /tmp/ file system. Please could you add a check when starting a new observation to kill any existing observation tasks? This may be something to do with the large amount of obs I'm putting through my station - 85-95 a day.
Also there is the error on line 142 of /var/lib/satnogs/local/lib/python2.7/site-packages/satnogsclient/observer/worker.py where it looks like a rebind to an existing socket. Apparently something like self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) can fix this, but i'm not a python expert.
Thanks and Regards,
Paul Station 91
Aug 08 16:14:27 satnogs satnogs-client[523]: Using device #0 Realtek RTL2838UHIDIR SN: 00000013
Aug 08 16:14:27 satnogs satnogs-client[523]: Using 32 buffers of size 16384.
Aug 08 16:14:27 satnogs satnogs-client[523]: Found Rafael Micro R820T tuner
Aug 08 16:14:27 satnogs satnogs-client[523]: [R82XX] PLL not locked!
Aug 08 16:14:27 satnogs satnogs-client[523]: Exact sample rate is: 1000000.026491 Hz
Aug 08 16:14:27 satnogs satnogs-client[523]: [R82XX] PLL not locked!
Aug 08 16:24:04 satnogs satnogs-client[523]: 2018-08-08 16:24:04,127 - satnogsclient - INFO - Closing socket: <socket._socketobject object at 0x6cee7570>
Aug 08 16:24:07 satnogs satnogs-client[523]: 2018-08-08 16:24:07,391 - satnogsclient - INFO - Closing socket: <socket._socketobject object at 0x6cee7c70>
Aug 08 16:26:25 satnogs satnogs-client[523]: linux; GNU C++ version 6.2.0 20161010; Boost_106100; UHD_003.009.005-0-unknown
Aug 08 16:26:25 satnogs satnogs-client[523]: linux; GNU C++ version 6.2.0 20161010; Boost_106100; UHD_003.009.005-0-unknown
Aug 08 16:26:25 satnogs satnogs-client[523]: Exception in thread Thread-42:
Aug 08 16:26:25 satnogs satnogs-client[523]: Traceback (most recent call last):
Aug 08 16:26:25 satnogs satnogs-client[523]: File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
Aug 08 16:26:25 satnogs satnogs-client[523]: self.run()
Aug 08 16:26:25 satnogs satnogs-client[523]: File "/usr/lib/python2.7/threading.py", line 754, in run
Aug 08 16:26:25 satnogs satnogs-client[523]: self.__target(*self.__args, **self.__kwargs)
Aug 08 16:26:25 satnogs satnogs-client[523]: File "/var/lib/satnogs/local/lib/python2.7/site-packages/satnogsclient/observer/worker.py", line 142, in _status_interface
Aug 08 16:26:25 satnogs satnogs-client[523]: sock.bind()
Aug 08 16:26:25 satnogs satnogs-client[523]: File "/var/lib/satnogs/local/lib/python2.7/site-packages/satnogsclient/observer/commsocket.py", line 104, in bind
Aug 08 16:26:25 satnogs satnogs-client[523]: self.s.bind((self._TCP_IP, self._TCP_PORT))
Aug 08 16:26:25 satnogs satnogs-client[523]: File "/usr/lib/python2.7/socket.py", line 228, in meth
Aug 08 16:26:25 satnogs satnogs-client[523]: return getattr(self._sock,name)(*args)
Aug 08 16:26:25 satnogs satnogs-client[523]: error: [Errno 98] Address already in use
Aug 08 16:26:25 satnogs satnogs-client[523]: linux; GNU C++ version 6.2.0 20161010; Boost_106100; UHD_003.009.005-0-unknown
Aug 08 16:26:25 satnogs satnogs-client[523]: linux; GNU C++ version 6.2.0 20161010; Boost_106100; UHD_003.009.005-0-unknown
Aug 08 16:26:26 satnogs satnogs-client[523]: gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.10
Aug 08 16:26:26 satnogs satnogs-client[523]: built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy soapy redpitaya
Aug 08 16:26:26 satnogs satnogs-client[523]: Using device #0 Realtek RTL2838UHIDIR SN: 00000013
Aug 08 16:26:26 satnogs satnogs-client[523]: Using 32 buffers of size 16384.
**Aug 08 16:26:26 satnogs satnogs-client[523]: usb_claim_interface error -6
Aug 08 16:26:26 satnogs satnogs-client[523]: FATAL: Failed to open rtlsdr device.**
Aug 08 16:26:26 satnogs satnogs-client[523]: Trying to fill up 1 missing channel(s) with null source(s).
Aug 08 16:26:26 satnogs satnogs-client[523]: This is being done to prevent the application from crashing
Aug 08 16:26:26 satnogs satnogs-client[523]: due to gnuradio bug #528.