My watchdog is a very simple minded one - it regularly (once per minute using cron) searches /var/log/messages for USB messages. If it detects some the raspi will be automatically rebooted.
Sadly currently I've no access to my scripts - drop me a note if you still need it. Then I'll look into that ... To be honest I do not know why my USB problems were solved. But besides updating involved software versions, I also started new services (e.g. Kodi), added an USB diskdrive, and a USB rs232 interface. For that I changed the USB ports (to avoid cable cluttering:-). Maybe your problem is simply solved by using another USB port? Or improving contacts by unplug/plugging? Regards, Michael Michael Waldor schrieb am Dienstag, 9. Februar 2021 um 10:34:06 UTC+1: > In the meantime all my problems seem to be resolved - probabely due to > recent software updates: > > 1. No longer any USB problem after upgrading to recent raspbian (buster > 5.4.72-v7+). > Previously, I encountered USB problems after some weeks. To detect them I > wrote a simple watchdog and rebooted my raspberry automatically. After > reboot USB always did recover. Additionally I did a reboot once per day. > Now these problems are gone, and my raspberry is up since 38 days (the > day when I did the upgrade onto buster). > > 2. I've updated to weewx 4.x based with python 3. > Beware, to use python 3 you have to use ANOTHER repository (see the > corresponding weewx documentation). If you don't switch the repository you > will stay with python 2. AND you must use special releases of the wh23xx > driver (NOT the official one, it's still at pyhton 2 as far as I know) and > for forecast. > > Concluding: After all these changes all my problems with that kind of > weather station are gone. Maybe one exception: If there is very heavy rain, > the base station will loose its contact with the sensor array despite the > short distance (only some meters). But of course that's not a weewx problem. > > I even use the same raspberry to run FHEM smart home and kodi multimedia. > holger...@gmail.com schrieb am Montag, 8. Februar 2021 um 17:53:00 UTC+1: > >> Hi there, >> >> same thing here. >> >> >> - WH2315 (Renkforce from Conrad) >> - RaspberryPi 3B >> - weewx 4.3.0 >> - Python 3.7 >> - SofaskinCW9009 >> - driver: wh23xx (EdwinGH fork) >> >> I'm also experiencing data gaps / lockups at random intervals (> once per >> day). I suspected RFI -> put RF chokes on all cables to an from the pi >> (snap ferrites and ferrite rings), shielded the USB cable with aluminum >> foil: problem persists. >> >> Of course I also changed the batteries in the outdoor unit: problem >> pesists. >> >> Here's the log: >> >> Feb 8 17:39:31 raspberrypi weewx[623] INFO weewx.cheetahgenerator: >> Generated 8 files for report SeasonsReport in 1.85 seconds >> Feb 8 17:39:31 raspberrypi weewx[623] DEBUG weewx.manager: Daily summary >> version is 3.0 >> Feb 8 17:39:33 raspberrypi weewx[623] INFO weewx.imagegenerator: >> Generated 15 images for report SeasonsReport in 1.66 seconds >> Feb 8 17:39:33 raspberrypi weewx[623] INFO weewx.reportengine: Copied 0 >> files to /var/www/html >> Feb 8 17:39:33 raspberrypi weewx[623] DEBUG weewx.reportengine: Running >> report 'SmartphoneReport' >> Feb 8 17:39:33 raspberrypi weewx[623] DEBUG weewx.reportengine: Found >> configuration file /etc/weewx/skins/Smartphone/skin.conf for report >> 'SmartphoneReport' >> Feb 8 17:39:33 raspberrypi weewx[623] DEBUG weewx.cheetahgenerator: >> Using search list ['weewx.cheetahgenerator.Almanac', >> 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', >> 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', >> 'weewx.cheetahgenerator.Extras'] >> Feb 8 17:39:33 raspberrypi weewx[623] DEBUG weewx.manager: Daily summary >> version is 3.0 >> Feb 8 17:39:33 raspberrypi weewx[623] INFO weewx.cheetahgenerator: >> Generated 6 files for report SmartphoneReport in 0.11 seconds >> Feb 8 17:39:33 raspberrypi weewx[623] DEBUG weewx.manager: Daily summary >> version is 3.0 >> Feb 8 17:39:33 raspberrypi weewx[623] INFO weewx.imagegenerator: >> Generated 6 images for report SmartphoneReport in 0.61 seconds >> Feb 8 17:39:33 raspberrypi weewx[623] INFO weewx.reportengine: Copied 0 >> files to /var/www/html/weewx/smartphone >> Feb 8 17:39:33 raspberrypi weewx[623] DEBUG weewx.reportengine: Running >> report 'MobileReport' >> Feb 8 17:39:34 raspberrypi weewx[623] DEBUG weewx.reportengine: Found >> configuration file /etc/weewx/skins/Mobile/skin.conf for report >> 'MobileReport' >> Feb 8 17:39:34 raspberrypi weewx[623] DEBUG weewx.cheetahgenerator: >> Using search list ['weewx.cheetahgenerator.Almanac', >> 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', >> 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', >> 'weewx.cheetahgenerator.Extras'] >> Feb 8 17:39:34 raspberrypi weewx[623] DEBUG weewx.manager: Daily summary >> version is 3.0 >> Feb 8 17:39:34 raspberrypi weewx[623] INFO weewx.cheetahgenerator: >> Generated 1 files for report MobileReport in 0.05 seconds >> Feb 8 17:39:34 raspberrypi weewx[623] DEBUG weewx.manager: Daily summary >> version is 3.0 >> Feb 8 17:39:34 raspberrypi weewx[623] INFO weewx.imagegenerator: >> Generated 4 images for report MobileReport in 0.46 seconds >> Feb 8 17:39:34 raspberrypi weewx[623] INFO weewx.reportengine: Copied 0 >> files to /var/www/html/weewx/mobile >> Feb 8 17:39:34 raspberrypi weewx[623] DEBUG weewx.reportengine: Running >> report 'StandardReport' >> Feb 8 17:39:34 raspberrypi weewx[623] DEBUG weewx.reportengine: Found >> configuration file /etc/weewx/skins/SofaCW/skin.conf for report >> 'StandardReport' >> Feb 8 17:39:34 raspberrypi weewx[623] DEBUG weewx.cheetahgenerator: >> Using search list ['weewx.cheetahgenerator.Almanac', >> 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', >> 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', >> 'weewx.cheetahgenerator.Extras', 'user.historygenerator.MyXSearch'] >> Feb 8 17:39:34 raspberrypi weewx[623] DEBUG weewx.manager: Daily summary >> version is 3.0 >> Feb 8 17:39:34 raspberrypi /weewxd: historygenerator.py: No bootstrap >> specific labels found >> Feb 8 17:39:34 raspberrypi /weewxd: historygenerator.py: Generated 8 >> tables in 0.08 seconds >> Feb 8 17:39:36 raspberrypi weewx[623] INFO weewx.cheetahgenerator: >> Generated 10 files for report StandardReport in 1.52 seconds >> Feb 8 17:39:36 raspberrypi weewx[623] DEBUG weewx.manager: Daily summary >> version is 3.0 >> Feb 8 17:39:37 raspberrypi weewx[623] INFO weewx.imagegenerator: >> Generated 11 images for report StandardReport in 1.74 seconds >> Feb 8 17:39:37 raspberrypi weewx[623] INFO weewx.reportengine: Copied 0 >> files to /var/www/html >> Feb 8 17:39:37 raspberrypi weewx[623] DEBUG weewx.reportengine: Report >> 'FTP' not enabled. Skipping. >> Feb 8 17:39:37 raspberrypi weewx[623] DEBUG weewx.reportengine: Report >> 'RSYNC' not enabled. Skipping. >> Feb 8 17:39:44 raspberrypi /weewxd: wh23xx: read_record: write: 02 02 04 >> 04 (len=4) >> Feb 8 17:39:44 raspberrypi /weewxd: wh23xx: read_record: buf: 01 35 01 >> a5 03 01 9a 04 01 a5 05 01 a5 06 33 07 5d 08 25 35 09 26 f9 0a 00 2d 0b 00 >> 00 0c 00 00 0e 00 00 00 00 10 00 00 00 2a 11 00 00 00 2a 12 00 00 01 14 13 >> 00 00 00 01 14 13 00 00 (len=61) >> *Feb 8 17:39:44 raspberrypi /weewxd: wh23xx: get_current: failed attempt >> 1 of 5: read_record: missing READ_RECORD: 0x01 != 0x04* >> Feb 8 17:39:54 raspberrypi /weewxd: wh23xx: read_record: write: 02 02 04 >> 04 (len=4) >> Feb 8 17:39:54 raspberrypi /weewxd: wh23xx: read_record: buf: 01 12 02 >> 82 14 00 00 02 82 15 00 00 00 00 16 00 00 17 00 e1 09 26 f9 0a 00 2d 0b 00 >> 00 0c 00 00 0e 00 00 00 00 10 00 00 00 2a 11 00 00 00 2a 12 00 00 01 14 13 >> 00 00 00 01 14 13 00 00 (len=61) >> *Feb 8 17:39:54 raspberrypi /weewxd: wh23xx: get_current: failed attempt >> 2 of 5: read_record: missing READ_RECORD: 0x02 != 0x04* >> Feb 8 17:40:04 raspberrypi /weewxd: wh23xx: read_record: write: 02 02 04 >> 04 (len=4) >> Feb 8 17:40:04 raspberrypi /weewxd: wh23xx: read_record: buf: 01 4d 04 >> 4a 01 02 65 02 01 a5 03 01 9a 04 01 a5 05 01 a5 06 33 07 5d 08 25 35 09 26 >> f9 0a 00 2d 0b 00 00 0c 00 00 0e 00 00 00 00 10 00 00 00 2a 11 00 00 00 2a >> 12 00 00 01 14 13 00 00 (len=61) >> Feb 8 17:40:04 raspberrypi /weewxd: wh23xx: read_record: record_size: 74 >> Feb 8 17:40:04 raspberrypi /weewxd: wh23xx: read_record: buf: 01 4d 04 >> 4a 01 02 65 02 01 a5 03 01 9a 04 01 a5 05 01 a5 06 33 07 5d 08 25 35 09 26 >> f9 0a 00 2d 0b 00 00 0c 00 00 0e 00 00 00 00 10 00 00 00 2a 11 00 00 00 2a >> 12 00 00 01 14 13 00 00 (len=61) >> Feb 8 17:40:04 raspberrypi /weewxd: wh23xx: read_record: rbuf: 01 02 65 >> 02 01 a5 03 01 9a 04 01 a5 05 01 a5 06 33 07 5d 08 25 35 09 26 f9 0a 00 2d >> 0b 00 00 0c 00 00 0e 00 00 00 00 10 00 00 00 2a 11 00 00 00 2a 12 00 00 01 >> 14 13 00 00 04 4a 01 02 65 02 01 a5 03 01 9a 04 01 a5 05 01 a5 (len=74) >> chksum_pkt=06 chksum=0xd4 >> Feb 8 17:40:04 raspberrypi /weewxd: wh23xx: read_record: checksum >> mismatch: 0x06 != 0xd4 (01 02 65 02 01 a5 03 01 9a 04 01 a5 05 01 a5 06 33 >> 07 5d 08 25 35 09 26 f9 0a 00 2d 0b 00 00 0c 00 00 0e 00 00 00 00 10 00 00 >> 00 2a 11 00 00 00 2a 12 00 00 01 14 13 00 00 04 4a 01 02 65 02 01 a5 03 01 >> 9a 04 01 a5 05 01 a5 (len=74)) >> *Feb 8 17:40:04 raspberrypi /weewxd: wh23xx: get_current: failed attempt >> 3 of 5: read_record: checksum mismatch: 06 != d4* >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: read_record: write: 02 02 04 >> 04 (len=4) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: read_record: buf: 01 3b 04 >> 4a 01 02 64 02 01 a5 03 01 9a 04 01 a5 05 01 a5 06 33 07 5d 08 25 37 09 26 >> fb 0a 00 2d 0b 00 00 0c 00 00 0e 00 00 00 00 10 00 00 00 2a 11 00 00 00 2a >> 12 00 00 01 14 13 00 00 (len=61) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: read_record: record_size: 74 >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: read_record: buf: 01 12 02 >> 82 14 00 00 02 82 15 00 00 00 00 16 00 00 17 00 e4 33 07 5d 08 25 37 09 26 >> fb 0a 00 2d 0b 00 00 0c 00 00 0e 00 00 00 00 10 00 00 00 2a 11 00 00 00 2a >> 12 00 00 01 14 13 00 00 (len=61) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: read_record: rbuf: 01 02 64 >> 02 01 a5 03 01 9a 04 01 a5 05 01 a5 06 33 07 5d 08 25 37 09 26 fb 0a 00 2d >> 0b 00 00 0c 00 00 0e 00 00 00 00 10 00 00 00 2a 11 00 00 00 2a 12 00 00 01 >> 14 13 00 00 02 82 14 00 00 02 82 15 00 00 00 00 16 00 00 17 00 (len=74) >> chksum_pkt=e4 chksum=0xe4 >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: raw data: [1, 2, 100, 2, 1, >> 165, 3, 1, 154, 4, 1, 165, 5, 1, 165, 6, 51, 7, 93, 8, 37, 55, 9, 38, 251, >> 10, 0, 45, 11, 0, 0, 12, 0, 0, 14, 0, 0, 0, 0, 16, 0, 0, 0, 42, 17, 0, 0, >> 0, 42, 18, 0, 0, 1, 20, 19, 0, 0, 2, 130, 20, 0, 0, 2, 130, 21, 0, 0, 0, 0, >> 22, 0, 0, 23, 0] >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: in_temp: {'value': >> 21.200000000000003} (0x01 0x01) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: out_temp: {'value': >> 2.1000000000000014} (0x02 0x02) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: dewpoint: {'value': 1.0} >> (0x03 0x03) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: windchill: {'value': >> 2.1000000000000014} (0x04 0x04) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: heatindex: {'value': >> 2.1000000000000014} (0x05 0x05) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: in_humidity: {'value': 51} >> (0x06 0x06) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: out_humidity: {'value': 93} >> (0x07 0x07) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: abs_baro: {'value': 952.7} >> (0x08 0x08) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: rel_baro: {'value': 997.9} >> (0x09 0x09) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: wind_dir: {'value': 45} >> (0x0a 0x0a) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: wind_speed: {'value': 0.0} >> (0x0b 0x0b) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: gust_speed: {'value': 0.0} >> (0x0c 0x0c) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: rain_rate: {'value': 0.0} >> (0x0e 0x0e) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: rain_day: {'value': 4.2} >> (0x10 0x10) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: rain_week: {'value': 4.2} >> (0x11 0x11) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: rain_month: {'value': 27.6} >> (0x12 0x12) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: rain_year: {'value': 64.2} >> (0x13 0x13) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: rain_totals: {'value': 64.2} >> (0x14 0x14) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: light: {'value': 0.0} (0x15 >> 0x15) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: uv: {'value': 0} (0x16 0x16) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: uvi: {'value': 0} (0x17 0x17) >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: decoded data: {'in_temp': >> {'value': 21.200000000000003}, 'out_temp': {'value': 2.1000000000000014}, >> 'dewpoint': {'value': 1.0}, 'windchill': {'value': 2.1000000000000014}, >> 'heatindex': {'value': 2.1000000000000014}, 'in_humidity': {'value': 51}, >> 'out_humidity': {'value': 93}, 'abs_baro': {'value': 952.7}, 'rel_baro': >> {'value': 997.9}, 'wind_dir': {'value': 45}, 'wind_speed': {'value': 0.0}, >> 'gust_speed': {'value': 0.0}, 'rain_rate': {'value': 0.0}, 'rain_day': >> {'value': 4.2}, 'rain_week': {'value': 4.2}, 'rain_month': {'value': 27.6}, >> 'rain_year': {'value': 64.2}, 'rain_totals': {'value': 64.2}, 'light': >> {'value': 0.0}, 'uv': {'value': 0}, 'uvi': {'value': 0}} >> Feb 8 17:40:14 raspberrypi /weewxd: wh23xx: packet: {'dateTime': >> 1612802415, 'usUnits': 17, 'windDir': 45, 'windSpeed': 0.0, 'windGust': >> 0.0, 'inHumidity': 51, 'outHumidity': 93, 'inTemp': 21.200000000000003, >> 'outTemp': 2.1000000000000014, 'pressure': 952.7, 'luminosity': 0.0, >> 'uv_raw': 0, 'UV': 0, 'rain': 0.0, 'radiation': 0.0} >> Feb 8 17:40:14 raspberrypi weewx[623] INFO weewx.manager: Added record >> 2021-02-08 17:40:00 CET (1612802400) to database 'weewx.sdb' >> Feb 8 17:40:14 raspberrypi weewx[623] INFO weewx.manager: Added record >> 2021-02-08 17:40:00 CET (1612802400) to daily summary in 'weewx.sdb' >> Feb 8 17:40:15 raspberrypi weewx[623] DEBUG weewx.restx: >> StationRegistry: wait interval (3060 < 604800) has not passed for record >> 2021-02-08 17:40:00 CET (1612802400) >> Feb 8 17:40:15 raspberrypi weewx[623] DEBUG weewx.reportengine: Running >> reports for latest time in the database. >> Feb 8 17:40:15 raspberrypi /weewxd: wh23xx: read_record: write: 02 02 04 >> 04 (len=4) >> Feb 8 17:40:15 raspberrypi weewx[623] DEBUG weewx.reportengine: Running >> report 'SeasonsReport' >> Feb 8 17:40:15 raspberrypi /weewxd: wh23xx: read_record: buf: 01 3b 04 >> 4a 01 02 64 02 01 a5 03 01 9a 04 01 a5 05 01 a5 06 33 07 5d 08 25 37 09 26 >> fb 0a 00 2d 0b 00 00 0c 00 00 0e 00 00 00 00 10 00 00 00 2a 11 00 00 00 2a >> 12 00 00 01 14 13 00 00 (len=61) >> Feb 8 17:40:15 raspberrypi /weewxd: wh23xx: read_record: record_size: 74 >> Feb 8 17:40:15 raspberrypi weewx[623] DEBUG weewx.reportengine: Found >> configuration file /etc/weewx/skins/Seasons/skin.conf for report >> 'SeasonsReport' >> >> I noticed that whenever get_current fails 5 times there's also no data on >> my indoor unit. Does that mean that there is a problem with the USB >> communication between weewx and the WH2315? I'm no programmer and don't >> have a clue what the lines in the syslog mean. I hope anyone of you out >> there can make sense of that. >> >> Thanks! >> Holger >> >> >> Michael Waldor schrieb am Samstag, 31. März 2018 um 10:33:04 UTC+2: >> >>> Now I have tried two things: >>> >>> 1. I have moved the sensor array from balcony into the garden. Now there >>> are no longer gaps in the data. >>> >>> 2. I have tried to use the power supply for my raspberry to also feed >>> the base station. This worked for half a day - but in the early morning USB >>> connection between base station and Raspy died completely. Thus I conclude >>> that either my power supply is too weak, or there are some spikes on the >>> power net which might have disturbed the base station. But only the USB >>> connection has died, the weather station itself worked smoothly including >>> logging of data. >>> Thus I have withdrawn my idea to use the power supply for the base >>> station, too. >>> >> -- 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/8630d114-4dc4-45c1-9e38-b9cd0ed7830an%40googlegroups.com.