RE: [weewx-user] Re: weewx crashes with error: unpack requires a string of len 104

2018-04-17 Thread Graham Seward
Hi Susan

I’m at a loss to understand where the problem lay but as it’s working fine with 
a loop delay of 15 I’m happy to leave it at that. 

 

Thank you for the note about the router advertisements and soliciting a DHCPV6 
lease – I’ve fixed the problem and the syslog files are a lot easier to read 
now.

 

Once again thanks for your help

Graham

 

 

From: weewx-user@googlegroups.com  On Behalf Of 
vk3...@gmail.com
Sent: 12 April 2018 04:42
To: weewx-user 
Subject: [weewx-user] Re: weewx crashes with error: unpack requires a string of 
len 104

 

Hello Graham,

 

I've not been able to come up with anything so far but I'm still looking at 
this. It is a real puzzle because there should be log file entries from WeeWx 
if my code was exiting or encountering a fault etc.. Instead there is nothing 
in the log file.

 

I'm still looking into this

 

By the way, I noticed a number of messages in your syslog file from wlan0 about 
router advertisements and soliciting an DCHPV6 lease. I used to get a number of 
those as well and I found that it was my system running its own DHCP server 
(dhcpd) on that interface as well as the main DHCP server in my router. I 
stopped the dhcpd service on the system and those all went away. Not what you 
were after but might help in other areas anyway.

 

Susan

-- 
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 
 .
For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: weewx crashes with error: unpack requires a string of len 104

2018-04-11 Thread Graham Seward
Thanks Susan
I just set up weewx on an older RPI and that seems to be working fine, though 
still on delay of 15.
I was wondering about the wlan and ip6 messages, thanks for giving me the 
solution. I had assumed it was to do with weewx.
Cheers
Graham

Get Outlook for Android


From: weewx-user@googlegroups.com  on behalf of 
vk3...@gmail.com 
Sent: Thursday, April 12, 2018 4:41:41 AM
To: weewx-user
Subject: [weewx-user] Re: weewx crashes with error: unpack requires a string of 
len 104

Hello Graham,

I've not been able to come up with anything so far but I'm still looking at 
this. It is a real puzzle because there should be log file entries from WeeWx 
if my code was exiting or encountering a fault etc.. Instead there is nothing 
in the log file.

I'm still looking into this

By the way, I noticed a number of messages in your syslog file from wlan0 about 
router advertisements and soliciting an DCHPV6 lease. I used to get a number of 
those as well and I found that it was my system running its own DHCP server 
(dhcpd) on that interface as well as the main DHCP server in my router. I 
stopped the dhcpd service on the system and those all went away. Not what you 
were after but might help in other areas anyway.

Susan

--
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.
For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


RE: [weewx-user] Re: weewx crashes with error: unpack requires a string of len 104

2018-04-04 Thread Graham Seward
Hi Susan

Regret to say that weewx stopped running again without writing anything to 
syslog, messages or user.log. Syslog shows that when weewx starts it is using 
the correct version of the driver, so I’m puzzled as to what is going on. Would 
you like a copy of the syslog file in it’s entirety to see if that throws up 
any clues?

 

I’m going to run weewx again but with your original driver to see what happens 
this time. Incidentally if I set the loop-delay to 60 secs the program doesn’t 
run at all – currently set at 30secs. 

 

Sorry to be a nuisance!

Graham

 

From: weewx-user@googlegroups.com  On Behalf Of 
vk3...@gmail.com
Sent: 04 April 2018 03:50
To: weewx-user 
Subject: Re: [weewx-user] Re: weewx crashes with error: unpack requires a 
string of len 104

 

G - too long since I wrote the code and I made a stupid mistake. The two 
'loginf' lines should read

 

loginf('Bad data: length = {0}'.format(len(rxData)))

loginf('Bad data: "{0}"'.format(rxData))

 

I've attached your file with the correction in it.

 

Sorry about that.

 

Susan

 

-- 
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 
 .
For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


RE: [weewx-user] Re: weewx crashes with error: unpack requires a string of len 104

2018-04-03 Thread Graham Seward
Hi Susan

I updated the hp1000 file as requested – copy attached. I then ran weewx which 
was fine until 17:39 when it stopped with the last reading being:

 

LOOP:   2018-04-03 17:39:07 BST (1522773547) altimeter: 29.1707530717, appTemp: 
47.1549180258, barometer: 29.8636759983, cloudbase: 2403.71906385, dateTime: 
1522773547, dewPoint: 6.3019073, dewpoint: 43.297915016, heatindex: 53.6, 
humidex: 53.6, inDewpoint: 48.7200784102, inHumidity: 48, inTemp: 
69.2600013733, maxSolarRad: None, outHumidity: 68, outTemp: 53.6, pressure: 
29.1136153972, radiation: 451.04699707, rain: 0.0, rainRate: 0, usUnits: 1, UV: 
1, windchill: 53.6, windChill: 12.0, windDir: 167, windGust: 9.81768936544, 
windSpeed: 8.69921832006

 

Syslog does not show the failure at all - see below:

 

Apr  3 17:39:06 raspberrypi dhcpcd[311]: wlan0: Router Advertisement from 
fe80::52c7:bfff:fe17:64d6

Apr  3 17:39:06 raspberrypi dhcpcd[311]: wlan0: soliciting a DHCPv6 lease

Apr  3 17:39:16 raspberrypi dhcpcd[311]: wlan0: Router Advertisement from 
fe80::52c7:bfff:fe17:64d6

Apr  3 17:39:16 raspberrypi dhcpcd[311]: wlan0: soliciting a DHCPv6 lease

 

I suspect I messed up editing HP1000 but I am at a bit of a loss to know how.

Any suggestions gratefully received.

Graham.

 

 

 

From: weewx-user@googlegroups.com  On Behalf Of 
vk3...@gmail.com
Sent: 03 April 2018 04:50
To: weewx-user 
Subject: Re: [weewx-user] Re: weewx crashes with error: unpack requires a 
string of len 104

 

First off, my apologies to all - given the subject line I completely missed 
that this question was related to my HP1000 driver.

Given the line number, you are using the latest version of the driver (I note 
that the driver that Bob provides above is based on the earlier version).

Is it possible to edit the HP1000.py file and change  line 524 from

 

interp_data = struct.unpack("8s8s16s8shbb14fbbh", rxData)

 

to

 

try:

interp_data = struct.unpack("8s8s16s8shbb14fbbh", rxData)

except:

loginf('Bad data: length = {0}', len(rxData))

loginf('Bad data: "{0}"', rxData)

continue

 

(Note the indenting of 4 spaces - Pythin is very sensitive to the indenting of 
the code.)

That should dump out to the system log file the bad data so that we can look at 
it and see what is wrong.

 

When I wrote the driver I only had my own weather station as a guide so if 
other firmware creates different sized (or formatted) records then there will 
be problems. It is hard to know the level of 'error protection' that is needed 
when yo don't know the sources of the possible errors (at least that is my 
excuse!).

 

Susan

-- 
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 
 .
For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


HP1000-gs.py
Description: Binary data


[weewx-user] Re: weewx crashes with error: unpack requires a string of len 104

2018-04-02 Thread Graham Seward
Thanks Bob
I look forward to seeing it - like you though I'm not a programmer and not 
sure I'll be able to hack the driver myself - still I'll have a go!
As you say, hopefully Susan will see this.
Many thanks
Graham

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: weewx crashes with error: unpack requires a string of len 104

2018-04-02 Thread Graham Seward
Hi
Did you ever get a solution to this issue. I have weewx running with 
Susan's HP1000 driver connecting to a Maplin N23-dq (HP1000 clone). Took me 
a while to get it going in first place but eventually a firmware upgrade on 
the HP1000 resulted in success. However after a couple of hours of running 
weewx stops. Syslog throws up the same error as yours:

Mar 31 17:04:38 raspberrypi weewx[1148]: engine: Main loop exiting. 
Shutting engine down.
Mar 31 17:04:38 raspberrypi weewx[1148]: engine: Shutting down StdReport 
thread
Mar 31 17:04:38 raspberrypi weewx[1148]: engine: StdReport thread has been 
terminated
Mar 31 17:04:38 raspberrypi weewx[1148]: engine: Caught unrecoverable 
exception in engine:
Mar 31 17:04:38 raspberrypi weewx[1148]:   unpack requires a string 
argument of length 104
Mar 31 17:04:38 raspberrypi weewx[1148]:   Traceback (most recent 
call last):
Mar 31 17:04:38 raspberrypi weewx[1148]: File 
"/home/weewx/bin/weewx/engine.py", line 871, in main
Mar 31 17:04:38 raspberrypi weewx[1148]:   engine.run()
Mar 31 17:04:38 raspberrypi weewx[1148]: File 
"/home/weewx/bin/weewx/engine.py", line 187, in run
Mar 31 17:04:38 raspberrypi weewx[1148]:   for packet in 
self.console.genLoopPackets():
Mar 31 17:04:38 raspberrypi weewx[1148]: File 
"/home/weewx/bin/user/HP1000.py", line 524, in genLoopPackets
Mar 31 17:04:38 raspberrypi weewx[1148]:   interp_data = 
struct.unpack("8s8s16s8shbb14fbbh", rxData)
Mar 31 17:04:38 raspberrypi weewx[1148]:   error: unpack requires a 
string argument of length 104
Mar 31 17:04:38 raspberrypi weewx[1148]:   Exiting.

Weewex v3.8 on Raspberry Pi model B 
Short of shutting down and restarting I have not been able to resolve the 
issue

I've searched all the threads and can't find a solution - is there one?
Any help appreciated
 


>>

-- 
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.
For more options, visit https://groups.google.com/d/optout.