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

2019-01-29 Thread Thomas Keffer
If I understand the situation correctly, you

   - Are running plain-vanilla wheezy on a stock RPi;
   - Installed weewx using setup.py;
   - Are using an Ultimeter station;
   - Have absolutely no extensions installed (in particular, rtg has been
   disabled);

yet are experiencing memory growth.

Please correct me if any of these assumptions are wrong. If they are
correct, I'll make up an instrumented version of weewxd that will show
which objects are growing in size and number.

-tk



On Tue, Jan 29, 2019 at 5:20 AM Steve2Q  wrote:

> Here is syslog from shortly before the crash.. Is there any other files
> that may be useful for analysis?
>
> Jan 28 23:44:15 raspberrypi weewx[9770]: manager: Added record 2019-01-28
> 23:44:00 EST (1548737040) to database 'weewx.sdb'
> Jan 28 23:44:16 raspberrypi weewx[9770]: manager: Added record 2019-01-28
> 23:44:00 EST (1548737040) to daily summary in 'weewx.sdb'
> Jan 28 23:44:18 raspberrypi weewx[9770]: restx: PWSWeather: Published
> record 2019-01-28 23:44:00 EST (1548737040)
> Jan 28 23:44:26 raspberrypi weewx[9770]: cheetahgenerator: Generated 14
> files for report StandardReport in 8.67 seconds
> Jan 28 23:44:36 raspberrypi weewx[9770]: imagegenerator: Generated 13
> images for StandardReport in 9.49 seconds
> Jan 28 23:44:36 raspberrypi weewx[9770]: copygenerator: copied 0 files to
> /home/weewx/public_html
> Jan 28 23:44:47 raspberrypi weewx[9770]: ftpgenerator: ftp'd 27 files in
> 11.38 seconds
> Jan 28 23:46:15 raspberrypi weewx[9770]: manager: Added record 2019-01-28
> 23:46:00 EST (1548737160) to database 'weewx.sdb'
> Jan 28 23:46:16 raspberrypi weewx[9770]: manager: Added record 2019-01-28
> 23:46:00 EST (1548737160) to daily summary in 'weewx.sdb'
> Jan 28 23:46:39 raspberrypi systemd[1]: apt-daily.service: Failed to fork:
> Cannot allocate memory
> Jan 28 23:46:39 raspberrypi systemd[1]: apt-daily.service: Failed to run
> 'start' task: Cannot allocate memory
> Jan 28 23:46:39 raspberrypi systemd[1]: Failed to start Daily apt download
> activities.
> Jan 28 23:46:39 raspberrypi systemd[1]: apt-daily.timer: Adding 1h 13min
> 18.732028s random time.
> Jan 28 23:46:39 raspberrypi systemd[1]: apt-daily.service: Unit entered
> failed state.
> Jan 28 23:46:39 raspberrypi systemd[1]: apt-daily.timer: Adding 9h 23min
> 52.201118s random time.
> Jan 28 23:46:39 raspberrypi systemd[1]: apt-daily.service: Failed with
> result 'resources'.
> Jan 28 23:48:31 raspberrypi weewx[9770]: engine: Garbage collected 248392
> objects
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633466] top invoked
> oom-killer: gfp_mask=0x14040d0(GFP_KERNEL|__GFP_COMP|__GFP_RECLAIMABLE),
> nodemask=(null),  order=0, oom_score_adj=0
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633480] top cpuset=/
> mems_allowed=0
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633495] CPU: 3 PID: 17293
> Comm: top Tainted: G C  4.14.87-v7+ #1178
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633497] Hardware name: BCM2835
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633521] [<8010ff30>]
> (unwind_backtrace) from [<8010c174>] (show_stack+0x20/0x24)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633531] [<8010c174>]
> (show_stack) from [<8078b424>] (dump_stack+0xd4/0x118)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633543] [<8078b424>]
> (dump_stack) from [<80224bac>] (dump_header+0xac/0x208)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633553] [<80224bac>]
> (dump_header) from [<80223f14>] (oom_kill_process+0x478/0x584)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633560] [<80223f14>]
> (oom_kill_process) from [<80224874>] (out_of_memory+0x124/0x334)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633570] [<80224874>]
> (out_of_memory) from [<8022a3b8>] (__alloc_pages_nodemask+0x10cc/0x11c0)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633579] [<8022a3b8>]
> (__alloc_pages_nodemask) from [<80275a60>] (new_slab+0x454/0x558)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633587] [<80275a60>]
> (new_slab) from [<802778a4>] (___slab_alloc.constprop.11+0x228/0x2c0)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633595] [<802778a4>]
> (___slab_alloc.constprop.11) from [<80277980>]
> (__slab_alloc.constprop.10+0x44/0x90)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633602] [<80277980>]
> (__slab_alloc.constprop.10) from [<80278118>] (kmem_cache_alloc+0x1f4/0x230)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633611] [<80278118>]
> (kmem_cache_alloc) from [<802f764c>] (proc_alloc_inode+0x2c/0x5c)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633622] [<802f764c>]
> (proc_alloc_inode) from [<802a7ca8>] (alloc_inode+0x2c/0xb4)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633631] [<802a7ca8>]
> (alloc_inode) from [<802aa01c>] (new_inode_pseudo+0x18/0x5c)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633639] [<802aa01c>]
> (new_inode_pseudo) from [<802aa07c>] (new_inode+0x1c/0x30)
> Jan 28 23:48:32 raspberrypi kernel: [3815265.633646] [<802aa07c>]
> (new_inode) from [<802fb850>] (proc_pi

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

2019-01-29 Thread Steve2Q
Tom: I am running Stretch on a RPi 3 + (most recent Raspian from 
raspberrypi.org; the version that includes desktop however I have the pi 
set to boot into the cli, not the GUI).  I have run the necessary commands 
to update, upgrade, and update the firmware. I used setup.py with the 
Ultimeter station, and except for a cron to backup .sdb, there are no other 
extensions installed. If you need to look at any particular files, please 
let me know.

>
>

-- 
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-01-29 Thread Thomas Keffer
I am not concerned about any crontab extensions. It's weewx.conf extensions
that we care about. Can you please run

*cd /home/weewx*
*./bin/wee_debug --info --output*

then email me (tkef...@gmail.com) the file /var/tmp/weewx.debug.



On Tue, Jan 29, 2019 at 6:40 AM Steve2Q  wrote:

> Tom: I am running Stretch on a RPi 3 + (most recent Raspian from
> raspberrypi.org; the version that includes desktop however I have the pi
> set to boot into the cli, not the GUI).  I have run the necessary commands
> to update, upgrade, and update the firmware. I used setup.py with the
> Ultimeter station, and except for a cron to backup .sdb, there are no other
> extensions installed. If you need to look at any particular files, please
> let me know.
>
>>
>> --
> 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-01-29 Thread Thomas Keffer
OK, Steve, I think we're ready. This is going to take a little preparation
on your part.

1. Install the tool pympler. This is a memory profiler.

*pip install pympler*


2. Replace your version of engine.py with the attached version. You should
find it in /home/weewx/bin/weewx/engine.py.


3. Edit your version of weewx.conf and add the highlighted line near the
top, under the 'debug' option:

# This section is for general configuration information.

# Set to 1 for extra debug info, otherwise comment it out or set to zero
debug = 0

debug_memory = True

# Root directory of the weewx data file hierarchy for this station
WEEWX_ROOT = /home/weewx


4. Run weewxd normally. It will profile memory after every archive
interval, and add the results to /var/tmp/weewx_memory_summary.

5.  Let it run overnight or, at least, long enough that you can see memory
climbing. Post the file /var/tmp/weewx_memory_summary.

Let me know if you have any questions or problems.

-tk

On Tue, Jan 29, 2019 at 11:08 AM rich T  wrote:

> Steve
>
> I'm running with desktop.
>
> On Tuesday, January 29, 2019 at 8:05:08 AM UTC-5, Steve2Q wrote:
>
>> Andrew and Rich...are you running the version of Stretch with the
>> desktop, of just the Lite version?
>>
>> My system did crash last evening as I thought it would.
>>
>> 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.
#
#Copyright (c) 2009-2015 Tom Keffer 
#
#See the file LICENSE.txt for your full rights.
#

"""Main engine for the weewx weather system."""

# Python imports
import gc
import locale
import os
import os.path
import platform
import signal
import socket
import sys
import syslog
import time
import thread

# 3rd party imports:
import configobj
import daemon

# weewx imports:
import weedb
import weewx.accum
import weewx.manager
import weewx.qc
import weewx.station
import weewx.reportengine
import weeutil.weeutil
from weeutil.weeutil import to_bool, to_int, to_sorted_string
from weewx import all_service_groups

class BreakLoop(Exception):
"""Exception raised when it's time to break the main loop."""

class InitializationError(weewx.WeeWxIOError):
"""Exception raised when unable to initialize the console."""

#==
#Class StdEngine
#==

class StdEngine(object):
"""The main engine responsible for the creating and dispatching of events
from the weather station.

It loads a set of services, specified by an option in the configuration
file.

When a service loads, it binds callbacks to events. When an event occurs,
the bound callback will be called."""

def __init__(self, config_dict):
"""Initialize an instance of StdEngine.

config_dict: The configuration dictionary. """

self.debug_memory = to_bool(config_dict.get('debug_memory', False))

# Set a default socket time out, in case FTP or HTTP hang:
timeout = int(config_dict.get('socket_timeout', 20))
socket.setdefaulttimeout(timeout)

# Default garbage collection is every 3 hours:
self.gc_interval = int(config_dict.get('gc_interval', 3 * 3600))

# Set up the callback dictionary:
self.callbacks = dict()

# Set up the weather station hardware:
self.setupStation(config_dict)

# Hook for performing any chores before loading the services:
self.preLoadServices(config_dict)

# Load the services:
self.loadServices(config_dict)

# Another hook for after the services load.
self.postLoadServices(config_dict)

def setupStation(self, config_dict):
"""Set up the weather station hardware."""
# Get the hardware type from the configuration dictionary. This will be
# a string such as "VantagePro"
stationType = config_dict['Station']['station_type']

# Find the driver name for this type of hardware
driver = config_dict[stationType]['driver']

syslog.syslog(syslog.LOG_INFO, "engine: Loading station type %s (%s)" %
  (stationType, driver))

# Import the driver:
__import__(driver)

# Open up the weather station, wrapping it in a try block in case
# of failure.
try:
# This is a bit of Python wizardry.

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

2019-01-29 Thread Steve2Q
Tom: I followed the instruction I received the following:

-- 
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-01-29 Thread Steve2Q
Tom; the previous is what I got just by stopping weewx and then restarting 
after the mods (no reboot of the pi).

> If I reboot the pi, it hangs here:


I reverted back to the original setting so the station will keep running 
until I hear back from you.

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-01-29 Thread Glenn McKechnie
Hi Steve,

The error is "No module named pympler"

Looks like you've either missed step 1. of  Toms instructions, or it's
failed to install.

Try installing it with sudo

sudo pip install pympler


On 30/01/2019, Steve2Q  wrote:
> Tom; the previous is what I got just by stopping weewx and then restarting
> after the mods (no reboot of the pi).
>
>> If I reboot the pi, it hangs here:
>
>
> I reverted back to the original setting so the station will keep running
> until I hear back from you.
>
> 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.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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-01-29 Thread Steve2Q
Glenn..it did say that it installed, but i will try your suggestion tomorrow.
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.
For more options, visit https://groups.google.com/d/optout.


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

2019-01-30 Thread Steve2Q
Tom and Glenn..thanks..it is running now. I will let it run for a full 24 
hours and post the results tomorrow. At this moment (weewx running for 5 
minutes), top shows 4.6% memory usage by weewxd.

-- 
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-01-31 Thread Thomas Keffer
It appears that "weakref" references  are steadily climbing over time. Weak
references are used to aid garbage collection in Python. They are not used
in WeeWX, so they are probably being used by an underlying library. My
candidate is the driver for your Ultimeter.

Could you please do two things?

1, First, run the command lsusb, then cut and paste the results.

2. Then unplug, then plug back in your Ultimeter, then run the command
'dmesg'. Cut and paste the last 20 lines or so that it prints out. It will
look something like this:

[93723.169773] usb 2-2: new full-speed USB device number 29 using xhci_hcd
[93723.318669] usb 2-2: New USB device found, idVendor=05ad, idProduct=0fba
[93723.318676] usb 2-2: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[93723.318680] usb 2-2: Product: USB-Serial Controller
[93723.318684] usb 2-2: Manufacturer: Prolific Technology Inc.
[93723.319500] pl2303 2-2:1.0: pl2303 converter detected
[93723.322547] usb 2-2: pl2303 converter now attached to ttyUSB0

This will tell us what modules are used by your Ultimeter.

-tk

On Thu, Jan 31, 2019 at 6:28 AM Steve2Q  wrote:

> Tom: attached is the summary file. Weewx has been running for 24 hours.
> Weewxd is using 9.6%
>
> 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-01-31 Thread vince
On Thursday, January 31, 2019 at 8:00:11 AM UTC-8, Thomas Keffer wrote:
>
> It appears that "weakref" references  are steadily climbing over time. 
> Weak references are used to aid garbage collection in Python. They are not 
> used in WeeWX, so they are probably being used by an underlying library. My 
> candidate is the driver for your Ultimeter.
>
>
>
The map shows 14 Ultimeter stations registered currently.
Might be interesting to see if any of those stations are showing similar 
behavior...

-- 
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-01-31 Thread Thomas Keffer
Good idea. I've sent a note to a couple of them.

-tk

On Thu, Jan 31, 2019 at 9:27 AM vince  wrote:

> On Thursday, January 31, 2019 at 8:00:11 AM UTC-8, Thomas Keffer wrote:
>>
>> It appears that "weakref" references  are steadily climbing over time.
>> Weak references are used to aid garbage collection in Python. They are not
>> used in WeeWX, so they are probably being used by an underlying library. My
>> candidate is the driver for your Ultimeter.
>>
>>
>>
> The map shows 14 Ultimeter stations registered currently.
> Might be interesting to see if any of those stations are showing similar
> behavior...
>
> --
> 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-01-31 Thread Steve2Q
Tom and Vince:

Should I leave Weewx running as is or should I comment out the debug_memory 
= True line, and switch back to the original engine.py?

I have cut and pasted the information you asked for, Tom. If it ends up 
being the driver, I could always use an old version I have (11rc3) and see 
if that is any better. I will say that I was never sure why the driver 
changed. The old one seemed to work fine, and the new one does not correct 
the console clock like the old (I had posted about this in the past).

Result of lsusb:


Result of dmesg:






-- 
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-01-31 Thread Thomas Keffer
You can comment out the debug_memory option.

I'm suspecting your serial-to-usb cable. Do you have another one you can
try?

-tk

On Thu, Jan 31, 2019 at 10:45 AM Steve2Q  wrote:

> Tom and Vince:
>
> Should I leave Weewx running as is or should I comment out the
> debug_memory = True line, and switch back to the original engine.py?
>
> I have cut and pasted the information you asked for, Tom. If it ends up
> being the driver, I could always use an old version I have (11rc3) and see
> if that is any better. I will say that I was never sure why the driver
> changed. The old one seemed to work fine, and the new one does not correct
> the console clock like the old (I had posted about this in the past).
>
> Result of lsusb:
>
>
> Result of dmesg:
>
>
>
>
>
>
> --
> 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-01-31 Thread Steve2Q
I substituted another cable. This is the result of lsusb for this one:


With the reboot, top shows 3.4%, will watch it over the next 24 hours. Just 
for info; what makes you suspect the cable?

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-01-31 Thread Thomas Keffer
Several things:

   - The climb in the number of weakrefs, which are not used by WeeWX, so
   must be used indirectly in a library or driver;
   - Of the libraries used by WeeWX, only the usb drivers use weakrefs (I
   checked);
   - User Kurt has an Ultimeter, but with a serial connection (instead of
   usb), and has no such problems;
   - Serial cables are notorious for hardware and software problems;
   - There isn't much left!

But, I could well be wrong! Hopefully, this stab-in-the-dark will work out.

-tk

On Thu, Jan 31, 2019 at 1:40 PM Steve2Q  wrote:

> I substituted another cable. This is the result of lsusb for this one:
>
>
> With the reboot, top shows 3.4%, will watch it over the next 24 hours.
> Just for info; what makes you suspect the cable?
>
> 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-01-31 Thread Steve2Q
Tom: will the memory usage stay fairly flat if things are working properly? 
I seem to remember some comments that it can go up, but then levels off. Is 
there some average % of usage that is considered "normal"?

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-01-31 Thread Thomas Keffer
It should go up, but stabilize within a couple hours. If you let it run
overnight, you should have a pretty good indication by morning.

-tk

On Thu, Jan 31, 2019 at 4:36 PM Steve2Q  wrote:

> Tom: will the memory usage stay fairly flat if things are working
> properly? I seem to remember some comments that it can go up, but then
> levels off. Is there some average % of usage that is considered "normal"?
>
> 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-01-31 Thread vince
On Thursday, January 31, 2019 at 4:48:43 PM UTC-8, Thomas Keffer wrote:
>
> It should go up, but stabilize within a couple hours. If you let it run 
> overnight, you should have a pretty good indication by morning.
>
> -tk
>
> On Thu, Jan 31, 2019 at 4:36 PM Steve2Q > 
> wrote:
>
>> Tom: will the memory usage stay fairly flat if things are working 
>> properly? I seem to remember some comments that it can go up, but then 
>> levels off. Is there some average % of usage that is considered "normal"?
>>
>> Steve
>>
>>
>>
Steve - give it 2-3 days since you've previously seen it grow quickly. 
 What the heck...have a weekend maybe and see what it looks like Sunday or 
Monday.  It should stay up that long regardless based on your past history, 
eh ?


-- 
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-01 Thread Steve2Q
Vince..good idea. I will let it keep running and chart the results as I did 
last time. Hopefully it will level off.

>
> Steve - give it 2-3 days since you've previously seen it grow quickly. 
>  What the heck...have a weekend maybe and see what it looks like Sunday or 
> Monday.  It should stay up that long regardless based on your past history, 
> eh ?
>
>
>

-- 
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-01 Thread Thomas Keffer
Still, if you've got any early results...

On Fri, Feb 1, 2019 at 6:57 AM Steve2Q  wrote:

> Vince..good idea. I will let it keep running and chart the results as I
> did last time. Hopefully it will level off.
>
>>
>> Steve - give it 2-3 days since you've previously seen it grow quickly.
>> What the heck...have a weekend maybe and see what it looks like Sunday or
>> Monday.  It should stay up that long regardless based on your past history,
>> eh ?
>>
>>
>> --
> 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-01 Thread vince
On Friday, February 1, 2019 at 7:29:27 AM UTC-8, Thomas Keffer wrote:
>
> Still, if you've got any early results...
>
>
>
yeah - this one is pretty interesting. 

-- 
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-01 Thread Steve2Q
Weewxd using 9.1% of memory as of now.


-- 
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-01 Thread Thomas Keffer
... and climbing? Or, has it been stable?

On Fri, Feb 1, 2019 at 1:01 PM Steve2Q  wrote:

> Weewxd using 9.1% of memory as of now.
>
>
> --
> 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-01 Thread Steve2Q
Tom, so far it is climbing. Started at 3.4, this AM it was 7.7, and now 9.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-01 Thread Thomas Keffer
Rats. It should have leveled off by now.

On Fri, Feb 1, 2019 at 1:13 PM Steve2Q  wrote:

> Tom, so far it is climbing. Started at 3.4, this AM it was 7.7, and now 9.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-02 Thread Steve2Q
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.


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

2019-02-02 Thread Thomas Keffer
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-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.


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


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


  1   2   >