Issue 77 in pywws: OverflowError: math range error

115 views
Skip to first unread message

py...@googlecode.com

unread,
Jul 2, 2012, 4:05:46 AM7/2/12
to py...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 77 by warren.c...@gmail.com: OverflowError: math range error
http://code.google.com/p/pywws/issues/detail?id=77

What steps will reproduce the problem?
1. unknown. just started getting this error.

What is the expected output? What do you see instead?
Getting the following output:
17:00:41:pywws.WeatherStation.CUSBDrive:using pywws.device_pyusb
17:00:41:pywws.weather_station:_read_block changing 000020
17:00:41:pywws.weather_station:_read_block changing 000040
17:00:42:pywws.weather_station:_read_block changing 000060
17:00:42:pywws.weather_station:_read_block changing 000080
17:00:42:pywws.weather_station:_read_block changing 0000a0
17:00:43:pywws.weather_station:_read_block changing 0000c0
17:00:43:pywws.weather_station:_read_block changing 0000e0
17:00:43:pywws.weather_station:_read_block changing
000017:00:43:pywws.weather_station:_read_block changing 000000
17:00:44:pywws.weather_station:_read_block changing 00a9a0
17:00:44:pywws.weather_station:_read_block changing 00a980
17:00:44:pywws.weather_station:_read_block changing 000000
17:00:44:pywws.weather_station:Unrecognised 'magic
n17:00:44:pyww17:00:44:pywws.weather_station:_read_block
cha17:00:45:pyww17:00:45:pywws.weather_station:_read_block chaTraceback
(most recent call last):
File "/share/MD0_DATA/.qpk17:10:46:pywws.weather_station:live_data new
ptr: 00a998
17:10:46:pywws.weather_station:delay 0, pause 600
17:20:46:pywws.weather_station:delay 23, pause 310
17:25:57:pywws.weather_station:delay 27, pause 70
17:27:07:pywws.weather_station:delay 29, pause 2
17:27:09:pywws.weather_station:delay 29, pause 2
17:27:11:pywws.weather_station:delay 29, pause 2
17:27:13:pywws.weather_station:delay 29, pause 2
17:27:16:pywws.weather_station:delay 29, pause 2
17:27:18:pywws.weather_station:delay 29, pause 2
17:27:20:pywws.weather_station:delay 29, pause 2
17:27:22:pywws.weather_station:delay 29, pause 2
17:27:25:pywws.weather_station:delay 29, pause 2
17:27:27:pywws.weather_station:delay 29, pause 2
17:27:29:pywws.weather_station:delay 29, pause 2
17:27:31:pywws.weather_station:delay 29, pause 2
17:27:33:pywws.weather_station:delay 29, pause 2
17:27:36:pywws.weather_station:type change 1080 -> 3080
17:27:36:pywws.weather_station:live_data new ptr: 00a9ac
17:27:36:pywws.weather_station:live_data log synchronised
17:27:36:pywws.LogData:Reading time 07:27:36
17:27:36:pywws.LogData:Fetching data
17:27:37:pywws.LogData:2 catchup records
17:27:37:pywws.Process:Generating summary data
17:27:38:pywws.Calib:Using default calibration
17:27:38:pywws.Process:calib: 2012-07-02 06:57:36
17:27:38:pywws.Process:hourly: 2012-07-02 06:00:00
17:27:38:pywws.Process:daily: 2012-07-01 11:00:00
17:27:38:pywws.Process:monthly: 2012-06-30 11:00:00
17:27:39:pywws.Tasks.RegularTasks:Graphing 3hrs_graphs.png.xml
17:27:40:pywws.Tasks.RegularTasks:Graphing day_graphs.png.xml
Traceback (most recent call last):
File "/share/MD0_DATA/.qpkg/pywws/Hourly.py", line 90, in <module>
sys.exit(main())
File "/share/MD0_DATA/.qpkg/pywws/Hourly.py", line 87, in main
return Hourly(args[0])
File "/share/MD0_DATA/.qpkg/pywws/Hourly.py", line 59, in Hourly
params, calib_data, hourly_data, daily_data, monthly_data
File "/share/MD0_DATA/.qpkg/pywws/pywws/Tasks.py", line 156, in do_tasks
upload = self.do_plot(template)
File "/share/MD0_DATA/.qpkg/pywws/pywws/Tasks.py", line 186, in do_plot
if self.plotter.DoPlot(input_file, output_file) == 0:
File "/share/MD0_DATA/.qpkg/pywws/pywws/Plot.py", line 150, in DoPlot
of.write(self.PlotData(plot_no, plot, source))
File "/share/MD0_DATA/.qpkg/pywws/pywws/Plot.py", line 321, in PlotData
value = eval(subplot.ycalc)
File "<string>", line 1, in <module>
File "/share/MD0_DATA/.qpkg/pywws/pywws/WeatherStation.py", line 80, in
dew_point
gamma = ((a * temp) / (b + temp)) + math.log(float(hum) / 100.0)
OverflowError: math range error

What version of the product are you using? On what operating system?
pywws: 12.05
OS: QNAP NAS

Please provide any additional information below.
pywws has been running fine for weeks. I suspect there is some data value
read from the station that pywws cannot handle.

py...@googlecode.com

unread,
Jul 2, 2012, 8:56:07 AM7/2/12
to py...@googlegroups.com

Comment #1 on issue 77 by a...@jim-easterbrook.me.uk: OverflowError: math
range error
http://code.google.com/p/pywws/issues/detail?id=77

That mixed up message at 17:00:44 is very odd - it looks like two instances
running at once - but it's not the cause of your problem.

I'm guessing you have a humidity value of zero, which is upsetting the
math.log function. I've never seen such a low humidity value - the 1080
type stations don't go below 10%.

Try editing pywws/WeatherStation.py and change line 76 from
if temp == None or hum == None:
to
if temp is None or hum is None or hum < 1:


Eivind Teig

unread,
Jul 2, 2012, 9:34:13 AM7/2/12
to py...@googlegroups.com
Hello again, as instructed i checked My local dealer but no luck, where on The Internett could i buy a WS?

Budget : 200€
Model: ill let your expertice descide.
Wishes : wireless and touch screen but it is not crutial.

I like Amazon.co.uk but anywhere that shippes worldwide would be an alternative.

Thanks om advance ;)
Eivind

Mark

unread,
Jul 3, 2012, 4:06:35 AM7/3/12
to py...@googlegroups.com
Hi

I am not sure which county you are in, so this may not help. I got mine
from Clas Ohlson. They have them at a special price right now £40GBP.

http://www.clasohlson.com/uk/Weather-Station/Pr363242000


Mark
>--
>You received this message because you are subscribed to the Google Groups
>"pywws" group.
>To post to this group, send email to py...@googlegroups.com.
>To unsubscribe from this group, send email to
>pywws+un...@googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/pywws?hl=en.
>


eivind teig

unread,
Jul 3, 2012, 4:39:48 AM7/3/12
to py...@googlegroups.com
Oh, thanks alot, i also have Clas Ohlson here, i will go and pick this up later today!

py...@googlecode.com

unread,
Jul 5, 2012, 3:39:25 AM7/5/12
to py...@googlegroups.com

Comment #2 on issue 77 by warren.c...@gmail.com: OverflowError: math range
error
http://code.google.com/p/pywws/issues/detail?id=77

Looks like the raw data got messed up somehow at hour 23:

2012-07-01 13:27:35,30,53,17.0,63,9.6,1010.2,0.7,1.4,0,1256.1,0,0.0,0
2012-07-01 13:45:37,3,91,1.6,0,0.0,768.0,5.3,17.0,63,28.8,118,91933.5,0
2012-07-01 13:51:37,6,5,2.1,18,589.4,0.0,181.0,26.2,0,1382.4,7,0.1,18
2012-07-01
13:57:37,6,48,1332.9,6,437.2,463.0,51.7,55.0,81,389.4,48,118477.7,6
2012-07-01 14:27:37,30,54,16.6,65,9.0,1009.8,0.7,1.7,12,1256.1,0,33229.1,24
2012-07-01 14:57:38,30,54,16.4,66,9.3,1009.5,0.3,1.4,0,1256.1,0,0.0,0
2012-07-01 15:27:38,30,53,16.2,68,8.9,1009.5,0.3,1.0,10,1256.1,0,0.0,0
2012-07-01 15:57:36,30,53,16.0,66,9.3,1009.0,0.7,1.4,10,1256.1,0,0.0,0
2012-07-01 16:27:36,30,54,15.9,67,9.1,1008.8,1.4,2.0,8,1256.1,0,0.0,0
2012-07-01 16:57:36,30,54,15.8,66,9.5,1009.0,0.3,0.7,3,1256.1,0,0.0,0
2012-07-01 17:27:36,30,54,15.6,64,9.5,1009.0,0.3,1.4,12,1256.1,0,0.0,0
2012-07-01 17:57:37,30,54,15.4,64,9.5,1009.1,0.3,1.0,10,1256.1,0,0.0,0
2012-07-01 18:27:37,30,54,15.3,64,9.6,1009.2,0.3,1.4,2,1256.1,0,0.0,0
2012-07-01 18:57:36,30,54,15.2,65,9.8,1009.3,0.3,1.0,14,1256.1,0,0.0,0
2012-07-01 19:27:36,30,54,15.0,65,9.9,1009.5,0.7,1.4,6,1256.1,0,0.0,0
2012-07-01 19:57:38,30,54,15.0,65,9.6,1009.7,1.0,1.4,0,1256.1,0,0.0,0
2012-07-01 20:27:38,30,55,14.8,66,9.7,1009.7,0.3,0.7,14,1256.1,0,0.0,0
2012-07-01 21:07:38,30,55,14.7,66,9.6,1010.3,0.0,1.0,8,1256.1,0,102.1,0
2012-07-01 21:37:38,30,55,14.5,65,10.0,1010.6,0.0,0.7,2,1256.1,0,2008.9,0
2012-07-01 22:27:38,30,54,14.5,59,12.6,1011.1,0.7,1.4,8,1256.1,0
2012-07-01 23:11:37,5,16,468.0,6,538.1,460.8,0.6,2.3,0,466.2,23,117964.8,7
2012-07-01
23:27:37,16,0,2457.6,8,2764.8,170.4,155.6,27.3,18,2919.9,34,33236.9,48
2012-07-01 23:57:38,30,54,14.6,51,15.0,1011.5,0.3,0.7,14,1256.1,0,22209.7,4

however, the values look different compared with EasyWeatherPlus software
(see attachement).

Shouldn't pywws have the same values?



Attachments:
pywws issue77 ewp.png 66.1 KB

py...@googlecode.com

unread,
Jul 5, 2012, 4:06:13 AM7/5/12
to py...@googlegroups.com

Comment #3 on issue 77 by a...@jim-easterbrook.me.uk: OverflowError: math
range error
http://code.google.com/p/pywws/issues/detail?id=77

Ah, I've just realised this is related to
the "17:27:36:pywws.weather_station:type change 1080 -> 3080" line in your
first message. You need to edit weather.ini and make sure the weather
station type is set to 3080. Otherwise pywws will read logged data from the
wrong memory locations, getting the nonsense values you have at 2012-07-01
13:45:37, 2012-07-01 13:51:37, 2012-07-01 13:57:37, 2012-07-01 23:11:37 and
2012-07-01 23:27:37.

All this data should still be in the console memory, so I think you should
delete the last few weeks of raw data files, make sure weather.ini has the
correct weather station type, then run LogData.py to fetch all the data
again.

py...@googlecode.com

unread,
Jul 5, 2012, 1:59:05 PM7/5/12
to py...@googlegroups.com

Comment #4 on issue 77 by a...@jim-easterbrook.me.uk: OverflowError: math
range error
http://code.google.com/p/pywws/issues/detail?id=77

I've added a check to LogData.py in r531 that should prevent this problem
occurring in future.

py...@googlecode.com

unread,
Jul 8, 2012, 4:34:44 AM7/8/12
to py...@googlegroups.com

Comment #5 on issue 77 by warren.c...@gmail.com: OverflowError: math range
error
http://code.google.com/p/pywws/issues/detail?id=77

Thanks Jim. I thought that was fixed in issue 66?

py...@googlecode.com

unread,
Jul 8, 2012, 5:08:48 AM7/8/12
to py...@googlegroups.com

Comment #6 on issue 77 by a...@jim-easterbrook.me.uk: OverflowError: math
range error
http://code.google.com/p/pywws/issues/detail?id=77

The unreliable detection was fixed by only changing weather station type
when the pointer gets incremented. If the increment is 20, it's definitely
a 3080 type.

In your case, you have a 30 minute logging interval, so waiting for a
pointer increment before logging any data would be unacceptable. However,
reading historical data without correctly identifying the station type is
also unacceptable. Requiring the user to set the type seems the best
solution.

py...@googlecode.com

unread,
Jul 10, 2012, 5:22:29 AM7/10/12
to py...@googlegroups.com

Comment #7 on issue 77 by warren.c...@gmail.com: OverflowError: math range
error
http://code.google.com/p/pywws/issues/detail?id=77

ok makes sense.
to save having to wait for the increment to determine the type, can you do
something where you compare the data count with the current position? for
example - take the current position, minus 256, then divide by both 16 and
20 and compare that against the data count?

py...@googlecode.com

unread,
Jul 10, 2012, 12:15:30 PM7/10/12
to py...@googlegroups.com

Comment #8 on issue 77 by a...@jim-easterbrook.me.uk: OverflowError: math
range error
http://code.google.com/p/pywws/issues/detail?id=77

The data count is not particularly useful as it's easily reset. If it's
more than 3264 we know it's not a 3080, but in general this test only needs
to be done for new users, who probably have a new station.

Similarly, finding if the pointer (minus 256) is divisible by 16 or 20
would work 75% of the time (for a 3080). However, there have been examples
of stations where the pointer hasn't been properly initialised and is
divisible by neither.

It's a one off configuration to be set - I think it's best left to the user.

py...@googlecode.com

unread,
Jul 12, 2012, 6:00:32 AM7/12/12
to py...@googlegroups.com

Comment #9 on issue 77 by warren.c...@gmail.com: OverflowError: math range
error
http://code.google.com/p/pywws/issues/detail?id=77

ok np. once again you prove you know more than I do :)
back to the original issue, I did make the change to
pywws/WeatherStation.py as you suggested and cleared out the last couple of
days worth or raw data. It appears to be running ok now, so not sure which
one or both fixed it.
feel free to close this issue.

py...@googlecode.com

unread,
Jul 12, 2012, 9:14:08 AM7/12/12
to py...@googlegroups.com
Updates:
Status: Fixed

Comment #10 on issue 77 by a...@jim-easterbrook.me.uk: OverflowError: math
range error
http://code.google.com/p/pywws/issues/detail?id=77

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages