Code Monkey home page Code Monkey logo

weewx-realtime_clientraw's Introduction

Note: Since the Realtime clientraw service is mainly used to support the Saratoga Weather Website templates, the Realtime clientraw service was rolled into the WeeWX-Saratoga extension repo back in 2021. Consequently, all subsequent development of the Realtime clientraw service has occurred in the WeeWX-Saratoga extension repo. Whilst I would prefer to have the Realtime clientraw service code base exist in one repo only, I appreciate that some users may wish to install the Realtime clientraw service only, without all the extras included in the WeeWX-Saratoga extension. So I have decided to maintain both this Realtime clientraw Extension repo and the WeeWX-Saratoga extension repo and synchronise the Realtime clientraw service code base between the two repos. In short, if you wish to use the Realtime clientraw service with the Saratoga Weather Website templates use the WeeWX-Saratoga extension. If you wish to use the Realtime clientraw service in conjunction with some other app/template you probably should use the Realtime clientraw Extension in this repo.

Realtime clientraw Extension

The Realtime clientraw extension is a WeeWX extension that generates a loop data based clientraw.txt file for near realtime updating of the Saratoga Weather Website templates dashboards. clientraw.txt may also be used by some other applications for near realtime display of weather related data (eg updating Weather Display Live).

Unlike WeeWX template based generation of clientraw.txt, the Realtime clientraw extension uses a custom WeeWX service, known as the Realtime clientraw service to generate a near realtime clientraw.txt based on loop packet data.

Note: The Saratoga dashboards include the standard dashboard included in the Saratoga Weather Website templates and the so-called Alternate dashboard. Use of the term Saratoga dashboards in this repository is taken to mean both the standard dashboard included in the Saratoga Weather Website templates and the so-called Alternate dashboard.

Note: Whilst clientraw.txt can be used for a number of purposes other than near realtime updates of the Saratoga dashboards, the Realtime clientraw extension has been developed with a focus on updating the Saratoga dashboards. As such some clientraw.txt fields not used by the Saratoga dashboards have not been populated and consequently the Realtime clientraw extension generated clientraw.txt may not be suitable for these other purposes. The initial comments in the rtcr.py file detail the clientraw.txt fields that are not populated.

Note: The Realtime clientraw extension generates clientraw.txt upon receipt of each loop packet. As such the definition of near realtime is very much dependent on the period between successive loop packets. The period between successive loop packets is normally a limitation of either the station hardware or driver or both.

Pre-Requisites

The Realtime clientraw extension requires WeeWX v4.5.0 or greater.

Installation

The preferred method of installing the Realtime clientraw extension is using the WeeWX wee_extension utility. The Realtime clientraw extension can also be installed manually.

Note: Symbolic names are used below to refer to some file location on the WeeWX system. Symbolic names allow a common name to be used to refer to a directory that may be different from system to system. The following symbolic names are used below:

  • HTML_ROOT. The path to the directory where WeeWX generated reports and images are located. This directory varies depending on WeeWX installation method and system or web server configuration.

  • BIN_ROOT. The path to the directory where WeeWX executables are located. This directory varies depending on WeeWX installation method.

Refer to where to find things in the WeeWX User's Guide for further information.

Installation using the wee_extension utility

  1. Download the latest Realtime clientraw extension from the Realtime clientraw extension releases page into a directory accessible from the WeeWX machine:

    wget -P /var/tmp https://github.com/gjr80/weewx-realtime_clientraw/releases/download/v0.3.7/rtcr-0.3.7.tar.gz
    

    in this case the extension package will be downloaded to directory /var/tmp.

  2. Stop WeeWX:

    sudo /etc/init.d/weewx stop
    

    or

    sudo service weewx stop
    

    or

    sudo systemctl stop weewx
    
  3. Install the Realtime clientraw extension downloaded at step 1 using the WeeWX wee_extension utility:

    wee_extension --install=/var/tmp/rtcr-0.3.7.tar.gz
    

    Note: Depending on your system/installation the above command may need to be prefixed with sudo.

    Note: Depending on your WeeWX installation the path to wee_extension may need to be provided, eg:

    /home/weewx/bin/wee_extension --install....
    

    This will result in output similar to the following:

    Request to install '/var/tmp/rtcr-0.3.7.tar.gz'
    Extracting from tar archive /var/tmp/rtcr-0.3.7.tar.gz
    Saving installer file to /home/weewx/bin/user/installer/Rtcr
    Saved configuration dictionary. Backup copy at /home/weewx/weewx.conf.20230515124410
    Finished installing extension '/var/tmp/rtcr-0.3.7.tar.gz'
    

    Note: If upgrading an existing Realtime clientraw extension installation any previous Realtime clientraw extension configuration information in weewx.conf will have been retained and upgraded as required. wee_extension will save a timestamped backup copy of the pre-upgrade weewx.conf as detailed in the wee_extension output, eg:

    Saved configuration dictionary. Backup copy at /home/weewx/weewx.conf.20230515124410
    
  4. Start WeeWX:

    sudo /etc/init.d/weewx start
    

    or

    sudo service weewx start
    

    or

    sudo systemctl start weewx
    
  5. This will result in the clientraw.txt file being generated on receipt of each loop packet. A default installation will result in the generated clientraw.txt file being placed in the HTML_ROOT directory.

  6. The Realtime clientraw extension installation can be further customized (eg file locations, frequency of generation etc) by referring to the Realtime clientraw extension wiki (to be written).

Manual installation

  1. Download the latest Realtime clientraw extension from the Realtime clientraw extension releases page into a directory accessible from the WeeWX machine:

    wget -P /var/tmp https://github.com/gjr80/weewx-realtime_clientraw/releases/download/v0.3.7/rtcr-0.3.7.tar.gz
    

    in this case the extension package will be downloaded to directory /var/tmp.

  2. Unpack the extension as follows:

    tar xvfz /var/tmp/rtcr-0.3.7.tar.gz
    
  3. Copy files from within the resulting rtcr directory as follows:

    cp /var/tmp/rtcr/bin/user/rtcr.py BIN_ROOT/user
    

    replacing the symbolic name BIN_ROOT with the nominal locations for your installation.

  4. Edit weewx.conf:

    vi weewx.conf
    
  5. In weewx.conf, modify the [Engine] [[Services]] section by adding the RealtimeClientraw service to the list of report services to be run:

    [Engine]
        [[Services]]
            ....
            report_services = weewx.engine.StdPrint, weewx.engine.StdReport, user.rtgd.RealtimeClientraw
    
  6. Start WeeWX:

    sudo /etc/init.d/weewx start
    

    or

    sudo service weewx start
    

    or

    sudo systemctl start weewx
    
  7. This will result in the clientraw.txt file being generated on receipt of each loop packet. A default installation will result in the generated clientraw.txt file being placed in the HTML_ROOT directory.

  8. The Realtime clientraw extension installation can be further customized (eg file locations, frequency of generation etc) by referring to the Realtime clientraw extension wiki (to be written).

Support

General support issues may be raised in the Google Groups weewx-user forum. Specific bugs in the Realtime clientraw extension code should be the subject of a new issue raised via the Issues Page.

Licensing

The Realtime clientraw extension is licensed under the GNU Public License v3.

weewx-realtime_clientraw's People

Contributors

gjr80 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

weewx-realtime_clientraw's Issues

Support for Weewx 4.1.1 and Python3?

Hi,

I recently upgraded my Weewx installation to version 4.1.1 and switched to Python 3.5.3. Then I installed weewx-realtime_clientraw addon.

It looks like this version, 0.2.3, does not support Python3 and Weewx 4.1.1. I’d made some adjustments to the code (using 2to3 tool) and it runs without errors.

Regards, Terje

rtcr.zip

problem with the combination of weewx 4.5.1, rtcr.py 0.2.3 and Python 3.9

Hello all together
At first all the best for 2022!!!

Because of a defect of my old hardware I moved to a new PC and the current version of weewx and Python within debian bullseye.
After installation of rtcr.py weewx does not work.

I´ve found a problem in the file weeutil.py and I am not able to solve it. The command return int(float(x)) does not work.
def to_int(x):
"""Convert an object to an integer, unless it is None

Examples:
>>> print(to_int(123))
123
>>> print(to_int('123'))
123
>>> print(to_int(-5.2))
-5
>>> print(to_int(None))
None
"""
if isinstance(x, six.string_types) and x.lower() == 'none':
    x = None
try:
    return int(x) if x is not None else None
except ValueError:
    return int(float(x))
   # Perhaps it's a string, holding a floating point number?

def to_float(x):

I would be happy, if somebody is able and willing to help.

Many thanks in advance!!!

Ulf
weewx.zip

Error while collecting weather from Clientraw file data in weatherstation (wordpress)

Once again I need support ...

Clientraw came from weewx to the server as it should be. Since 05:30 this morning I get no new data on my homepage and I have found the below mentioned error in the log file from weather station in wordpress round about every 5 minutes. I have not made modifications within the last days.

example of the log entry:
Zeitstempel : 2021-03-09 20:01:48 (vor 44 Sekunden)
System : Weather Collector 3.8.10
Dienst : File Handler - Clientraw

Station : Dresden Ortsteil Altfranken (yx:00:00:00:00:02)
Modul : N/A (00:00:00:00:00:00)Error while collecting weather from Clientraw file data

I hope, that I am not alone with this problem.

BR
Ulf from Dresden

weewxd: rtcrthread: Unexpected exception of type <type 'exceptions.KeyError'>

This seems to be occurring at midnight...

Jun  5 00:00:05 Service1 weewxd: rtcrthread: Unexpected exception of type <type 'exceptions.KeyError'>
...
Jun 11 00:00:01 Service1 weewxd: rtcrthread: Unexpected exception of type <type 'exceptions.KeyError'>

It then kills rtctrthread and I have to restart weewx.

rtcrthread: Unexpected exception of type <'exceptions.TypeError'>

My dad has Weewx 3.8.2 reading data from an Acurite 01536 station, and I installed your extension to generate clientraw.txt files. But I'm running into an error as described in the syslog lines below. Any idea on how I can resolve this? Thanks -Ben

Jul 26 17:24:26 raspberrypi weewx[1395]: engine: RealtimeClientraw will generate clientraw.txt. min_interval is None
Jul 26 17:24:26 raspberrypi weewx[1395]: engine: Starting up weewx version 3.8.2
Jul 26 17:24:26 raspberrypi weewx[1395]: engine: Starting main packet loop.
Jul 26 17:24:26 raspberrypi weewx[1395]: rtcrthread: Unexpected exception of type <type 'exceptions.TypeError'>
Jul 26 17:24:26 raspberrypi weewx[1395]: rtcrthread: Thread exiting. Reason: unsupported operand type(s) for -: 'float' and 'NoneType'

realtimeclientraw will be created on a wrong place or not

Hello Gary
I have the problem, that realtimeclientraw will be not created if i put the the sentence which is attached in weewx.conf. If I delete the sentence I find the realtimeclientraw in /vat/tmp where I also find a rtcr.py. Another rtcr.py I putted in /usr/share/weewx/user as requested.

If possible please let me know what's wrong.

BR Ulf
rtcr.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.