Weewx dying randomly - IndexError: list index out of range

259 views
Skip to first unread message

David Rickard

unread,
Mar 17, 2014, 4:33:07 PM3/17/14
to weewx...@googlegroups.com
Hi,

I've got Weewx running on a Raspberry Pi:
Weewx Version: 2.6.2-1
Python Version: 2.7.3-4+deb7u1

# uname -a
Linux pinecone 3.10-3-rpi #1 Debian 3.10.11-1+rpi4 (2014-01-24) armv6l GNU/Linux

I'm running Raspbian 7, which admittedly is from a custom installer script, but all it does is install Raspbian in a bare-bones fashion, so it has no X11 or anything. It's pretty stripped down. My weather station is a Oregon Scientific WMR88, so I'm using the WMR100 driver.

It will run quite happily, pulling in data, and producing report files. However, very randomly weewx is crashing out. I've enabled the debug log and I see the following:

Mar 17 18:15:34 localhost weewx[1888]: genimages: Generated 12 images for StandardReport in 4.99 seconds
Mar 17 18:15:34 localhost weewx[1888]: reportengine: copied 0 files to /var/www
Mar 17 18:15:34 localhost weewx[1888]: reportengine: Running report FTP
Mar 17 18:15:34 localhost weewx[1888]: reportengine: Found configuration file /etc/weewx/skins/Ftp/skin.conf for report FTP
Mar 17 18:15:34 localhost weewx[1888]: reportengine: FTP upload not requested. Skipped.
Mar 17 18:15:34 localhost weewx[1888]: reportengine: Running report RSYNC
Mar 17 18:15:34 localhost weewx[1888]: reportengine: Found configuration file /etc/weewx/skins/Rsync/skin.conf for report RSYNC
Mar 17 18:15:34 localhost weewx[1888]: reportengine: rsync upload not requested. Skipped.
Mar 17 18:15:52 localhost weewx[1888]: wmr100: Bad USB report received.
Mar 17 18:15:52 localhost weewx[1888]: ***** Connection timed out
Mar 17 18:16:13 localhost weewx[1888]: wmr100: Bad USB report received.
Mar 17 18:16:13 localhost weewx[1888]: ***** Connection timed out
Mar 17 18:17:09 localhost weewx[1888]: wmr100: Bad USB report received.
Mar 17 18:17:09 localhost weewx[1888]: ***** Connection timed out
Mar 17 18:17:31 localhost weewx[1888]: wmr100: Bad USB report received.
Mar 17 18:17:31 localhost weewx[1888]: ***** Connection timed out
Mar 17 18:18:05 localhost weewx[1888]: wmr100: Bad USB report received.
Mar 17 18:18:05 localhost weewx[1888]: ***** Connection timed out
Mar 17 18:18:31 localhost weewx[1888]: wmr100: Bad USB report received.
Mar 17 18:18:31 localhost weewx[1888]: ***** Connection timed out
Mar 17 18:18:36 localhost weewx[1888]: wmr100: Bad USB report received.
Mar 17 18:18:36 localhost weewx[1888]: ***** tuple index out of range
Mar 17 18:18:41 localhost weewx[1888]: wmr100: Bad USB report received.
Mar 17 18:18:41 localhost weewx[1888]: ***** tuple index out of range
Mar 17 18:18:46 localhost weewx[1888]: wmr100: Bad checksum on buffer of length 25
Mar 17 18:18:46 localhost weewx[1888]: wmr100: Bad checksum on buffer of length 4
Mar 17 18:18:46 localhost weewx[1888]: wxengine: Shut down StdReport thread.
Mar 17 18:18:46 localhost weewx[1888]: wxengine: Caught unrecoverable exception in wxengine:
Mar 17 18:18:46 localhost weewx[1888]:     ****  list index out of range
Mar 17 18:18:46 localhost weewx[1888]:     ****  Traceback (most recent call last):
Mar 17 18:18:46 localhost weewx[1888]:     ****    File "/usr/share/weewx/weewx/wxengine.py", line 949, in main
Mar 17 18:18:46 localhost weewx[1888]:     ****      engine.run()
Mar 17 18:18:46 localhost weewx[1888]:     ****    File "/usr/share/weewx/weewx/wxengine.py", line 178, in run
Mar 17 18:18:46 localhost weewx[1888]:     ****      for packet in self.console.genLoopPackets():
Mar 17 18:18:46 localhost weewx[1888]:     ****    File "/usr/share/weewx/weewx/drivers/wmr100.py", line 132, in genLoopPackets
Mar 17 18:18:46 localhost weewx[1888]:     ****      _record = WMR100._dispatch_dict[_packet_type](self, _packet)
Mar 17 18:18:46 localhost weewx[1888]:     ****    File "/usr/share/weewx/weewx/drivers/wmr100.py", line 270, in _temperature_packet
Mar 17 18:18:46 localhost weewx[1888]:     ****      R = float(packet[5])
Mar 17 18:18:46 localhost weewx[1888]:     ****  IndexError: list index out of range
Mar 17 18:18:46 localhost weewx[1888]:     ****  Exiting.

I'm seeing the Bad USB Report received message a lot. But usually it's collecting data happily, regardless of that error. Now and then it's dying though. The temperature it's picking up when it records that (according to the base unit, at least) is around 8 degrees C outside, and around 20 degrees C inside. For some reason it's not licking the temperature value it sees, and so dies. This happens completely randomly, and I'm at a loss as to what could be causing it.

Any help gratefully received. :)

Thomas Keffer

unread,
Mar 17, 2014, 4:55:52 PM3/17/14
to weewx-user
Hi, David

I've seen this before. It seems to come from either ill-formed packets, or from a packet type that we are not aware of (everything had to be reverse engineered).

The latest version of the driver that is in the repository catches these exceptions and logs them. It won't fix the problem, but at least the application won't crash. Give it a try. Replace bin/weewx/drivers/wmr100.py with


-tk


--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Rickard

unread,
Mar 17, 2014, 8:15:11 PM3/17/14
to weewx...@googlegroups.com
Hi Thomas,

That all sounds very reasonable. I didn't realise it had to be reverse-engineered. Shame they don't document these things!

I've replaced the driver, so I'll keep an eye on it. I'm interested to see what data it is outputting.

Regards

David.


--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/JDoqiA2CTUs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Thomas Keffer

unread,
Mar 17, 2014, 8:31:19 PM3/17/14
to weewx-user

Eager to hear your experiences with the new driver.

Make sure you restart weewx after you install it.

-tk

Fat-fingered from my Android

David Rickard

unread,
Mar 18, 2014, 6:30:14 AM3/18/14
to weewx...@googlegroups.com
Hi,

Well, so far so good. I'll let you know what exception it throws. 

David Rickard

unread,
Mar 20, 2014, 8:11:37 PM3/20/14
to weewx...@googlegroups.com
Update:

No exceptions, but I'm seeing these:

Mar 20 23:55:17 localhost weewx[16514]: wmr100: Bad checksum on buffer of length 4
Mar 20 23:55:32 localhost weewx[16514]: wmr100: Bad USB report received.
Mar 20 23:55:37 localhost weewx[16514]: wmr100: Exception while calculating checksum.
Mar 20 23:55:37 localhost weewx[16514]: wmr100: Bad checksum on buffer of length 4
Mar 20 23:55:37 localhost weewx[16514]: wmr100: Bad USB report received.
Mar 20 23:55:42 localhost weewx[16514]: wmr100: Bad checksum on buffer of length 12
Mar 20 23:55:57 localhost weewx[16514]: wmr100: Bad USB report received.
Mar 20 23:56:08 localhost weewx[16514]: wmr100: Bad checksum on buffer of length 4


So I'm guessing the fact it was dying before was because of the missing/bad checksums. It has been quite happily logging since though, so thanks. :)

Peder

unread,
Apr 10, 2014, 5:29:26 AM4/10/14
to weewx...@googlegroups.com

Hi, 

I have also experienced this problem a couple of times

. Since the fix is not released in any package yet, how do you install this py-patch? (i'm new to python applications)

Regards, Peder

Thomas Keffer

unread,
Apr 10, 2014, 12:13:57 PM4/10/14
to weewx-user
Matthew and I hope to get v2.6.3 out in the next few days, which will include this fix.

-tk
Reply all
Reply to author
Forward
0 new messages