[weewx-user] wweewx not archive data during RPi turn off: any idea for troubleshooting?

2017-05-31 Thread Sanit ARUNPLOD
Dear, All
I 'm testing weather station using [FineOffsetUSB] WH1080  site 
by using weewx 3.7.0. This site using raspberry pi on weewx and power up by 
timer switch. It will be on during 9.00-10.00, 12.00-13.00 and 22.00-23.00 
every day. 
The problem  is the sqlite is not update data archive during station 
offline (RPI). It will update data archive during RPI online only. as 
 attachment image  : but when i query data directly from device 
./wee_device --history=30 , it show the logged data properly. 



System: 
[FineOffsetUSB] WH1080
Raspberry pi + weewx 3.7.0 version 
Log interval 5 mins. 

What i have troubleshoot? 
1.   clean up on device + delete /archive/weewx.sdb + delete /public_html 
 ; wee_device --clear-memory : Not work 
2. clean configure: wee_config --reconfigure : Not work
3. reinstall new: Weewx version3.7.1 : Not work

This is my weewx.conf in attachment> 

ANY idea for this problem? 





-- 
You received this message because you are subscribed to the Google 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-2015 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 = /home/weewx

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

##

#   This section is for information about the station.

[Station]

# Description of the station location
location = Thailand

# Latitude and longitude in decimal degrees
latitude = 14.06
longitude = 100.07

# Altitude of the station, with unit it is in. This is downloaded from
# from the station if the hardware supports it.
altitude = 0, meter# Choose 'foot' or 'meter' for unit

# 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 = FineOffsetUSB

# 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

##

[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

##

#   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.
enable = false
username = replace_me
# To guard against parsing errors, put your password in quotes:
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 = replace_me

# If this is an APRS (radio amateur) station, uncomment
# the following and replace with a passcode (e.g., 12345).
#passcode = replace_me (APRS stations only)

[[PWSweather]]
# This section is for configuring posts to PWSweather.com.

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

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

# If you wish to do this, set the option 'enable' to true,
# and speci

Re: [weewx-user] MySQL server has gone away

2017-05-31 Thread Andrew Milner
what does the log show during the period a)loss of Mysql, b) weewx restart 
from top, c) reacquire MySQL external db, d) a couple of archive intervals.

how (what order) are the services listed in weewx.conf?



On Thursday, 1 June 2017 04:34:01 UTC+3, Louis De Lange wrote:

> Tom,
>
> I tried you recommendation, but it did not quite have the result that I 
> had in mind.
>
> Rasing a WeeWxIOError shut down the engine, which retries again and starts 
> up again if the MySQL server is back online.  The problem is that it no 
> longer updates the local database either.
>
> If there is an exception to be raised that would restart the connection to 
> the database without shutting down the engine, it would be my preference.
>
>
> On Wednesday, 31 May 2017 04:44:35 UTC-7, Tom Keffer wrote:
>>
>> Most likely, the connection to the MySQL server needs to be reestablished 
>> as well.
>>
>> When weewx gets a MySQL server error, it restarts from the top, which 
>> effectively causes the connection to be re-established. If you raise a 
>> WeeWxIOError (or subclass) instead of ignoring the error, it should do this.
>>
>> -tk
>>
>> On Tue, May 30, 2017 at 7:22 PM, Louis De Lange  
>> wrote:
>>
>>> While there seem to be great excitement for the new meteotemplate 
>>> uploader, I previously wrote a service that updates my meteotemplate 
>>> database directly without an intermediate php script.  In the service i use 
>>> a ."getSql("INSERT INTO" statement.  This works really well and I even 
>>> resolved the dayrain issue that is now being discussed on another thread.
>>>
>>> There is one annoying bug and I dont know how to solve it.  My 
>>> meteotemplate install is located on a different server than weewx.  It can 
>>> sometimes happen that the meteotemplate server is temporarily unavailable.  
>>> To overcome this scenario I use a "try" statement when inserting SQL data, 
>>> so that it will just skip the upload attempt if the MySQL server is not 
>>> available.  The bug is that the mysql insert command continue to fail after 
>>> the meteotemplate server becomes available again, and the only way to 
>>> correct it is to restart weewx. 
>>>
>>> The fail message is "Error (2006, 'MySQL server has gone away')" and it 
>>> continues to be displayed after the meteotemplate server is back on line.
>>>
>>> Any ideas how to resolve this will be appreciated.
>>>
>>> Louis
>>>
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "weewx-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to weewx-user+...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

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


Re: [weewx-user] MySQL server has gone away

2017-05-31 Thread Louis De Lange
Tom,

I tried you recommendation, but it did not quite have the result that I had 
in mind.

Rasing a WeeWxIOError shut down the engine, which retries again and starts 
up again if the MySQL server is back online.  The problem is that it no 
longer updates the local database either.

If there is an exception to be raised that would restart the connection to 
the database without shutting down the engine, it would be my preference.


On Wednesday, 31 May 2017 04:44:35 UTC-7, Tom Keffer wrote:
>
> Most likely, the connection to the MySQL server needs to be reestablished 
> as well.
>
> When weewx gets a MySQL server error, it restarts from the top, which 
> effectively causes the connection to be re-established. If you raise a 
> WeeWxIOError (or subclass) instead of ignoring the error, it should do this.
>
> -tk
>
> On Tue, May 30, 2017 at 7:22 PM, Louis De Lange  > wrote:
>
>> While there seem to be great excitement for the new meteotemplate 
>> uploader, I previously wrote a service that updates my meteotemplate 
>> database directly without an intermediate php script.  In the service i use 
>> a ."getSql("INSERT INTO" statement.  This works really well and I even 
>> resolved the dayrain issue that is now being discussed on another thread.
>>
>> There is one annoying bug and I dont know how to solve it.  My 
>> meteotemplate install is located on a different server than weewx.  It can 
>> sometimes happen that the meteotemplate server is temporarily unavailable.  
>> To overcome this scenario I use a "try" statement when inserting SQL data, 
>> so that it will just skip the upload attempt if the MySQL server is not 
>> available.  The bug is that the mysql insert command continue to fail after 
>> the meteotemplate server becomes available again, and the only way to 
>> correct it is to restart weewx. 
>>
>> The fail message is "Error (2006, 'MySQL server has gone away')" and it 
>> continues to be displayed after the meteotemplate server is back on line.
>>
>> Any ideas how to resolve this will be appreciated.
>>
>> Louis
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "weewx-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to weewx-user+...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


[weewx-user] Lacrosse WS2300 datalogger

2017-05-31 Thread Andrea Giglietti
Hi, I'm new here, and I'm new on WeeWx. 2 days ago I connect my old 
Lacrosse Ws2300 to a Raspberry with WeeWx software installed. All works 
fine, and I'm really happy... all, except the datalogger. When I 
disconnnect the station for some hours and I connect it again, no old data 
is visible on charts. I set the archive interval on 300 seconds, and I 
leave all value set on default on weewx.conf, except the [WS23xx] that I 
set on this way:

[WS23xx]
# This section is for the La Crosse WS-2300 series of weather stations.

# Serial port such as /dev/ttyS0, /dev/ttyUSB0, or /dev/cuaU0
port = /dev/ttyUSB0

# The station model, e.g., 'LaCrosse WS2317' or 'TFA Primus'
model = LaCrosse WS2300

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

Some suggestion? Thanks in advance to all!

-- 
You received this message because you are subscribed to the Google 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] Problem with reset of dayRain value in loop data

2017-05-31 Thread Luc Heijst
Hi Tom,

Dealing with the dayRain value of the Vantage loop data received from the 
Pro2 and Vue consoles or Envoys when no time stamps are available and with 
an internal clock which can run both slow or fast will be not easy and 
should not be done.
A possible solution might introduce other problems.

I advice to use instead the dayRain calculation of weewx which already will 
be done for most (all?) other weather stations and even for the Vantage 
stations when used with the Meteostick driver.
We could of course introduce a choice (hardware, software or 
prefer_hardware) but again I think it is wasting of time because the 
software solution is the best in my opinion

As a test I renamed the "dayRain" variable names in the loop definitions of 
the Vantage driver to "dayRain_skip" with as result the dayRain value in 
the Vantage driver also will be calculate by weewx.

I will report tomorrow the results of the upload data round midnight.

Cheers, Luc 


On Tuesday, 30 May 2017 21:09:21 UTC-3, Tom Keffer wrote:
>
> If we are going to have the driver make a decision that a dayRain (and 
>> monthRain and yearRain and maybe dayET, monthET and yearET?) value is to 
>> be ignored (ie we are essentially making the decision that the packet was 
>> from the previous day) can we not just leave the packet data as is (we have 
>> no reason to doubt its accuracy) and just set the packet timestamp to 
>> 00:00? 
>>
>>
> ​A sensible idea. 
>
> But, say we have a packet that arrives at 00:00:02. How do we know if it's 
> from the previous day? Maybe it is the very first packet of the day?
>
> At the end of the day (pun intended), we are trying to create N+1 pieces 
> of data out of N pieces of information. Can't be done.
>
> -tk​
>
>

-- 
You received this message because you are subscribed to the Google 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] Re: MySQL server has gone away

2017-05-31 Thread Paul Bartholdi
Hello,  I faced the same problem once or twice in the past, even with both 
weewx and mysql on the same host. In all cases I could point to the culprit 
on me.  I had updated mysql or restarted altogether the host just at the 
time weewx wanted to insert new records. In both cases I had to stop and 
restart weewx, with no data lost.
Paul


On Wednesday, May 31, 2017 at 4:22:16 AM UTC+2, Louis De Lange wrote:
>
> While there seem to be great excitement for the new meteotemplate 
> uploader, I previously wrote a service that updates my meteotemplate 
> database directly without an intermediate php script.  In the service i use 
> a ."getSql("INSERT INTO" statement.  This works really well and I even 
> resolved the dayrain issue that is now being discussed on another thread.
>
> There is one annoying bug and I dont know how to solve it.  My 
> meteotemplate install is located on a different server than weewx.  It can 
> sometimes happen that the meteotemplate server is temporarily unavailable. 
>  To overcome this scenario I use a "try" statement when inserting SQL data, 
> so that it will just skip the upload attempt if the MySQL server is not 
> available.  The bug is that the mysql insert command continue to fail after 
> the meteotemplate server becomes available again, and the only way to 
> correct it is to restart weewx. 
>
> The fail message is "Error (2006, 'MySQL server has gone away')" and it 
> continues to be displayed after the meteotemplate server is back on line.
>
> Any ideas how to resolve this will be appreciated.
>
> Louis
>
>
>

-- 
You received this message because you are subscribed to the Google 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] Re: Problem with reset of dayRain value in loop data

2017-05-31 Thread Luc Heijst
Below the log results of the meteotemplate upload log messages

Notes: 
1. Both vantage driver and meteostick driver upload loop values to 
(different versions of) meteotemplate.
2. Both drivers get their values from the same Vantage Pro 2 weather 
station.
3. The clock of the Vantage Pro 2 console is behind the clock of the 
raspberry pi system. (differences typically at startup of weewx between -1 
to -5 seconds)
4. vantage driver archive_delay=8 seconds; sends full loop packets; ie each 
loop packet contain dayRain value
5. meteostick driver: archive_delay=12 seconds; sends partial loop packets; 
many loop packets contain a dayRain value 
6. dayRain values are sent to meteotemplate as R values.

Vantage driver:
23:59:58R=6.4
00:00:00R=6.4
00:00:06R=6.4
00:00:07R=0.0
...
New rain value in the morning:
01:18:25R=0.2

Meteostick driver:
23:59:57R=6.4
00:00:13R=0.0
...
New rain value in the morning:
01:20:14R=0.2

Observations and conclusions:

Vantage driver:
The Vantage driver sent after midnight two loop messages with the total 
rain value of the previous day.
The dayRain values are retrieved from the Vantage console loop messages 
(=hardware).
The last received value of 6.4 at 00:00:06 could be explained by a clock 
difference of 3.5 seconds plus the loop interval of 2.5 seconds (is 6.0 
seconds).
Explanation: due to a clock difference of about 6 seconds, the Vantage 
console would have reset the dayRain value at 00:00:06 (server time)
(Not sure if the interval time of 2.5 seconds between loop messages played 
a (negative) role here. If so the clock difference may be as low as 3.5 
seconds.)

Round 01:18:00 this morning it started raining again.
The vantage driver sends this first value of R=0.2 at 01:18:25. Note this 
time stamp is not related to archive calculations which were on 01:15:08 
and 01:20:08

Meteostick driver:
The first loop message after midnight contain the reset dayRain value of 
0.0.
The dayRain values are calculated by weewx because the driver has no 
dayRain values (=software).
The dayRain value is as it should be (OK).

Round 01:18:00 this morning it started raining again.
The meteostick driver kept sending R=0.0 each 2-3 seconds until 01:20:14 
when the first value of R=0.2 was received.
The archive calculation started at 01:20:12, so the dayRain calculation in 
weewx is using the values in the archive.

My conclusions:

The use of the Vantage dayRain loop values is tricky and should not be done.
The reset of dayRaion to 0.0 at midnight can have time stamps before 
midnight when the Vantage console clock is fast and will have time stamps 
after midnight when the Vantage console clock is slow.
The situation could be improved somewhat when the Vantage clock difference 
is measured and/or corrected short before midnight (eg. at 23:59:55), but 
still changing dayRain values and/or time stamps is tricky.

The dayRain values calculated by weewx seems a better solution, especially 
round midnight.
The disadvantage is a delay between a change of the rain bucket counter and 
the first registration in weewx which can be upto 5 minutes with an archive 
interval of 5 minutes.
This could be improved by caching the rain bucket counter values (or rain 
values per loop) between archive periods and adding these values to the 
last archive record as Gary pointed out.

Luc

On Tuesday, 30 May 2017 12:59:26 UTC-3, Luc Heijst wrote:
>
> Hi Andrew,
>
> I have no data right now; I will implement logging of the upload data.
>
> It would be something like:
> 2017-05:29 23:59:58 R=2.8 mm
> 2017-05-30 00:00:02 R=2.8 mm
>
> Don't know at what time R is reset to 0.0 mm. I was looking once to live 
> data and had the impression it was reset within a few seconds after 
> midnight.
> I will report the logging tomorrow.
>
> Luc
>
> On Tuesday, 30 May 2017 12:36:03 UTC-3, Andrew Milner wrote:
>>
>> what time was the previous timestamp?
>>
>>
>> On Tuesday, 30 May 2017 17:44:15 UTC+3, Luc Heijst wrote:
>>
>>> Any of you have an answer about the dayRain calculation? Tom, Gary?
>>>
>>> On Sunday, 28 May 2017 08:30:54 UTC-3, Luc Heijst wrote:

 Sorry, I meant to say: 
 The *uploader *can send either archive data or loop data.

 On Sunday, 28 May 2017 08:28:54 UTC-3, Luc Heijst wrote:
>
> The meteotemplate uploader use value 'dayRain' to populate 
> meteotemplates 'R' value.
> The template can send either archive data or loop data.
>
> When loop data is selected the 'dayRain' value is not reset to 0.0 at 
> the exact start of a new day but shortly after.
> For my Davis Vantage Pro station I got recently in Meteotemplate a 
> registration of 29.0 mm rain with time stamp 00:00:02.
> The result was a meteotemplate database value of 29.0 mm rain for the 
> first archive period that day
>
> Is there a solution for this in weewx?
>
> Luc
>


-- 
You received this message because you are subscribed to the Goo

Re: [weewx-user] MySQL server has gone away

2017-05-31 Thread Thomas Keffer
Most likely, the connection to the MySQL server needs to be reestablished
as well.

When weewx gets a MySQL server error, it restarts from the top, which
effectively causes the connection to be re-established. If you raise a
WeeWxIOError (or subclass) instead of ignoring the error, it should do this.

-tk

On Tue, May 30, 2017 at 7:22 PM, Louis De Lange  wrote:

> While there seem to be great excitement for the new meteotemplate
> uploader, I previously wrote a service that updates my meteotemplate
> database directly without an intermediate php script.  In the service i use
> a ."getSql("INSERT INTO" statement.  This works really well and I even
> resolved the dayrain issue that is now being discussed on another thread.
>
> There is one annoying bug and I dont know how to solve it.  My
> meteotemplate install is located on a different server than weewx.  It can
> sometimes happen that the meteotemplate server is temporarily unavailable.
> To overcome this scenario I use a "try" statement when inserting SQL data,
> so that it will just skip the upload attempt if the MySQL server is not
> available.  The bug is that the mysql insert command continue to fail after
> the meteotemplate server becomes available again, and the only way to
> correct it is to restart weewx.
>
> The fail message is "Error (2006, 'MySQL server has gone away')" and it
> continues to be displayed after the meteotemplate server is back on line.
>
> Any ideas how to resolve this will be appreciated.
>
> Louis
>
>
> --
> You received this message because you are subscribed to the Google 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] Re: Problem with Custom Driver: Wrong data inserting in MySql

2017-05-31 Thread Christophe Allory
@ Gary

Thanks for your help

You saved me many many search hours

I followed your advice and it seems that it works

I delete too many lines when I tried to modify Matthew's sdr driver 


 You're right, the output packet has to look like that:

{'outHumidity': 65, 'outTemp': 15.3, 'usUnits': 17, 'dateTime': 1496213141}
{'rain_total': 423.6, 'usUnits': 17, 'dateTime': 1496213180}

I did not find this information on the Internet during my searches.


Here is my driver.

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#!/usr/bin/env python
# rfxcom driver for weewx
#
# Copyright 2016 Matthew Wall, Luc Heijst
#
# See http://www.gnu.org/licenses/
"""rfxcom is a USB device that receives radio transmissions from sensors
weather.
"""
#Temperature & Humidity sensors
#Checked with RTGR328N & THGR810

#Rain sensors
#Checked with PCR800

#Wind sensors
#Checked with none

#UV sensors
#Checked with none

import serial
import threading
import syslog
import time
import fnmatch
import sys
from _struct import unpack

import weewx.drivers
import weewx.engine


DRIVER_NAME = 'rfxcom'
DRIVER_VERSION = '0.1'


def loader(config_dict, engine):
return rfxcomDriver(engine, config_dict)

def confeditor_loader():
return rfxcomConfEditor()

def configurator_loader(config_dict):
return rfxcomConfigurator()

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

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

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

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


class rfxcomDriver(weewx.drivers.AbstractDevice):

def __init__(self, engine, config_dict):
loginf('driver version is %s' % DRIVER_VERSION)
stn_dict = config_dict.get(DRIVER_NAME, {})
self.sensor_map = stn_dict.get('sensor_map', {})
loginf('sensor map is: %s' % self.sensor_map)
self.last_rain_count = None
self.station = rfxcom(**stn_dict)
self.station.open()

def startup(self):
reading = rfxcom()
reading.start()

def closePort(self):
if self.station is not None:
self.station.close()
self.station = None

@property
def hardware_name(self):
return 'rfxcom'

def genLoopPackets(self):
while True:
while True:
size=self.station.get_readings(1)
if len(size) == 1:
break
size = int(size.encode('hex'), 16)
if size == 0:
continue
readings = self.station.get_readings(size)
try:
stype = ord(readings[0])
except IndexError:
break
subtype = ord(readings[1])
data = readings[3:]
if stype == 82:
result = self.station.processTempHumid(data)
elif stype == 85:
result = self.station.processRain(data)
elif stype == 86:
result = self.station.processWind(subtype, data)
elif stype == 87:
result = self.station.processUV(subtype, data)
else:
logdbg("Warning: Type %d is unsupported" % stype)
if stype == 82 or stype == 85 or stype == 86 or stype == 87:
packet = {'dateTime': int(time.time() + 0.5),
   'usUnits': weewx.METRICWX}
packet.update(result)
packet = self.station.map_to_fields(packet, self.sensor_map)
if packet:
logdbg("%s" % packet)
yield packet


class rfxcom(threading.Thread):
DEFAULT_PORT = '/dev/ttyUSB0'
DEFAULT_BAUDRATE = 38400
DEFAULT_PARITY = serial.PARITY_NONE
DEFAULT_STOPBITS = serial.STOPBITS_ONE
DEFAULT_BYTESIZE = serial.EIGHTBITS

def __init__(self, **cfg):
threading.Thread.__init__(self)
self.port = cfg.get('port', self.DEFAULT_PORT)
loginf('using serial port %s' % self.port)

self.baudrate = cfg.get('baudrate', self.DEFAULT_BAUDRATE)
loginf('using baudrate %s' % self.baudrate)

self.parity = cfg.get('parity', self.DEFAULT_PARITY)
loginf('using parity %s' % self.parity)

self.stopbits = cfg.get('stopbits', self.DEFAULT_STOPBITS)
loginf('using stopbits %s' % self.stopbits)

self.bytesize = cfg.get('bytesize', self.DEFAULT_BYTESIZE)
loginf('using bytesize %s' % self.bytesize)

self.timeout = 1 # seconds
self.serial_port = None
self.last_rain = None

def __enter__(self):
self.open()
return self

def __exit__(self, _, value, 

[weewx-user] Re: Twitter feed on top of the hour

2017-05-31 Thread Maarten van der Hoeven
 

Hi,

 

Thanks for the suggestion, most useful. I’ve followed it, and it is working 
nicely now on top of the hour (crontab). I use twidge to post the created 
datafile to twitter (#welsum).

 

Thanks!


Op dinsdag 30 mei 2017 13:50:10 UTC+2 schreef mwall:
>
>
>
> On Sunday, May 14, 2017 at 3:34:47 PM UTC-4, Maarten van der Hoeven wrote:
>>
>> Hi,
>>
>> I've configured a Twiiter-feed in Weewx, working perfectly. With 
>> post_interval=3600, I told weewx to send the twitter feed every hour. 
>> Working okay.
>>
>> But, this hourly feed is initiated when weewx is started. For example, if 
>> I start weewx at 08:17, immediately a twitter feed is send, the next one to 
>> follow at 09:17. However, I want the twitter feed to be send at the top of 
>> every hour. 08:00, 09:00, 10:00, regardless the time I start weewx.
>>
>> Is this possible? How?
>>
>
> hi maarten,
>
> the weewx uploaders are designed to send data as soon as there is 
> something new to send, i.e., when there is a change to the data.  they are 
> not designed operate based on the clock.
>
> so there is no explicit way to do what you want with the weewx-twitter 
> extension.
>
> one way to do what you want is to make a new skin with a template that 
> spits out to file the data you want to tweet.  then write a shell script 
> that tweets that file.  then make a crontab that invokes the script at the 
> top of each hour.
>
> m
>
>
>
>

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