Re: [weewx-user] Re: Second crash after 11 days

2019-07-18 Thread Steve Meltz
Gary..yes..I believe you are correct, but there is something kind of
nagging at me, so I am going to do a controlled test (ie writing down what
I do) rather than trying to remember the steps I go through.

On Thu, Jul 18, 2019, 11:40 AM gjr80  wrote:

> Hi Steve,
>
> Haven’t we been round this buoy before? I thought you had previously
> disabled all things SteelSeries and it had more or less no effect on the
> problem. I thought the issue/leak had been nailed down to the driver(can’t
> link to a post on this device but on 6 Feb Tom said):
>
> Well, that's pretty definitive: the problem is in the driver, or its
> underlying libraries.
> Can you check what version of pyserial you are using:
> python -c "import serial; print serial.VERSION"
> I get "3.4"
>
> -tk
>
> Disabling all things SteelSeries will certainly save some memory (all
> extensions will use some) but I don’t see it having any great effect on
> your system, you are still going to run out of memory albeit a little while
> (minutes, hours, day) later.
>
> Gary
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/weewx-user/VehicK_KNso/unsubscribe.
> To unsubscribe from this group and all its topics, 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/44c48951-8b76-40e8-aa90-cf814edcc82a%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAH0o-amMX5KOs5wv9Kmb6O72RyTNAQx4dUieANrKERSXQx_K2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-07-18 Thread gjr80
Hi Steve,

Haven’t we been round this buoy before? I thought you had previously disabled 
all things SteelSeries and it had more or less no effect on the problem. I 
thought the issue/leak had been nailed down to the driver(can’t link to a post 
on this device but on 6 Feb Tom said):

Well, that's pretty definitive: the problem is in the driver, or its underlying 
libraries.
Can you check what version of pyserial you are using:
python -c "import serial; print serial.VERSION"
I get "3.4"

-tk

Disabling all things SteelSeries will certainly save some memory (all 
extensions will use some) but I don’t see it having any great effect on your 
system, you are still going to run out of memory albeit a little while 
(minutes, hours, day) later.

Gary

-- 
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/44c48951-8b76-40e8-aa90-cf814edcc82a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-07-18 Thread Steve Meltz
Peter..yes, Weewx is running when I backup.  I have it scheduled to run on
an odd minute once/day.  Archiving runs on the even minute.

-- 
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/CAH0o-akSQPUid1NVx97PUskKyS0puj%2BVhDZ3VXoWRdE96i9iPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-07-18 Thread p q
Do you back up your database with Weewx still running? I ask because I also
use Steelseries on a Raspi and I've never had a problem. I have a script
that stops Weewx momentarily at 3am, makes a copy of the database, and then
restarts it.

-- 
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/CAA1SM21B5%3DkKjEenijRzaV%3DU5Nyor9b5ef%3DvefqRwHFKa_6Aew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-07-18 Thread Steve2Q
A follow-up to the memory problem. At present, Weewx will run for 45 days 
before my script restarts the program at 80% memory usage (approx 1.8% 
increase/day). I am not home, but when I get back I will shut down SteelSeries 
gauges and see what effect that has. The gauges are the only extension 
currently running.

-- 
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/7fcdee23-32dc-449d-9582-5058aec87d9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-28 Thread Steve Meltz
Thanks Gary...as usual, your fix was spot on!

Steve

On Mon, May 27, 2019 at 11:19 PM gjr80  wrote:

> Steve,
>
> When I look at your gauges just now they are not working, the clue is in
> the scroller message - 'error: Not Found'. This means the gauges.js
> script cannot find gauge-data.txt. I suppose it is possible that when we
> uncommented the SteelSeries skin a few days ago to get your plots back that
> caused your web server gauges.js to be overwritten with the default
> gauges.js (or a version that is not up to date with your latest setup).
> Though if this were the case/cause I would have expected the gauges to stop
> straight away and I remember seeing them working properly after your plots
> came back. No matter, this is clearly a case of gauges.js not finding
> gauge-data.txt. I can see that gauge-data.txt is being updated on your
> web server every few seconds so rtgd is doing its job. The file is located
> in photokinetics.org/Weather/. To fix it, on your WeeWX machine, edit
> skins/SteelSeries/scripts/gauges.js and find the realTimeUrlWeewx setting
> at about line 74, it probably looks like:
>
> realTimeUrlWeewx : 'gauge-data.txt', // *** WeeWX Users: 
> Change to your location of the gauge data file **
>
>
> Try changing the setting to '../gauge-data.txt'. Save the file and the
> restart WeeWX. The next report cycle should seethe modified gauges.js
> uploaded to your server and hopefully the gauges will come on line.
>
> Gary
>
> On Tuesday, 28 May 2019 10:25:26 UTC+10, Steve2Q wrote:
>>
>> Gary...I was away for the weekend, so when I checked in using the Chrome
>> browser on my phone, the Steel Gauges were, and still are, working.
>> However, if I pull up the guages on my desktop or tablet, they are frozen
>> and "offline".  Please take a look at photokinetics.org/Weather and
>> click on the Steel Gauges button at the bottom and see if you observe the
>> same behavior. I tried both Chrome and Firefox on both devices. Thanks.
>>
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/weewx-user/VehicK_KNso/unsubscribe.
> To unsubscribe from this group and all its topics, 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/4b1de92a-fc25-4050-b692-d9dfb54033b2%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAH0o-anu2iS_WCtstwhAq%2BUFDNBPWN1PyWDWH0s-eDxCc0VbQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-27 Thread gjr80
Steve,

When I look at your gauges just now they are not working, the clue is in 
the scroller message - 'error: Not Found'. This means the gauges.js script 
cannot find gauge-data.txt. I suppose it is possible that when we 
uncommented the SteelSeries skin a few days ago to get your plots back that 
caused your web server gauges.js to be overwritten with the default 
gauges.js (or a version that is not up to date with your latest setup). 
Though if this were the case/cause I would have expected the gauges to stop 
straight away and I remember seeing them working properly after your plots 
came back. No matter, this is clearly a case of gauges.js not finding 
gauge-data.txt. I can see that gauge-data.txt is being updated on your web 
server every few seconds so rtgd is doing its job. The file is located in 
photokinetics.org/Weather/. To fix it, on your WeeWX machine, edit 
skins/SteelSeries/scripts/gauges.js and find the realTimeUrlWeewx setting 
at about line 74, it probably looks like:

realTimeUrlWeewx : 'gauge-data.txt', // *** WeeWX Users: Change 
to your location of the gauge data file **


Try changing the setting to '../gauge-data.txt'. Save the file and the 
restart WeeWX. The next report cycle should seethe modified gauges.js 
uploaded to your server and hopefully the gauges will come on line.

Gary

On Tuesday, 28 May 2019 10:25:26 UTC+10, Steve2Q wrote:
>
> Gary...I was away for the weekend, so when I checked in using the Chrome 
> browser on my phone, the Steel Gauges were, and still are, working. 
> However, if I pull up the guages on my desktop or tablet, they are frozen 
> and "offline".  Please take a look at photokinetics.org/Weather and click 
> on the Steel Gauges button at the bottom and see if you observe the same 
> behavior. I tried both Chrome and Firefox on both devices. Thanks.
>
>
>

-- 
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/4b1de92a-fc25-4050-b692-d9dfb54033b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-27 Thread p q
Do you have gauge-data.txt in the directory with your gauges? It looks like
you might not.

By the way, I got the same results with desktop chrome and on my android
phone. Could you be seeing different results because of a browser cache?

On Mon, May 27, 2019 at 5:25 PM Steve2Q  wrote:

> Gary...I was away for the weekend, so when I checked in using the Chrome
> browser on my phone, the Steel Gauges were, and still are, working.
> However, if I pull up the guages on my desktop or tablet, they are frozen
> and "offline".  Please take a look at photokinetics.org/Weather and click
> on the Steel Gauges button at the bottom and see if you observe the same
> behavior. I tried both Chrome and Firefox on both devices. Thanks.
>
>
> --
> 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/f0f27dc6-7ea5-4ec8-b27f-6411907e5292%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Peter Quinn
(415)794-2264

-- 
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/CAA1SM23tzWD7TJOKDNRWHEJDmOde%2B9ExfCNTkZC6-RBPNLx%2B2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-27 Thread Steve2Q
Gary...I was away for the weekend, so when I checked in using the Chrome 
browser on my phone, the Steel Gauges were, and still are, working. 
However, if I pull up the guages on my desktop or tablet, they are frozen 
and "offline".  Please take a look at photokinetics.org/Weather and click 
on the Steel Gauges button at the bottom and see if you observe the same 
behavior. I tried both Chrome and Firefox on both devices. Thanks.


-- 
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/f0f27dc6-7ea5-4ec8-b27f-6411907e5292%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-24 Thread Steve2Q
Gary..thank you! that did the trick!

-- 
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/26b8e1b2-f1d0-433e-846a-c3213fc2ec43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-24 Thread gjr80
Steve 

Ok, looks like you disabled the SteelSeries skin completely (not sure but this 
could be due to some instructions from me in the past, my apologies if I did 
say to to that). To fix you need to:

1. Uncommment the entire [[SteelSeries]] Stanza in weewx.conf (note you have a 
couple of misplaced # in the Groups stanza - you need to remove them as 
well - well at least the second one)

2. In the SteelSeries skin.conf disable the generation of gauge-data.txt (by 
the skin) by commenting out the lines indicated:

[CheetahGenerator]
encoding = html_entities
[[ToDate]]
[[[index]]]
template = index.html.tmpl
#[[[data]]]
#template = gauge-data.txt.tmpl

(your site appears to use the index.html generated by the SteelSeries skin 
otherwise we would just disable the CheetahGenerator completely)

3. Restart WeeWX or do a config reload. Your SteelSeries plots should be 
generated and uploaded to your web server on the next report cycle.

Gary

-- 
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/30fb956b-34f1-4060-8b07-e51c7a29a5e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-24 Thread Steve2Q
Gary, thanks for answering. My regular weewx charts update, and the steel 
gauges themselves are operating correctly on my 2 second update. Only the 
graphs on the steel gauges are "stuck" on the installation date.

He is the [StdReport] stanza from weewx.conf, followed by skin.conf for 
SteelSeries.

 [[StandardReport]]
# See the customizing guide to change the units, plot types and line
# colors, modify the fonts, display additional sensor data, and 
other
# customizations. Many of those changes can be made here by 
overriding
# parameters, or by modifying templates within the skin itself.

# The StandardReport uses the 'Standard' skin, which contains the
# images, templates and plots for the report.
skin = Standard
#[[SteelSeries]]
#HTML_ROOT = public_html/ss
#skin = ss
#[[[Units]]]
#StringFormats
#mm_per_hour = %.1f
#mile_per_hour = %.0f
#degree_compass = %.0f
#degree_C = %.1f
#inHg = %.3f
#mmHg = %.1f
#meter_per_second = %.1f
#meter = %.0f
#mile = %.1f
#uv_index = %.1f
#watt_per_meter_squared = %.0f
#percent = %.0f
#km_per_hour = %.0f
#inch = %.2f
#degree_F = %.1f
#knot = %.0f
#foot = %.0f
#hPa = %.1f
#mbar = %.1f
#inch_per_hour = %.2f
#mm = %.1f
#km = %.1f
#Groups
#group_temperature = degree_C#
#group_altitude = foo#t
#group_pressure = hPa
#group_rain = mm
#group_rainRate = mm_per_hour
#group_speed = km_per_hour




# configuration file for the steel series gauges skin for weewx
#   created by Matthew Wall
#   based on work by Mark Crossley and others
#
# This skin can be copied, modified, and distributed as long as this notice
# is included in any derivative work.

[CopyGenerator]
copy_once = css/*.css, scripts/*.js

[CheetahGenerator]
encoding = html_entities
[[ToDate]]
[[[index]]]
template = index.html.tmpl
[[[data]]]
template = gauge-data.txt.tmpl

[ImageGenerator]
image_width = 720
image_height = 196
image_background_color = 0xff
chart_background_color = 0xff
chart_gridline_color = 0xeaeaea

top_label_font_path = 
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-Bold.ttf
top_label_font_size = 10

unit_label_font_path = 
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed.ttf
unit_label_font_size = 10
unit_label_font_color = 0xaa

bottom_label_font_path = 
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed.ttf
bottom_label_font_size = 10
bottom_label_font_color = 0xaa

axis_label_font_path = 
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed.ttf
axis_label_font_size = 10
axis_label_font_color = 0xaa

rose_label = N
rose_label_font_path = 
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed.ttf
rose_label_font_size  = 8
rose_label_font_color = 0x88
rose_color = 0xaa

chart_line_colors = 0x1e69d2, 0x8b008b, 0xa09e5f, 0x8080f0
chart_fill_colors = 0x7ec9f2, 0xeb00eb, 0xf0febf, 0xe0e0f0

line_type = 'solid'
marker_size = 2
marker_type ='none'
plot_type = line
aggregate_type = none
width = 1
yscale = None, None, None
vector_rotate = 90
line_gap_fraction = 0.01
bar_gap_fraction = 0.2
daynight_day_color = 0xff
daynight_night_color = 0xf8f0f0
daynight_edge_color = 0xafefef
bottom_label_format = %x %X
time_length = 9

[[images]]
x_label_format = %H:%M
show_daynight = true
[[[daybarometer]]]
barometer
[[[dayrain]]]
yscale = None, None, 0.02
plot_type = bar
rain
aggregate_type = sum
aggregate_interval = 3600
label = Rain (hourly total)
[[[dayrainrate]]]
rainrate
[[[daywind]]]
windSpeed
windGust
[[[daywinddir]]]
line_type = None
marker_type = 'box'
marker_size = 2
yscale = 0.0, 360.0, 45.0
windDir
[[[daywindvec]]]
windvec
plot_type = vector
windgustvec
plot_type = vector
aggregate_type = max
aggregate_interval = 3600
[[[dayouttemphum]]]

Re: [weewx-user] Re: Second crash after 11 days

2019-05-23 Thread gjr80
Steve,

Regards the SteelSeries Gauges plots, when you installed rtgd and disabled the 
SteelSeries skin from producing gauge-data.txt you didn't happen to disable the 
whole SteelSeries skin did you? To use rtgd with the SteelSeries skin you need 
to disable the SteelSeries skin generation of gauge-data.txt but the 
SteelSeries skin needs to continue generating the plots and uploading the 
SteelSeries javascript/css (once on startup).

If you did only disable the generation of gauge-data.txt then have a look at 
the plots on your WeeWX machine, are they being updated? If they are being 
updated then the issue is with the upload to your web server, if not then the 
issue is their generation by the skin. Either way probably best to post the 
[StdReport] stanza of weewx.conf and the SteelSeries skin.conf. Neither should 
contain any sensitive info but do check before posting.

Gary 

-- 
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/bffd53ac-6a47-4806-84ee-4bc3d5341d6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-23 Thread Steve2Q
Leon and Vince; first thanks for your help and advice. My only experience 
in programming was a LONG time ago, so anything I learn is either from 
helpful people like you or what I can figure out by searching the web. I 
did come to the conclusion that the nesting order of the expressions is 
most likely why the email is not being sent properly. My next bit of 
research will be in how to properly nest if / then statements. The reason I 
picked such low values is I did not want to wait so long for the %mem to 
climb to a high value so I could see what is happening. I was careful in 
copying the original script that I found, so I can only assume it didn't 
run properly as originally written, and no one called the writer out on it. 
As for the multitude of braces, parenthesis, and who knows what else, that 
is me not knowing proper syntax. Here is where I found the script, (he uses 
free -m) if you want to see it:  
https://superuser.com/questions/419617/how-to-monitor-memory-usage-for-alarming-purpose
 
It is answer #3.

Leon, This all started when I noticed my system was crashing after running 
for a relatively short time. There are almost 8 pages (!) but back around 
Jan 38 I think I posted the results of top.

Steve

-- 
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/11131edd-7d7a-423f-b29e-4876b715ee62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-23 Thread vince
Your script has a lot of errors in it from a quick look-see, did you have a 
cut+paste massacre perhaps ?


   - if weewxd is not running at all, it'll blow up in your 'if' statement
   - you have braces and parens all messed up in your usage calculation line
   - do you really mean '3' and '4' for your thresholds ?  Guessing not.
   - the if/then flow doesn't make any sense to me

Try to work this one out yourself a little more.


   - rename your 'threshold' and 'threshold2' variables to be able to 
   understand what you wrote 6 months from now (or at least comment the code a 
   bit)
   - Hard-set usage's value to a good value, walk through your logic and 
   see what it will do
   - then hard-set it to a value in between your two thresholds, walk 
   through your logic and see what it'll do
   - then hard-set it to a value over the 'need to restart' threshold, walk 
   through your logic and see what it'll do
   - then hard-set it to a non-numeric value and see if the code breaks (it 
   will)
   - then hard-set it to a null value and see if the code breaks (it will)
   - then try it live in a 'log only, take no action mode' for a bit
   - then try it live for real, taking action as needed
   
If it's me, my flow would be something like:

   - if it's bad, syslog a message (hint - use 'logger') and try to take 
   action to fix it
   - if it's semi-bad, syslog a message saying it's in the not-great middle 
   range
   - if it's ok, 'consider' logging "all is good"
   - in all cases, log the actual data so you have that in the message (ie, 
   "weewx mem usage 23.3 % (ok)" or the like)
   

But you should really do the coding and analysis here so you can 
effectively 'own' your solution long-term.




-- 
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/f7aba085-c3c5-41c0-87a6-319376e4f030%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-23 Thread Steve2Q
Leon: thank you very much for your reply...lots of interesting things 
there. I like the top command rather than free as top would give me the % 
of memory used by weewxd. I took the command ps -C weewxd -o 
comm,size,rss,vsize,%mem (which I never saw before, thank you!) and 
shortened it to ps -C weewxd -o %mem as that is the parameter I am 
interested in tracking. I then made the following script, which has a 
problem: It does not send the email when the first "threshold" is exceeded; 
it sends an email that the second threshold is exceeded and simultaneously 
restarts weewx. Do I have something in the wrong order in the script?


---
#!/bin/bash

threshold=3
threshold2=4

usage=$(($(ps -C weewxd -o %mem |awk 'NR==2 {printf ("%.0f", $1}')))   

if [ "$usage" -gt "$threshold2" ]

then

sudo /etc/init.d/service_name restart

 if [ "$usage" -gt "$threshold" ]

 then

 echo "The memory usage has reached $usage% on $HOSTNAME." | mail -s 
"High Memory Usage Alert" someoneseamailaddress

 fi
fi
---




-- 
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/6b2ec4dd-f453-4a53-9e08-2c8d81e4508f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-23 Thread Steve2Q
Leon: thank you very much for your reply...lots of interesting things 
there. I like the top command rather than free as top would give me the % 
of memory used by weewxd. I took the command ps -C weewxd -o 
comm,size,rss,vsize,%mem (which I never saw before, thank you!) and 
shortened it to ps -C weewxd -o %mem as that is the parameter I am 
interested in tracking. I then made the following script, which has a 
problem: It does not send the email when the first "threshold" is exceeded; 
it sends an email that the second threshold is exceeded and simultaneously 
restarts weewx. Do I have something in the wrong order in the script?


---
#!/bin/bash

threshold=3
threshold2=4

usage=$(($(ps -C weewxd -o %mem |awk 'NR==2 {printf ("%.0f", $1}')))   

if [ "$usage" -gt "$threshold2" ]

then

sudo /etc/init.d/service_name restart

 if [ "$usage" -gt "$threshold" ]

 then

 echo "The memory usage has reached $usage% on $HOSTNAME." | mail -s 
"High Memory Usage Alert" userssemailaddress

 fi
fi
---




-- 
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/722fbf07-c6b1-467b-b5a3-7ef1c9f80d81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-23 Thread Steve2Q

Leon: thank you very much for your reply...lots of interesting things 
there. I like the top command rather than free as top would show me the % 
of memory used by weewxd. I took the command ps -C weewxd -o 
comm,size,rss,vsize,%mem (which I never saw before, thank you!) and 
shortened it to ps -C weewxd -o %mem as that is the parameter I am 
interested in tracking. I then made the following script, which has a 
problem: It does not send the email when the first "threshold" is exceeded; 
it sends an email that the second threshold is exceeded and simultaneously 
restarts weewx. Do I have something in the wrong order in the script?


---
#!/bin/bash

threshold=3
threshold2=4

usage=$(($(ps -C weewxd -o %mem |awk 'NR==2 {printf ("%.0f", $1}')))   

if [ "$usage" -gt "$threshold2" ]

then

sudo /etc/init.d/service_name restart

 if [ "$usage" -gt "$threshold" ]

 then

 echo "The memory usage has reached $usage% on $HOSTNAME." | mail -s 
"High Memory Usage Alert" x...@mail.com


 fi
fi
---




-- 
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/198a5f4c-b558-4aec-abc7-b61cb2fdb46c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-22 Thread Leon Shaner
Hey, Steve,

I must have missed the context, but if you are looking at overall system memory 
growth, well, it's a normal / healthy thing for a Linux kernel to try to use as 
much memory as possible at all times, to keep from having to go back to disk 
for code pages as different processes context switch in/out of the scheduler.   
Even as memory is freed by a program, the kernel won't bother to go back and 
re-use free'd pages unless/until there are no more previously unused memory 
pages available.
At that point the kernel will run the free memory "scanner" to go through the 
list of freed pages to find some to allocate to some other program requesting 
memory.

In a healthy system with plenty of RAM the free memory scanner should rarely 
run.
If the scanner runs a lot, then that means memory pressure is high and so THERE 
would be your indication that you're running low on memory, not "free -m" 
indicating a high number (because a high number is a good/normal thing in 
Linux).

What you should be most concerned about is if the system is starting to 
actually use swap, because then that means that not only is the physical RAM 
full, and freed pages are constantly being turned over / re-used, but the 
kernel is ALSO having to dip into virtual memory by swapping out (to disk) 
things not currently running, and then swapping those things back in when the 
associated processes are brought back to the running state by the process 
scheduler.

I like to use "top" to see what's going on with swap usage, but you can also 
get the info via other ways, such as:

$ cat /proc/meminfo
$ vmstat

(Etc etc)...

As for how to track the *real* indicator of memory pressure, that being the 
free memory scanner running too frequently, I'd look to "sar" for that.

I didn't see mention of what platform you are on, but for me on RPI, I get sar 
via:

$ sudo apt-get install sysstat
(And enable it in "/etc/default/sysstat").

And then these go in root's cron, a la "sudo crontab -e"

# Enable SAR:
# Collect measurements at 10-minute intervals
0,10,20,30,40,50   * * * *   /usr/lib/sysstat/sa1
# Create daily reports and purge old files
0  0 * * *   /usr/lib/sysstat/sa2 -A



After sa1 has been running a few times (say, give it an hour) then you can use 
"sar -B" to see the "pgscand/s" statistics (and related).

Of course check "man sar" for more details.


Like I said I missed the context, but did you previously capture some data to 
suggest that weewxd is growing and growing in its memory consumption?

Here is a handy command you can use to check it:

$ ps -C weewxd -o comm,size,rss,vsize,%mem
COMMAND  SIZE   RSSVSZ %MEM
weewxd  88616 71816 102640 16.1

You can use "man ps" to understand what size and RSS is, but if those grow and 
grow and grow, then that's usually an indicator of a memory leak in the code.

If you run that ps command in a loop, checking it say once every 10 minutes you 
can do some math to gauge how much it is growing.

A la:

$ while [ 1 ] ; do
ps -C weewxd -o comm,size,rss,vsize,%mem
sleep 600
done | tee -a /var/tmp/weewxd_size.txt

Wouldn't be too hard to just show the delta in the numbers.
Lemme know if you're still reading this far and I'll take a few seconds to show 
such an example.  ;-)

Regards,
\Leon
--
Leon Shaner :: Dearborn, Michigan (iPad Pro)

> On May 22, 2019, at 12:14 PM, Steve2Q  wrote:
> 
> A little follow up. As the memory growth is still happening, I implemented a 
> script which runs the program free -m and does a little calculation to 
> determine if memory use is over 80% (or any % I want to use). If mem >80% 
> weewx is restarted. So at least it now will run unattended.
> 
> A new question with Steel Gauges. I did the re-installation of RTG on April 
> 9. I just noticed that the gauges themselves are working perfectly, the pop 
> up charts are showing April 9; they have not updated. I probably have the 
> wrong syntax somewhere?
> 
> Steve
> 
> -- 
> 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/aa2ae09d-6a65-4c1d-aff5-46332084ade7%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/170C7D38-46B5-4285-BFC4-C82807F8DB7B%40isylum.org.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-05-22 Thread Steve2Q
A little follow up. As the memory growth is still happening, I implemented 
a script which runs the program free -m and does a little calculation to 
determine if memory use is over 80% (or any % I want to use). If mem >80% 
weewx is restarted. So at least it now will run unattended.

A new question with Steel Gauges. I did the re-installation of RTG on April 
9. I just noticed that the gauges themselves are working perfectly, the pop 
up charts are showing April 9; they have not updated. I probably have the 
wrong syntax somewhere?

Steve

-- 
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/aa2ae09d-6a65-4c1d-aff5-46332084ade7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-03-13 Thread Steve2Q
Seems like I may not be upgrading. I have to point out that even after 
switching back to 11rc3 the memory growth is still there albeit slower. I 
guess I did not notice it before as the failure occurred over a longer 
period of time than what happened when a different driver was installed 
after an update. Here are the results from top:

Version 11rc3  94 hours 7.2% Version 0.25  96 hours  9.9%

-- 
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: Second crash after 11 days

2019-03-12 Thread Thomas Keffer
Looks like memory growth is a problem using Python 3, under Debian 9.8.
Sigh.

http://www.threefools.org/weewx/

-tk

On Mon, Mar 4, 2019 at 5:31 AM Thomas Keffer  wrote:

> Both the 0.11rc3 and 0.25 drivers are compatible with the current version
> of WeeWX.
>
> I guess we'll include the v0.25 driver in the distribution, but it sure is
> ugly and inefficient!
>
> -tk
>
> On Sun, Mar 3, 2019 at 10:06 AM Steve2Q  wrote:
>
>> Hello;  as of today, Weewx has been running for 96 hours and Top shows
>> memory to be 9.9% which is a big improvement. I don't know if you want to
>> do any more tweaking, Tom. If not, I can always set a cron to stop and
>> restart Weewx once a month. This would be a restart when Mem = 54%
>>
>> I would like to install the newest Weewx version, so would I be safe in
>> assuming that driver v 0.25 will act the same as now?  And just in case, if
>> I do run into problems, would my old 11rc3 driver be compatible with the
>> newest Weewx version if I have to revert?
>>
>> --
>> 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: Second crash after 11 days

2019-03-04 Thread Thomas Keffer
Both the 0.11rc3 and 0.25 drivers are compatible with the current version
of WeeWX.

I guess we'll include the v0.25 driver in the distribution, but it sure is
ugly and inefficient!

-tk

On Sun, Mar 3, 2019 at 10:06 AM Steve2Q  wrote:

> Hello;  as of today, Weewx has been running for 96 hours and Top shows
> memory to be 9.9% which is a big improvement. I don't know if you want to
> do any more tweaking, Tom. If not, I can always set a cron to stop and
> restart Weewx once a month. This would be a restart when Mem = 54%
>
> I would like to install the newest Weewx version, so would I be safe in
> assuming that driver v 0.25 will act the same as now?  And just in case, if
> I do run into problems, would my old 11rc3 driver be compatible with the
> newest Weewx version if I have to revert?
>
> --
> 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: Second crash after 11 days

2019-03-03 Thread Steve2Q
Hello;  as of today, Weewx has been running for 96 hours and Top shows 
memory to be 9.9% which is a big improvement. I don't know if you want to 
do any more tweaking, Tom. If not, I can always set a cron to stop and 
restart Weewx once a month. This would be a restart when Mem = 54%

I would like to install the newest Weewx version, so would I be safe in 
assuming that driver v 0.25 will act the same as now?  And just in case, if 
I do run into problems, would my old 11rc3 driver be compatible with the 
newest Weewx version if I have to revert?

-- 
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: Second crash after 11 days

2019-03-01 Thread Steve2Q
Here are today's numbers: 48 hours at 6.6%. While it is still going up, at 
the present rate I estimate that it should hit 90% in 55 days, which is 
much better than the 11 days it started at. Maybe it will level off. I will 
continue my updates. And thank you Tom and Matt for continuing to help.

-- 
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: Second crash after 11 days

2019-02-28 Thread Steve2Q
Tom: I will let it run as is, and report back tomorrow with 48 hour stats.

-- 
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: Second crash after 11 days

2019-02-28 Thread Thomas Keffer
5% is way better than before, no?

I would expect occasional buffer errors with this version. The serial port
is constantly getting opened and closed. If a new packet comes in at the
wrong time, parts of it could get missed.

On Thu, Feb 28, 2019 at 10:22 AM Steve2Q  wrote:

> Tom; at 25 hours top shows 5.0% v  4.4% at 24 hours for 11rc3 and is still
> going up.
>
> Also 0.25 is throwing off sporadic buffer errors as follows.
>
> --
> 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: Second crash after 11 days

2019-02-28 Thread Steve2Q
Tom; at 25 hours top shows 5.0% v  4.4% at 24 hours for 11rc3 and is still 
going up.

Also 0.25 is throwing off sporadic buffer errors as follows.

-- 
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: Second crash after 11 days

2019-02-28 Thread Thomas Keffer
Steve, progress report? Is version 0.25 holding steady?

On Wed, Feb 27, 2019 at 9:33 AM Thomas Keffer  wrote:

> Well, that's the current kernel version. Let's see how it goes with the
> new Ultimeter driver.
>
> -tk
>
> On Wed, Feb 27, 2019 at 8:58 AM Steve2Q  wrote:
>
>> I am going to try .25 now. Here is the result of uname -a
>>
>> --
>> 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: Second crash after 11 days

2019-02-27 Thread Thomas Keffer
Well, that's the current kernel version. Let's see how it goes with the new
Ultimeter driver.

-tk

On Wed, Feb 27, 2019 at 8:58 AM Steve2Q  wrote:

> I am going to try .25 now. Here is the result of uname -a
>
> --
> 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: Second crash after 11 days

2019-02-27 Thread Steve2Q
I am going to try .25 now. Here is the result of uname -a

-- 
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: Second crash after 11 days

2019-02-27 Thread Thomas Keffer
The pl2303 is certainly a well known module. Which kernel?

*uname -a*

Here's yet another version, 0.25. This one opens and closes the port with
every read. Incredibly inefficient, but if it gets the job done...

-tk

On Wed, Feb 27, 2019 at 7:50 AM Steve2Q  wrote:

> Tom: The memory usage started at 3.4% on startup of Weewx. Then 6.8% at 14
> hours and now 7.3% at 16 hours. Here is the result of dmesg | tail
>
>
> --
> 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.
#!/usr/bin/env python
#
# Copyright 2014 Matthew Wall
# Copyright 2014 Nate Bargmann 
# See the file LICENSE.txt for your rights.
#
# Credit to and contributions from:
#   Jay Nugent (WB8TKL) and KRK6 for weather-2.kr6k-V2.1
# http://server1.nuge.com/~weather/
#   Steve (sesykes71) for testing the first implementations of this driver
#   Garret Power for improved decoding and proper handling of negative values
#   Chris Thompstone for testing the fast-read implementation
#
# Thanks to PeetBros for publishing the communication protocols and details
# about each model they manufacture.

"""Driver for Peet Bros Ultimeter weather stations except the Ultimeter II

This driver assumes the Ultimeter is emitting data in Peet Bros Data Logger
mode format.  This driver will set the mode automatically on stations
manufactured after 2004.  Stations manufactured before 2004 must be set to
data logger mode using the buttons on the console.

Resources for the Ultimeter stations

Ultimeter Models 2100, 2000, 800, & 100 serial specifications:
  http://www.peetbros.com/shop/custom.aspx?recid=29

Ultimeter 2000 Pinouts and Parsers:
  http://www.webaugur.com/ham-radio/52-ultimeter-2000-pinouts-and-parsers.html

Ultimeter II
  not supported by this driver

All models communicate over an RS-232 compatible serial port using three
wires--RXD, TXD, and Ground (except Ultimeter II which omits TXD).  Port
parameters are 2400, 8N1, with no flow control.

The Ultimeter hardware supports several "modes" for providing station data
to the serial port.  This driver utilizes the "modem mode" to set the date
and time of the Ultimeter upon initialization and then sets it into Data
Logger mode for continuous updates.

Modem Mode commands used by the driver
>A  Set Date and Time (decimal digits  = day of year,
 = minute of day; Jan 1 = , Midnight = )

>I  Set output mode to Data Logger Mode (continuous output)

See http://www.peetbros.com/shop/custom.aspx?recid=29

CHANGE HISTORY

0.20 02/13/2019
Changed from using serial.readline() to serial.read().
Ported to Python 3

0.21 02/21/2019
Now uses serial.inWaiting() to get the number of  bytes to be read,
instead of using a fixed number.

0.22 02/21/2019
Read a whole buffer full of bytes, but throw away any partial packets.

0.23 02/21/2019
Added debug info when no bytes are received.

0.24 02/26/2019
Read byte-by-byte.

0.25 02/27/2019
Open and close the port with every reading.
"""

from __future__ import with_statement
from __future__ import print_function

import serial
import syslog
import time

import weewx.drivers
import weewx.wxformulas
from weewx.units import INHG_PER_MBAR, MILE_PER_KM
from weeutil.weeutil import timestamp_to_string, GenWithPeek

DRIVER_NAME = 'Ultimeter'
DRIVER_VERSION = '0.25'


def loader(config_dict, _):
return UltimeterDriver(**config_dict[DRIVER_NAME])


def confeditor_loader():
return UltimeterConfEditor()


def logmsg(level, msg):
syslog.syslog(level, 'ultimeter: %s' % msg)


def logdbg(msg):
logmsg(syslog.LOG_DEBUG, msg)


def loginf(msg):
logmsg(syslog.LOG_INFO, msg)


def logerr(msg):
logmsg(syslog.LOG_ERR, msg)


def _fmt(x):
return ' '.join([b"%0.2X" % ord(c) for c in x])


class UltimeterDriver(weewx.drivers.AbstractDevice):
"""WeeWX driver that communicates with a Peet Bros Ultimeter station"""

def __init__(self, **stn_dict):
"""Initialize an instance of UltimeterDriver

model: station model, e.g., 'Ultimeter 2000' or 'Ultimeter 100'
[Optional. Default is 'Ultimeter']

port - serial port
[Optional. Default is /dev/ttyUSB0]

max_tries - how often to retry serial communication before giving up
[Optional. Default is 5]

retry_wait -- After an error, how long to wait before retrying.
[Optional. Default is 3]

debug_serial: Set to non-zero fo

Re: [weewx-user] Re: Second crash after 11 days

2019-02-27 Thread Steve2Q
Follow up: I did not stop Weewx before unplugging/replugging the USB/serial 
adapter from the Pi. I got the following, so I had to reboot to restart 
Weewx.

-- 
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: Second crash after 11 days

2019-02-27 Thread Steve2Q
Tom: The memory usage started at 3.4% on startup of Weewx. Then 6.8% at 14 
hours and now 7.3% at 16 hours. Here is the result of dmesg | tail


-- 
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: Second crash after 11 days

2019-02-27 Thread Thomas Keffer
It started at about 4.4%, right?

You know, I just noticed another difference: 0.11 closed the serial port
after every read, whereas 0.2x opens it only once, then leaves it open for
all reads. That makes me think there might be an issue with the hardware
device driver.

Can you check and see what driver you are using? The easiest way is to
unplug the USB connection of your Ultimeter, then plug it back in. Then
show

*dmesg | tail*


-tk



On Wed, Feb 27, 2019 at 5:56 AM Steve2Q  wrote:

> Tom: here are the results as of now:  the new driver (v .24) is 6.8% after
> 14 hours v 4.0% after 16 hours with 11rc3. Looks like something else is
> still using increasing memory.
>
> --
> 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: Second crash after 11 days

2019-02-27 Thread Steve2Q
Tom: here are the results as of now:  the new driver (v .24) is 6.8% after 
14 hours v 4.0% after 16 hours with 11rc3. Looks like something else is 
still using increasing memory.

-- 
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: Second crash after 11 days

2019-02-26 Thread Thomas Keffer
We will solve the problem with the newer drivers! 😃
Try this version. It reads data byte-by-byte, just like 0.11rc3.

-tk

On Tue, Feb 26, 2019 at 1:40 PM Steve2Q  wrote:

> Weewx has been running for 24 hours now with the 11rc3 driver. Top shows
> 4.4% memory usage v 7.5% for the 0.22 driver. A previous run of 11rc3
> resulted in 4.8% after 31 hours v 9.0% for v 0.22
>
> So obviously there is something going on with the newer drivers, but I
> cannot hazard a guess as to what.
>
> If the memory problem cannot be solved with the newer drivers, can I use
> 11rc3 with the newest version of Weewx? I have never had a problem with
> negative values..in Florida we never get below 0.
>
> --
> 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.
#!/usr/bin/env python
#
# Copyright 2014 Matthew Wall
# Copyright 2014 Nate Bargmann 
# See the file LICENSE.txt for your rights.
#
# Credit to and contributions from:
#   Jay Nugent (WB8TKL) and KRK6 for weather-2.kr6k-V2.1
# http://server1.nuge.com/~weather/
#   Steve (sesykes71) for testing the first implementations of this driver
#   Garret Power for improved decoding and proper handling of negative values
#   Chris Thompstone for testing the fast-read implementation
#
# Thanks to PeetBros for publishing the communication protocols and details
# about each model they manufacture.

"""Driver for Peet Bros Ultimeter weather stations except the Ultimeter II

This driver assumes the Ultimeter is emitting data in Peet Bros Data Logger
mode format.  This driver will set the mode automatically on stations
manufactured after 2004.  Stations manufactured before 2004 must be set to
data logger mode using the buttons on the console.

Resources for the Ultimeter stations

Ultimeter Models 2100, 2000, 800, & 100 serial specifications:
  http://www.peetbros.com/shop/custom.aspx?recid=29

Ultimeter 2000 Pinouts and Parsers:
  http://www.webaugur.com/ham-radio/52-ultimeter-2000-pinouts-and-parsers.html

Ultimeter II
  not supported by this driver

All models communicate over an RS-232 compatible serial port using three
wires--RXD, TXD, and Ground (except Ultimeter II which omits TXD).  Port
parameters are 2400, 8N1, with no flow control.

The Ultimeter hardware supports several "modes" for providing station data
to the serial port.  This driver utilizes the "modem mode" to set the date
and time of the Ultimeter upon initialization and then sets it into Data
Logger mode for continuous updates.

Modem Mode commands used by the driver
>A  Set Date and Time (decimal digits  = day of year,
 = minute of day; Jan 1 = , Midnight = )

>I  Set output mode to Data Logger Mode (continuous output)

See http://www.peetbros.com/shop/custom.aspx?recid=29

CHANGE HISTORY

0.20 02/13/2019
Changed from using serial.readline() to serial.read().
Ported to Python 3

0.21 02/21/2019
Now uses serial.inWaiting() to get the number of  bytes to be read,
instead of using a fixed number.

0.22 02/21/2019
Read a whole buffer full of bytes, but throw away any partial packets.

0.23 02/21/2019
Added debug info when no bytes are received.

0.24 02/26/2019
Read byte-by-byte.
"""

from __future__ import with_statement
from __future__ import print_function

import serial
import syslog
import time

import weewx.drivers
import weewx.wxformulas
from weewx.units import INHG_PER_MBAR, MILE_PER_KM
from weeutil.weeutil import timestamp_to_string, GenWithPeek

DRIVER_NAME = 'Ultimeter'
DRIVER_VERSION = '0.24'


def loader(config_dict, _):
return UltimeterDriver(**config_dict[DRIVER_NAME])


def confeditor_loader():
return UltimeterConfEditor()


def logmsg(level, msg):
syslog.syslog(level, 'ultimeter: %s' % msg)


def logdbg(msg):
logmsg(syslog.LOG_DEBUG, msg)


def loginf(msg):
logmsg(syslog.LOG_INFO, msg)


def logerr(msg):
logmsg(syslog.LOG_ERR, msg)


def _fmt(x):
return ' '.join([b"%0.2X" % ord(c) for c in x])


class UltimeterDriver(weewx.drivers.AbstractDevice):
"""WeeWX driver that communicates with a Peet Bros Ultimeter station"""

def __init__(self, **stn_dict):
"""Initialize an instance of UltimeterDriver

model: station model, e.g., 'Ultimeter 2000' or 'Ultimeter 100'
[Optional. Default is 'Ultimeter']

port - serial port
[Optional. Default is /dev/ttyUSB0]

max_tries - how often to retry serial communication befor

Re: [weewx-user] Re: Second crash after 11 days

2019-02-26 Thread Steve2Q
Weewx has been running for 24 hours now with the 11rc3 driver. Top shows 
4.4% memory usage v 7.5% for the 0.22 driver. A previous run of 11rc3 
resulted in 4.8% after 31 hours v 9.0% for v 0.22

So obviously there is something going on with the newer drivers, but I 
cannot hazard a guess as to what.

If the memory problem cannot be solved with the newer drivers, can I use 
11rc3 with the newest version of Weewx? I have never had a problem with 
negative values..in Florida we never get below 0.

-- 
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: Second crash after 11 days

2019-02-25 Thread Steve2Q
I meant 11rc3.

-- 
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: Second crash after 11 days

2019-02-25 Thread Steve2Q
Tom..I will put 11rc2 back and let it run for at least 24 hours. Then, we will 
know for sure if there is an increase in memory usage.
I will post the results.

Steve

-- 
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: Second crash after 11 days

2019-02-25 Thread Thomas Keffer
Well, now I'm thoroughly confused. The v0.11rc3 version did not use
readline() and it showed no memory growth. V.22 also does not use
readline(), but it does show memory growth.

Either we're mistaken and 0.11rc3 does show memory growth, or something
else besides readline() is causing it.

-tk

On Mon, Feb 25, 2019 at 6:07 AM Ralph Underwood  wrote:

> I haven't been using TOP to monitor memory usage - I have cmon running and
> note the total memory use is creeping up.  I restarted this station a
> couple of times yesterday. I had a request to show the freezing level on
> some charts - ended up setting soilTemp4 to 32 degrees and including it on
> some charts.
>
>
> [image: Screen Shot 2019-02-25 at 5.56.31 AM.png]
>
>
>
> Ralph
>
>
>
> On Sunday, February 24, 2019 at 6:34:05 PM UTC-8, Steve2Q wrote:
>>
>> My experience so far:
>>
>> With driver v 0.22, I first did a run of 44 hours with the DISABLE_
>> removed from the set time and get time portions of the driver. TOP showed
>> 3.3% memory usage at startup, which climbed to 10.4% at 44 hours.
>>
>> I then replaced the DISABLE_ in both lines which put the driver back to
>> its original state. Again there was 3.3% usage at startup, and while I am
>> writing this, I have 9.1% after 36 hours. I am going to let in run in the
>> current state to see if it levels off.
>>
>> Ralph, do you see the same thing happening?
>>
> --
> 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: Second crash after 11 days

2019-02-25 Thread Ralph Underwood
I haven't been using TOP to monitor memory usage - I have cmon running and 
note the total memory use is creeping up.  I restarted this station a 
couple of times yesterday. I had a request to show the freezing level on 
some charts - ended up setting soilTemp4 to 32 degrees and including it on 
some charts. 


[image: Screen Shot 2019-02-25 at 5.56.31 AM.png]



Ralph



On Sunday, February 24, 2019 at 6:34:05 PM UTC-8, Steve2Q wrote:
>
> My experience so far:
>
> With driver v 0.22, I first did a run of 44 hours with the DISABLE_ 
> removed from the set time and get time portions of the driver. TOP showed 
> 3.3% memory usage at startup, which climbed to 10.4% at 44 hours.
>
> I then replaced the DISABLE_ in both lines which put the driver back to 
> its original state. Again there was 3.3% usage at startup, and while I am 
> writing this, I have 9.1% after 36 hours. I am going to let in run in the 
> current state to see if it levels off.
>
> Ralph, do you see the same thing happening?
>

-- 
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: Second crash after 11 days

2019-02-24 Thread Steve2Q
My experience so far:

With driver v 0.22, I first did a run of 44 hours with the DISABLE_ removed 
from the set time and get time portions of the driver. TOP showed 3.3% 
memory usage at startup, which climbed to 10.4% at 44 hours.

I then replaced the DISABLE_ in both lines which put the driver back to its 
original state. Again there was 3.3% usage at startup, and while I am 
writing this, I have 9.1% after 36 hours. I am going to let in run in the 
current state to see if it levels off.

Ralph, do you see the same thing happening?

-- 
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: Second crash after 11 days

2019-02-21 Thread Steve2Q
I saw no errors during the run of over 30 minutes. I edited out the 
DISABLED_  under the get_time and set_time portion of the driver and 
restarted with debugs commented out. TOP show weexd at 3.3%

-- 
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: Second crash after 11 days

2019-02-21 Thread Thomas Keffer
I guess so. Are you worried about the log size?

I just want to make sure we capture any data gaps.

-tk

On Thu, Feb 21, 2019 at 9:28 AM Steve2Q  wrote:

> Tom..is 30 minutes enough time with debug and debug_serial both set to 1 ?
>
> --
> 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: Second crash after 11 days

2019-02-21 Thread Steve2Q
Tom..is 30 minutes enough time with debug and debug_serial both set to 1 ?

-- 
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: Second crash after 11 days

2019-02-21 Thread Thomas Keffer
Be sure to run with debug=1 and debug_serial=1 as per my earlier email
.

On Thu, Feb 21, 2019 at 9:18 AM Ralph Underwood  wrote:

> I have v0.22 running now and it appears to work - no buffer errors.
>
> Ralph
>
> --
> 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: Second crash after 11 days

2019-02-21 Thread Ralph Underwood
I have v0.22 running now and it appears to work - no buffer errors.

Ralph

-- 
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: Second crash after 11 days

2019-02-21 Thread Steve2Q
I am presently testing 0.22, Tom and Matthew. So far the output is not 
showing any buffer length errors. I will let it run for at least 30 minutes.

Steve

-- 
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: Second crash after 11 days

2019-02-21 Thread Ralph Underwood
I will test v0.22.  Thanks!!

On Thursday, February 21, 2019 at 9:04:04 AM UTC-8, Ralph Underwood wrote:
>
> The URL for the development station is http://www.mapleleaf.ruresearch.com. 
>  This station is in my basement lab area - the wind and rain stuff is 
> sitting on a counter so that's why there are no readings for them. The 
> "Temperature 1" reading is from a DS18B20 sensor connected to an Adafruit 
> Huzzah ESP8266 which uses wifi / mqtt. I have a python program running 
> which collects the mqtt data and writes it to a file, which filepile.py 
> reads and puts into WeeWx.  It's working, however the goal is to modify the 
> existing wxMesh and wxMQTT to operate as WeeWx service.
>
>
> The cmon memory chart shows the increasing memory use, there is a big drop 
> when I restarted WeeWx this AM and then started a browser to download the 
> ultimeter.py files.
>
> The driver I tried was the last one Tom posted.
>
>
> On Thursday, February 21, 2019 at 8:32:13 AM UTC-8, Steve2Q wrote:
>>
>> Ralph. Thanks for joining this discussion. A few questions:
>>
>> 1. What is your station URL? There are not too many of us Ultimeter 
>> users, but I think it is great that Tom, Matt, Andrew, Vince and so many 
>> other help out our small population as best they can. Having another 2100 
>> user may make debugging easier (?).
>>
>> 2. Which version of the driver did you try? The newest one, I assume. I 
>> am going to try it with the debug "switches" turned on. And which version 
>> did you roll back to?
>>
>> Steve
>>
>>>
>>>

-- 
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: Second crash after 11 days

2019-02-21 Thread Ralph Underwood
The URL for the development station is http://www.mapleleaf.ruresearch.com. 
 This station is in my basement lab area - the wind and rain stuff is 
sitting on a counter so that's why there are no readings for them. The 
"Temperature 1" reading is from a DS18B20 sensor connected to an Adafruit 
Huzzah ESP8266 which uses wifi / mqtt. I have a python program running 
which collects the mqtt data and writes it to a file, which filepile.py 
reads and puts into WeeWx.  It's working, however the goal is to modify the 
existing wxMesh and wxMQTT to operate as WeeWx service.


The cmon memory chart shows the increasing memory use, there is a big drop 
when I restarted WeeWx this AM and then started a browser to download the 
ultimeter.py files.

The driver I tried was the last one Tom posted.


On Thursday, February 21, 2019 at 8:32:13 AM UTC-8, Steve2Q wrote:
>
> Ralph. Thanks for joining this discussion. A few questions:
>
> 1. What is your station URL? There are not too many of us Ultimeter users, 
> but I think it is great that Tom, Matt, Andrew, Vince and so many other 
> help out our small population as best they can. Having another 2100 user 
> may make debugging easier (?).
>
> 2. Which version of the driver did you try? The newest one, I assume. I am 
> going to try it with the debug "switches" turned on. And which version did 
> you roll back to?
>
> Steve
>
>>
>>

-- 
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: Second crash after 11 days

2019-02-21 Thread Thomas Keffer
OK, thanks, Ralph.

Let's try this version of the driver, v0.22.  This one is a little more
sophisticated. It reads in buffer fulls (and, thus, is more efficient), but
parcels them out byte-by-byte. It has the ability to throw away anything
leading up to the buffer header (b'!!').

This is v0.22. In your correspondence make sure you indicate which version
of the driver you are using so we don't end up chasing our tails.

I don't know how Matthew does it, writing drivers by remote control!

-tk

On Thu, Feb 21, 2019 at 8:32 AM Steve2Q  wrote:

> Ralph. Thanks for joining this discussion. A few questions:
>
> 1. What is your station URL? There are not too many of us Ultimeter users,
> but I think it is great that Tom, Matt, Andrew, Vince and so many other
> help out our small population as best they can. Having another 2100 user
> may make debugging easier (?).
>
> 2. Which version of the driver did you try? The newest one, I assume. I am
> going to try it with the debug "switches" turned on. And which version did
> you roll back to?
>
> Steve
>
>>
>> --
> 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.
#!/usr/bin/env python
#
# Copyright 2014 Matthew Wall
# Copyright 2014 Nate Bargmann 
# See the file LICENSE.txt for your rights.
#
# Credit to and contributions from:
#   Jay Nugent (WB8TKL) and KRK6 for weather-2.kr6k-V2.1
# http://server1.nuge.com/~weather/
#   Steve (sesykes71) for testing the first implementations of this driver
#   Garret Power for improved decoding and proper handling of negative values
#   Chris Thompstone for testing the fast-read implementation
#
# Thanks to PeetBros for publishing the communication protocols and details
# about each model they manufacture.

"""Driver for Peet Bros Ultimeter weather stations except the Ultimeter II

This driver assumes the Ultimeter is emitting data in Peet Bros Data Logger
mode format.  This driver will set the mode automatically on stations
manufactured after 2004.  Stations manufactured before 2004 must be set to
data logger mode using the buttons on the console.

Resources for the Ultimeter stations

Ultimeter Models 2100, 2000, 800, & 100 serial specifications:
  http://www.peetbros.com/shop/custom.aspx?recid=29

Ultimeter 2000 Pinouts and Parsers:
  http://www.webaugur.com/ham-radio/52-ultimeter-2000-pinouts-and-parsers.html

Ultimeter II
  not supported by this driver

All models communicate over an RS-232 compatible serial port using three
wires--RXD, TXD, and Ground (except Ultimeter II which omits TXD).  Port
parameters are 2400, 8N1, with no flow control.

The Ultimeter hardware supports several "modes" for providing station data
to the serial port.  This driver utilizes the "modem mode" to set the date
and time of the Ultimeter upon initialization and then sets it into Data
Logger mode for continuous updates.

Modem Mode commands used by the driver
>A  Set Date and Time (decimal digits  = day of year,
 = minute of day; Jan 1 = , Midnight = )

>I  Set output mode to Data Logger Mode (continuous output)

See http://www.peetbros.com/shop/custom.aspx?recid=29

CHANGE HISTORY

0.20 02/13/2019
Changed from using serial.readline() to serial.read().
Ported to Python 3

0.21 02/21/2019
Now uses serial.inWaiting() to get the number of  bytes to be read,
instead of using a fixed number.

0.22 02/21/2019
Read a whole buffer full of bytes, but throw away any partial packets.

"""



from __future__ import with_statement
from __future__ import print_function

import serial
import syslog
import time

import weewx.drivers
import weewx.wxformulas
from weewx.units import INHG_PER_MBAR, MILE_PER_KM
from weeutil.weeutil import timestamp_to_string, GenWithPeek

DRIVER_NAME = 'Ultimeter'
DRIVER_VERSION = '0.22'


def loader(config_dict, _):
return UltimeterDriver(**config_dict[DRIVER_NAME])

def confeditor_loader():
return UltimeterConfEditor()


def logmsg(level, msg):
syslog.syslog(level, 'ultimeter: %s' % msg)

def logdbg(msg):
logmsg(syslog.LOG_DEBUG, msg)

def loginf(msg):
logmsg(syslog.LOG_INFO, msg)

def logerr(msg):
logmsg(syslog.LOG_ERR, msg)


def _fmt(x):
return ' '.join([b"%0.2X" % ord(c) for c in x])


class UltimeterDriver(weewx.drivers.AbstractDevice):
"""weewx driver that communicates with a Peet Bros Ultimeter station

model: station model, e.g., 'Ultimeter 2000' or 'Ultimeter 100'
[Optional. Defau

Re: [weewx-user] Re: Second crash after 11 days

2019-02-21 Thread Steve2Q
Ralph. Thanks for joining this discussion. A few questions:

1. What is your station URL? There are not too many of us Ultimeter users, 
but I think it is great that Tom, Matt, Andrew, Vince and so many other 
help out our small population as best they can. Having another 2100 user 
may make debugging easier (?).

2. Which version of the driver did you try? The newest one, I assume. I am 
going to try it with the debug "switches" turned on. And which version did 
you roll back to?

Steve

>
>

-- 
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: Second crash after 11 days

2019-02-21 Thread Ralph Underwood
I have a couple of stations with Ultimeter 2100 and usb-serial connections 
to RPi 3 B+.  Both appear to have increasing memory usage.  

I just copied the "new" ultimeter.py driver to the driver directory and 
restarted - this was my result. I went back to "old" version of driver and 
restarted OK.

Feb 21 07:26:54 RanchWx weewx[7135]: engine: Starting up weewx version 3.9.1
Feb 21 07:26:54 RanchWx weewx[7135]: engine: Station does not support 
reading the time
Feb 21 07:26:54 RanchWx weewx[7135]: engine: Starting main packet loop.
Feb 21 07:26:54 RanchWx weewx[7135]: ultimeter: Failed attempt 1 of 5 to 
get readings: Unexpected buffer length 49
Feb 21 07:26:57 RanchWx weewx[7135]: ultimeter: Failed attempt 2 of 5 to 
get readings: Unexpected buffer length 446
Feb 21 07:27:00 RanchWx weewx[7135]: ultimeter: Failed attempt 3 of 5 to 
get readings: Unexpected buffer length 446
Feb 21 07:27:03 RanchWx weewx[7135]: ultimeter: Failed attempt 4 of 5 to 
get readings: Unexpected buffer length 463
Feb 21 07:27:06 RanchWx weewx[7135]: ultimeter: Failed attempt 5 of 5 to 
get readings: Unexpected buffer length 461
Feb 21 07:27:09 RanchWx weewx[7135]: ultimeter: Max retries (5) exceeded 
for readings
Feb 21 07:27:09 RanchWx weewx[7135]: engine: Main loop exiting. Shutting 
engine down.
Feb 21 07:27:09 RanchWx weewx[7135]: ultimeter: close serial port 
/dev/ttyUSB0
Feb 21 07:27:10 RanchWx weewx[7135]: engine: Caught WeeWxIOError: Max 
retries (5) exceeded for readings
Feb 21 07:27:10 RanchWx weewx[7135]:   Waiting 60 seconds then 
retrying...


On Thursday, February 21, 2019 at 5:51:41 AM UTC-8, Thomas Keffer wrote:
>
> Oops. The set of valid buffer lengths was wrong. Try this one.
>
>
>
> On Thu, Feb 21, 2019 at 5:49 AM Thomas Keffer  > wrote:
>
>> Possibly, but I don't think so. The way I read the documents, a given 
>> instrument has a given buffer length. Yours seems to be 52 bytes, which is 
>> what the driver is expecting.
>>
>> The trouble is there is a communications glitch. Then the number of  
>> bytes may be unknown.
>>
>> It would help if you could include the log for one of these glitches. Be 
>> sure to not only set debug=1 at the top of weewx.conf, but also set 
>> debug_serial in the [Ultimeter] section:
>>
>> debug = 1
>> ...
>>
>> [Ultimeter]
>>   port = XXX
>>   debug_serial = 1
>>
>>
>> At the risk of confusing things, here's another version of the driver. 
>> This one looks for the number of bytes in the serial port buffer, then 
>> reads exactly that many. So, it should work for 48, 50, or 52 byte buffers. 
>> But, it could still have a sync problem.
>>
>> -tk
>>
>> On Thu, Feb 21, 2019 at 5:39 AM Steve2Q > 
>> wrote:
>>
>>> A follow up: According to Peet Bros web site the Ultimeter 2100 (and 
>>> several other models) emit data in 48 byte chunks in Data Logger Mode, 
>>> while ultimeter.py (version .20) apparently expects 52 bytes. Could this be 
>>> the problem?. Here is a snip from their web site:
>>>
>>>
>>>- *Data Logger Mode**:  to manually select, press CLEAR + WIND SPEED 
>>>for 3 seconds. ** While in this mode, records are sent out 
>>>continuously at up to about 120 per minute.  The total record size is 48 
>>>hex digits + header, carriage return and line feed.  (All models)* 
>>>- *Packet Mode**:  to manually select, press CLEAR + WIND CHILL for 
>>>3 seconds.  While in this mode, one record is output every five minutes 
>>> (at 
>>>5 min past the hour, 10 min past, 15 min past, etc.). The total record 
>>>length is 52 hex digits + header, carriage return and line feed.  (All 
>>>models)*
>>>
>>> and this:
>>>
>>> *DATA LOGGER MODE - RECORD STRUCTURE* 
>>>
>>>- *Header = !!  (or || if in Multiple Output Mode) * 
>>>- *Data Fields * 
>>>   - *1. Wind Speed (0.1 kph) * 
>>>   - *2. Wind Direction (0-255) * 
>>>   - *3. Outdoor Temp (0.1 deg F) * 
>>>   - *4. Rain* Long Term Total (0.01 inches) * 
>>>   - *5. Barometer (0.1 mbar) * 
>>>   - *6. Indoor Temp (0.1 deg F) * 
>>>   - *7. Outdoor Humidity (0.1%) * 
>>>   - *8. Indoor Humidity (0.1%) * 
>>>   - *9. Date (day of year) * 
>>>   - *10. Time (minute of day) * 
>>>   - *11. Today's Rain Total (0.01 inches)* * 
>>>   - *12. 1 Minute Wind Speed Average (0.1kph)* *
>>>- *Carriage Return & Line Feed *
>>>
>>>
>>> **Some instruments may not include field 12, some may not include 11 or 
>>> 12. Please contact Peet Bros. if this presents any problem. Total size: 40, 
>>> 44 or 48 characters (hex digits) + header, carriage return and line feed. *
>>>
>>> *PACKET MODE - RECORD STRUCTURE* 
>>>
>>>- *Header = $ULTW * 
>>>- *Data Fields * 
>>>   - *1. Wind Speed Peak over last 5 min. (0.1 kph) * 
>>>   - *2. Wind Direction of Wind Speed Peak (0-255) * 
>>>   - *3. Current Outdoor Temp (0.1 deg F) * 
>>>   - *4. Rain Long Term Total (0.01 in.) * 
>>>   - *5. Current Barometer (0.1 mbar) * 
>>>   - *6. Barometer 

Re: [weewx-user] Re: Second crash after 11 days

2019-02-21 Thread Andrew Milner
I read this as 48 data bytes + 2 for header + cr +lf = 52



On Thursday, 21 February 2019 15:39:42 UTC+2, Steve2Q wrote:
>
> A follow up: According to Peet Bros web site the Ultimeter 2100 (and 
> several other models) emit data in 48 byte chunks in Data Logger Mode, 
> while ultimeter.py (version .20) apparently expects 52 bytes. Could this be 
> the problem?. Here is a snip from their web site:
>
>
>- *Data Logger Mode**:  to manually select, press CLEAR + WIND SPEED 
>for 3 seconds. ** While in this mode, records are sent out 
>continuously at up to about 120 per minute.  The total record size is 48 
>hex digits + header, carriage return and line feed.  (All models)* 
>- *Packet Mode**:  to manually select, press CLEAR + WIND CHILL for 3 
>seconds.  While in this mode, one record is output every five minutes (at 
> 5 
>min past the hour, 10 min past, 15 min past, etc.). The total record 
> length 
>is 52 hex digits + header, carriage return and line feed.  (All models)*
>
> and this:
>
> *DATA LOGGER MODE - RECORD STRUCTURE* 
>
>- *Header = !!  (or || if in Multiple Output Mode) * 
>- *Data Fields * 
>   - *1. Wind Speed (0.1 kph) * 
>   - *2. Wind Direction (0-255) * 
>   - *3. Outdoor Temp (0.1 deg F) * 
>   - *4. Rain* Long Term Total (0.01 inches) * 
>   - *5. Barometer (0.1 mbar) * 
>   - *6. Indoor Temp (0.1 deg F) * 
>   - *7. Outdoor Humidity (0.1%) * 
>   - *8. Indoor Humidity (0.1%) * 
>   - *9. Date (day of year) * 
>   - *10. Time (minute of day) * 
>   - *11. Today's Rain Total (0.01 inches)* * 
>   - *12. 1 Minute Wind Speed Average (0.1kph)* *
>- *Carriage Return & Line Feed *
>
>
> **Some instruments may not include field 12, some may not include 11 or 
> 12. Please contact Peet Bros. if this presents any problem. Total size: 40, 
> 44 or 48 characters (hex digits) + header, carriage return and line feed. *
>
> *PACKET MODE - RECORD STRUCTURE* 
>
>- *Header = $ULTW * 
>- *Data Fields * 
>   - *1. Wind Speed Peak over last 5 min. (0.1 kph) * 
>   - *2. Wind Direction of Wind Speed Peak (0-255) * 
>   - *3. Current Outdoor Temp (0.1 deg F) * 
>   - *4. Rain Long Term Total (0.01 in.) * 
>   - *5. Current Barometer (0.1 mbar) * 
>   - *6. Barometer Delta Value(0.1 mbar) * 
>   - *7. Barometer Corr. Factor(LSW) * 
>   - *8. Barometer Corr. Factor(MSW) * 
>   - *9. Current Outdoor Humidity (0.1%) * 
>   - *10. Date (day of year) * 
>   - *11. Time (minute of day) * 
>   - *12. Today's Rain Total (0.01 inches)** 
>   - *13. 5 Minute Wind Speed Average (0.1kph)* *
>- *Carriage Return & Line Feed*
>
>
>
> **Some instruments may not include field 13, some may not include 12 or 
> 13. Please contact Peet Bros. if this presents any problem. *
>
> *Packet Mode records are output every five minutes:  first, upon selection 
> of Packet Mode; then, at every 5 minutes past the hour (12:00, 12:05, 
> 12:10, etc.), continuosly.*
>
> *Total size: 44, 48 or 52 characters (hex digits) + header, carriage 
> return and line feed. *
>
>
>

-- 
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: Second crash after 11 days

2019-02-21 Thread Thomas Keffer
Oops. The set of valid buffer lengths was wrong. Try this one.



On Thu, Feb 21, 2019 at 5:49 AM Thomas Keffer  wrote:

> Possibly, but I don't think so. The way I read the documents, a given
> instrument has a given buffer length. Yours seems to be 52 bytes, which is
> what the driver is expecting.
>
> The trouble is there is a communications glitch. Then the number of  bytes
> may be unknown.
>
> It would help if you could include the log for one of these glitches. Be
> sure to not only set debug=1 at the top of weewx.conf, but also set
> debug_serial in the [Ultimeter] section:
>
> debug = 1
> ...
>
> [Ultimeter]
>   port = XXX
>   debug_serial = 1
>
>
> At the risk of confusing things, here's another version of the driver.
> This one looks for the number of bytes in the serial port buffer, then
> reads exactly that many. So, it should work for 48, 50, or 52 byte buffers.
> But, it could still have a sync problem.
>
> -tk
>
> On Thu, Feb 21, 2019 at 5:39 AM Steve2Q  wrote:
>
>> A follow up: According to Peet Bros web site the Ultimeter 2100 (and
>> several other models) emit data in 48 byte chunks in Data Logger Mode,
>> while ultimeter.py (version .20) apparently expects 52 bytes. Could this be
>> the problem?. Here is a snip from their web site:
>>
>>
>>- *Data Logger Mode**:  to manually select, press CLEAR + WIND SPEED
>>for 3 seconds. ** While in this mode, records are sent out
>>continuously at up to about 120 per minute.  The total record size is 48
>>hex digits + header, carriage return and line feed.  (All models)*
>>- *Packet Mode**:  to manually select, press CLEAR + WIND CHILL for 3
>>seconds.  While in this mode, one record is output every five minutes (at 
>> 5
>>min past the hour, 10 min past, 15 min past, etc.). The total record 
>> length
>>is 52 hex digits + header, carriage return and line feed.  (All models)*
>>
>> and this:
>>
>> *DATA LOGGER MODE - RECORD STRUCTURE*
>>
>>- *Header = !!  (or || if in Multiple Output Mode) *
>>- *Data Fields *
>>   - *1. Wind Speed (0.1 kph) *
>>   - *2. Wind Direction (0-255) *
>>   - *3. Outdoor Temp (0.1 deg F) *
>>   - *4. Rain* Long Term Total (0.01 inches) *
>>   - *5. Barometer (0.1 mbar) *
>>   - *6. Indoor Temp (0.1 deg F) *
>>   - *7. Outdoor Humidity (0.1%) *
>>   - *8. Indoor Humidity (0.1%) *
>>   - *9. Date (day of year) *
>>   - *10. Time (minute of day) *
>>   - *11. Today's Rain Total (0.01 inches)* *
>>   - *12. 1 Minute Wind Speed Average (0.1kph)* *
>>- *Carriage Return & Line Feed *
>>
>>
>> **Some instruments may not include field 12, some may not include 11 or
>> 12. Please contact Peet Bros. if this presents any problem. Total size: 40,
>> 44 or 48 characters (hex digits) + header, carriage return and line feed. *
>>
>> *PACKET MODE - RECORD STRUCTURE*
>>
>>- *Header = $ULTW *
>>- *Data Fields *
>>   - *1. Wind Speed Peak over last 5 min. (0.1 kph) *
>>   - *2. Wind Direction of Wind Speed Peak (0-255) *
>>   - *3. Current Outdoor Temp (0.1 deg F) *
>>   - *4. Rain Long Term Total (0.01 in.) *
>>   - *5. Current Barometer (0.1 mbar) *
>>   - *6. Barometer Delta Value(0.1 mbar) *
>>   - *7. Barometer Corr. Factor(LSW) *
>>   - *8. Barometer Corr. Factor(MSW) *
>>   - *9. Current Outdoor Humidity (0.1%) *
>>   - *10. Date (day of year) *
>>   - *11. Time (minute of day) *
>>   - *12. Today's Rain Total (0.01 inches)**
>>   - *13. 5 Minute Wind Speed Average (0.1kph)* *
>>- *Carriage Return & Line Feed*
>>
>>
>>
>> **Some instruments may not include field 13, some may not include 12 or
>> 13. Please contact Peet Bros. if this presents any problem. *
>>
>> *Packet Mode records are output every five minutes:  first, upon
>> selection of Packet Mode; then, at every 5 minutes past the hour (12:00,
>> 12:05, 12:10, etc.), continuosly.*
>>
>> *Total size: 44, 48 or 52 characters (hex digits) + header, carriage
>> return and line feed. *
>>
>>
>> --
>> 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.
#!/usr/bin/env python
#
# Copyright 2014 Matthew Wall
# Copyright 2014 Nate Bargmann 
# See the file LICENSE.txt for your rights.
#
# Credit to and contributions from:
#   Jay Nugent (WB8TKL) and KRK6 for weather-2.kr6k-V2.1
# http://server1.nuge.com/~weather/
#   Steve (sesykes71) for testing the first implementations of this driver
#   Garret Power for improve

Re: [weewx-user] Re: Second crash after 11 days

2019-02-21 Thread Thomas Keffer
Possibly, but I don't think so. The way I read the documents, a given
instrument has a given buffer length. Yours seems to be 52 bytes, which is
what the driver is expecting.

The trouble is there is a communications glitch. Then the number of  bytes
may be unknown.

It would help if you could include the log for one of these glitches. Be
sure to not only set debug=1 at the top of weewx.conf, but also set
debug_serial in the [Ultimeter] section:

debug = 1
...

[Ultimeter]
  port = XXX
  debug_serial = 1


At the risk of confusing things, here's another version of the driver. This
one looks for the number of bytes in the serial port buffer, then reads
exactly that many. So, it should work for 48, 50, or 52 byte buffers. But,
it could still have a sync problem.

-tk

On Thu, Feb 21, 2019 at 5:39 AM Steve2Q  wrote:

> A follow up: According to Peet Bros web site the Ultimeter 2100 (and
> several other models) emit data in 48 byte chunks in Data Logger Mode,
> while ultimeter.py (version .20) apparently expects 52 bytes. Could this be
> the problem?. Here is a snip from their web site:
>
>
>- *Data Logger Mode**:  to manually select, press CLEAR + WIND SPEED
>for 3 seconds. ** While in this mode, records are sent out
>continuously at up to about 120 per minute.  The total record size is 48
>hex digits + header, carriage return and line feed.  (All models)*
>- *Packet Mode**:  to manually select, press CLEAR + WIND CHILL for 3
>seconds.  While in this mode, one record is output every five minutes (at 5
>min past the hour, 10 min past, 15 min past, etc.). The total record length
>is 52 hex digits + header, carriage return and line feed.  (All models)*
>
> and this:
>
> *DATA LOGGER MODE - RECORD STRUCTURE*
>
>- *Header = !!  (or || if in Multiple Output Mode) *
>- *Data Fields *
>   - *1. Wind Speed (0.1 kph) *
>   - *2. Wind Direction (0-255) *
>   - *3. Outdoor Temp (0.1 deg F) *
>   - *4. Rain* Long Term Total (0.01 inches) *
>   - *5. Barometer (0.1 mbar) *
>   - *6. Indoor Temp (0.1 deg F) *
>   - *7. Outdoor Humidity (0.1%) *
>   - *8. Indoor Humidity (0.1%) *
>   - *9. Date (day of year) *
>   - *10. Time (minute of day) *
>   - *11. Today's Rain Total (0.01 inches)* *
>   - *12. 1 Minute Wind Speed Average (0.1kph)* *
>- *Carriage Return & Line Feed *
>
>
> **Some instruments may not include field 12, some may not include 11 or
> 12. Please contact Peet Bros. if this presents any problem. Total size: 40,
> 44 or 48 characters (hex digits) + header, carriage return and line feed. *
>
> *PACKET MODE - RECORD STRUCTURE*
>
>- *Header = $ULTW *
>- *Data Fields *
>   - *1. Wind Speed Peak over last 5 min. (0.1 kph) *
>   - *2. Wind Direction of Wind Speed Peak (0-255) *
>   - *3. Current Outdoor Temp (0.1 deg F) *
>   - *4. Rain Long Term Total (0.01 in.) *
>   - *5. Current Barometer (0.1 mbar) *
>   - *6. Barometer Delta Value(0.1 mbar) *
>   - *7. Barometer Corr. Factor(LSW) *
>   - *8. Barometer Corr. Factor(MSW) *
>   - *9. Current Outdoor Humidity (0.1%) *
>   - *10. Date (day of year) *
>   - *11. Time (minute of day) *
>   - *12. Today's Rain Total (0.01 inches)**
>   - *13. 5 Minute Wind Speed Average (0.1kph)* *
>- *Carriage Return & Line Feed*
>
>
>
> **Some instruments may not include field 13, some may not include 12 or
> 13. Please contact Peet Bros. if this presents any problem. *
>
> *Packet Mode records are output every five minutes:  first, upon selection
> of Packet Mode; then, at every 5 minutes past the hour (12:00, 12:05,
> 12:10, etc.), continuosly.*
>
> *Total size: 44, 48 or 52 characters (hex digits) + header, carriage
> return and line feed. *
>
>
> --
> 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.
#!/usr/bin/env python
#
# Copyright 2014 Matthew Wall
# Copyright 2014 Nate Bargmann 
# See the file LICENSE.txt for your rights.
#
# Credit to and contributions from:
#   Jay Nugent (WB8TKL) and KRK6 for weather-2.kr6k-V2.1
# http://server1.nuge.com/~weather/
#   Steve (sesykes71) for testing the first implementations of this driver
#   Garret Power for improved decoding and proper handling of negative values
#   Chris Thompstone for testing the fast-read implementation
#
# Thanks to PeetBros for publishing the communication protocols and details
# about each model they manufacture.

"""Driver for Peet Bros Ultim

Re: [weewx-user] Re: Second crash after 11 days

2019-02-21 Thread Steve2Q
A follow up: According to Peet Bros web site the Ultimeter 2100 (and 
several other models) emit data in 48 byte chunks in Data Logger Mode, 
while ultimeter.py (version .20) apparently expects 52 bytes. Could this be 
the problem?. Here is a snip from their web site:


   - *Data Logger Mode**:  to manually select, press CLEAR + WIND SPEED for 
   3 seconds. ** While in this mode, records are sent out continuously at 
   up to about 120 per minute.  The total record size is 48 hex digits + 
   header, carriage return and line feed.  (All models)* 
   - *Packet Mode**:  to manually select, press CLEAR + WIND CHILL for 3 
   seconds.  While in this mode, one record is output every five minutes (at 5 
   min past the hour, 10 min past, 15 min past, etc.). The total record length 
   is 52 hex digits + header, carriage return and line feed.  (All models)*

and this:

*DATA LOGGER MODE - RECORD STRUCTURE* 

   - *Header = !!  (or || if in Multiple Output Mode) * 
   - *Data Fields * 
  - *1. Wind Speed (0.1 kph) * 
  - *2. Wind Direction (0-255) * 
  - *3. Outdoor Temp (0.1 deg F) * 
  - *4. Rain* Long Term Total (0.01 inches) * 
  - *5. Barometer (0.1 mbar) * 
  - *6. Indoor Temp (0.1 deg F) * 
  - *7. Outdoor Humidity (0.1%) * 
  - *8. Indoor Humidity (0.1%) * 
  - *9. Date (day of year) * 
  - *10. Time (minute of day) * 
  - *11. Today's Rain Total (0.01 inches)* * 
  - *12. 1 Minute Wind Speed Average (0.1kph)* *
   - *Carriage Return & Line Feed *


**Some instruments may not include field 12, some may not include 11 or 12. 
Please contact Peet Bros. if this presents any problem. Total size: 40, 44 
or 48 characters (hex digits) + header, carriage return and line feed. *

*PACKET MODE - RECORD STRUCTURE* 

   - *Header = $ULTW * 
   - *Data Fields * 
  - *1. Wind Speed Peak over last 5 min. (0.1 kph) * 
  - *2. Wind Direction of Wind Speed Peak (0-255) * 
  - *3. Current Outdoor Temp (0.1 deg F) * 
  - *4. Rain Long Term Total (0.01 in.) * 
  - *5. Current Barometer (0.1 mbar) * 
  - *6. Barometer Delta Value(0.1 mbar) * 
  - *7. Barometer Corr. Factor(LSW) * 
  - *8. Barometer Corr. Factor(MSW) * 
  - *9. Current Outdoor Humidity (0.1%) * 
  - *10. Date (day of year) * 
  - *11. Time (minute of day) * 
  - *12. Today's Rain Total (0.01 inches)** 
  - *13. 5 Minute Wind Speed Average (0.1kph)* *
   - *Carriage Return & Line Feed*



**Some instruments may not include field 13, some may not include 12 or 13. 
Please contact Peet Bros. if this presents any problem. *

*Packet Mode records are output every five minutes:  first, upon selection 
of Packet Mode; then, at every 5 minutes past the hour (12:00, 12:05, 
12:10, etc.), continuosly.*

*Total size: 44, 48 or 52 characters (hex digits) + header, carriage return 
and line feed. *


-- 
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: Second crash after 11 days

2019-02-21 Thread Steve2Q
Hello: I have been out of town for several days. The good news is top shows 
weexd using only 4.6% of memory. The bad news is there are now many gaps in 
the charts (see example), which apparently are caused by the "unexpected 
error byte messages" I have been getting. So the question remains should I 
drop back to the driver that worked even though it may prevent me from 
upgrading to the newest Weewx version?




-- 
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: Second crash after 11 days

2019-02-14 Thread Steve2Q
Matt...I have the model 2100, and it was manufactured in 2006 (I just got 
off the phone with Peet Bros.).

Just FYI,  you probably know this information, but here is the link to 
their page which shows the serial output for the different modes:   
http://www.peetbros.com/shop/custom.aspx?recid=29

I will make your recommended changes and start now.  How long should I let 
it run with the debugging on?

Steve

-- 
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: Second crash after 11 days

2019-02-14 Thread mwall


On Thursday, February 14, 2019 at 2:06:48 PM UTC-5, Steve2Q wrote:
>
> I set debug = 1, and rebooted. I then left the Pi running and then stopped 
> and restarted Weewx. Attached is syslog. It appears that there is an 
> "unexpected header bytes" error, which sometimes continues and at other 
> times resolves and then Weewx runs OK.
>

which ultimeter model are you using, and when was it manufactured?

please turn up the debug like this:

debug = 1
...
[Ultimeter]
debug_serial = 1
...

then restart weewx (you do not need to restart the computer)

m 

-- 
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: Second crash after 11 days

2019-02-14 Thread mwall
On Thursday, February 14, 2019 at 10:59:35 AM UTC-5, Thomas Keffer wrote:
>
> Matthew, do you recall why the time-related functions were disabled?
>

not enough testing.  as i recall, the only feedback i got about them was 
from steve, and that was confounded by other issues he was having at the 
time.  so i left them disabled until we get feedback from other ultimeter 
users.

m 

-- 
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: Second crash after 11 days

2019-02-14 Thread Thomas Keffer
Matthew, do you recall why the time-related functions were disabled?

-tk

On Thu, Feb 14, 2019 at 7:55 AM mwall  wrote:

>
>
> On Thursday, February 14, 2019 at 10:12:37 AM UTC-5, Steve2Q wrote:
>>
>> The only difference now is the console clock is no longer being corrected
>> as it was with version 11rc3.
>>
>
> that is because setting the time is disabled in v0.20 of the ultimeter
> driver.
>
> you can enable it by changing this:
>
> def DISABLED_getTime(self):
> return self.station.get_time()
>
> def DISABLED_setTime(self):
> self.station.set_time(int(time.time()))
>
> to this:
>
> def getTime(self):
> return self.station.get_time()
>
> def setTime(self):
> self.station.set_time(int(time.time()))
>
> m
>
> --
> 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: Second crash after 11 days

2019-02-14 Thread mwall


On Thursday, February 14, 2019 at 10:12:37 AM UTC-5, Steve2Q wrote:
>
> The only difference now is the console clock is no longer being corrected 
> as it was with version 11rc3.
>

that is because setting the time is disabled in v0.20 of the ultimeter 
driver.

you can enable it by changing this:

def DISABLED_getTime(self):
return self.station.get_time()

def DISABLED_setTime(self):
self.station.set_time(int(time.time()))

to this:

def getTime(self):
return self.station.get_time()

def setTime(self):
self.station.set_time(int(time.time()))

m 

-- 
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: Second crash after 11 days

2019-02-14 Thread Steve2Q

Here is an update. After running for 16 hours 40 minutes memory usage is 
5.0%, and Weewx itself is running normally. The only difference now is the 
console clock is no longer being corrected as it was with version 11rc3.

-- 
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: Second crash after 11 days

2019-02-14 Thread Steve2Q
Here is an update. After running for 16 hours 40 minutes memory usage is 
5.0%, and Weewx itself is running normally. The only difference now is the 
console clock is no longer being corrected as it was with version 11rc3.



-- 
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: Second crash after 11 days

2019-02-14 Thread Steve2Q
Here is an update. After running for 16 hours 40 minutes memory usage is 
5.0%, and Weewx itself is running normally. The only difference now is the 
console clock is no longer being corrected as it was with version 11rc3.

Steve

>

-- 
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: Second crash after 11 days

2019-02-13 Thread Thomas Keffer
The one thing that gives me pause with my version is that it reads the
lines in fixed length chunks: 52 bytes. Unfortunately, not all Ultimeters
support the full buffer. Some emit 48 bytes, other 44. The amount is
changeable via a [Ultimeter] setting, but earlier versions could handle all
3 buffer lengths without a change.

We could go back to the v0.11 strategy of reading a byte at a time, but
let's see if this works first.

-tk


On Wed, Feb 13, 2019 at 9:22 AM mwall  wrote:

>
>
> On Wednesday, February 13, 2019 at 12:15:22 PM UTC-5, Steve2Q wrote:
>>
>> A general question; if it turns out that both 11rc3 and 0.20 work, is
>> there any other advantage to changing to 0.20? Is it more compatible with
>> future changes in Weewx or perhaps with Python 3?
>>
>
> it may not affect you, but there are more reasons why 0.20 and later are
> preferred:
>
> - handling of negative temperatures
> - handling of set/get time - it is different for different ultimeter
> hardware
> - handling of NULL values from the ultimeter - different models have
> different behavior
>
> the 0.11 version of the driver did not deal with these things
>
>
> --
> 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: Second crash after 11 days

2019-02-13 Thread mwall


On Wednesday, February 13, 2019 at 12:15:22 PM UTC-5, Steve2Q wrote:
>
> A general question; if it turns out that both 11rc3 and 0.20 work, is 
> there any other advantage to changing to 0.20? Is it more compatible with 
> future changes in Weewx or perhaps with Python 3?
>

it may not affect you, but there are more reasons why 0.20 and later are 
preferred:

- handling of negative temperatures
- handling of set/get time - it is different for different ultimeter 
hardware
- handling of NULL values from the ultimeter - different models have 
different behavior

the 0.11 version of the driver did not deal with these things
 

-- 
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: Second crash after 11 days

2019-02-13 Thread Thomas Keffer
It is slightly less resource intensive (it reads in 52 byte chunks instead
of 1 byte chunks) and, yes, it has been ported to Python 3.

-tk

On Wed, Feb 13, 2019 at 9:15 AM Steve2Q  wrote:

> Tom. I am going to let Weewx run for another 12  hours before making the
> change. That way I can be sure memory usage has leveled off.
>
> A general question; if it turns out that both 11rc3 and 0.20 work, is
> there any other advantage to changing to 0.20? Is it more compatible with
> future changes in Weewx or perhaps with Python 3?
>
> --
> 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: Second crash after 11 days

2019-02-13 Thread Steve2Q
Tom. I am going to let Weewx run for another 12  hours before making the 
change. That way I can be sure memory usage has leveled off.

A general question; if it turns out that both 11rc3 and 0.20 work, is there 
any other advantage to changing to 0.20? Is it more compatible with future 
changes in Weewx or perhaps with Python 3?

-- 
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: Second crash after 11 days

2019-02-13 Thread Thomas Keffer
I think we're getting closer. The biggest difference I see is that the
current version uses the function serial.readline(), which reads to a
newline, while the old version uses repeated calls to serial.read(),
requesting a single byte each time, until it gets a full line.

It's entirely possible that serial.readline() has a memory leak (it's
written in C).

Try the enclosed version 0.20. It uses serial.read().

-tk





On Wed, Feb 13, 2019 at 7:15 AM Steve2Q  wrote:

> Hi Tom: Attached is the 11rc3 version of ultimeter.py
>
> Steve
>
> --
> 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.
#!/usr/bin/env python
#
# Copyright 2014 Matthew Wall
# Copyright 2014 Nate Bargmann 
# See the file LICENSE.txt for your rights.
#
# Credit to and contributions from:
#   Jay Nugent (WB8TKL) and KRK6 for weather-2.kr6k-V2.1
# http://server1.nuge.com/~weather/
#   Steve (sesykes71) for testing the first implementations of this driver
#   Garret Power for improved decoding and proper handling of negative values
#   Chris Thompstone for testing the fast-read implementation
#
# Thanks to PeetBros for publishing the communication protocols and details
# about each model they manufacture.

"""Driver for Peet Bros Ultimeter weather stations except the Ultimeter II

This driver assumes the Ultimeter is emitting data in Peet Bros Data Logger
mode format.  This driver will set the mode automatically on stations
manufactured after 2004.  Stations manufactured before 2004 must be set to
data logger mode using the buttons on the console.

Resources for the Ultimeter stations

Ultimeter Models 2100, 2000, 800, & 100 serial specifications:
  http://www.peetbros.com/shop/custom.aspx?recid=29

Ultimeter 2000 Pinouts and Parsers:
  http://www.webaugur.com/ham-radio/52-ultimeter-2000-pinouts-and-parsers.html

Ultimeter II
  not supported by this driver

All models communicate over an RS-232 compatible serial port using three
wires--RXD, TXD, and Ground (except Ultimeter II which omits TXD).  Port
parameters are 2400, 8N1, with no flow control.

The Ultimeter hardware supports several "modes" for providing station data
to the serial port.  This driver utilizes the "modem mode" to set the date
and time of the Ultimeter upon initialization and then sets it into Data
Logger mode for continuous updates.

Modem Mode commands used by the driver
>A  Set Date and Time (decimal digits  = day of year,
 = minute of day; Jan 1 = , Midnight = )

>I  Set output mode to Data Logger Mode (continuous output)

See http://www.peetbros.com/shop/custom.aspx?recid=29

CHANGE HISTORY

0.20 02/13/2019
Changed from using serial.readline() to serial.read().
Ported to Python 3
-tk

"""

from __future__ import with_statement
from __future__ import print_function

import serial
import syslog
import time

import weewx.drivers
import weewx.wxformulas
from weewx.units import INHG_PER_MBAR, MILE_PER_KM
from weeutil.weeutil import timestamp_to_string

DRIVER_NAME = 'Ultimeter'
DRIVER_VERSION = '0.20'


def loader(config_dict, _):
return UltimeterDriver(**config_dict[DRIVER_NAME])

def confeditor_loader():
return UltimeterConfEditor()


def logmsg(level, msg):
syslog.syslog(level, 'ultimeter: %s' % msg)

def logdbg(msg):
logmsg(syslog.LOG_DEBUG, msg)

def loginf(msg):
logmsg(syslog.LOG_INFO, msg)

def logerr(msg):
logmsg(syslog.LOG_ERR, msg)


def _fmt(x):
return ' '.join([b"%0.2X" % ord(c) for c in x])


class UltimeterDriver(weewx.drivers.AbstractDevice):
"""weewx driver that communicates with a Peet Bros Ultimeter station

model: station model, e.g., 'Ultimeter 2000' or 'Ultimeter 100'
[Optional. Default is 'Ultimeter']

port - serial port
[Required. Default is /dev/ttyUSB0]

max_tries - how often to retry serial communication before giving up
[Optional. Default is 5]
"""
def __init__(self, **stn_dict):
self.model = stn_dict.get('model', 'Ultimeter')
self.port = stn_dict.get('port', Station.DEFAULT_PORT)
self.max_tries = int(stn_dict.get('max_tries', 5))
self.retry_wait = int(stn_dict.get('retry_wait', 3))
# Most models use 52 byte fields, some use 48 or 50.
# See http://www.peetbros.com/shop/custom.aspx?recid=29
buffer_length = int(stn_dict.get('buffer_length', 52))
debug_serial = int(stn_dict.get('debug_serial', 0))
self.last_rain 

Re: [weewx-user] Re: Second crash after 11 days

2019-02-13 Thread Steve2Q
Hi Tom: Attached is the 11rc3 version of ultimeter.py

Steve

-- 
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.
#!/usr/bin/env python
# $Id: ultimeter.py 2842 2015-01-10 16:12:02Z mwall $
# Copyright 2014 Matthew Wall
# Copyright 2014 Nate Bargmann 
# See the file LICENSE.txt for your full rights.
#
# Credit to and contributions from:
#   Jay Nugent (WB8TKL) and KRK6 for weather-2.kr6k-V2.1
# http://server1.nuge.com/~weather/
#   Steve (sesykes71) for testing the first implementations of this driver
#   Garret Power for decoding improvements and testing

"""Driver for Peet Bros Ultimeter weather stations except the Ultimeter II

This driver assumes the Ultimeter is emitting data in Peet Bros Data Logger
mode format.

Resources for the Ultimeter stations

Ultimeter Models 2100, 2000, 800, & 100 serial specifications:
  http://www.peetbros.com/shop/custom.aspx?recid=29

Ultimeter 2000 Pinouts and Parsers:
  http://www.webaugur.com/ham-radio/52-ultimeter-2000-pinouts-and-parsers.html

Ultimeter II
  not supported by this driver

All models communicate over an RS-232 compatible serial port using three
wires--RXD, TXD, and Ground (except Ultimeter II which omits TXD).  Port
parameters are 2400, 8N1, with no flow control.

The Ultimeter hardware supports several "modes" for providing station data
to the serial port.  This driver utilizes the "modem mode" to set the date
and time of the Ultimeter upon initialization and then sets it into Data
Logger mode for continuous updates.

Modem Mode commands used by the driver
>A  Set Date and Time (decimal digits  = day of year,
 = minute of day; Jan 1 = , Midnight = )

>I  Set output mode to Data Logger Mode (continuous output)

"""

from __future__ import with_statement
import serial
import syslog
import time

import weewx.drivers

DRIVER_NAME = 'Ultimeter'
DRIVER_VERSION = '0.11rc3'

INHG_PER_MBAR = 0.0295333727
METER_PER_FOOT = 0.3048
MILE_PER_KM = 0.621371

def loader(config_dict, engine):
return Ultimeter(**config_dict[DRIVER_NAME])

def confeditor_loader():
return UltimeterConfEditor()


DEFAULT_PORT = '/dev/ttyS0'
DEBUG_READ = 0

def logmsg(level, msg):
syslog.syslog(level, 'ultimeter: %s' % msg)

def logdbg(msg):
logmsg(syslog.LOG_DEBUG, msg)

def loginf(msg):
logmsg(syslog.LOG_INFO, msg)

def logerr(msg):
logmsg(syslog.LOG_ERR, msg)


class Ultimeter(weewx.drivers.AbstractDevice):
"""weewx driver that communicates with a Peet Bros Ultimeter station

model: station model, e.g., 'Ultimeter 2000' or 'Ultimeter 100'
[Optional. Default is 'Ultimeter']

port - serial port
[Required. Default is /dev/ttyS0]

polling_interval - how often to query the serial interface, seconds
[Optional. Default is 1]

max_tries - how often to retry serial communication before giving up
[Optional. Default is 5]
"""
def __init__(self, **stn_dict):
self.model = stn_dict.get('model', 'Ultimeter')
self.port = stn_dict.get('port', DEFAULT_PORT)
self.polling_interval = float(stn_dict.get('polling_interval', 1))
self.max_tries = int(stn_dict.get('max_tries', 5))
self.retry_wait = int(stn_dict.get('retry_wait', 10))
self.last_rain = None
loginf('driver version is %s' % DRIVER_VERSION)
loginf('using serial port %s' % self.port)
loginf('polling interval is %s' % str(self.polling_interval))
global DEBUG_READ
DEBUG_READ = int(stn_dict.get('debug_read', DEBUG_READ))

def genLoopPackets(self):
ntries = 0
while ntries < self.max_tries:
ntries += 1
try:
packet = {'dateTime': int(time.time() + 0.5),
  'usUnits': weewx.US}
# open a new connection to the station for each reading
with Station(self.port) as station:
readings = station.get_readings()
data = Station.parse_readings(readings)
packet.update(data)
self._augment_packet(packet)
ntries = 0
yield packet
if self.polling_interval:
time.sleep(self.polling_interval)
except (serial.serialutil.SerialException, weewx.WeeWxIOError), e:
logerr("Failed attempt %d of %d to get LOOP data: %s" %
   (ntries, self.max_tries, e))
time.sleep(self.retry_wait)
else:
msg = "Max retries (%d) exceeded for LOOP data" % self.max_tries
logerr(msg)
raise weewx.RetriesExceeded(msg)

@property
def hardware_name(self):
return self.model

def _augment_packet(self, pac

Re: [weewx-user] Re: Second crash after 11 days

2019-02-13 Thread Thomas Keffer
Steve: could you send me the exact copy of ultimeter.py that you are using,
so I can diff it?

I can't find a version 11rc3 in git. Only version 11, and it is about 4
years old.

On Wed, Feb 13, 2019 at 6:38 AM Steve2Q  wrote:

> Possible success??!!
>
> Yesterday I changed only one item, the driver. I rolled back to 11rc3
> which has had two effects. First, after running for 24 hours the memory
> usage is up to only 4.4% where before it would be around 9+%. Second,
> Weewx has reset the time on my console to within 2 seconds of the correct
> time where under .18 it kept drifting.
>
> There are no other apparent effects on the graphs or anything else within
> Weewx at this time. While there are very few Ultimeter users, I am going to
> see if I can get some responses as to what model Ultimeter is being used
> and which driver.
>
> Will see how it goes over the next few days...hope springs eternal!
>
> --
> 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: Second crash after 11 days

2019-02-13 Thread Steve2Q
Possible success??!!

Yesterday I changed only one item, the driver. I rolled back to 11rc3 which 
has had two effects. First, after running for 24 hours the memory usage is 
up to only 4.4% where before it would be around 9+%. Second,  Weewx has 
reset the time on my console to within 2 seconds of the correct time where 
under .18 it kept drifting.

There are no other apparent effects on the graphs or anything else within 
Weewx at this time. While there are very few Ultimeter users, I am going to 
see if I can get some responses as to what model Ultimeter is being used 
and which driver.

Will see how it goes over the next few days...hope springs eternal!

-- 
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: Second crash after 11 days

2019-02-11 Thread Steve2Q
I will try substituting an older version of the driver to see if that makes any 
difference.  

-- 
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: Second crash after 11 days

2019-02-11 Thread vince
On Monday, February 11, 2019 at 6:43:06 PM UTC-8, Steve2Q wrote:
>
> Is there any possibility that substituting an older driver may work? The 
> newest version (0.18) is quite different than the older ones.
>
>
>
Still think you need to find a weewx user with the same driver+version and 
usb-to-serial configuration, if possible.

But if you change things, change 'one' thing at a time and keep track of 
what you changed.  This one's pretty odd. 

-- 
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: Second crash after 11 days

2019-02-11 Thread Steve2Q
Tom: Thanks for checking in..I was going to get back to you after a few 
more days of running. At at this point, it still appears to be acting the 
same way. It is so regular that I derived a formula for % of memory v 
time:  % = .253 (time in hours) + 3.24  

For 2 Days 6 hours 50 minutes, % = .253 (56.83) + 3.24  = 17.62   Top show 
17.0%  I know this is irrelevant, but it is interesting nonetheless.

Is there any possibility that substituting an older driver may work? The 
newest version (0.18) is quite different than the older ones.

Steve

-- 
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: Second crash after 11 days

2019-02-11 Thread Thomas Keffer
Steve, how is it going with this?

On Wed, Feb 6, 2019 at 9:16 AM Steve2Q  wrote:

> Tom: I upgraded pyserial and have rebooted. I will run just the regular
> instance of weewx without the simulator, and will see how that goes. Weewxd
> started at 3.4% mem usage.
>
> --
> 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: Second crash after 11 days

2019-02-06 Thread Steve2Q
Tom: I upgraded pyserial and have rebooted. I will run just the regular 
instance of weewx without the simulator, and will see how that goes. Weewxd 
started at 3.4% mem usage.

-- 
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: Second crash after 11 days

2019-02-06 Thread Thomas Keffer
That's the version that's included in the debian package python-serial.

Looking through the pyserial change log
, I don't see
any obvious patches for memory leaks between v3.2.1 and v3.4.

The only major difference (besides API details) I see between the Ultimeter
and the Vantage drivers, is that the former uses the method readline(),
instead of read(), but it's hard to see how that would lead to leaks.

You can try upgrading to v3.4 and see if that helps. First remove the
Debian package, then use pip:

*sudo apt remove python-serial*
*sudo pip install pyserial*

-tk


On Wed, Feb 6, 2019 at 7:19 AM Steve2Q  wrote:

> My version is 3.2.1
>
> --
> 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: Second crash after 11 days

2019-02-06 Thread Steve2Q
My version is 3.2.1

-- 
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: Second crash after 11 days

2019-02-06 Thread Thomas Keffer
Well, that's pretty definitive: the problem is in the driver, or its
underlying libraries.

Can you check what version of pyserial you are using:

*python -c "import serial; print serial.VERSION"*

I get "3.4"

-tk

On Wed, Feb 6, 2019 at 6:56 AM Steve2Q  wrote:

> Here is this mornings results. No change in the simulator, but weewx
> itself is going up. I was wondering if it would help with diagnosis if I
> tried running an older driver version.
>
>
> --
> 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: Second crash after 11 days

2019-02-06 Thread Steve2Q
Here is this mornings results. No change in the simulator, but weewx itself 
is going up. I was wondering if it would help with diagnosis if I tried 
running an older driver version.


-- 
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: Second crash after 11 days

2019-02-05 Thread Steve2Q
Tom: Here is the screenshot of Top showing both instances running. 
Obviously, the simulator is using far less memory. I will check tomorrow AM 
and send an updated screen capture.


-- 
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: Second crash after 11 days

2019-02-05 Thread Steve2Q


On Tuesday, February 5, 2019 at 10:38:36 AM UTC-5, Thomas Keffer wrote:
>
> I really only need the 'top' results for the instance running the 
> simulator: is it growing in its memory use?
>
> On Tue, Feb 5, 2019 at 7:11 AM Steve2Q > 
> wrote:
>
>> Tom: After I run my system for a few more days, let me know which file(s) 
>> you would like to see. 
>>
>> -- 
>> 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+...@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: Second crash after 11 days

2019-02-05 Thread Thomas Keffer
I really only need the 'top' results for the instance running the
simulator: is it growing in its memory use?

On Tue, Feb 5, 2019 at 7:11 AM Steve2Q  wrote:

> Tom: After I run my system for a few more days, let me know which file(s)
> you would like to see.
>
> --
> 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: Second crash after 11 days

2019-02-05 Thread Steve2Q
Tom: After I run my system for a few more days, let me know which file(s) you 
would like to see. 

-- 
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: Second crash after 11 days

2019-02-05 Thread Thomas Keffer
Another data point: I installed the stretch 4.14.94 kernel that Steve is
using, then ran weewxd using my VPro2. No memory growth.

I'll be interested to see the results of running the simulator.

-tk

On Mon, Feb 4, 2019 at 12:12 PM Thomas Keffer  wrote:

> It is helpful for figuring out which services WeeWX is loading. Not
> essential, but useful for when you post a log.
>
> -tk
>
> On Mon, Feb 4, 2019 at 11:04 AM Steve2Q  wrote:
>
>> Tom..now that I have a better understanding of the process, I will
>> implement the change. Before I do that, I note that you have debug = 1 in
>> weewx_mem.conf, while in my weewx.conf debug is not set. Should I set it to
>> 1 in my weewx.conf?
>>
>>
>> --
>> 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: Second crash after 11 days

2019-02-04 Thread Thomas Keffer
It is helpful for figuring out which services WeeWX is loading. Not
essential, but useful for when you post a log.

-tk

On Mon, Feb 4, 2019 at 11:04 AM Steve2Q  wrote:

> Tom..now that I have a better understanding of the process, I will
> implement the change. Before I do that, I note that you have debug = 1 in
> weewx_mem.conf, while in my weewx.conf debug is not set. Should I set it to
> 1 in my weewx.conf?
>
>
> --
> 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: Second crash after 11 days

2019-02-04 Thread Steve2Q
Tom..now that I have a better understanding of the process, I will 
implement the change. Before I do that, I note that you have debug = 1 in 
weewx_mem.conf, while in my weewx.conf debug is not set. Should I set it to 
1 in my weewx.conf?


-- 
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: Second crash after 11 days

2019-02-04 Thread Thomas Keffer
Yes, the memory would increase for the WeeWX instance running the
Ultimeter. Nothing changes there.

What we are trying to see is if the same thing happens with the simulator.
That would point to whether or not it has anything to do with the hardware,
driver, and serial interface.

You can, of course, stop the Ultimeter and just run the simulator, but my
assumption is that you'd like to have the data from the Ultimeter and don't
want to stop it. With this approach, you can leave the Ultimeter running,
while we can still get the data we need from the simulator.

-tk

On Mon, Feb 4, 2019 at 9:14 AM Steve2Q  wrote:

> Tom: I am not sure how this would work. If I am running both the Ultimeter
> and the Simulator simultaneously, wouldn't I get the same memory increase
> as data from the Ultimeter would still be coming in?
>
> Steve
>
>
>
> --
> 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: Second crash after 11 days

2019-02-04 Thread Steve2Q
Tom: I am not sure how this would work. If I am running both the Ultimeter 
and the Simulator simultaneously, wouldn't I get the same memory increase 
as data from the Ultimeter would still be coming in?

Steve



-- 
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: Second crash after 11 days

2019-02-04 Thread Thomas Keffer
Good idea.

You don't even need to shut down your Ultimeter. Just run a second instance
of weewx, using the attached configuration file weewx_mem.conf. It will put
the database in subdirectory /home/weewx/archive2, and the generated
reports in /home/weewx/public_html2.

Put it in /home/weewx, then run with

cd /home/weewx
./bin/weewxd weewx_mem.conf

-tk



On Mon, Feb 4, 2019 at 7:09 AM vince  wrote:

> On Monday, February 4, 2019 at 6:37:14 AM UTC-8, Thomas Keffer wrote:
>
>> Steve, I'm at a loss. You are running a simple system, on a well-known
>> platform, yet experiencing memory growth.
>>
>>
> Tom - the only thing I can think of is to take the driver and usb stuff
> out of the equation temporarily
>
>- shutdown weewx, stash the archive and public_html trees
>- switch to the simulator, run that for a couple days (with your
>instrumented software)
>- verify that the simulator works without memory growth on his pi
>
> That would at least verify the os side, ignoring the USB subsystem of
> course.
>
> And maybe look for a user with that station who uses USB 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.
> 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.


weewx_mem.conf
Description: Binary data


Re: [weewx-user] Re: Second crash after 11 days

2019-02-04 Thread Steve2Q
Tom and Vince. It appears that using the serial connections on the Pi is a 
relatively easy thing to do. I just need the proper adapter and then have 
to make a few changes in the software for the pi and Weewx. I am going to 
order one, do the change and see what happens.

Steve


-- 
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: Second crash after 11 days

2019-02-04 Thread Steve Meltz
Kevin..thats what I am doing now until a resolution is found.

On Sun, Feb 3, 2019 at 9:01 AM Kevin Hedgepeth  wrote:

> I ran into a problem with my pi randomly shutting down. I set CRON to
> restart my pi every night and have not had a problem since.  The only
> adverse effect is that the bragging comment about how long ur station has
> been up gets reset.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/weewx-user/VehicK_KNso/unsubscribe.
> To unsubscribe from this group and all its topics, 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: Second crash after 11 days

2019-02-04 Thread vince
On Monday, February 4, 2019 at 6:37:14 AM UTC-8, Thomas Keffer wrote:

> Steve, I'm at a loss. You are running a simple system, on a well-known 
> platform, yet experiencing memory growth. 
>
>
Tom - the only thing I can think of is to take the driver and usb stuff out 
of the equation temporarily

   - shutdown weewx, stash the archive and public_html trees
   - switch to the simulator, run that for a couple days (with your 
   instrumented software)
   - verify that the simulator works without memory growth on his pi

That would at least verify the os side, ignoring the USB subsystem of 
course.

And maybe look for a user with that station who uses USB 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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Second crash after 11 days

2019-02-04 Thread Thomas Keffer
I've been running WeeWX on an RPi with stretch for a day now. I don't have
an Ultimeter, so I used a VPro2 console, which also has a serial interface.
Memory use is

VIRT=48416, RES=33500

and seems to be steady.

I'm using kernel Linux-4.14.79-v7+-armv7l-with-debian-9.6, which is a
slightly older version than your Linux-4.14.94-v7+-armv7l-with-debian-9.6.

I doubt that would make a difference, but who knows?

Steve, I'm at a loss. You are running a simple system, on a well-known
platform, yet experiencing memory growth.

-tk

On Sat, Feb 2, 2019 at 5:28 PM Thomas Keffer  wrote:

> Well, that's no good.
>
> I've been doing some of my own tests here, and think that the weakrefs are
> an artifact of using pympler.
>
> I am running some experiments on my end with stretch. Unfortunately, I
> don't have a lot of time at the moment, so it may take a while.
>
> -tk
>
> On Sat, Feb 2, 2019 at 1:18 PM Steve2Q  wrote:
>
>> Now up to 15%  :(
>>
>> --
>> 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: Second crash after 11 days

2019-02-03 Thread Kevin Hedgepeth
I ran into a problem with my pi randomly shutting down. I set CRON to restart 
my pi every night and have not had a problem since.  The only adverse effect is 
that the bragging comment about how long ur station has been up gets reset.

-- 
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: Second crash after 11 days

2019-02-02 Thread Steve2Q
Tom..thank you for taking the time to help. For now I will reboot the 
system when the % gets up to around 80. It will be interesting if this is a 
problem with Stretch. I wonder if any other Pi users have similar problems 
with Stretch or they are using an older Raspian distro.

-- 
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.


  1   2   >