Re: [weewx-user] FilePile help please

2019-05-06 Thread Colin Larsen
Hi Thomas

Thanks for the quick reply. It was just the format, it needs the spaces so
each line in the text file is


AQI25 = 1.60

AQI100 = 3.30

AQIIndex = 6

AQICO2 = 683


Once I did that and checked the database after an archive period the fields
were populated

Does my section with the units look valid? I've borrowed that from a
similar service but I can't wrap my head around how the relationship
between those and the data in the txt file get joined together


Thanks again

Colin



On Tue, May 7, 2019 at 3:13 PM Thomas Keffer  wrote:

> Hi, Colin
>
> Does your text file use newlines ('\n') as line delineators? Perhaps it is
> using the MS-DOS standard of '\n\r'? Examine the file carefully and make
> sure it contains what you think it contains.
>
> -tk
>
> On Mon, May 6, 2019 at 8:05 PM Colin Larsen 
> wrote:
>
>> Hi all
>>
>> I'm trying to get Filepile working but have come across an error that I
>> don't understand. Any help appreciated. The database has been extended with
>> fields to match those below in the data file - am I just missing spaces in
>> the layout? Should it be AQI25 = 1.60 etc etc
>>
>> Many thanks
>>
>> This is my data file;
>>
>> AQI25=1.60
>>
>> AQI100=3.30
>>
>> AQIIndex=6
>>
>> AQICO2=683
>>
>>
>> This is my stanza in weewx.conf
>>
>>
>> ##
>>
>>
>> #   This section is for FilePile
>>
>>
>> [FilePile]
>>
>>
>> filename = /home/pi/AQIData.txt
>>
>> unit_system = METRIC
>>
>>
>>
>> ##
>>
>>
>> This is my filepile.py (modified from original to suit)
>>
>>
>> *import* syslog
>>
>> *import* weewx
>>
>> *import* weewx.units
>>
>> *from* weewx.wxengine *import* StdService
>>
>> *from* weeutil.weeutil *import* to_float
>>
>>
>> weewx.units.USUnits[*'group_gas_concentration'*] = *'ppm'*
>>
>> weewx.units.MetricUnits[*'group_gas_concentration'*] = *'ppm'*
>>
>> weewx.units.MetricWXUnits[*'group_gas_concentration'*] = *'ppm'*
>>
>> weewx.units.default_unit_format_dict[*'ppm'*]  = *'%.0f'*
>>
>> weewx.units.default_unit_label_dict[*'ppm'*]  = *' ppm'*
>>
>>
>> weewx.units.USUnits[*'group_dust'*] = *'microgramm_per_meter_cubic'*
>>
>> weewx.units.MetricUnits[*'group_dust'*] = *'microgramm_per_meter_cubic'*
>>
>> weewx.units.MetricWXUnits[*'group_dust'*] =
>> *'microgramm_per_meter_cubic'*
>>
>> weewx.units.default_unit_format_dict[*'microgramm_per_meter_cubic'*]  =
>> *'%.1f'*
>>
>> weewx.units.default_unit_label_dict[*'microgramm_per_meter_cubic'*]  = *'
>> \xce\xbcg/m\xc2\xb3'*
>>
>>
>> *class* FilePile(StdService):
>>
>> *"""WeeWX service for augmenting a record with data parsed from a
>> file."""*
>>
>>
>> *def** __init__*(self, engine, config_dict):
>>
>>* # Initialize my superclass:*
>>
>> super(FilePile, self).__init__(engine, config_dict)
>>
>> *# Extract our stanza from the configuration dicdtionary*
>>
>> filepile_dict = config_dict.get(*'FilePile'*, {})
>>
>>* # Get the location of the file ...*
>>
>> self.filename = filepile_dict.get(*'filename'*,
>> *'/var/tmp/filepile.txt'*)
>>
>>* # ... and the unit system it will use*
>>
>> unit_system_name = filepile_dict.get(*'unit_system'*,
>> *'METRICWX'*).strip().upper()
>>
>>* # Make sure we know about the unit system. If not, raise an
>> exception.*
>>
>> *if* unit_system_name *not* *in* weewx.units.unit_constants:
>>
>> *raise* ValueError(*"FilePile: Unknown unit system: %s"* %
>> unit_system_name)
>>
>>* # Use the numeric code for the unit system*
>>
>> self.unit_system = weewx.units.unit_constants[unit_system_name]
>>
>>
>>* # Mapping from variable names to weewx names*
>>
>> self.label_map = filepile_dict.get(*'label_map'*, {})
>>
>> syslog.syslog(syslog.LOG_INFO, *"filepile: Using %s with the
>> '%s' unit system"*
>>
>>   % (self.filename, unit_system_name))
>>
>> syslog.syslog(syslog.LOG_INFO, *"filepile: Label map is %s"* %
>> self.label_map)
>>
>>
>>* # Bind to the NEW_ARCHIVE_RECORD event*
>>
>> self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
>>
>>
>> *def** new_archive_record*(self, event):
>>
>> new_record_data = {}
>>
>> *try*:
>>
>> *with* open(self.filename, *'r'*) *as* fd:
>>
>> *for* line *in* fd:
>>
>> eq_index = line.find(*'='*)
>>
>> *# Ignore all lines that do not have an equal sign*
>>
>> *if* eq_index == -1:
>>
>> *continue*
>>
>> name = line[:eq_index].strip()
>>
>> value = line[eq_index + 1:].strip()
>>
>> new_record_data[self.label_map.get(name, name)] =
>> to_float(value)
>>
>>* # Supply a unit system if one wasn't included in the
>> file*
>>
>> 

Re: [weewx-user] FilePile help please

2019-05-06 Thread Thomas Keffer
Hi, Colin

Does your text file use newlines ('\n') as line delineators? Perhaps it is
using the MS-DOS standard of '\n\r'? Examine the file carefully and make
sure it contains what you think it contains.

-tk

On Mon, May 6, 2019 at 8:05 PM Colin Larsen  wrote:

> Hi all
>
> I'm trying to get Filepile working but have come across an error that I
> don't understand. Any help appreciated. The database has been extended with
> fields to match those below in the data file - am I just missing spaces in
> the layout? Should it be AQI25 = 1.60 etc etc
>
> Many thanks
>
> This is my data file;
>
> AQI25=1.60
>
> AQI100=3.30
>
> AQIIndex=6
>
> AQICO2=683
>
>
> This is my stanza in weewx.conf
>
>
> ##
>
>
> #   This section is for FilePile
>
>
> [FilePile]
>
>
> filename = /home/pi/AQIData.txt
>
> unit_system = METRIC
>
>
>
> ##
>
>
> This is my filepile.py (modified from original to suit)
>
>
> *import* syslog
>
> *import* weewx
>
> *import* weewx.units
>
> *from* weewx.wxengine *import* StdService
>
> *from* weeutil.weeutil *import* to_float
>
>
> weewx.units.USUnits[*'group_gas_concentration'*] = *'ppm'*
>
> weewx.units.MetricUnits[*'group_gas_concentration'*] = *'ppm'*
>
> weewx.units.MetricWXUnits[*'group_gas_concentration'*] = *'ppm'*
>
> weewx.units.default_unit_format_dict[*'ppm'*]  = *'%.0f'*
>
> weewx.units.default_unit_label_dict[*'ppm'*]  = *' ppm'*
>
>
> weewx.units.USUnits[*'group_dust'*] = *'microgramm_per_meter_cubic'*
>
> weewx.units.MetricUnits[*'group_dust'*] = *'microgramm_per_meter_cubic'*
>
> weewx.units.MetricWXUnits[*'group_dust'*] = *'microgramm_per_meter_cubic'*
>
> weewx.units.default_unit_format_dict[*'microgramm_per_meter_cubic'*]  =
> *'%.1f'*
>
> weewx.units.default_unit_label_dict[*'microgramm_per_meter_cubic'*]  = *'
> \xce\xbcg/m\xc2\xb3'*
>
>
> *class* FilePile(StdService):
>
> *"""WeeWX service for augmenting a record with data parsed from a
> file."""*
>
>
> *def** __init__*(self, engine, config_dict):
>
>* # Initialize my superclass:*
>
> super(FilePile, self).__init__(engine, config_dict)
>
> *# Extract our stanza from the configuration dicdtionary*
>
> filepile_dict = config_dict.get(*'FilePile'*, {})
>
>* # Get the location of the file ...*
>
> self.filename = filepile_dict.get(*'filename'*,
> *'/var/tmp/filepile.txt'*)
>
>* # ... and the unit system it will use*
>
> unit_system_name = filepile_dict.get(*'unit_system'*, *'METRICWX'*
> ).strip().upper()
>
>* # Make sure we know about the unit system. If not, raise an
> exception.*
>
> *if* unit_system_name *not* *in* weewx.units.unit_constants:
>
> *raise* ValueError(*"FilePile: Unknown unit system: %s"* %
> unit_system_name)
>
>* # Use the numeric code for the unit system*
>
> self.unit_system = weewx.units.unit_constants[unit_system_name]
>
>
>* # Mapping from variable names to weewx names*
>
> self.label_map = filepile_dict.get(*'label_map'*, {})
>
> syslog.syslog(syslog.LOG_INFO, *"filepile: Using %s with the '%s'
> unit system"*
>
>   % (self.filename, unit_system_name))
>
> syslog.syslog(syslog.LOG_INFO, *"filepile: Label map is %s"* %
> self.label_map)
>
>
>* # Bind to the NEW_ARCHIVE_RECORD event*
>
> self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
>
>
> *def** new_archive_record*(self, event):
>
> new_record_data = {}
>
> *try*:
>
> *with* open(self.filename, *'r'*) *as* fd:
>
> *for* line *in* fd:
>
> eq_index = line.find(*'='*)
>
> *# Ignore all lines that do not have an equal sign*
>
> *if* eq_index == -1:
>
> *continue*
>
> name = line[:eq_index].strip()
>
> value = line[eq_index + 1:].strip()
>
> new_record_data[self.label_map.get(name, name)] =
> to_float(value)
>
>* # Supply a unit system if one wasn't included in the
> file*
>
> *if* *'usUnits'* *not* *in* new_record_data:
>
> new_record_data[*'usUnits'*] = self.unit_system
>
>* # Convert the new values to the same unit system as the
> record*
>
> target_data = weewx.units.to_std_system(new_record_data,
> event.record[*'usUnits'*])
>
>* # Add the converted values to the record:*
>
> event.record.update(target_data)
>
> *except* IOError *as* e:
>
>syslog.syslog(syslog.LOG_ERR, *"FilePile: Cannot open file.
> Reason: %s"* % e)
>
> This is the syslog error;
>
> May  7 14:50:16 raspberrypi weewx[6605]: engine: Caught unrecoverable
> exception in engine:
>
> May  7 14:50:16 

[weewx-user] FilePile help please

2019-05-06 Thread Colin Larsen
Hi all

I'm trying to get Filepile working but have come across an error that I
don't understand. Any help appreciated. The database has been extended with
fields to match those below in the data file - am I just missing spaces in
the layout? Should it be AQI25 = 1.60 etc etc

Many thanks

This is my data file;

AQI25=1.60

AQI100=3.30

AQIIndex=6

AQICO2=683


This is my stanza in weewx.conf

##


#   This section is for FilePile


[FilePile]


filename = /home/pi/AQIData.txt

unit_system = METRIC


##


This is my filepile.py (modified from original to suit)


*import* syslog

*import* weewx

*import* weewx.units

*from* weewx.wxengine *import* StdService

*from* weeutil.weeutil *import* to_float


weewx.units.USUnits[*'group_gas_concentration'*] = *'ppm'*

weewx.units.MetricUnits[*'group_gas_concentration'*] = *'ppm'*

weewx.units.MetricWXUnits[*'group_gas_concentration'*] = *'ppm'*

weewx.units.default_unit_format_dict[*'ppm'*]  = *'%.0f'*

weewx.units.default_unit_label_dict[*'ppm'*]  = *' ppm'*


weewx.units.USUnits[*'group_dust'*] = *'microgramm_per_meter_cubic'*

weewx.units.MetricUnits[*'group_dust'*] = *'microgramm_per_meter_cubic'*

weewx.units.MetricWXUnits[*'group_dust'*] = *'microgramm_per_meter_cubic'*

weewx.units.default_unit_format_dict[*'microgramm_per_meter_cubic'*]  =
*'%.1f'*

weewx.units.default_unit_label_dict[*'microgramm_per_meter_cubic'*]  = *'
\xce\xbcg/m\xc2\xb3'*


*class* FilePile(StdService):

*"""WeeWX service for augmenting a record with data parsed from a
file."""*


*def** __init__*(self, engine, config_dict):

   * # Initialize my superclass:*

super(FilePile, self).__init__(engine, config_dict)

*# Extract our stanza from the configuration dicdtionary*

filepile_dict = config_dict.get(*'FilePile'*, {})

   * # Get the location of the file ...*

self.filename = filepile_dict.get(*'filename'*,
*'/var/tmp/filepile.txt'*)

   * # ... and the unit system it will use*

unit_system_name = filepile_dict.get(*'unit_system'*, *'METRICWX'*
).strip().upper()

   * # Make sure we know about the unit system. If not, raise an
exception.*

*if* unit_system_name *not* *in* weewx.units.unit_constants:

*raise* ValueError(*"FilePile: Unknown unit system: %s"* %
unit_system_name)

   * # Use the numeric code for the unit system*

self.unit_system = weewx.units.unit_constants[unit_system_name]


   * # Mapping from variable names to weewx names*

self.label_map = filepile_dict.get(*'label_map'*, {})

syslog.syslog(syslog.LOG_INFO, *"filepile: Using %s with the '%s'
unit system"*

  % (self.filename, unit_system_name))

syslog.syslog(syslog.LOG_INFO, *"filepile: Label map is %s"* %
self.label_map)


   * # Bind to the NEW_ARCHIVE_RECORD event*

self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)


*def** new_archive_record*(self, event):

new_record_data = {}

*try*:

*with* open(self.filename, *'r'*) *as* fd:

*for* line *in* fd:

eq_index = line.find(*'='*)

*# Ignore all lines that do not have an equal sign*

*if* eq_index == -1:

*continue*

name = line[:eq_index].strip()

value = line[eq_index + 1:].strip()

new_record_data[self.label_map.get(name, name)] =
to_float(value)

   * # Supply a unit system if one wasn't included in the file*

*if* *'usUnits'* *not* *in* new_record_data:

new_record_data[*'usUnits'*] = self.unit_system

   * # Convert the new values to the same unit system as the
record*

target_data = weewx.units.to_std_system(new_record_data,
event.record[*'usUnits'*])

   * # Add the converted values to the record:*

event.record.update(target_data)

*except* IOError *as* e:

   syslog.syslog(syslog.LOG_ERR, *"FilePile: Cannot open file. Reason:
%s"* % e)

This is the syslog error;

May  7 14:50:16 raspberrypi weewx[6605]: engine: Caught unrecoverable
exception in engine:

May  7 14:50:16 raspberrypi weewx[6605]:   invalid literal for
float(): 1.60#015AQI100=3.30#015AQIIndex=6#015AQICO2=683

May  7 14:50:16 raspberrypi weewx[6605]:   Traceback (most recent
call last):

May  7 14:50:16 raspberrypi weewx[6605]: File
"/usr/share/weewx/weewx/engine.py", line 890, in main

May  7 14:50:16 raspberrypi weewx[6605]:   engine.run()

May  7 14:50:16 raspberrypi weewx[6605]: File
"/usr/share/weewx/weewx/engine.py", line 202, in run

May  7 14:50:16 raspberrypi weewx[6605]: 

Re: [weewx-user] Re: change archive interval?

2019-05-06 Thread Graham Eddy
after several days running this change on test platform, turned it on yesterday 
on actual weather station.
all is well so far.
cheers

Graham Eddy

> On 7 May 2019, at 9:13 am, gjr80  wrote:
> 
> Hi,
> 
> Provided you are using v3.7.0 or later WeeWX will have no problems handling 
> your data with various different archive intervals. if you simply stop WeeWX, 
> change the archive interval in weewx.conf/on the hardware and then restart 
> WeeWX there should be no need to do anything else. Though if you manipulate 
> any databases it would be advisable to rebuild the daily summaries using 
> wee_database  
> before restarting WeeWX.
> 
> Gary
> 
> On Sunday, 5 May 2019 21:41:51 UTC+10, graha...@gmail.com wrote:
> i have wview data collected since 2007 that i do not want to lose.
> the archive interval on the VP2 is 30 mins, which is fine for historical 
> recording.
> wview allows reports to be generated every minute, irrespective of the 
> archive interval
> 
> i have just realised that weewx ties report generation period to the archive 
> interval, so the old 30 mins is far too long.
> 5 mins would be good.
> would weewx cope with my changing the archive interval on VP2 to 5 mins from 
> 30 mins, in the sense of still reporting the older data?
> cheers

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/9708EE31-C97C-4C2F-A516-D100DC5956FD%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: How do I convert battery strength back to a string?

2019-05-06 Thread Radar
look at the sensors.inc file

On Monday, May 6, 2019 at 6:16:22 PM UTC-5, Ken Booth wrote:
>
> When the Acurite SmartHub sends raw data to weewx, the battery status is 
> reported as "normal" or "low" and this is converted to 0 or 1 respectively.
>
> weewx[24667]: interceptor: MainThread: raw data: 
> dateutc=now=updateraw=1=24C86E090EC1=tower=4036=34=76.4=30.31=normal=4
> weewx[24667]: interceptor: MainThread: raw packet: 
> {'bridge_id.4036.24C86E090EC1': '24C86E090EC1', 
> 'sensor_type.4036.24C86E090EC1': 'tower', 
> 'battery.4036.24C86E090EC1': 0, 
> ...
> weewx[24667]: interceptor: MainThread: raw data: 
> dateutc=now=updateraw=1=24C86E090A48=tower=5422=34=71.4=29.83=low=3
> weewx[24667]: interceptor: MainThread: raw packet: 
> {'rssi.5422.24C86E090A48': 75.0, 'battery.5422.24C86E090A48': 1, 
> ...
>
> I've defined the battery status as a count, rather than a percentage in 
> /usr/share/weewx/user/extensions.py
> weewx.units.obs_group_dict['extraTempBatteryStatus12'] = 'group_count'
>
> But when I put into the skin in /etc/weewx/skins/Seasons/current.inc
> $current.extraTempBatteryStatus12
> the resulting table is displayed as 0% for normal and 1% for low
>
> At the moment I have changed /etc/weewx/skins/Seasons/current.inc to
> $current.extraTempBatteryStatus12.raw
> so I get 0.0 for a good battery and 1.0 for a low battery.
>
> What syntax do I use in current.inc to display the string "OK" for 0 or 
> "Low Batt" for 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/77a148ff-1b38-476e-83cb-dbc21a89942a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-05-06 Thread Thomas Keffer
Or, cmon is reading a value from a /proc file, which are generally strings.
Most likely, the author forgot to convert to a float.

On Mon, May 6, 2019 at 4:05 PM gjr80  wrote:

> So the error is arising from data coming from cmon and not the weather
> station:
>
> May  6 20:20:31 raspberrypi weewx[333]: File
> "/usr/share/weewx/user/cmon.py", line 711, in save_data
> May  6 20:20:31 raspberrypi weewx[333]:   self.dbm.addRecord(
> record)
>
> and
>
> Apr 25 19:00:32 raspberrypi weewx[331]:  File
> "/usr/share/weewx/user/cmon.py", line 704, in new_archive_record
> Apr 25 19:00:32 raspberrypi weewx[331]:  self.save_data(self.get_data(
> now, self.last_ts))
> Apr 25 19:00:32 raspberrypi weewx[331]:  File
> "/usr/share/weewx/user/cmon.py", line 711, in save_data
> Apr 25 19:00:32 raspberrypi weewx[331]:  self.dbm.addRecord(record)
>
>
> Judging by the 'numbers' involved I would hazard a guess that the routine 
> used by cmon to extract data from some files on the system is returning 
> something other than a float or an int. Judging by the numbers I would be 
> looking at the network traffic.
> I recall an earlier thread where network traffic figures being read by cmon 
> were too big for an int, though that would not appear to be the case here.
>
> Perhaps some details of what cmon version, what operating system and WeeWX 
> system hardware might help
>
> Gary
>
>
> On Tuesday, 7 May 2019 07:56:45 UTC+10, Redanman wrote:
>>
>> Weewx crashed again tonight with what seems to be the same root cause.
>> Here is the syslog just at the moment it crashed.  Again, looking at the
>> data, I cannot see any spurious text/numbers.  Out of interest, is accum.py
>> run every iteration of the engine or only on an interval?
>>
>> May  6 20:20:30 raspberrypi weewx[333]: interceptor: MainThread: raw
>> packet: {'wind_speed': 0.0, 'humidity_in': 43.0, 'temperature_in': 68.4,
>> 'barometer': 30.15, 'windchill': 46.9, 'dewpoint': 40.5, 'battery': 0.0,
>> 'humidity_out': 78.0, 'uv': 0.0, 'radiation': 0.15, 'rain': 0.0,
>> 'dateTime': 1557170426, 'temperature_out': 46.9, 'wind_dir': 143.0,
>> 'rain_total': 4.49, 'usUnits': 1, 'wind_gust': 0.0}
>> May  6 20:20:30 raspberrypi weewx[333]: interceptor: MainThread: mapped
>> packet: {'barometer': 30.15, 'windchill': 46.9, 'dewpoint': 40.5,
>> 'outHumidity': 78.0, 'UV': 0.0, 'radiation': 0.15, 'rain': 0.0, 'dateTime':
>> 1557170426, 'windDir': 143.0, 'outTemp': 46.9, 'windSpeed': 0.0,
>> 'txBatteryStatus': 0.0, 'inTemp': 68.4, 'windGust': 0.0, 'inHumidity':
>> 43.0, 'usUnits': 1}
>> May  6 20:20:30 raspberrypi weewx[333]: manager: Added record 2019-05-06
>> 20:20:31 BST (1557170431) to database 'cmon.sdb'
>> May  6 20:20:30 raspberrypi weewx[333]: engine: Main loop exiting.
>> Shutting engine down.
>> May  6 20:20:30 raspberrypi weewx[333]: engine: Shutting down StdReport
>> thread
>> May  6 20:20:30 raspberrypi weewx[333]: engine: StdReport thread has been
>> terminated
>> May  6 20:20:30 raspberrypi weewx[333]: restx: Shut down WOW thread.
>> May  6 20:20:30 raspberrypi weewx[333]: restx: Shut down PWSWeather
>> thread.
>> May  6 20:20:31 raspberrypi weewx[333]: restx: Shut down Wunderground-PWS
>> thread.
>> May  6 20:20:31 raspberrypi weewx[333]: restx: Shut down StationRegistry
>> thread.
>> May  6 20:20:31 raspberrypi weewx[333]: interceptor: MainThread: shutting
>> down server thread
>> May  6 20:20:31 raspberrypi weewx[333]: interceptor: MainThread: stop tcp
>> server
>> May  6 20:20:31 raspberrypi weewx[333]: engine: Caught unrecoverable
>> exception in engine:
>> May  6 20:20:31 raspberrypi weewx[333]:   accum:
>> ScalarStats.addHiLo expected float or int, got 710464
>> May  6 20:20:31 raspberrypi weewx[333]:   Traceback (most recent
>> call last):
>> May  6 20:20:31 raspberrypi weewx[333]: File
>> "/usr/share/weewx/weewx/engine.py", line 890, in main
>> May  6 20:20:31 raspberrypi weewx[333]:   engine.run()
>> May  6 20:20:31 raspberrypi weewx[333]: File
>> "/usr/share/weewx/weewx/engine.py", line 202, in run
>> May  6 20:20:31 raspberrypi weewx[333]: 
>> self.dispatchEvent(weewx.Event(weewx.POST_LOOP))
>> May  6 20:20:31 raspberrypi weewx[333]: File
>> "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
>> May  6 20:20:31 raspberrypi weewx[333]:   callback(event)
>> May  6 20:20:31 raspberrypi weewx[333]: File
>> "/usr/share/weewx/weewx/engine.py", line 574, in post_loop
>> May  6 20:20:31 raspberrypi weewx[333]: 
>> self._software_catchup()
>> May  6 20:20:31 raspberrypi weewx[333]: File
>> "/usr/share/weewx/weewx/engine.py", line 646, in _software_catchup
>> May  6 20:20:31 raspberrypi weewx[333]: 
>> self.engine.dispatchEvent(weewx.Event(weewx.NEW_ARCHIVE_RECORD,
>> record=record, origin='software'))
>> May  6 20:20:31 raspberrypi weewx[333]: File
>> "/usr/share/weewx/weewx/engine.py", 

Re: [weewx-user] Re: Installation paths -debian package

2019-05-06 Thread Thomas Keffer
This is not the first time that Gary has corrected me on the workings of my
own software!

He is correct. The search "in the usual places" applies only to the
utilities. A path must be specified for weewxd.

-tk

On Mon, May 6, 2019 at 3:54 PM gjr80  wrote:

> My understanding was that when weewxd is invoked the first command line
> parameter is the path and file name of the config file to be be used and no
> attempts are made to search elsewhere for the config file. My further
> understanding is that searches for the config file 'in the usual places'
> occur in the likes of the WeeWX utilities etc. Back to weewxd. If the
> config file (as given on the command like) does not exist WeeWX exits.
>
> In the case above the command:
>
> pi@raspberrypi:~ $ sudo weewxd weewx.conf
>
> irrespective of WeeWX installation type, will cause weewxd to use
> /home/pi/weewx.conf as the config file, but of course that file does not
> exist so WeeWX exits. If WeeWX was installed via a deb package then
> weewx.conf will be in /etc/weewx and the correct command to use is:
>
> $ sudo weewxd /etc/weewx/weewx.conf
>
> Unless of course the present working directory is /etc/weewx in which
> case the original command would work.
>
> Perhaps there is some confusion here over the command used to run WeeWX
> directly. The command is frequently given as:
>
> $ sudo weewxd weewx.conf
>
> which is often taken literally when in fact there is an implied need to
> include the path to weewx.conf. I don't have a problem with this format but
> perhaps there is a need for an explanatory note about the requirement for a
> path. Though I am not sure this is the only instance of an implied path in
> the documents, so if it is done for one it may need to be done for many.
>
> In this case I would also remove all of the files copied to /home/pi (and
> any other non-standard WeeWX deb package locations), WeeWX may work with
> them in place now but you are setting yourself up for chasing your tail in
> the future when something does not work and you have multiples copies of
> WeeWX on your system.
>
> Gary
>
> On Tuesday, 7 May 2019 07:35:22 UTC+10, JM wrote:
>>
>> To clarify, my understanding is that setup.py installs to different paths
>> than the DEB package. it almost seems as if they got switched.
>>
>>
>> On Monday, May 6, 2019 at 5:32:08 PM UTC-4, JM wrote:
>>>
>>> No its there, I copied the weewx.conf and weewx.conf.dist there.
>>> without it, it will not run.
>>> FWIW, I originally set up Raspian on a different, New MicroSD and
>>> encountered the same problem. both instances behaved the same way.
>>> Initially I thought maybe the SD card was defective.
>>> So I imaged another card and encountered the same result.
>>>
>>> I also copied the entire weewx folder from /etc/weewx/ to home/pi/  I
>>> dont think this made any difference. I'm confused, since I didn't run
>>> Setup.py and that installs to the paths this version is expecting.
>>> Any help is appreciated.
>>>
>>>
>>>
>>> On Sunday, May 5, 2019 at 8:47:52 PM UTC-4, JM wrote:

 I have previously set up two other weather stations using weewx. Just
 set up a new instance and I am finding that the default installation path
 for weewx.conf is incorrect.
 below is a error received in it's initial installation state. I have
 moved weewx.conf to the /home/pi/ directory and it runs. The weewx
 documentation indicates that the default DEB package will install to :
 /etc/weewx/weewx.conf.
 Can anyone give me insight on how to point weewx to the /etc/weewx
 directory instead of /home/pi ?


 pi@raspberrypi:~ $ sudo weewxd weewx.conf
 Traceback (most recent call last):
   File "/usr/bin/weewxd", line 64, in 
 weewx.engine.main(options, args)
   File "/usr/share/weewx/weewx/engine.py", line 848, in main
 sane = os.stat(config_path).st_ctime
 OSError: [Errno 2] No such file or directory: '/home/pi/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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/9d87d861-3da0-44b7-9c95-54f3af4eb0e2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEAbbdGn_-egOYHzYE76t8BLmwX4VbcW_0M_akCE-d3Oiw%40mail.gmail.com.
For more options, visit 

[weewx-user] Re: How do I convert battery strength back to a string?

2019-05-06 Thread gjr80
Hi,

There are a few ways you could do this but the simplest way for a one-off 
requirement is a little in-line python code in the template. Put something 
like the following (untested) in your template:

#set $battery_state = $current.extraTempBatteryStatus12.raw
#set $battery_message = "N/A"
#if $battery_state == 0
#set $battery_message = "OK"
#elif $battery_state == 1
#set $battery_message = "Low Batt"
#end if

Then use $battery_message wherever you want the battery state message to 
appear.

The code could go in index.html.tmpl or in the .inc, up to you, as long as 
it is executed before you try to use the $battery_message tag.

Gary

On Tuesday, 7 May 2019 09:16:22 UTC+10, Ken Booth wrote:
>
> When the Acurite SmartHub sends raw data to weewx, the battery status is 
> reported as "normal" or "low" and this is converted to 0 or 1 respectively.
>
> weewx[24667]: interceptor: MainThread: raw data: 
> dateutc=now=updateraw=1=24C86E090EC1=tower=4036=34=76.4=30.31=normal=4
> weewx[24667]: interceptor: MainThread: raw packet: 
> {'bridge_id.4036.24C86E090EC1': '24C86E090EC1', 
> 'sensor_type.4036.24C86E090EC1': 'tower', 
> 'battery.4036.24C86E090EC1': 0, 
> ...
> weewx[24667]: interceptor: MainThread: raw data: 
> dateutc=now=updateraw=1=24C86E090A48=tower=5422=34=71.4=29.83=low=3
> weewx[24667]: interceptor: MainThread: raw packet: 
> {'rssi.5422.24C86E090A48': 75.0, 'battery.5422.24C86E090A48': 1, 
> ...
>
> I've defined the battery status as a count, rather than a percentage in 
> /usr/share/weewx/user/extensions.py
> weewx.units.obs_group_dict['extraTempBatteryStatus12'] = 'group_count'
>
> But when I put into the skin in /etc/weewx/skins/Seasons/current.inc
> $current.extraTempBatteryStatus12
> the resulting table is displayed as 0% for normal and 1% for low
>
> At the moment I have changed /etc/weewx/skins/Seasons/current.inc to
> $current.extraTempBatteryStatus12.raw
> so I get 0.0 for a good battery and 1.0 for a low battery.
>
> What syntax do I use in current.inc to display the string "OK" for 0 or 
> "Low Batt" for 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/7ffd9919-d550-409b-b47d-6980943f7914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: How do I remove and add extra graphs to a skin?

2019-05-06 Thread gjr80
Hi,

I assume you are wanting to add more/change plots on the Seasons main page. 
If so there are a few moving parts to understand and adjust.

The [ImageGenerator] stanza of skin.conf will control what plots WeeWX will 
generate and save as image files. Refer to The image generator 
 in the Customization 
Guide in the first instance. There are a few rules when setting up the 
[ImageGenerator], stanza, the one that you have fallen foul of is that in a 
given stanza you cannot have a duplicate entry. So

[[dayplots]]
[[[daytemp]]]
outTemp
[[[daytemp]]]
extraTemp1

will give the duplicate section name error you saw but 

[[dayplots]]
[[[daytemp]]]
outTemp
[[[daytemp1]]]
extraTemp1

will be fine. The latter will result in two image files being created; 
daytemp.png and daytemp1.png showing plots of outTemp and extraTemp1 
respectively. You should be able to see these files on you WeeWX server.

All the [ImageGenerator] stanza does is cause your plot image files to be 
generated, it has no direct control over whether an image is displayed on 
your web page (other than if the image file is not generated then it cannot 
be displayed of course). In the previous Standard skin this was simply a 
case of editing skins/Standard/index.html.tmpl and either editing the 
existing or adding new html img tags in the appropriate location. Similar 
changes are needed to week.html.tmpl, month.html.tmpl etc if you wish to 
change the plots on the week, month etc pages. The new Seasons skin is 
somewhat more modular though the same html img tags are used. You need to 
edit skins/Seasons/index.html.tmpl and make the necessary changes to the 
html img tags. Note that in the case of the Seasons skin all the current, 
week, month etc img tags are in index.html.tmpl, not spread across multiple 
files. So if you want to display the image file daytemp1.png you might make 
a change like (untested):

  






To make changes to the week, month etc plots you need to edit the img tags 
under the applicable . Once 
you have made your changes save index.html.tmpl and provided your image 
files have been generated your web page should display the changed plots 
after the next report cycle (you may need to refresh the page).

To remove plots from you page you simply delete the corresponding html 
image tags from index.html.tmpl. That will cause index.html to stop 
displaying them but the image generator will continue to generate the image 
file each report cycle. To stop their generation either delete or comment 
out the respective stanza for that plot under [ImageGenerator] in skin.conf.

Gary

On Tuesday, 7 May 2019 08:47:16 UTC+10, Ken Booth wrote:
>
> Hi,
>
> I've been able to edit the current.inc and hilo.inc to display tables of 
> the values that interest me, but when I edit skins.conf things just don't 
> go the way I want.
>
> If I comment out
> [[[daywind]]]
> windSpeed
> windGust
> I still get a windSpeed/WindGust graph.
>
> If I add an extra [[[daytemp]]] for more sensors, I get
> weewx[24667]: reportengine: Failed to read skin configuration file 
> /etc/weewx/skins/Seasons/skin.conf for report 'SeasonsReport': Duplicate 
> section name at line 267
>
> If I add a new name such as
> [[[daytemp1]]]
> extraTemp11
> then I don't get an extra graph.
>
> So far I have been able to get temperature graphs by replacing values in 
> existing graphs
> ##[[[daytempfeel]]]
> ##windchill
> ##heatindex
>
> [[[daytempfeel]]]
> extraTemp12
> extraTemp8
> extraTemp9
> extraTemp11
> extraTemp7
>
> So obviously editing skins.conf on its own is insufficient. How do I 
> remove the rainfall and wind graphs, and get more humidity graphs. Which 
> file defines what to generate, and how?
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/0b6234e6-7034-49dc-abc8-298030c56d07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] How do I convert battery strength back to a string?

2019-05-06 Thread Ken Booth
When the Acurite SmartHub sends raw data to weewx, the battery status is 
reported as "normal" or "low" and this is converted to 0 or 1 respectively.

weewx[24667]: interceptor: MainThread: raw data: 
dateutc=now=updateraw=1=24C86E090EC1=tower=4036=34=76.4=30.31=normal=4
weewx[24667]: interceptor: MainThread: raw packet: 
{'bridge_id.4036.24C86E090EC1': '24C86E090EC1', 
'sensor_type.4036.24C86E090EC1': 'tower', 
'battery.4036.24C86E090EC1': 0, 
...
weewx[24667]: interceptor: MainThread: raw data: 
dateutc=now=updateraw=1=24C86E090A48=tower=5422=34=71.4=29.83=low=3
weewx[24667]: interceptor: MainThread: raw packet: 
{'rssi.5422.24C86E090A48': 75.0, 'battery.5422.24C86E090A48': 1, 
...

I've defined the battery status as a count, rather than a percentage in 
/usr/share/weewx/user/extensions.py
weewx.units.obs_group_dict['extraTempBatteryStatus12'] = 'group_count'

But when I put into the skin in /etc/weewx/skins/Seasons/current.inc
$current.extraTempBatteryStatus12
the resulting table is displayed as 0% for normal and 1% for low

At the moment I have changed /etc/weewx/skins/Seasons/current.inc to
$current.extraTempBatteryStatus12.raw
so I get 0.0 for a good battery and 1.0 for a low battery.

What syntax do I use in current.inc to display the string "OK" for 0 or 
"Low Batt" for 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/18ede405-782c-4c5f-ad12-4aff7e661cab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: change archive interval?

2019-05-06 Thread gjr80
Hi,

Provided you are using v3.7.0 or later WeeWX will have no problems handling 
your data with various different archive intervals. if you simply stop 
WeeWX, change the archive interval in weewx.conf/on the hardware and then 
restart WeeWX there should be no need to do anything else. Though if you 
manipulate any databases it would be advisable to rebuild the daily 
summaries using wee_database 
 before 
restarting WeeWX.

Gary

On Sunday, 5 May 2019 21:41:51 UTC+10, graha...@gmail.com wrote:
>
> i have wview data collected since 2007 that i do not want to lose.
> the archive interval on the VP2 is 30 mins, which is fine for historical 
> recording.
> wview allows reports to be generated every minute, irrespective of the 
> archive interval
>
> i have just realised that weewx ties report generation period to the 
> archive interval, so the old 30 mins is far too long.
> 5 mins would be good.
> would weewx cope with my changing the archive interval on VP2 to 5 mins 
> from 30 mins, in the sense of still reporting the older data?
> cheers
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/d9a708b8-ed06-4c90-a08c-c5d9172d5747%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] WeeWX Watchdog, latest improvements

2019-05-06 Thread Leon Shaner
Hey, WeeWX'ers!  =D

Lots of improvements made to my watchdog script(s).

1)   wunderfixer is now decoupled, except in conjunction with an outage.

It means that even if dowufixer=1 (enabled), it will only run if it is within a 
certain time-frame after an outage (watchdogsecs * repeatwufixer).
With the defaults, wunderfixer runs every 10 minutes, six times, i.e. spread 
over an hour after an outage.

2)  A separate weewx_wunderfixer wrapper is provided to run separately twice a 
day.
See readme for recommendations.  This change and #1 above is in the spirit of 
lowering the amount of "gratuitous" calls to WU infrastructure, while still 
attempting to keep WU up-to-date a soon as possible after an outage.  The main 
purpose of the weewx_wunderfixer is to compute today's and yesterday's dates 
and run against both, just to be extra sure that there are no gaps on the WU 
side.  Decoupling now means those actions only occur twice a day, instead of 
every watchdogsecs (e.g. every 10 minutes by default), plus a default of 6 more 
times after an outage.

3)  The running status of weewx is now explicitly checked, which is in part to 
catch an outage sooner, in case weewx crashed very recently after a cron 
interval.
A similar check is now added after a weewx restart attempt, which avoids a 
double watchdogsecs wait (allows back to back weewx restart and host reboot 
remediations, which is especially nice in the case of a USB / firmware hang).

4)  Improved and more consistent logging with a running history of status and 
remediation steps the beginning of the current pass of weewx_watchdog.

That one proved more challenging than expected due to a 1024 line-length 
limitation somewhere in the middle between the host and my inbox.  A simple 
"fmt -s -w 1024" did the trick.  I woulda had this update out sooner, were it 
not for that one!  LOL

The latest 1.1.0 version is over here:

https://github.com/UberEclectic/weewx/tree/watchdog/examples/watchdog

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

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/475020EA-09A6-44E4-B282-502B8C64F37F%40isylum.org.
For more options, visit https://groups.google.com/d/optout.


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

2019-05-06 Thread gjr80
So the error is arising from data coming from cmon and not the weather 
station:

May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/user/cmon.py", line 711, in save_data
May  6 20:20:31 raspberrypi weewx[333]:   self.dbm.addRecord(
record)

and

Apr 25 19:00:32 raspberrypi weewx[331]:  File 
"/usr/share/weewx/user/cmon.py", line 704, in new_archive_record
Apr 25 19:00:32 raspberrypi weewx[331]:  self.save_data(self.get_data(
now, self.last_ts))
Apr 25 19:00:32 raspberrypi weewx[331]:  File 
"/usr/share/weewx/user/cmon.py", line 711, in save_data
Apr 25 19:00:32 raspberrypi weewx[331]:  self.dbm.addRecord(record)


Judging by the 'numbers' involved I would hazard a guess that the routine used 
by cmon to extract data from some files on the system is returning something 
other than a float or an int. Judging by the numbers I would be looking at the 
network traffic. 
I recall an earlier thread where network traffic figures being read by cmon 
were too big for an int, though that would not appear to be the case here.

Perhaps some details of what cmon version, what operating system and WeeWX 
system hardware might help 

Gary


On Tuesday, 7 May 2019 07:56:45 UTC+10, Redanman wrote:
>
> Weewx crashed again tonight with what seems to be the same root cause.  
> Here is the syslog just at the moment it crashed.  Again, looking at the 
> data, I cannot see any spurious text/numbers.  Out of interest, is accum.py 
> run every iteration of the engine or only on an interval?  
>
> May  6 20:20:30 raspberrypi weewx[333]: interceptor: MainThread: raw 
> packet: {'wind_speed': 0.0, 'humidity_in': 43.0, 'temperature_in': 68.4, 
> 'barometer': 30.15, 'windchill': 46.9, 'dewpoint': 40.5, 'battery': 0.0, 
> 'humidity_out': 78.0, 'uv': 0.0, 'radiation': 0.15, 'rain': 0.0, 
> 'dateTime': 1557170426, 'temperature_out': 46.9, 'wind_dir': 143.0, 
> 'rain_total': 4.49, 'usUnits': 1, 'wind_gust': 0.0}
> May  6 20:20:30 raspberrypi weewx[333]: interceptor: MainThread: mapped 
> packet: {'barometer': 30.15, 'windchill': 46.9, 'dewpoint': 40.5, 
> 'outHumidity': 78.0, 'UV': 0.0, 'radiation': 0.15, 'rain': 0.0, 'dateTime': 
> 1557170426, 'windDir': 143.0, 'outTemp': 46.9, 'windSpeed': 0.0, 
> 'txBatteryStatus': 0.0, 'inTemp': 68.4, 'windGust': 0.0, 'inHumidity': 
> 43.0, 'usUnits': 1}
> May  6 20:20:30 raspberrypi weewx[333]: manager: Added record 2019-05-06 
> 20:20:31 BST (1557170431) to database 'cmon.sdb'
> May  6 20:20:30 raspberrypi weewx[333]: engine: Main loop exiting. 
> Shutting engine down.
> May  6 20:20:30 raspberrypi weewx[333]: engine: Shutting down StdReport 
> thread
> May  6 20:20:30 raspberrypi weewx[333]: engine: StdReport thread has been 
> terminated
> May  6 20:20:30 raspberrypi weewx[333]: restx: Shut down WOW thread.
> May  6 20:20:30 raspberrypi weewx[333]: restx: Shut down PWSWeather thread.
> May  6 20:20:31 raspberrypi weewx[333]: restx: Shut down Wunderground-PWS 
> thread.
> May  6 20:20:31 raspberrypi weewx[333]: restx: Shut down StationRegistry 
> thread.
> May  6 20:20:31 raspberrypi weewx[333]: interceptor: MainThread: shutting 
> down server thread
> May  6 20:20:31 raspberrypi weewx[333]: interceptor: MainThread: stop tcp 
> server
> May  6 20:20:31 raspberrypi weewx[333]: engine: Caught unrecoverable 
> exception in engine:
> May  6 20:20:31 raspberrypi weewx[333]:   accum: 
> ScalarStats.addHiLo expected float or int, got 710464
> May  6 20:20:31 raspberrypi weewx[333]:   Traceback (most recent 
> call last):
> May  6 20:20:31 raspberrypi weewx[333]: File 
> "/usr/share/weewx/weewx/engine.py", line 890, in main
> May  6 20:20:31 raspberrypi weewx[333]:   engine.run()
> May  6 20:20:31 raspberrypi weewx[333]: File 
> "/usr/share/weewx/weewx/engine.py", line 202, in run
> May  6 20:20:31 raspberrypi weewx[333]:   
> self.dispatchEvent(weewx.Event(weewx.POST_LOOP))
> May  6 20:20:31 raspberrypi weewx[333]: File 
> "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
> May  6 20:20:31 raspberrypi weewx[333]:   callback(event)
> May  6 20:20:31 raspberrypi weewx[333]: File 
> "/usr/share/weewx/weewx/engine.py", line 574, in post_loop
> May  6 20:20:31 raspberrypi weewx[333]:   
> self._software_catchup()
> May  6 20:20:31 raspberrypi weewx[333]: File 
> "/usr/share/weewx/weewx/engine.py", line 646, in _software_catchup
> May  6 20:20:31 raspberrypi weewx[333]:   
> self.engine.dispatchEvent(weewx.Event(weewx.NEW_ARCHIVE_RECORD, 
> record=record, origin='software'))
> May  6 20:20:31 raspberrypi weewx[333]: File 
> "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
> May  6 20:20:31 raspberrypi weewx[333]:   callback(event)
> May  6 20:20:31 raspberrypi weewx[333]: File 
> "/usr/share/weewx/user/cmon.py", line 704, in new_archive_record
> May  6 20:20:31 

[weewx-user] Re: Installation paths -debian package

2019-05-06 Thread gjr80
My understanding was that when weewxd is invoked the first command line 
parameter is the path and file name of the config file to be be used and no 
attempts are made to search elsewhere for the config file. My further 
understanding is that searches for the config file 'in the usual places' 
occur in the likes of the WeeWX utilities etc. Back to weewxd. If the 
config file (as given on the command like) does not exist WeeWX exits.

In the case above the command:

pi@raspberrypi:~ $ sudo weewxd weewx.conf

irrespective of WeeWX installation type, will cause weewxd to use 
/home/pi/weewx.conf as the config file, but of course that file does not 
exist so WeeWX exits. If WeeWX was installed via a deb package then 
weewx.conf will be in /etc/weewx and the correct command to use is:

$ sudo weewxd /etc/weewx/weewx.conf

Unless of course the present working directory is /etc/weewx in which case 
the original command would work.

Perhaps there is some confusion here over the command used to run WeeWX 
directly. The command is frequently given as:

$ sudo weewxd weewx.conf

which is often taken literally when in fact there is an implied need to 
include the path to weewx.conf. I don't have a problem with this format but 
perhaps there is a need for an explanatory note about the requirement for a 
path. Though I am not sure this is the only instance of an implied path in 
the documents, so if it is done for one it may need to be done for many.

In this case I would also remove all of the files copied to /home/pi (and 
any other non-standard WeeWX deb package locations), WeeWX may work with 
them in place now but you are setting yourself up for chasing your tail in 
the future when something does not work and you have multiples copies of 
WeeWX on your system.

Gary

On Tuesday, 7 May 2019 07:35:22 UTC+10, JM wrote:
>
> To clarify, my understanding is that setup.py installs to different paths 
> than the DEB package. it almost seems as if they got switched. 
>
>
> On Monday, May 6, 2019 at 5:32:08 PM UTC-4, JM wrote:
>>
>> No its there, I copied the weewx.conf and weewx.conf.dist there. 
>> without it, it will not run. 
>> FWIW, I originally set up Raspian on a different, New MicroSD and 
>> encountered the same problem. both instances behaved the same way. 
>> Initially I thought maybe the SD card was defective. 
>> So I imaged another card and encountered the same result. 
>>
>> I also copied the entire weewx folder from /etc/weewx/ to home/pi/  I 
>> dont think this made any difference. I'm confused, since I didn't run 
>> Setup.py and that installs to the paths this version is expecting. 
>> Any help is appreciated. 
>>
>>
>>
>> On Sunday, May 5, 2019 at 8:47:52 PM UTC-4, JM wrote:
>>>
>>> I have previously set up two other weather stations using weewx. Just 
>>> set up a new instance and I am finding that the default installation path 
>>> for weewx.conf is incorrect. 
>>> below is a error received in it's initial installation state. I have 
>>> moved weewx.conf to the /home/pi/ directory and it runs. The weewx 
>>> documentation indicates that the default DEB package will install to : 
>>> /etc/weewx/weewx.conf.
>>> Can anyone give me insight on how to point weewx to the /etc/weewx 
>>> directory instead of /home/pi ?
>>>  
>>>
>>> pi@raspberrypi:~ $ sudo weewxd weewx.conf
>>> Traceback (most recent call last):
>>>   File "/usr/bin/weewxd", line 64, in 
>>> weewx.engine.main(options, args)
>>>   File "/usr/share/weewx/weewx/engine.py", line 848, in main
>>> sane = os.stat(config_path).st_ctime
>>> OSError: [Errno 2] No such file or directory: '/home/pi/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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/9d87d861-3da0-44b7-9c95-54f3af4eb0e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] How do I remove and add extra graphs to a skin?

2019-05-06 Thread Ken Booth
Hi,

I've been able to edit the current.inc and hilo.inc to display tables of 
the values that interest me, but when I edit skins.conf things just don't 
go the way I want.

If I comment out
[[[daywind]]]
windSpeed
windGust
I still get a windSpeed/WindGust graph.

If I add an extra [[[daytemp]]] for more sensors, I get
weewx[24667]: reportengine: Failed to read skin configuration file 
/etc/weewx/skins/Seasons/skin.conf for report 'SeasonsReport': Duplicate 
section name at line 267

If I add a new name such as
[[[daytemp1]]]
extraTemp11
then I don't get an extra graph.

So far I have been able to get temperature graphs by replacing values in 
existing graphs
##[[[daytempfeel]]]
##windchill
##heatindex

[[[daytempfeel]]]
extraTemp12
extraTemp8
extraTemp9
extraTemp11
extraTemp7

So obviously editing skins.conf on its own is insufficient. How do I remove 
the rainfall and wind graphs, and get more humidity graphs. Which file 
defines what to generate, and how?


-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/0a590977-8b70-42fe-9fd6-80ec544f496d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-05-06 Thread Redanman
Weewx crashed again tonight with what seems to be the same root cause.  
Here is the syslog just at the moment it crashed.  Again, looking at the 
data, I cannot see any spurious text/numbers.  Out of interest, is accum.py 
run every iteration of the engine or only on an interval?  

May  6 20:20:30 raspberrypi weewx[333]: interceptor: MainThread: raw 
packet: {'wind_speed': 0.0, 'humidity_in': 43.0, 'temperature_in': 68.4, 
'barometer': 30.15, 'windchill': 46.9, 'dewpoint': 40.5, 'battery': 0.0, 
'humidity_out': 78.0, 'uv': 0.0, 'radiation': 0.15, 'rain': 0.0, 
'dateTime': 1557170426, 'temperature_out': 46.9, 'wind_dir': 143.0, 
'rain_total': 4.49, 'usUnits': 1, 'wind_gust': 0.0}
May  6 20:20:30 raspberrypi weewx[333]: interceptor: MainThread: mapped 
packet: {'barometer': 30.15, 'windchill': 46.9, 'dewpoint': 40.5, 
'outHumidity': 78.0, 'UV': 0.0, 'radiation': 0.15, 'rain': 0.0, 'dateTime': 
1557170426, 'windDir': 143.0, 'outTemp': 46.9, 'windSpeed': 0.0, 
'txBatteryStatus': 0.0, 'inTemp': 68.4, 'windGust': 0.0, 'inHumidity': 
43.0, 'usUnits': 1}
May  6 20:20:30 raspberrypi weewx[333]: manager: Added record 2019-05-06 
20:20:31 BST (1557170431) to database 'cmon.sdb'
May  6 20:20:30 raspberrypi weewx[333]: engine: Main loop exiting. Shutting 
engine down.
May  6 20:20:30 raspberrypi weewx[333]: engine: Shutting down StdReport 
thread
May  6 20:20:30 raspberrypi weewx[333]: engine: StdReport thread has been 
terminated
May  6 20:20:30 raspberrypi weewx[333]: restx: Shut down WOW thread.
May  6 20:20:30 raspberrypi weewx[333]: restx: Shut down PWSWeather thread.
May  6 20:20:31 raspberrypi weewx[333]: restx: Shut down Wunderground-PWS 
thread.
May  6 20:20:31 raspberrypi weewx[333]: restx: Shut down StationRegistry 
thread.
May  6 20:20:31 raspberrypi weewx[333]: interceptor: MainThread: shutting 
down server thread
May  6 20:20:31 raspberrypi weewx[333]: interceptor: MainThread: stop tcp 
server
May  6 20:20:31 raspberrypi weewx[333]: engine: Caught unrecoverable 
exception in engine:
May  6 20:20:31 raspberrypi weewx[333]:   accum: 
ScalarStats.addHiLo expected float or int, got 710464
May  6 20:20:31 raspberrypi weewx[333]:   Traceback (most recent 
call last):
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/weewx/engine.py", line 890, in main
May  6 20:20:31 raspberrypi weewx[333]:   engine.run()
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/weewx/engine.py", line 202, in run
May  6 20:20:31 raspberrypi weewx[333]:   
self.dispatchEvent(weewx.Event(weewx.POST_LOOP))
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
May  6 20:20:31 raspberrypi weewx[333]:   callback(event)
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/weewx/engine.py", line 574, in post_loop
May  6 20:20:31 raspberrypi weewx[333]:   
self._software_catchup()
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/weewx/engine.py", line 646, in _software_catchup
May  6 20:20:31 raspberrypi weewx[333]:   
self.engine.dispatchEvent(weewx.Event(weewx.NEW_ARCHIVE_RECORD, 
record=record, origin='software'))
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
May  6 20:20:31 raspberrypi weewx[333]:   callback(event)
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/user/cmon.py", line 704, in new_archive_record
May  6 20:20:31 raspberrypi weewx[333]:   
self.save_data(self.get_data(now, self.last_ts))
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/user/cmon.py", line 711, in save_data
May  6 20:20:31 raspberrypi weewx[333]:   
self.dbm.addRecord(record)
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/weewx/manager.py", line 246, in addRecord
May  6 20:20:31 raspberrypi weewx[333]:   
self._addSingleRecord(record, cursor, log_level)
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/weewx/manager.py", line 1216, in _addSingleRecord
May  6 20:20:31 raspberrypi weewx[333]:   
_day_summary.addRecord(record, weight=_weight)
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/weewx/accum.py", line 256, in addRecord
May  6 20:20:31 raspberrypi weewx[333]:   func(self, record, 
obs_type, add_hilo, weight)
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/weewx/accum.py", line 314, in add_value
May  6 20:20:31 raspberrypi weewx[333]:   
self[obs_type].addHiLo(val, record['dateTime'])
May  6 20:20:31 raspberrypi weewx[333]: File 
"/usr/share/weewx/weewx/accum.py", line 77, in addHiLo
May  6 20:20:31 raspberrypi weewx[333]:   raise 
ValueError("accum: ScalarStats.addHiLo 

[weewx-user] Re: Installation paths -debian package

2019-05-06 Thread JM
To clarify, my understanding is that setup.py installs to different paths 
than the DEB package. it almost seems as if they got switched. 


On Monday, May 6, 2019 at 5:32:08 PM UTC-4, JM wrote:
>
> No its there, I copied the weewx.conf and weewx.conf.dist there. 
> without it, it will not run. 
> FWIW, I originally set up Raspian on a different, New MicroSD and 
> encountered the same problem. both instances behaved the same way. 
> Initially I thought maybe the SD card was defective. 
> So I imaged another card and encountered the same result. 
>
> I also copied the entire weewx folder from /etc/weewx/ to home/pi/  I dont 
> think this made any difference. I'm confused, since I didn't run Setup.py 
> and that installs to the paths this version is expecting. 
> Any help is appreciated. 
>
>
>
> On Sunday, May 5, 2019 at 8:47:52 PM UTC-4, JM wrote:
>>
>> I have previously set up two other weather stations using weewx. Just set 
>> up a new instance and I am finding that the default installation path for 
>> weewx.conf is incorrect. 
>> below is a error received in it's initial installation state. I have 
>> moved weewx.conf to the /home/pi/ directory and it runs. The weewx 
>> documentation indicates that the default DEB package will install to : 
>> /etc/weewx/weewx.conf.
>> Can anyone give me insight on how to point weewx to the /etc/weewx 
>> directory instead of /home/pi ?
>>  
>>
>> pi@raspberrypi:~ $ sudo weewxd weewx.conf
>> Traceback (most recent call last):
>>   File "/usr/bin/weewxd", line 64, in 
>> weewx.engine.main(options, args)
>>   File "/usr/share/weewx/weewx/engine.py", line 848, in main
>> sane = os.stat(config_path).st_ctime
>> OSError: [Errno 2] No such file or directory: '/home/pi/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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/80f5bfc3-2875-43eb-a8f8-e10dd0ba66dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Installation paths -debian package

2019-05-06 Thread JM
No its there, I copied the weewx.conf and weewx.conf.dist there. 
without it, it will not run. 
FWIW, I originally set up Raspian on a different, New MicroSD and 
encountered the same problem. both instances behaved the same way. 
Initially I thought maybe the SD card was defective. 
So I imaged another card and encountered the same result. 

I also copied the entire weewx folder from /etc/weewx/ to home/pi/  I dont 
think this made any difference. I'm confused, since I didn't run Setup.py 
and that installs to the paths this version is expecting. 
Any help is appreciated. 



On Sunday, May 5, 2019 at 8:47:52 PM UTC-4, JM wrote:
>
> I have previously set up two other weather stations using weewx. Just set 
> up a new instance and I am finding that the default installation path for 
> weewx.conf is incorrect. 
> below is a error received in it's initial installation state. I have moved 
> weewx.conf to the /home/pi/ directory and it runs. The weewx documentation 
> indicates that the default DEB package will install to : 
> /etc/weewx/weewx.conf.
> Can anyone give me insight on how to point weewx to the /etc/weewx 
> directory instead of /home/pi ?
>  
>
> pi@raspberrypi:~ $ sudo weewxd weewx.conf
> Traceback (most recent call last):
>   File "/usr/bin/weewxd", line 64, in 
> weewx.engine.main(options, args)
>   File "/usr/share/weewx/weewx/engine.py", line 848, in main
> sane = os.stat(config_path).st_ctime
> OSError: [Errno 2] No such file or directory: '/home/pi/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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/fbcff80d-a0f6-43d3-b214-ebe12867907e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Another database

2019-05-06 Thread Andrew Milner
I think you need to define your integers as signed integers to modbus 
rather than (I suspect) unsigned integers which you are probably using now

The 'error' will be within the modbus tcp setup/definitions


On Monday, 6 May 2019 18:49:14 UTC+3, rimas petronis wrote:
>
> red scans from "1000 to -1000" data, "1000 to 0" good, and -1 to -1000 
> shows 65536 o should read -1
>
>
> 2019 m. kovas 19 d., antradienis 16:10:50 UTC+2, rimas petronis rašė:
>>
>> good day
>>
>> sorry my weak english translated with google
>> i really liked the program not only watching the weather but watching 
>> other devices i would like to connect to weewx data in another database
>>
>> database and other composition
>>
>> [image: image.png]
>>
>>
>> can be connected
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/0623b70b-5e75-4f22-a7d7-e9d5eb70df93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] it misses the time display and forecasts

2019-05-06 Thread Patrick Tranchant
hi every body,

since yesterday , I had this with skin "Belchertown"; it is ok with skin 
"Seasons".

it misses the time display and forecasts and graphs on home page !!!
an idea, the logs are corrects for Belchertown

May  6 20:00:16 raspberrypi weewx[22084]: manager: Added record 2019-05-06 
20:00:00 CEST (1557165600) to database 'weewx.sdb'
May  6 20:00:16 raspberrypi weewx[22084]: manager: Added record 2019-05-06 
20:00:00 CEST (1557165600) to daily summary in 'weewx.sdb'
May  6 20:00:19 raspberrypi weewx[22084]: cheetahgenerator: Generated 8 
files for report SeasonsReport in 2.81 seconds
May  6 20:00:26 raspberrypi weewx[22084]: imagegenerator: Generated 28 
images for SeasonsReport in 6.47 seconds
May  6 20:00:26 raspberrypi weewx[22084]: copygenerator: copied 0 files to 
/var/www/html/weewx
May  6 20:00:26 raspberrypi weewx[22084]: cheetahgenerator: Generated 7 
files for report SmartphoneReport in 0.23 seconds
May  6 20:00:29 raspberrypi weewx[22084]: imagegenerator: Generated 14 
images for SmartphoneReport in 2.88 seconds
May  6 20:00:29 raspberrypi weewx[22084]: copygenerator: copied 0 files to 
/var/www/html/weewx/smartphone
May  6 20:00:29 raspberrypi weewx[22084]: cheetahgenerator: Generated 1 
files for report MobileReport in 0.08 seconds
May  6 20:00:30 raspberrypi weewx[22084]: imagegenerator: Generated 4 
images for MobileReport in 0.53 seconds
May  6 20:00:30 raspberrypi weewx[22084]: copygenerator: copied 0 files to 
/var/www/html/weewx/mobile
May  6 20:00:31 raspberrypi weewx[22084]: Belchertown Extension: New 
forecast file downloaded to 
/var/www/html/weewx/belchertown/json/darksky_forecast.json
May  6 20:00:34 raspberrypi weewx[22084]: cheetahgenerator: Generated 14 
files for report Belchertown in 3.73 seconds
May  6 20:00:34 raspberrypi weewx[22084]: copygenerator: copied 1 files to 
/var/www/html/weewx/belchertown
May  6 20:00:50 raspberrypi weewx[22084]: cheetahgenerator: Generated 4 
files for report Highcharts_Belchertown in 16.39 seconds
May  6 20:00:50 raspberrypi weewx[22084]: copygenerator: copied 0 files to 
/var/www/html/weewx/belchertown


Patrick

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/413e8db3-3529-4bd0-9160-2c0619b3924a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Another database

2019-05-06 Thread rimas petronis
red scans from "1000 to -1000" data, "1000 to 0" good, and -1 to -1000 
shows 65536 o should read -1


2019 m. kovas 19 d., antradienis 16:10:50 UTC+2, rimas petronis rašė:
>
> good day
>
> sorry my weak english translated with google
> i really liked the program not only watching the weather but watching 
> other devices i would like to connect to weewx data in another database
>
> database and other composition
>
> [image: image.png]
>
>
> can be connected
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/3ba8f755-7386-4e09-8bdc-8106ce203b6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Interceptor not sniffing packets, router configured correctly

2019-05-06 Thread Kev D
Hi all,

Just an update, I have figured out a solution to my issues. Instead of 
forcing the data from the WS to the WeeWx server, I turned the WeeWx server 
into a gateway just for WS traffic, here are the steps I performed in case 
someone needs the same solution.

Environment: 
Ubuntu VM running WeeWx / Interceptor. IP:192.168.0.8
WS2902a Weather station: IP: 192.168.0.7
Router: UniFi Security Gateway 3P

First I assigned the WS a static IP and gateway to force it to my Ubuntu 
server:

configure
set service dhcp-server shared-network-name net_LAN_eth1_192.168.0.0-24 
subnet 192.168.0.0/24 static-mapping client1 mac-address 00:00:00:00:00:00
set service dhcp-server shared-network-name net_LAN_eth1_192.168.0.0-24 
subnet 192.168.0.0/24 static-mapping client1 ip-address 192.168.0.7
set service dhcp-server shared-network-name net_LAN_eth1_192.168.0.0-24 
subnet 192.168.0.0/24 static-mapping client1 static-mapping-parameters  
"option routers 192.168.0.8;"
commit;save;exit

Then applied this to the config.gateway.json file to keep settings between 
reboots and provisions:
{
"service": {
"dhcp-server": {
"shared-network-name": {
"net_LAN_eth1_192.168.0.0-24": {
"subnet": {
"192.168.0.0/24": {
"static-mapping": {
"client1": {
"ip-address": "192.168.0.7",
"mac-address": "00:00:00:00:00:00",
"static-mapping-parameters": [
"option routers 192.168.0.8;"
]
}
}
}
}
}
}
}
}
}


Next, on the Ubuntu server I applied the following(eth1 interface set 
static to 0.8):

sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -A FORWARD -s 192.168.0.7 -i eth1 -j ACCEPT
iptables -A FORWARD -s 192.168.0.7 -d 192.168.0.8 -eth1 -j ACCEPT


After the above was applied I am able to pass WS all data through the 
server to the internet in order to sniff the packets accordingly. Thanks 
for everyone's assistance and I hope my solution can help someone else in a 
similar situation :)

Cheers,

Kev


On Wednesday, April 24, 2019 at 7:26:48 PM UTC-4, Kev D wrote:
Hi Leon,

Thanks for the response, I am actually in the process of placing my old 
router (which this setup worked perfectly with prior to upgrading) in front 
of the the station to achieve this. Although I am already encountering 
issues as I cannot apply iptables on it unless it’s the active gateway but 
I need to play with it more. As for my switch, it is unmanaged and I am not 
able to control any ports individually. 

Ideally, I would love to limit the amount of equipment running but I think 
I am most frustrated my new fancy USG can’t handle some simple iptables.

-Kev

On Wed, Apr 24, 2019 at 19:13 Leon Shaner  wrote:
Kev,

MAYBE you need a good old fashioned hub in the middle.

A switch does jack to jack / port to port optimizations such that not every 
packet is seen on every jack.   Also, if WiFi is involved and you have more 
than one access point, and the weather station and your weewx host are not 
connected via the same access point (or one is wired and the other is WiFi 
and there is a switch in the middle), then they too will be subject to the 
jack to jack / port to port optimizations at the switch.

I say this because your weather station is sending to the server and your 
weewx interceptor is a "third-party" and your switch has no reason to think 
the conversation between the weather station and the server should be 
"shared" with your weewx host.

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

On Apr 24, 2019, at 3:54 PM, Kev D <> wrote:

Another update: To eliminate any possible interference, I spun up an Ubuntu 
VM to continue testing. This is the current setup:

Weather station: 192.168.0.7
Unbuntu/WeeWx/Interceptor: 192.168.0.8

I can confirm the router is sending data from the weather station to the 
server as I when I run TCDUMP, you can see the data coming from 192.168.0.7

However, when I call the interceptor driver directly it does not capture 
any of this data. This is both in sniff and listen modes. Does anyone know 
what I missing?





Thanks in advance,

Kev

On Tuesday, April 23, 2019 at 9:56:12 AM UTC-4, Kev D wrote:
One thing I am confused on, the Weewx logs appear to be seeing data but the 
interceptor is not. I assume since I routed all data coming from the 
weather station IP to weewx this would have to be data from the WS right? 
When I disable this routing it will just return "empty queue". I feel like 
I am missing something here.

Capture.JPG























On Tuesday, April 23, 2019 at 9:30:23 AM UTC-4, Kevin De Lucca wrote:
The goal is to continue to send to wu while sniffing from weewx. I had the 
router configured to the point where anything from the weather station IP 
was sent to the observer and still would not sniff (WU site even had it 
showing offline because of this). Maybe I should go the DNS hijack route 
then just have weewx send the data to wu. Would this mean I need to change 
the observer to listen mode rather than sniff?

Thanks,

Kev

On Tuesday, April 

[weewx-user] Re: Another database

2019-05-06 Thread Andrew Milner
I do not understand your problem
The first values you said were type float, and you have printed them with 
the format %.2f - are these the correct values??

the values in red you have said are type integer, but you are printing them 
as type float
if they are integers the format should be %d ((integers do not have a 
decimal point)

What are the logged messages supposed to be showing??



On Monday, 6 May 2019 17:02:42 UTC+3, rimas petronis wrote:
>
>
> I'm asking for help
> For 3 weeks, I try to get along, but I don't succeed
>
> I've created another scrip for data scans
> one problem
> reads healthy numbers well
>   negatives (65250 must -286)
> I found a formula to calculate
> unable to get stuck (65250 -65536 = - 286)
> how to make correct numbers
> positive and negative
>
>
> May  6 16:38:27 rimaspetronis weewx[25649]: Vc: 248.60
> May  6 16:38:27 rimaspetronis weewx[25649]: Vab: 435.30
> May  6 16:38:27 rimaspetronis weewx[25649]: Vbc: 427.40
> May  6 16:38:27 rimaspetronis weewx[25649]: Vca: 438.40
> May  6 16:38:27 rimaspetronis weewx[25649]: Hz: 50.00
> May  6 16:38:27 rimaspetronis weewx[25649]: Kwa: 65437.00
> May  6 16:38:27 rimaspetronis weewx[25649]: Kwb: 65439.00
> May  6 16:38:27 rimaspetronis weewx[25649]: Kwc: 65422.00
>
>
>
> 2019 m. kovas 19 d., antradienis 16:10:50 UTC+2, rimas petronis rašė:
>>
>> good day
>>
>> sorry my weak english translated with google
>> i really liked the program not only watching the weather but watching 
>> other devices i would like to connect to weewx data in another database
>>
>> database and other composition
>>
>> [image: image.png]
>>
>>
>> can be connected
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/33142ad6-800b-4db6-9b2f-e1e052ef32fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: Another database

2019-05-06 Thread rimas petronis

I'm asking for help
For 3 weeks, I try to get along, but I don't succeed

I've created another scrip for data scans
one problem
reads healthy numbers well
  negatives (65250 must -286)
I found a formula to calculate
unable to get stuck (65250 -65536 = - 286)
how to make correct numbers
positive and negative


May  6 16:38:27 rimaspetronis weewx[25649]: Vc: 248.60
May  6 16:38:27 rimaspetronis weewx[25649]: Vab: 435.30
May  6 16:38:27 rimaspetronis weewx[25649]: Vbc: 427.40
May  6 16:38:27 rimaspetronis weewx[25649]: Vca: 438.40
May  6 16:38:27 rimaspetronis weewx[25649]: Hz: 50.00
May  6 16:38:27 rimaspetronis weewx[25649]: Kwa: 65437.00
May  6 16:38:27 rimaspetronis weewx[25649]: Kwb: 65439.00
May  6 16:38:27 rimaspetronis weewx[25649]: Kwc: 65422.00



2019 m. kovas 19 d., antradienis 16:10:50 UTC+2, rimas petronis rašė:
>
> good day
>
> sorry my weak english translated with google
> i really liked the program not only watching the weather but watching 
> other devices i would like to connect to weewx data in another database
>
> database and other composition
>
> [image: image.png]
>
>
> can be connected
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/456cc7c9-fe9b-4b1c-bd30-dfe5ebeda804%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
import syslog
import weewx
from weewx.engine import StdService
from pymodbus.client.sync import ModbusTcpClient

class AddelectricData(StdService):
	def __init__(self, engine, config_dict):
		# Initialize Superclass
		super(AddelectricData, self).__init__(engine, config_dict)

		# Grab the configuration parameters for communication with the charge controller
		try:
			
			self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_packet)
		except KeyError as e:
			syslog.syslog(syslog.LOG_ERR, "Electric failed to configure")

	def new_archive_packet(self, event):
		client = ModbusTcpClient('192.168.1.199', port=502)
		try:
			client.connect()
			rr = client.read_holding_registers(7680, 30, unit=10)
			if rr is None:
client.close()
syslog.syslog(syslog.LOG_ERR, "Failed to connect to tristar")
			else:


# Voltage Related Statistics
Kwha = float(rr.registers[1]) / 10.00
syslog.syslog(syslog.LOG_DEBUG, "Kwha: %.2f" % Kwha)
event.record['Kwha'] = Kwha

Kwhr = float(rr.registers[7]) / 10.00
syslog.syslog(syslog.LOG_DEBUG, "Kwhr: %.2f" % Kwhr)
event.record['Kwhr'] = Kwhr

Aa = float(rr.registers[8]) / 100.00
syslog.syslog(syslog.LOG_DEBUG, "Aa: %.2f" % Aa) 
event.record['Aa'] = Aa

Ab = float(rr.registers[9]) / 100.00
syslog.syslog(syslog.LOG_DEBUG, "Ab: %.2f" % Ab) 
event.record['Ab'] = Ab

Ac = float(rr.registers[10]) / 100.00
syslog.syslog(syslog.LOG_DEBUG, "Ac: %.2f" % Ac) 
event.record['Ac'] = Ac

Va = float(rr.registers[11]) / 10.00
syslog.syslog(syslog.LOG_DEBUG, "Va: %.2f" % Va) 
event.record['Va'] = Va

Vb = float(rr.registers[12]) / 10.00
syslog.syslog(syslog.LOG_DEBUG, "Vb: %.2f" % Vb) 
event.record['Vb'] = Vb

Vc = float(rr.registers[13]) / 10.00
syslog.syslog(syslog.LOG_DEBUG, "Vc: %.2f" % Vc) 
event.record['Vc'] = Vc

Vab = float(rr.registers[14]) / 10.00
syslog.syslog(syslog.LOG_DEBUG, "Vab: %.2f" % Vab) 
event.record['Vab'] = Vab

Vbc = float(rr.registers[15]) / 10.00
syslog.syslog(syslog.LOG_DEBUG, "Vbc: %.2f" % Vbc) 
event.record['Vbc'] = Vbc

Vca = float(rr.registers[16]) / 10.00
syslog.syslog(syslog.LOG_DEBUG, "Vca: %.2f" % Vca) 
event.record['Vca'] = Vca

Hz = float(rr.registers[17]) / 10.00
syslog.syslog(syslog.LOG_DEBUG, "Hz: %.2f" % Hz) 
event.record['Hz'] = Hz

Kwa = int(rr.registers[22])
syslog.syslog(syslog.LOG_DEBUG, "Kwa: %.2f" % Kwa) 
event.record['Kwa'] = Kwa

Kwb = int(rr.registers[23])
syslog.syslog(syslog.LOG_DEBUG, "Kwb: %.2f" % Kwb) 
event.record['Kwb'] = Kwb

Kwc = int(rr.registers[24])
syslog.syslog(syslog.LOG_DEBUG, "Kwc: %.2f" % Kwc) 
event.record['Kwc'] = Kwc

Kw = int(rr.registers[25])
syslog.syslog(syslog.LOG_DEBUG, "Kw: %.2f" % Kw) 
event.record['Kw'] = Kw

client.close()
		except Exception as e:
			syslog.syslog(syslog.LOG_ERR, "Error processing record from electric: " + str(e))
			client.close()