I am having problems with the sdr driver as a result of having a page with 
many queries that causes after a few hours when weewx writes in the 
database it gives the database is locked error. 
I also don't understand why weewx doesn't wait for the query to finish 
before writing.
When this happens, weewx restart but the sdr driver is unable to boot 
because there is another process rtl_433 running and it gives the error 
usb_claim_interface error -6. 
The driver enters in a loop that does not come out until I stop weewx, kill 
the rtl_433 process and start weewx again
I think the problem is that the previous rtl_433 process was not killed.

Sep 16 00:06:03 raspberrypi weewx[21121]: manager: Added record 2019-09-16 
00:05:00 CEST (1568585100) to database 'weewx.sdb'
Sep 16 00:06:03 raspberrypi weewx[21121]: manager: Added record 2019-09-16 
00:05:00 CEST (1568585100) to daily summary in 'weewx.sdb'
Sep 16 00:06:08 raspberrypi weewx[21121]: engine: Main loop exiting. 
Shutting engine down.
Sep 16 00:06:08 raspberrypi weewx[21121]: engine: Shutting down StdReport 
thread
Sep 16 00:06:09 raspberrypi weewx[21121]: Belchertown Extension: 
Query:SELECT strftime("%m", datetime(dateTime, "unixepoch")) as month, 
IFNULL(sum(rain),0) as obs FROM archive WHERE dateTime >= 1420066800 AND 
dateTime <= 1451602800 GROUP BY month;
Sep 16 00:06:14 raspberrypi weewx[21121]: reportengine: Caught 
unrecoverable exception in generator 
'user.belchertown.HighchartsJsonGenerator'
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****  database is locked
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****  Traceback (most 
recent call last):
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****    File 
"/usr/share/weewx/weewx/reportengine.py", line 204, in run
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****      obj.start()
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****    File 
"/usr/share/weewx/weewx/reportengine.py", line 300, in start
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****      self.run()
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****    File 
"/usr/share/weewx/user/belchertown.py", line 1205, in run
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****      series_data = 
self._getObservationData(binding, archive, observation_type, minstamp, 
maxstamp, aggregate_type, aggregate_interval, time_length, xaxis_groupby, 
xaxis_categories, mirrored_value)
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****    File 
"/usr/share/weewx/user/belchertown.py", line 1592, in _getObservationData
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****      for row in 
query:
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****    File 
"/usr/share/weewx/weewx/manager.py", line 407, in genSql
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****      for _row in 
_cursor.execute(sql, sqlargs):
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****    File 
"/usr/share/weewx/weedb/sqlite.py", line 43, in guarded_fn
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****      raise 
weedb.OperationalError(e)
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****  OperationalError: 
database is locked
Sep 16 00:06:14 raspberrypi weewx[21121]:         ****  Generator terminated
Sep 16 00:06:14 raspberrypi weewx[21121]: sdr: MainThread: shutdown process 
rtl_433 -q -F json -R 32 -M utc -f 868.3M
Sep 16 00:06:24 raspberrypi weewx[21121]: sdr: MainThread: timed out 
waiting for stdout-thread
Sep 16 00:06:34 raspberrypi weewx[21121]: sdr: MainThread: timed out 
waiting for stderr-thread
Sep 16 00:06:34 raspberrypi weewx[21121]: engine: Database OperationalError 
exception: database is locked
Sep 16 00:06:34 raspberrypi weewx[21121]:     ****  Waiting 2 minutes then 
retrying...
Sep 16 00:08:34 raspberrypi weewx[21121]: engine: retrying...
Sep 16 00:08:34 raspberrypi weewx[21121]: engine: Using configuration file 
/etc/weewx/weewx.conf
Sep 16 00:08:34 raspberrypi weewx[21121]: engine: Loading station type SDR 
(user.sdr)
Sep 16 00:08:34 raspberrypi weewx[21121]: sdr: MainThread: driver version 
is 0.64
Sep 16 00:08:34 raspberrypi weewx[21121]: sdr: MainThread: sensor map is 
{'windGust': 'wind_gust.*.FOWHx080Packet', 'windDir': 
'wind_dir.*.FOWHx080Packet', 'windSpeed': 'wind_speed.*.FOWHx080Packet', 
'outTemp': 'temperature.*.FOWHx080Packet', 'outHumidity': 
'humidity.*.FOWHx080Packet', 'rain_total': 'rain_total.*.FOWHx080Packet', 
'battery': 'battery.*.FOWHx080Packet'}
Sep 16 00:08:34 raspberrypi weewx[21121]: sdr: MainThread: deltas is 
{'rain': 'rain_total'}
Sep 16 00:08:34 raspberrypi weewx[21121]: sdr: MainThread: startup process 
'rtl_433 -q -F json -R 32 -M utc -f 868.3M'
...
...
Sep 16 00:08:35 raspberrypi weewx[21121]: engine: Starting main packet loop.
Sep 16 00:08:35 raspberrypi weewx[21121]: sdr: MainThread: err: ['rtl_433 
version unknown inputs file rtl_tcp RTL-SDR\n', 'Trying conf file at 
"rtl_433.conf"...\n', 'Trying conf file at 
"/root/.config/rtl_433/rtl_433.conf"...\n', 'Trying conf file at 
"/usr/local/etc/rtl_433/rtl_433.conf"...\n', 'Trying conf file at 
"/etc/rtl_433/rtl_433.conf"...\n', 'quiet option (-q) is default and 
deprecated. See -v to increase verbosity\n', '\n', '\tConsider using "-M 
newmodel" to transition to new model keys. This will become the default 
someday.\n', '\tA table of changes and discussion is at 
https://github.com/merbanan/rtl_433/pull/986.\n', '\n', 'Registered 1 out 
of 133 device decoding protocols [ 32 ]\n', *'usb_claim_interface error -6*
\n']
Sep 16 00:08:35 raspberrypi weewx[21121]: engine: Main loop exiting. 
Shutting engine down.
Sep 16 00:08:35 raspberrypi weewx[21121]: sdr: MainThread: shutdown process 
rtl_433 -q -F json -R 32 -M utc -f 868.3M
Sep 16 00:08:35 raspberrypi weewx[21121]: engine: Caught WeeWxIOError: 
rtl_433 process is not running
Sep 16 00:08:35 raspberrypi weewx[21121]:     ****  Waiting 60 seconds then 
retrying...
Sep 16 00:09:35 raspberrypi weewx[21121]: engine: retrying...
Sep 16 00:09:35 raspberrypi weewx[21121]: engine: Using configuration file 
/etc/weewx/weewx.conf
Sep 16 00:09:35 raspberrypi weewx[21121]: engine: Loading station type SDR 
(user.sdr)
Sep 16 00:09:35 raspberrypi weewx[21121]: sdr: MainThread: driver version 
is 0.64
Sep 16 00:09:35 raspberrypi weewx[21121]: sdr: MainThread: sensor map is 
{'windGust': 'wind_gust.*.FOWHx080Packet', 'windDir': 
'wind_dir.*.FOWHx080Packet', 'windSpeed': 'wind_speed.*.FOWHx080Packet', 
'outTemp': 'temperature.*.FOWHx080Packet', 'outHumidity': 
'humidity.*.FOWHx080Packet', 'rain_total': 'rain_total.*.FOWHx080Packet', 
'battery': 'battery.*.FOWHx080Packet'}
Sep 16 00:09:35 raspberrypi weewx[21121]: sdr: MainThread: deltas is 
{'rain': 'rain_total'}
Sep 16 00:09:35 raspberrypi weewx[21121]: sdr: MainThread: startup process 
'rtl_433 -q -F json -R 32 -M utc -f 868.3M'
...

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5795ad1c-25df-416c-8094-00aae73378b7%40googlegroups.com.

Reply via email to