I am working with a B210 USRP from Ettus Research and for some reason it keeps dropping GPS lock. I would like to periodically poll the GPS lock status and save it to a file while running.
The basic design was generated in gnuradio-companion where the USRP source block is tied to a File Sink block. From there, the python was modified to check the GPS lock from the GPSDO looping on self.usrp.get_mboard_sensor("gps_locked",0).to_bool()
in the __init__()
function.
I've added the function below to the class to read GPS data so that I can access it from another process.
def getGPS(self,gps_field):
return self.usrp.get_mboard_sensor(gps_field,0).value
When I call the above function from another process, it works the first time through but then produces the following error:
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "./experiment.py", line 291, in monitorGPS
locked = tb.getGPS('gps_locked')
File "./experiment.py", line 158, in getGPS
return self.usrp.get_mboard_sensor(gps_field,0).value
File "/usr/local/lib/python2.7/dist-packages/gnuradio/uhd/uhd_swig.py", line 3493, in get_mboard_sensor
return _uhd_swig.usrp_sink_sptr_get_mboard_sensor(self, name, mboard)
RuntimeError: ValueError: locked(): unable to determine GPS lock status
Is it possible to access GPS information while running a data collect and if so, where am I going wrong here?
-Edit- It turns out that using threading rather than multiprocessing allows me to access GPS information without error. I would still like to know if there is a better way of going about this.