BobAtchley / weewx-ws6in1

weewx driver for the 6 in 1 PC weather station clones
GNU General Public License v3.0
5 stars 6 forks source link

CRITICAL user.ws6in1: genLoopPackets::IOError critical (too many timeouts): [Errno 5] Input/Output Error #14

Closed ralphhughes closed 8 months ago

ralphhughes commented 1 year ago

Hi, thanks so much for writing this driver, I'm using it with a Bresser 7002571 weather station I got for Christmas. The console part of the weather station is plugged in via USB to a 32-bit x86 "fitPC" fanless mini-PC running Ubuntu 18.04 server that is on 24/7.

I noticed today weewx had crashed. /var/log/syslog shows:

Jan 1 16:00:14 fitpc2i-1 weewx[9165] WARNING user.ws6in1: genLoopPackets: bad CRC Jan 1 16:00:27 fitpc2i-1 weewx[9165] INFO weewx.manager: Added record 2023-01-01 16:00:00 GMT (1672588800) to database 'weewx.sdb' Jan 1 16:00:27 fitpc2i-1 weewx[9165] INFO weewx.manager: Added record 2023-01-01 16:00:00 GMT (1672588800) to daily summary in 'weewx.sdb' Jan 1 16:00:27 fitpc2i-1 weewx[9165] INFO weewx.restx: Wunderground-PWS: Published record 2023-01-01 16:00:00 GMT (1672588800) Jan 1 16:00:31 fitpc2i-1 weewx[9165] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 4.32 seconds Jan 1 16:00:38 fitpc2i-1 weewx[9165] INFO weewx.imagegenerator: Generated 20 images for report SeasonsReport in 6.46 seconds Jan 1 16:00:38 fitpc2i-1 weewx[9165] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html Jan 1 16:00:41 fitpc2i-1 weewx[9165] INFO weewx.cheetahgenerator: Generated 11 files for report Belchertown in 3.43 seconds Jan 1 16:00:41 fitpc2i-1 weewx[9165] INFO weewx.reportengine: Copied 2 files to /home/weewx/public_html/belchertown Jan 1 16:00:44 fitpc2i-1 weewx[9165] INFO user.stackedwindrose: Generated 1 images for StackedWindRose in 0.15 seconds Jan 1 16:04:05 fitpc2i-1 weewx[9165] ERROR user.ws6in1: genLoopPackets::IOError error: [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] ERROR user.ws6in1: genLoopPackets::timeout on read as well: [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] ERROR user.ws6in1: genLoopPackets::IOError error: [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] ERROR user.ws6in1: genLoopPackets::timeout on read as well: [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] ERROR user.ws6in1: genLoopPackets::IOError error: [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] ERROR user.ws6in1: genLoopPackets::timeout on read as well: [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] ERROR user.ws6in1: genLoopPackets::IOError error: [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] ERROR user.ws6in1: genLoopPackets::timeout on read as well: [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] ERROR user.ws6in1: genLoopPackets::IOError error: [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] ERROR user.ws6in1: genLoopPackets::timeout on read as well: [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] ERROR user.ws6in1: genLoopPackets::IOError error: [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] CRITICAL user.ws6in1: genLoopPackets::IOError critical (too many timeouts): [Errno 5] Input/Output Error Jan 1 16:04:05 fitpc2i-1 weewx[9165] INFO weewx.engine: Main loop exiting. Shutting engine down. Jan 1 16:04:05 fitpc2i-1 weewx[9165] INFO weewx.engine: Shutting down StdReport thread

Any idea where I should start with debugging this? I know a bit of Java but I'm new to weewx & python

BobAtchley commented 1 year ago

This is caused when the WS6in1 driver fails to communicate with the weatherstation - from memory it is allowed 6 timeouts after which it assumes communication is broken. I saw the same error recently on my system. I'm using systemd which automatically restarts weewx after a 1 minute delay, and no problem on recovery. If this error is repeatable for you it might be worth swapping the usb cable to see if that makes a difference. I'll revisit the code and see if I can improve the robustness. I've not had any other reports of this problem.

ralphhughes commented 1 year ago

Thanks for the tips on what to investigate. Tried a different USB cable and problem got worse to the point weather station didn't show up in lsusb anymore so defo cable related. Took your advice on using systemd service to auto-restart weewx if it crashes. $ cat /var/log/syslog | grep "bad CRC" shows 58 occurrences in the past 24 hours for me. Wondering if a powered USB hub might help as I'm also powering the console over the USB cable from the host?

BobAtchley commented 1 year ago

I use a powered usb hub which works well for my use (raspberryPi and Console) the "bad CRC" is a warning only and means a message was received with an invalid checksum. These occur intermittently and can be ignored (usually the console has sent an incomplete message).