Upgraded raw plugin for MesoWx v0.4.0

706 views
Skip to first unread message

Luc Heijst

unread,
Jan 31, 2016, 8:24:49 AM1/31/16
to weewx-user
MesoWx is a real-time HTML front-end for visualizing personal weather station data. 
It provides a real-time graph and console display, and dynamic graphs of your weather station history allowing you to explore the details of any recorded time period in your data. 

The latest MesoWx version (v0.4.0 - 2014-05-10) doesn't work with Weewx version 3.x
So far the author didn't provide an upgrade for weewx, so I upgraded modules sync.py and raw.py myself.

Module sync.py synchronizes local weewx loop and archive data with two databases on a remote web server.
Module raw.py synchronizes local weewx loop data with a local meso/raw database for use with a local web server.
Depending on your choice where to put the meso files (local or remote), you only need one of the modules above.

Attached weewx plugin raw_0.4.1-lh.py which is tested with weewx v3.4.0
See attached installation instructions raw_0.4.1-lh.txt 

Release notes raw_0.4.1-lh:
- upgraded weewx database calls
- removed Redis functionality

Comments are welcome

Luc

PS: See for the upgraded sync_lh4 plugin the following thread: https://groups.google.com/forum/#!topic/weewx-user/DnaWsMpC9vE
raw_0.4.1-lh.py
installation instructions raw_0.4.1-lh.txt

Glenn McKechnie

unread,
Mar 24, 2016, 6:41:44 AM3/24/16
to weewx-user
As a follow on from the thread  - https://groups.google.com/forum/#!topic/weewx-user/Z4sW4oDDboo - where I was using Mesowx with sync.py and killing weewx in the process. That issue has been fixed by Luc (thanks again Luc) but the loss of LOOP data when suspended, while a minor issue, went against the spirit of a real time display. I managed to get hold of a HP GT7720 which seems to be working well as a grunty headless master for all the little pi's dotted around here - Masterofpis be its name!

Anyway, I've had cause to use this - raw_0.4.1-lh.py - so feedback here we go.

Works (that's the main thing!)  pretty well...but some additions to the notes follows.


edit raw.py to uncomment selected schema fields.

In truth, this may not be necessary for everyone, but it would pay to take a look before creating the new (meso) database, otherwise you may be doing it all again. In my case some of the fields were commented out. Same thing with sync.py as I (vaguely) recall.

Following on from the above,

edit  <www>/meso/include/config.json to include those missing fields in the "columns" listing. It's not the simplest thing to then get those fields displaying via the web page, but it can be done obviously, and is a lot easier when the data is being captured in the first instance.
(A hint for where to start to use that data, for including within the sparse index.html page is - <www>/js/Config.js But don't start editing that page without making a robust original copy to restore from, and expect lots of silent, blank breakages. )


The "securityKey" ( "securityKey" : ""  ) in the config.json file I still had populated from the remote installation, it makes sense that it could be blank (null) for a local installation. But I left mine in as I knew it worked with it (for sync.py) and removing it from the configs gave blank pages - I possibly should have restarted mysqld to dump the key from memory.

Copy and paste isn't always your friend, the instructions show...

            "user" : "weewx",       / NOTE: Your mysql username/passwords must be the same as in the
            "password" : "weewx",   / [[MySQL]] section of section [DatabaseTypes] in weewx.conf
            "database" : "weewx"
        },
        "raw_mysql" : { // the data source ID
            "type" : "mysql",
            "host" : "localhost",
            "user" : "weewx",       / NOTE: Your mysql username/passwords must be the same as in the
            "password" : "weewx",   / [[MySQL]] section of section [DatabaseTypes] in weewx.conf

comments are 2 /'s not 1 / . Yeah I got caught - laziness has its drawbacks, and syntax highlighters don't always work!

Create the database, and give permissions etc

the instructions at lirpa - https://bitbucket.org/lirpa/mesowx - indicate otherwise but this needs doing.

mysql -uroot -p

mysql> create database meso;

mysql> CREATE USER 'weewx'@'localhost' IDENTIFIED BY 'weewx';

mysql> GRANT select, update, create, delete, insert ON meso.* TO weewx@localhost;


mysql> quit

I think I've replicated Luc's example adjust user/password/database if necessary.

edit weewx.conf to add

 user.raw.RawService to archive services, as in...

[Engine]
    [[Services]]
         archive_services = weewx.engine.StdArchive , user.raw.RawService


with that done, as well as the installation notes Luc has above then raw.py - weewx should be right to go.

Problems ?

[Raw]
[...]
# The max amount of raw data to retain specified in hours (set to 0 to retain all data) [my bold]
# This will in effect keep a rolling window of the data removing old data based on·
# the time of the most recent record. It is recommended to set this to at least 24.
#
# NOTE: if increasing this value (or setting to unlimited), keep in mind that raw data·
# may consume VERY large amounts of space!

DON'T set data_limit to 0, 0 is zero and the database will be dealt with accordingly...

Mar 24 20:06:09 freezerpi weewx[11587]: manager: added record 2016-03-24 20:05:50 AEDT (1458810350) to database 'mesofreezer'
Mar 24 20:06:10 freezerpi weewx[11587]: raw: deleted rawdata prior to 2016-03-24 20:05:00 AEDT (1458810300)
Mar 24 20:06:35 freezerpi weewx[11587]: manager: added record 2016-03-24 20:06:20 AEDT (1458810380) to database 'mesofreezer'


And finally, this one makes no sense - yet


...  I had to change the tableName in  <www>/meso/include/config.json from raw to archive??

it's listed as...

        "weewx_raw" : {
            "type" : "table",
            "dataSource" : "raw_mysql",
            "tableName" : "raw",


but my raw table was empty, barren, deserted! I have 2 tables within the new meso database - archive and raw. The archive was populated and appeared to be all LOOP data - 10 - 20secs between values as comes straight from the owfs service so it's the right data under the wrong name? or is it? What am I missing?
I seem to recall a comment about raw not being present under raw.py but I can't do a precise enough search to find it, if that memory is even correct.

To check this I've stopped weewx, pointed to another database (mesoweather) created it with permissions etc (no tables) and restarted weewx. Same result although I know the archive table was created first, and suspect the raw showed up later. I only 'noticed' it came into existance after the event when checking mysql's response. It's barren too but then I had stopped weewx by then.

Having another completely seperate machine (freezerpi) available, I installed raw.py on that adjusted weewx and raw.py accordingly, created the database and started weewx. And this time raw was created, with no sign of archive at all. The only difference between installations was that Mesowx wasn't installed there. ie; weewx and raw.py were all that was present, No Mesowx installation. Would the Mesowx installation be creating the (my) confusion?

Having said all the above - ie; lots of negative, perhaps confusing information. I'd recommend the Mesowx installation to anyone wanting a Real Time data display.
Not having a website to point to, I'll attach a screen dump of it for those (did anyone besides Luc get this far? Perhaps not even Luc! ;-) who may be intrigued about what I / we're talking about, with more original info at https://bitbucket.org/lirpa/mesowx
Mesowx-MessmateFarm.png

Luc Heijst

unread,
Mar 24, 2016, 10:43:55 AM3/24/16
to weewx-user
Hi Glenn,

Thanks very much for your execellent feedback!

I'm planning to bring all pieces together of my mesowx modicications on github  in a weewx-mesowx-extra branch.
There you will find all added or changed files in respect to the original source at bitbucket.

I will take your comments in account when writing the new documentation.

raw table name
============
I can remember I didn't want to have the LOCAL raw table in the LOCAL weewx database because all table names started with 'archive' and the 'raw' table came at the bottom (and sometimes not even was shown). 
The intention was to create a database 'meso' with a table 'raw' in it. 

I will have a look at the data_limit = 0 setting. This should work as described: no deleting of raw data. Not a big deal I think, because soon one will regret setting this to 'unlimited'. 

Luc
Message has been deleted

René Schulze

unread,
Mar 25, 2016, 8:34:17 AM3/25/16
to weewx-user
Hi Luc

The pluging works perfect with one exception. My Pi uploads the data to a MySQL Server on my webserver in a data center. If i lose my internet connection during an archive upload weewx shut down the engines an sleeps for 2 minutes. After the 2 minutes weewx wake up and restarts the engines, if the connection reestablished weewx runs normal, else weewx sleeps again for to minutes. If the plugin recognizes the disconnect (prune_rawdata) weex stops. I changed the line 133 to  self.prune_rawdata(self.dbm, ts, 10, 10) but it doesn't help. Thy syslog says raw: prune failed (MySQL Server is gone away) 10 in a row and then weewx stops. The problem maybe that raw not reconnect to the MySQL server and only trys to upload the data. Could you extend the plugin that weewx also go to sleep if prune failed. My provider has a 24h forced reconnect with ip change (my router does that at various time short to the 24h because i want the reconnect between 5 and 6 am). Sometimes i also have an unstable internet connection like yesterday for 20min between 7 and 6 pm. So it is a pure coincidence that at this time a archive update runs.
At current i have a workaround with monit. Monit monitors the weewx deamon and if the deamon not runs monit restarts them.

Greetings René

Luc Heijst

unread,
Mar 25, 2016, 9:48:20 AM3/25/16
to weewx-user
Hi René,

Thanks very much for your input. 

Attached version 0.4.2 with modified installation instructions. (Thanks to Glenn for his comments)

When the prune command fails no longer an exception is raised but instead an error is printed.
It is now possible to retain the raw data "forever"; set the value of data_limit to None (instead of 0)

Release notes raw_0.4.2-lh:
- No longer raise exception when prune fails
- To retain all raw data: set data_limit to None (data_limit = None) 

Luc
raw_0.4.2-lh.py
installation instructions raw_0.4.2-lh.txt

René Schulze

unread,
Mar 25, 2016, 10:18:39 AM3/25/16
to weewx-user
Hi Luc,

thank you for your very fast response. I've updated the raw.py on my installation. Now i wait for the next internet fail ;)

Greetings René

Luc Heijst

unread,
Mar 25, 2016, 10:22:53 AM3/25/16
to weewx-user
Hi René,

You have implemented an interesting solution for populating a remote database for use with MesoWX!

Instead of synchronizing the local weewx loop and archive data to a 'shadow' database on the web server (with use of module sync.py),
you use module raw.py to populate a 'local' MySQL meso database and configured the MySQL section in weewx.conf to use a remote MySQL database.

Clever!

    # Defaults for MySQL databases
    [[MySQL]]
        driver = weedb.mysql
        # The host where the database is located
        host = [the name (or ip-address) of your web server]
        # The user name for logging in to the host
        user = weewx
        # The password for the user name
        password = [your_password]

Luc

On Friday, 25 March 2016 09:34:17 UTC-3, René Schulze wrote:

René Schulze

unread,
Mar 25, 2016, 10:55:53 AM3/25/16
to weewx-user
Hi Luc,

yes, I do this since i've installed weewx, cause i'll create my website in the future directly on the server using the data from the MySQL db weewx and meso.
I'm on holidays until next monday, so i can some more fiddle around my server. Currently i look for a solution to use weewx for uploading the alamanac data from pyephem to a database or how i can use pyephem directly on the webserver with php. But my python is very basic, my php and html is quite a bit better. 

But one thing you must think of cause its a dangerously security risk. To upload the data directly to an online MySQL server you must bind them on your servers ip adress or 0.0.0.0 that he can listen to connects from outside localhost. It's recommended the you use a very strong password for all your MySQL users. Further its needful to use fail2ban on the server for monitoring the auth.log to preventing of brute force attacks. For data security i also use a dropbox app who makes a sqldump of the weewx db and uploads it to my dropbox. So I have a daily copy of the db on dropbox and my home pc and somedays also on my laptop if i use it.

Greetings René

Björn Baldus

unread,
Sep 20, 2016, 7:21:25 AM9/20/16
to weewx-user
Hi,

we are searching for a plugin which can send the realtime data from our davis via weewx to a webserver in a data center. we tried an older version of mesowx - but i didnt work (weewx crashed).
How do we setup the new raw-plugin to send data to the webserver. The Raspberry Pi is connected via 3G to the internet - the v-server is hosted by a big sharehoster. We only want to send the realtime loop packets to the server - and run an instance of mesowx there.
The data upload to wunderground and awekas runs fine.

Any suggestions?

Luc Heijst

unread,
Sep 20, 2016, 12:11:17 PM9/20/16
to weewx-user
Hi,

Use my updated sync plugin (see thread: https://groups.google.com/forum/?nomobile=true#!msg/weewx-user/DnaWsMpC9vE/kbVPHiaWAQAJ) and configure only the raw section.

Luc

laki1

unread,
Jan 5, 2017, 3:17:34 AM1/5/17
to weewx-user
Hi Guys,

I want to report successful implementation on weewx 2.6.2 (nginx on rpi0 with 2 bme280).
Used raw_0.4.1-lh.py from Luc and highlights from Glenn - that was useful.
My station is 'smaller' - only pressure,temperature,humidity are now reported (light is also planned) , but after editing scripts it looks very good.

Meet two not obvious problems that someone can meet:
- In my particular case any comments from config.json needed to be removed.
- Some time spent - like Glenn said - on parameters configuration. My case was simpler because this is all about removing :-)
- Stuck on visualization problem with different tooltip on real time and 24h and Archive view. Wanted to have marker symbol in legend like this

It was some tuning but successful - i can provide additional information if someone wish to have it.

Cheers

Auto Generated Inline Image 1

Glenn McKechnie

unread,
Jan 11, 2017, 6:29:15 PM1/11/17
to weewx...@googlegroups.com
Another success, it's always good to hear of them, at the very least it means that Mesowx isn't quite dead yet. :-)

What was the magic required to change the markers in the pop-up? Any pointers to their location or a brief HowTo on the tuning required would certainly be appreciated from this end.

That reminds me of another entry on the wishlist.  I'd love to get the Hi/Lo flags to match their line colours. It's not a really big deal but when the graphs get a bit tight it would help to quickly zero in on the right one if they were colour matched.
Message has been deleted
Message has been deleted
Message has been deleted

laki1

unread,
Jan 12, 2017, 4:22:47 AM1/12/17
to weewx-user
I believe this it will be dead soon if no updated version will appear.
There are plenty of people that wants click-and-go like in android :-). So adding and reconfiguring mysql and additionally debugging js scripts can be deterrent (plus to find updated script for new weewx :-))
I have already weewx as other people here but was looking for almost-real-time data and found mesowx. To be honest failed at first time and leaved it for about 3 days (that was problems with comments in json file).
I'm a database programmer so for first look it looks complicated with practically 4 languages php, py, js. but in fact - it is created with large acknowledge.

Anyway You asked about shapes in legend, this should be modified in {AbstractHigstockChart.js}  default configuration real-time tooltip is displayed as unmodified higcharts tooltip but others because of ranfe of date presentation are displayed from tooltip formatted. So legend is slightly different from real-time.
So there are two tasks:
1. Set legend same for all tabs.
2. Add shapes to default formater


...Wanted to add pretty code but it was cuted off so attached dif file and new file :-)
AbstractHigstockChart.js.diff
AbstractHighstockChart.js

karlch...@googlemail.com

unread,
Sep 22, 2020, 5:30:37 AM9/22/20
to weewx-user
i know mesowx is quite dead... but we use the python script to update our archive on the server. After a crash of our Raspberry pi we are unable to get the sync_lh9 working again... Weewx starts quite normal till an unrecoverable exception. Maybe someone can help us.

Problems with mesowx (also in use till today for our archive)

Sep 21 23:42:58 WSKOSt01 systemd[1]: Starting LSB: weewx weather system...
Sep 21 23:42:59 WSKOSt01 weewx[2735] INFO __main__: Initializing weewx version 4.1.1
Sep 21 23:42:59 WSKOSt01 weewx[2735] INFO __main__: Using Python 3.7.3 (default, Jul 25 2020, 13:03:44) #012[GCC 8.3.0]
Sep 21 23:42:59 WSKOSt01 weewx[2735] INFO __main__: Platform Linux-5.4.51-v7+-armv7l-with-debian-10.4
Sep 21 23:42:59 WSKOSt01 weewx[2735] INFO __main__: Locale is 'de_DE.UTF-8'
Sep 21 23:42:59 WSKOSt01 weewx[2735] INFO __main__: PID file is /var/run/weewx.pid
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO __main__: Using configuration file /etc/weewx/weewx.conf
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO __main__: Debug is 1
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG __main__: Initializing engine
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)
Sep 21 23:42:59 WSKOSt01 weewx[2723]: Starting weewx weather system: weewx.
Sep 21 23:42:59 WSKOSt01 systemd[1]: Started LSB: weewx weather system.
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.drivers.vantage: Driver version is 3.2.1
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.drivers.vantage: Opened up serial port /dev/ttyUSB0; baud 19200; timeout 4.00
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.drivers.vantage: Gentle wake up of console successful
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.drivers.vantage: Hardware type is 16
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.drivers.vantage: ISS ID is 2
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.drivers.vantage: Hardware name: Vantage Pro2
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.engine.StdTimeSynch
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.engine.StdTimeSynch
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.engine.StdConvert
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.engine: StdConvert target unit is 0x10
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.engine.StdConvert
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.engine.StdCalibrate
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.engine.StdCalibrate
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.engine.StdQC
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.engine.StdQC
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.wxservices.StdWXCalculate
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.manager: Daily summary version is 1.0
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.wxservices: The following values will be calculated: pressure=prefer_hardware, altimeter=prefer_hardware, appTemp=prefer_hardware, barometer=prefer_hardware, beaufort=prefer_hardware, cloudbase=prefer_hardware, dewpoint=prefer_hardware, ET=prefer_hardware, heatindex=prefer_hardware, humidex=prefer_hardware, inDewpoint=prefer_hardware$
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.wxservices: The following algorithms will be used for calculations: altimeter=aaASOS, maxSolarRad=RS
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.wxservices.StdWXCalculate
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.engine.StdArchive
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.engine: Archive will use data binding wx_binding
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.engine: Record generation will be attempted in 'hardware'
Sep 21 23:42:59 WSKOSt01 weewx[2739] ERROR weewx.engine: The archive interval in the configuration file (300) does not match the station hardware interval (60).
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.engine: Using archive interval of 60 seconds (specified by hardware)
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Use LOOP data in hi/low calculations: 1
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.engine.StdArchive
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.restx.StdStationRegistry
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.restx: StationRegistry: Station will be registered.
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.restx.StdStationRegistry
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.restx.StdWunderground
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.restx: WU essentials: {}
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.restx: Wunderground-RF: Data for station IWINNING12 will be posted
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.restx.StdWunderground
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.restx.StdPWSweather
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.restx: PWSweather: Posting not enabled.
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.restx.StdPWSweather
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.restx.StdCWOP
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.restx: CWOP: Posting not enabled.
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.restx.StdCWOP
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.restx.StdWOW
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.restx: WOW: Posting not enabled.
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.restx.StdWOW
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service weewx.restx.StdAWEKAS
Sep 21 23:42:59 WSKOSt01 weewx[2739] INFO weewx.restx: AWEKAS: Data will be uploaded for user wsko001
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Finished loading service weewx.restx.StdAWEKAS
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.engine: Loading service user.sync_lh9.SyncService
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.manager: Daily summary version is 1.0
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.manager: Daily summary version is 1.0
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.restx: Shut down AWEKAS thread.
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.restx: Shut down Wunderground-RF thread.
Sep 21 23:42:59 WSKOSt01 weewx[2739] DEBUG weewx.restx: Shut down StationRegistry thread.
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__: Caught unrecoverable exception:
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****  invalid syntax (sync_lh9.py, line 109)
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****  Traceback (most recent call last):
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****    File "/usr/share/weewx/weewxd", line 148, in main
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 75, in __init__
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****      self.loadServices(config_dict)
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 138, in loadServices
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****      obj = weeutil.weeutil.get_object(svc)(self,config_dict)
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****    File "/usr/share/weewx/weeutil/weeutil.py", line 1093, in get_object
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****      mod = __import__(module)
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****    File "/usr/share/weewx/user/sync_lh9.py", line 109
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****      if self.entity_id <> "":
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****                         ^
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****  SyntaxError: invalid syntax
Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:     ****  Exiting.

Tom Keffer

unread,
Sep 22, 2020, 7:09:21 AM9/22/20
to weewx-user
This is a Python 3 problem. The syntax '<>' is no longer accepted by the Python 3 interpreter as an inequality operator. You'll have to either run under Python 2, or port the sync_lh9 module to Python 3.

-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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/fb3d49e2-fa15-46ae-8605-b520db0b267bn%40googlegroups.com.

Glenn McKechnie

unread,
Sep 22, 2020, 7:58:04 AM9/22/20
to weewx...@googlegroups.com
On 22/09/2020, 'karlch...@googlemail.com' via weewx-user
<weewx...@googlegroups.com> wrote:
> i know mesowx is quite dead... but we use the python script to update our
> archive on the server. After a crash of our Raspberry pi we are unable to
> get the sync_lh9 working again... Weewx starts quite normal till an
> unrecoverable exception. Maybe someone can help us.

Mesowx is still alive, although not at lirpa.

The update at github is current...

https://github.com/glennmckechnie/weewx-mesowx

You'll find a weewx4, python3.x version there that is installable via
wee-extension, but differs in installation method and appearance to
what you no doubt have there.

You can go three ways with the problem you are having:-

1) Install the above maintained and updated package.
The downside to that is that it won't have the look and feel of your
current version, and any tweaks you've introduced to it..
Obviously you'll keep your old configuration as a reference,
especially if you have tweaked anything.

Degree of difficulty: That should install seamlessly but it's meant
for a fresh install. Retrofitting with your existing setup may make it
more complicated than it should be.

2) Update your sync_lh9 to run with python3.7 (as @tk has already noted)

Degree of difficulty: Should be a fairly straight forward conversion.
If you're familiar with python then very easy!

The file mesowx.py in the above weewx-mesowx repo at github contains
the code of sync_lh9 (or one of lucs versions) as well as raw.py and
retain.py

Line 477 equates to your line 109.
Start there, compare the code and adjust accordingly.

As I recall, there may have been a change to a weewx import as well.

Ah! Compare mesowx.py Line 749 to your line 381??? (or thereabouts)
for that change in the call to weewx.

3) Manually install the mesowx.py script. Add a corresponding
weewx.conf section with adjusted entries [Mesowx] [[RemoteSync]] to
suit your setup (examples in the README).

Degree of difficulty: Probably a bit convoluted, but it is another approach.


> Problems with mesowx (also in use till today for our archive)
[...]
> __import__(module)
> Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__: **** File
> "/usr/share/weewx/user/sync_lh9.py", line 109
> Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__: **** if
> self.entity_id <> "":
> Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__: ****
>
> ^


--


Cheers
Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie
Reply all
Reply to author
Forward
0 new messages