My Raspberry PI has stopped downloading information from my Maplin weather station. It's not been logging for a few days and ideally I don't want to reset the Weather Station as I lose the data. I have tried unplugging the usb cable and restarting the RPi to no avail. There are no raw data files for the missing days.
I've done some tests to see if it can still see the station, and running python -m pywws.TestWeatherStation produces a reasonable looking set of numbers.
If I run python -m pywws.LogData -vvv ~/weather/data I get the following:
21:37:40:pywws.WeatherStation.CUSBDrive:using pywws.device_pyusb
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/pywws/LogData.py", line 315, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/pywws/LogData.py", line 312, in main
DataStore.data_store(root_dir)).log_data(sync=sync, clear=clear)
File "/usr/local/lib/python2.7/dist-packages/pywws/LogData.py", line 96, in __init__
fixed_block = self.check_fixed_block()
File "/usr/local/lib/python2.7/dist-pack(unbuffered=True)
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 582, in get_fixed_block
self._fixed_block = self._read_fixed_block()
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 630, in _read_fixed_block
result += self._read_block(mempos)
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 618, in _read_block
new_block = self.cusb.read_block(ptr)
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 274, in read_block
return self.dev.read_data(32)
File "/usr/local/lib/python2.7/dist-packages/pywws/device_pyusb.py", line 157, in read_data
result = self.devh.interruptRead(0x81, size, 1200)
usb.USBError: could not claim interface 0: Device or resource busy
The log files show:
2014-03-22 06:30:13:pywws.weather_station:status {'unknown': 0, 'lost_connection': 0, 'rain_overflow': 0}
2014-03-24 22:00:11:pywws.weather_station:status {'unknown': 0, 'lost_connection': 0, 'rain_overflow': 0}
2014-03-24 22:00:16:pywws.weather_station:setting station clock 16.5845
2014-03-24 22:00:16:pywws.weather_station:live_data log synchronised
2014-03-25 07:00:13:pywws.weather_station:status {'unknown': 0, 'lost_connection': 0, 'rain_overflow': 0}
2014-03-25 07:00:16:pywws.weather_station:setting station clock 16.5421
2014-03-25 07:00:16:pywws.weather_station:live_data log synchronised
2014-03-25 19:30:56:pywws.weather_station:status {'unknown': 0, 'lost_connection': 0, 'rain_overflow': 0}
2014-03-25 19:42:56:pywws.LiveLog:error sending control message: Device or resource busy
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pywws/LiveLog.py", line 80, in LiveLog
logged_only=(not tasks.has_live_tasks())):
File "/usr/local/lib/python2.7/dist-packages/pywws/LogData.py", line 262, in live_data
for data, ptr, logged in self.ws.live_data(logged_only=logged_only):
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 397, in live_data
new_ptr = self.current_pos()
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 557, in current_pos
self._read_fixed_block(0x0020), self.lo_fix_format['current_pos'])
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 630, in _read_fixed_block
result += self._read_block(mempos)
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 618, in _read_block
new_block = self.cusb.read_block(ptr)
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 272, in read_block
if not self.dev.write_data(buf):
File "/usr/local/lib/python2.7/dist-packages/pywws/device_pyusb.py", line 179, in write_data
usb.REQ_SET_CONFIGURATION, buf, value=0x200, timeout=50)
USBError: error sending control message: Device or resource busy
2014-03-25 20:00:10:pywws.weather_station:status {'unknown': 0, 'lost_connection': 0, 'rain_overflow': 0}
2014-03-25 20:00:10:pywws.LiveLog:station is not logging data
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pywws/LiveLog.py", line 80, in LiveLog
logged_only=(not tasks.has_live_tasks())):
File "/usr/local/lib/python2.7/dist-packages/pywws/LogData.py", line 262, in live_data
for data, ptr, logged in self.ws.live_data(logged_only=logged_only):
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 495, in live_data
raise IOError('station is not logging data')
IOError: station is not logging data
2014-03-25 20:31:03:pywws.weather_station:status {'unknown': 0, 'lost_connection': 0, 'rain_overflow': 0}
2014-03-25 20:35:17:pywws.LiveLog:could not claim interface 0: Device or resource busy
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pywws/LiveLog.py", line 80, in LiveLog
logged_only=(not tasks.has_live_tasks())):
File "/usr/local/lib/python2.7/dist-packages/pywws/LogData.py", line 262, in live_data
for data, ptr, logged in self.ws.live_data(logged_only=logged_only):
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 397, in live_data
new_ptr = self.current_pos()
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 557, in current_pos
self._read_fixed_block(0x0020), self.lo_fix_format['current_pos'])
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 630, in _read_fixed_block
result += self._read_block(mempos)
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 618, in _read_block
new_block = self.cusb.read_block(ptr)
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 274, in read_block
return self.dev.read_data(32)
File "/usr/local/lib/python2.7/dist-packages/pywws/device_pyusb.py", line 157, in read_data
result = self.devh.interruptRead(0x81, size, 1200)
USBError: could not claim interface 0: Device or resource busy
Any help appreciated.