Re: [weewx-user] Re: Noob help setting up acurite bridges and indoor sensors

2019-04-29 Thread mwall
On Monday, April 29, 2019 at 10:40:38 PM UTC-4, Ken Booth wrote:
>
>
> [root@weather ~]# tcpdump -w /tmp/snoopy -c 160 port 80
>

what happens when you run the interceptor directly, something like this:

sudo PYTHONPATH=bin python bin/user/interceptor.py --device=acurite-bridge 
--mode=listen --iface=ens3 --port=80 --debug


-- 
You received this message because you are subscribed to the Google 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: Noob help setting up acurite bridges and indoor sensors

2019-04-29 Thread Ken Booth
On Sunday, 28 April 2019 05:23:37 UTC+2, mwall wrote:
>
>
> it is really not that difficult.  if you are starting from scratch, just 
> extend the wview schema:
>
> 1 copy the wview schema definition to a new file
>
> cp bin/schemas/wview.py bin/user/wview_extended.py
>
> 2 add as many temperature and humidity fields as you need by modifying the 
> new schema file.  see this for an example of what 8 temperature/humidity 
> sensors and signals looks like:
>
> https://github.com/weewx/weewx/blob/schema/bin/schemas/wview_extended.py
>

Thanks for the details.

Added he following sensors:

[root@weather ~]# cd /usr/share/weewx/schemas/
[root@weather schemas]# diff wview.py wview_extra.py
22a23,34
>   ('extraBarometer1','REAL'),
>   ('extraBarometer2','REAL'),
>   ('extraBarometer3','REAL'),
>   ('extraBarometer4','REAL'),
>   ('extraBarometer5','REAL'),
>   ('extraBarometer6','REAL'),
>   ('extraBarometer7','REAL'),
>   ('extraBarometer8','REAL'),
>   ('extraBarometer9','REAL'),
>   ('extraBarometer10','REAL'),
>   ('extraBarometer11','REAL'),
>   ('extraBarometer12','REAL'),
43a56,64
>   ('extraTemp4',   'REAL'),
>   ('extraTemp5',   'REAL'),
>   ('extraTemp6',   'REAL'),
>   ('extraTemp7',   'REAL'),
>   ('extraTemp8',   'REAL'),
>   ('extraTemp9',   'REAL'),
>   ('extraTemp10',   'REAL'),
>   ('extraTemp11',   'REAL'),
>   ('extraTemp12',   'REAL'),
51a73,82
>   ('extraHumid3',  'REAL'),
>   ('extraHumid4',  'REAL'),
>   ('extraHumid5',  'REAL'),
>   ('extraHumid6',  'REAL'),
>   ('extraHumid7',  'REAL'),
>   ('extraHumid8',  'REAL'),
>   ('extraHumid9',  'REAL'),
>   ('extraHumid10',  'REAL'),
>   ('extraHumid11',  'REAL'),
>   ('extraHumid12',  'REAL'),
58a90,101
>   ('extraSigPercent1',   'REAL'),
>   ('extraSigPercent2',   'REAL'),
>   ('extraSigPercent3',   'REAL'),
>   ('extraSigPercent4',   'REAL'),
>   ('extraSigPercent5',   'REAL'),
>   ('extraSigPercent6',   'REAL'),
>   ('extraSigPercent7',   'REAL'),
>   ('extraSigPercent8',   'REAL'),
>   ('extraSigPercent9',   'REAL'),
>   ('extraSigPercent10',   'REAL'),
>   ('extraSigPercent11',   'REAL'),
>   ('extraSigPercent12',   'REAL'),
70c113,125
<   ('inTempBatteryStatus',  'REAL')]
---
>   ('inTempBatteryStatus',  'REAL'),
>   ('extraTempBatteryStatus1',  'REAL'),
>   ('extraTempBatteryStatus2',  'REAL'),
>   ('extraTempBatteryStatus3',  'REAL'),
>   ('extraTempBatteryStatus4',  'REAL'),
>   ('extraTempBatteryStatus5',  'REAL'),
>   ('extraTempBatteryStatus6',  'REAL'),
>   ('extraTempBatteryStatus7',  'REAL'),
>   ('extraTempBatteryStatus8',  'REAL'),
>   ('extraTempBatteryStatus9',  'REAL'),
>   ('extraTempBatteryStatus10',  'REAL'),
>   ('extraTempBatteryStatus11',  'REAL'),
>   ('extraTempBatteryStatus12',  'REAL')]


> 3 add the units for each new field.  in the file bin/user/extensions.py 
> add something like this:
>
> import weewx.units
> weewx.units.obs_group_dict['extraTemp4'] = 'group_temperature'
> weewx.units.obs_group_dict['extraTemp5'] = 'group_temperature'
> weewx.units.obs_group_dict['extraTemp6'] = 'group_temperature'
> weewx.units.obs_group_dict['extraTemp7'] = 'group_temperature'
> weewx.units.obs_group_dict['extraHumid4'] = 'group_percent'
> weewx.units.obs_group_dict['extraHumid5'] = 'group_percent'
> weewx.units.obs_group_dict['extraHumid6'] = 'group_percent'
> weewx.units.obs_group_dict['extraHumid7'] = 'group_percent'
>

I added the units (excluding battery status, as I couldn't find an example):

[root@weather schemas]# cd ../user/
[root@weather user]# more extensions.py
#
#Copyright (c) 2009-2015 Tom Keffer 
#
#See the file LICENSE.txt for your full rights.
#

"""User extensions module

This module is imported from the main executable, so anything put here will 
be
executed before anything else happens. This makes it a good place to put 
user
extensions.
"""

import locale
# This will use the locale specified by the environment variable 'LANG'
# Other options are possible. See:
# http://docs.python.org/2/library/locale.html#locale.setlocale
locale.setlocale(locale.LC_ALL, '')

import weewx.units
weewx.units.obs_group_dict['extraTemp4'] = 'group_temperature'
weewx.units.obs_group_dict['extraTemp5'] = 'group_temperature'
weewx.units

Re: [weewx-user] installation failure on Ubuntu 18.10

2019-04-29 Thread Thomas Keffer
Hard to say much with such a little snippet of the log. Take a look at *Help!
Posting to weewx-user
* on how
to get a good log.

-tk

On Mon, Apr 29, 2019 at 2:15 PM Allen Gordon  wrote:

> Installation of weewx on ubuntu 18.10 failed.  I installed with with
> apt-get using the posted directions for ubuntu,
>
> sudo /etc/init.d/weewx -l status
> Usage: /etc/init.d/weewx {start|stop|status|restart|reload}
> judoal@pgserver:/etc/weewx$ sudo /etc/init.d/weewx  status -l
> ● weewx.service - LSB: weewx weather system
>Loaded: loaded (/etc/init.d/weewx; generated)
>Active: active (exited) since Mon 2019-04-29 14:15:17 MDT; 1min 7s ago
>  Docs: man:systemd-sysv-generator(8)
>   Process: 3412 ExecStop=/etc/init.d/weewx stop (code=exited,
> status=0/SUCCESS)
>   Process: 3475 ExecStart=/etc/init.d/weewx start (code=exited,
> status=0/SUCCESS)
>
> Apr 29 14:15:17 pgserver weewx[3502]: File
> "/usr/lib/python2.7/dist-packages/usb/core.py", line 174, in
> managed_release_interface
> Apr 29 14:15:17 pgserver weewx[3502]:   i =
> cfg[(0,0)].bInterfaceNumber
> Apr 29 14:15:17 pgserver weewx[3502]: File
> "/usr/lib/python2.7/dist-packages/usb/core.py", line 641, in __getitem__
> Apr 29 14:15:17 pgserver weewx[3502]:   return
> Interface(self.device, index[0], index[1], self.index)
> Apr 29 14:15:17 pgserver weewx[3502]: File
> "/usr/lib/python2.7/dist-packages/usb/core.py", line 460, in __init__
> Apr 29 14:15:17 pgserver weewx[3502]:   configuration
> Apr 29 14:15:17 pgserver weewx[3502]: File
> "/usr/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 767, in
> get_interface_descriptor
> Apr 29 14:15:17 pgserver weewx[3502]:   raise
> IndexError('Invalid interface index ' + str(intf))
> Apr 29 14:15:17 pgserver weewx[3502]:   IndexError: Invalid
> interface index 0
> Apr 29 14:15:17 pgserver weewx[3502]:   Exiting.
>
> The weewx configuration file is attached.
>
> Thanks in advance for help.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to weewx-user+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[weewx-user] MQTT extension enable option.

2019-04-29 Thread HoracioDos
Hello!
I added a new option in mqtt extension to enable or disable it. It seems to 
work fine but I don't know if I did it the proper way. I didn't find any 
repo in github, so i post it here.
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.
# $Id: mqtt.py 1784 2018-08-26 15:46:33Z mwall $
# Copyright 2013 Matthew Wall
"""
Upload data to MQTT server

This service requires the python bindings for mqtt:

   pip install paho-mqtt

Minimal configuration:

[StdRestful]
[[MQTT]]
server_url = mqtt://username:password@localhost:1883/
topic = weather
unit_system = METRIC

Use of the inputs map to customer name, format, or units:

[StdRestful]
[[MQTT]]
...
unit_system = METRIC # default to metric
[[[inputs]]]
outTemp
name = inside_temperature  # use a label other than outTemp
format = %.2f  # two decimal places of precision
units = degree_F   # convert outTemp to F, others in C
windSpeed
units = knot  # convert the wind speed to knots

Use of TLS to encrypt connection to broker.  The TLS options will be passed to
Paho client tls_set method.  Refer to Paho client documentation for details:

  https://eclipse.org/paho/clients/python/docs/

[StdRestful]
[[MQTT]]
...
[[[tls]]]
# CA certificates file (mandatory)
ca_certs = /etc/ssl/certs/ca-certificates.crt
# PEM encoded client certificate file (optional)
certfile = /home/user/.ssh/id.crt
# private key file (optional)
keyfile = /home/user/.ssh/id.key
# Certificate requirements imposed on the broker (optional).
#   Options are 'none', 'optional' or 'required'.
#   Default is 'required'.
cert_reqs = required
# SSL/TLS protocol (optional).
#   Options include sslv1, sslv2, sslv23, tls, tlsv1.
#   Default is 'tlsv1'
#   Not all options are supported by all systems.
tls_version = tlsv1
# Allowable encryption ciphers (optional).
#   To specify multiple cyphers, delimit with commas and enclose
#   in quotes.
#ciphers =
"""

import Queue
import paho.mqtt.client as mqtt
import sys
import syslog
import time
import urlparse

try:
import cjson as json
setattr(json, 'dumps', json.encode)
setattr(json, 'loads', json.decode)
except (ImportError, AttributeError):
try:
import simplejson as json
except ImportError:
import json

import weewx
import weewx.restx
import weewx.units
from weeutil.weeutil import to_bool, accumulateLeaves

VERSION = "0.18"

if weewx.__version__ < "3":
raise weewx.UnsupportedFeature("weewx 3 is required, found %s" %
   weewx.__version__)

def logmsg(level, msg):
syslog.syslog(level, 'restx: MQTT: %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 _compat(d, old_label, new_label):
if old_label in d and new_label not in d:
d.setdefault(new_label, d[old_label])
d.pop(old_label)

def _obfuscate_password(url):
parts = urlparse.urlparse(url)
if parts.password is not None:
# split out the host portion manually. We could use
# parts.hostname and parts.port, but then you'd have to check
# if either part is None. The hostname would also be lowercased.
host_info = parts.netloc.rpartition('@')[-1]
parts = parts._replace(netloc='{}:xxx@{}'.format(
parts.username, host_info))
url = parts.geturl()
return url

# some unit labels are rather lengthy.  this reduces them to something shorter.
UNIT_REDUCTIONS = {
'degree_F': 'F',
'degree_C': 'C',
'inch': 'in',
'mile_per_hour': 'mph',
'mile_per_hour2': 'mph',
'km_per_hour': 'kph',
'km_per_hour2': 'kph',
'meter_per_second': 'mps',
'meter_per_second2': 'mps',
'degree_compass': None,
'watt_per_meter_squared': 'Wpm2',
'uv_index': None,
'percent': None,
'unix_epoch': None,
}

# return the units label for an observation
def _get_units_label(obs, unit_system):
(unit_type, _) = weewx.units.getStandardUnitType(unit_system, obs)
return UNIT_REDUCTIONS.get(unit_type, unit_type)

# get the template for an observation based on the observation key
def _get_template(obs_key, overrides, append_units_label, unit_system):
tmpl_dict = dict()
if append_units_label:
label = _get_units_label(obs_key, unit_system)
if label is not

[weewx-user] Re: Can MISOL station work with weewx, suggest me one

2019-04-29 Thread Douglas Krug
If you have the Observer IP module, this is very simple. I did this with my 
Ambient Weather Observer IP (same as MISOL as both are made by Fine Offset, 
just different firmware), just follow "Method 2" here on Pat O'Brien's blog 
7 . 
All you need is an inexpensive router compatible with DD-WRT and the 
patience to flash its firmware. You can stop at the end of Pat's 
instructions before getting to "Accepting the data on your server". That 
bit is unnecessary. Once I did this. it was simple to redirect WU data that 
I was uploading from my Observer IP module to Weewx. Since this method uses 
the WU upload data, it doesn't matter which firmware version the Observer 
IP bridge is using.

On Monday, April 8, 2019 at 7:22:04 AM UTC-4, Ramesh Rasappan wrote:
>
> noob here, I spent several hrs to find a weather station that can work 
> with weewx (can be hooked up with my existing Rasberry Pi 3), my budget is 
> limited (~$120). I prefer to buy a station from China since it is too 
> expensive to import from US. I found MISOL products (very similar to Fine 
> Offset products) in AliExpress and they have a whole range of products but 
> I am not sure if they can be used with weewx!! They do have a 
> console with USB connection for connecting a PC to upload the data to 
> weather stations like wunderground but I don't know if weewx can pull the 
> data from this console!! Also, the MISOL products can be bought without the 
> console (cheaper) but again I am not sure if I can directly hook the 
> station to Rasberry Pi 3, I may need few adapters and the overall cost may 
> increase a lot.
>
> I found a discussion that talks about weewx and MISOL WH2310 station but 
> it is not clear from that discussion that the following models can work or 
> not (https://groups.google.com/forum/#!topic/weewx-user/4NeVsThRxJk 
>  andhttps://github.com/weewx/weewx)
>
>
> can you suggest me if I can buy one of them? (also should I go with 
> console or without?)
>
> with console (WS-2310-1)
>
> https://www.aliexpress.com/store/product/MISOL-professional-weather-station-wind-speed-wind-direction-rain-meter-pressure-temperature-humidity-UV/112828_32673332115.html?spm=2114.12010612.8148357.32.44fe336bpL60C8
>
> without the console (same as above)
>
> https://www.aliexpress.com/store/product/1-set-of-Spare-part-outdoor-unit-for-Professional-Wireless-Weather-Station-with-small-solar-panel/112828_32846646856.html?spm=2114.12010612.8148357.47.44fe336bpL60C8
>
> same with different console and cheaper
>
> https://www.aliexpress.com/store/product/misol-Professional-Wireless-Weather-Station-Touch-Panel-w-Solar-sensor-w-PC-interface/112828_32765225865.html?spm=2114.12010612.8148357.38.44fe336bpL60C8
>
> directly uploads to wunderground
>
> https://www.aliexpress.com/store/product/MISOL-IP-OBSERVER-Solar-Powered-Wireless-Internet-Remote-Monitoring-Weather-Station/112828_32624080442.html?spm=2114.12010612.8148357.20.44fe336bpL60C8
>
>

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


[weewx-user] installation failure on Ubuntu 18.10

2019-04-29 Thread Allen Gordon
Installation of weewx on ubuntu 18.10 failed.  I installed with with 
apt-get using the posted directions for ubuntu,

sudo /etc/init.d/weewx -l status
Usage: /etc/init.d/weewx {start|stop|status|restart|reload}
judoal@pgserver:/etc/weewx$ sudo /etc/init.d/weewx  status -l
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated)
   Active: active (exited) since Mon 2019-04-29 14:15:17 MDT; 1min 7s ago
 Docs: man:systemd-sysv-generator(8)
  Process: 3412 ExecStop=/etc/init.d/weewx stop (code=exited, 
status=0/SUCCESS)
  Process: 3475 ExecStart=/etc/init.d/weewx start (code=exited, 
status=0/SUCCESS)

Apr 29 14:15:17 pgserver weewx[3502]: File 
"/usr/lib/python2.7/dist-packages/usb/core.py", line 174, in 
managed_release_interface
Apr 29 14:15:17 pgserver weewx[3502]:   i = 
cfg[(0,0)].bInterfaceNumber
Apr 29 14:15:17 pgserver weewx[3502]: File 
"/usr/lib/python2.7/dist-packages/usb/core.py", line 641, in __getitem__
Apr 29 14:15:17 pgserver weewx[3502]:   return 
Interface(self.device, index[0], index[1], self.index)
Apr 29 14:15:17 pgserver weewx[3502]: File 
"/usr/lib/python2.7/dist-packages/usb/core.py", line 460, in __init__
Apr 29 14:15:17 pgserver weewx[3502]:   configuration
Apr 29 14:15:17 pgserver weewx[3502]: File 
"/usr/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 767, in 
get_interface_descriptor
Apr 29 14:15:17 pgserver weewx[3502]:   raise 
IndexError('Invalid interface index ' + str(intf))
Apr 29 14:15:17 pgserver weewx[3502]:   IndexError: Invalid 
interface index 0
Apr 29 14:15:17 pgserver weewx[3502]:   Exiting.

The weewx configuration file is attached.

Thanks in advance for help.


-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# WEEWX CONFIGURATION FILE
#
# Copyright (c) 2009-2019 Tom Keffer 
# See the file LICENSE.txt for your rights.

##

# This section is for general configuration information.

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

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

# Whether to log successful operations
log_success = True

# Whether to log unsuccessful operations
log_failure = True

# How long to wait before timing out a socket (FTP, HTTP) connection
socket_timeout = 20

# Do not modify this. It is used when installing and updating weewx.
version = 3.9.1

##

#   This section is for information about the station.

[Station]

# Description of the station location
location = "Upper Pineglade"

# Latitude and longitude in decimal degrees
latitude = 39.965805
longitude = -105.431716

# Altitude of the station, with unit it is in. This is downloaded from
# from the station if the hardware supports it.
altitude = 8150, foot

# Set to type of station hardware. There must be a corresponding stanza
# in this file with a 'driver' parameter indicating the driver to be used.
station_type = AcuRite

# If you have a website, you may specify an URL
#station_url = http://www.example.com

# The start of the rain year (1=January; 10=October, etc.). This is
# downloaded from the station if the hardware supports it.
rain_year_start = 1

# Start of week (0=Monday, 6=Sunday)
week_start = 6

##

[AcuRite]
# This section is for AcuRite weather stations.

# The station model, e.g., 'AcuRite 01025' or 'AcuRite 02032C'
model = AcuRite 02032CRM

# The driver to use:
driver = weewx.drivers.acurite

##

#   This section is for uploading data to Internet sites

[StdRESTful]

[[StationRegistry]]
# To register this weather station with weewx, set this to true
register_this_station = false

[[AWEKAS]]
# This section is for configuring posts to AWEKAS.

# If you wish to do this, set the option 'enable' to true,
# and specify a username and password.
# To guard against parsing errors, put the password in quotes.
enable = false
username = replace_me
password = replace_me

[[CWOP]]
# This section is for configuring posts to CWOP.

# If you wish to do this, set the option 'enable' to true,
# and specify the station ID (e.g., CW1234).
enable = false
station = re

[weewx-user] Re: Weewx crashing with error associated with ScalarStats.addHiLo

2019-04-29 Thread pliggen . is


Den lördag 27 april 2019 kl. 02:14:15 UTC+2 skrev mwall:
>
> On Friday, April 26, 2019 at 6:34:50 PM UTC-4, pliggen.is wrote:
>>
>> I also got the issue two days ago. Strange because I've been running for 
>> quite some time now and just the other day was my first crash. 
>>
>
> what kind of weather station?
>
> what is your interceptor configuration?  (please post the [Interceptor] 
> section from your weewx configuration file)
>
> m
>

Not sure what interceptor means, maybe something in this?

[FineOffsetUSB]
# This section is for the Fine Offset series of weather stations.

# The station model, e.g., WH1080, WS1090, WS2080, WH3081
model = WH1080

# How often to poll the station for data, in seconds
polling_interval = 60

# The driver to use:
driver = weewx.drivers.fousb


-- 
You received this message because you are subscribed to the Google 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.