Upgraded sync plugin for MesoWx v0.4.0

839 views
Skip to first unread message

Luc Heijst

unread,
Nov 3, 2015, 5:19:54 AM11/3/15
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 sync.py myself.
Attached weewx plugin sync_lh3.py which is tested with weewx v3.2.1
See the results on my website: http://www.lucdesign.nl/web/index.html

Installation instructions: 
- Stop weewx
- Install MesoWx v0.4.0 according to the installation instruction given with the package
- Download sync_lh4.py, rename it to sync.py and move it to the bin/user directory overwriting the original sync.py.
- Start weewx

Release notes sync_lh4:
- upgraded weewx database calls
- works now with local sqlite or mysql databases; on the web server you still need a mysql database
- fix for not resending records with 'Duplicate key' errors

Comments are welcome

Luc
sync_lh4.py
Message has been deleted

Hugo Valentim

unread,
Nov 5, 2015, 6:15:33 PM11/5/15
to weewx-user
Thanks a lot. Just what I needed. Working like a charm.

Eirik Skorstad

unread,
Nov 10, 2015, 10:03:34 AM11/10/15
to weewx-user

I'm running my webserver behind a proxy. From time to time i get a strange timeout on this and the sync service stops. Seems like sync service is very sensitive to this error.

Any ideas here  how this can be avoided? 

Nov  9 06:47:02 weewx[32067]: sync: http request failed (400 Bad Request): <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">#012<html><head>#012<title>400 Bad Request</title>#012</head><body>#012<h1>Bad Request</h1>#012<p>Your browser sent a request that this server could not understand.<br />#012</p>#012<hr>#012<address>Apache/2.2.22 (Debian) Server at my.domain.com Port 80</address>#012</body></html>
Nov  9 06:47:02 weewx[32067]: sync: fatal syncronization error
Nov  9 06:47:02 weewx[32067]:    ****  Reason: sync: Request to http://my.domain.com/updateData.php failed, server returned 400 status with reason 'Bad Request'. Check your entity configuration.



L.J.M. Heijst

unread,
Nov 10, 2015, 10:10:24 AM11/10/15
to Eirik Skorstad
Hi Erik,

I'm sorry, I have no idea.

I'm not the author of this software and I don't understand many ins and outs. 
I only replaced the calls to the weewx database by the new concept of weewx version 3 and moved these calls to the main thread to let it work with sqlite too.

Regards,
Luc





I'm running my webserver behind a proxy. From time to time i get a strange timeout on this and the sync service stops. Seems like sync service is very sensitive to this error. 

Any ideas here  how this can be avoided?  

Nov  906:47:02 weewx[32067]: sync: http request failed (400BadRequest):<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">#012<html><head>#012<title>400 Bad Request</title>#012</head><body>#012<h1>Bad Request</h1>#012<p>Your browser sent a request that this server could not understand.<br />#012</p>#012<hr>#012<address>Apache/2.2.22 (Debian) Server at my.domain.com Port 80</address>#012</body></html>
Nov  906:47:02 weewx[32067]: sync: fatal syncronization error
Nov  906:47:02 weewx[32067]:    ****  Reason: sync:Request to http://my.domain.com/updateData.php failed, server returned 400 status with reason 'Bad Request'. Check your entity configuration.



-- 
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/weewx-user/DnaWsMpC9vE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
weewx-user+...@googlegroups.com.
For more options, visit 
https://groups.google.com/d/optout.



Avast logo

Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
www.avast.com


Josep Montamat

unread,
Nov 11, 2015, 2:04:58 PM11/11/15
to weewx-user
How to configure and metric units?
Thank you.
JM.

Luc Heijst

unread,
Nov 11, 2015, 2:27:16 PM11/11/15
to weewx-user
Josep,

In weewx.conf I have set [StdConvert] to METRIC. Maybe this isn't necessary, but I like to inpect the values in my weewx database in metric units.
[StdConvert]
    target_unit = METRIC 

For the meso database you have a setup file called Config.js in location: http://your.website/web/js
Below an example of the metric settings in this file:

    Config.fieldDefaults = {
        'dateTime':             new meso.FieldDef('dateTime',             meso.Unit.ms,           0,      meso.Agg.avg),
        'outTemp':              new meso.FieldDef('outTemp',              mesowx.Unit.c,          1,      meso.Agg.avg,   'Out Temp'),
        'dewpoint':             new meso.FieldDef('dewpoint',             mesowx.Unit.c,          1,      meso.Agg.avg,   'Dewpoint'),
        'rain':                 new meso.FieldDef('rain',                 mesowx.Unit.mm,         1,      meso.Agg.sum,   'Rain'),
        'rainRate':             new meso.FieldDef('rainRate',             mesowx.Unit.mmHr,       1,      meso.Agg.max,   'Rain Rate'),
        'dayRain':              new meso.FieldDef('dayRain',              mesowx.Unit.mm,         1,      meso.Agg.max,   'Rain Today'),
        'windSpeed':            new meso.FieldDef('windSpeed',            mesowx.Unit.kph,        1,      meso.Agg.avg,   'Wind Speed'),
        'windDir':              new meso.FieldDef('windDir',              mesowx.Unit.deg,        0,      meso.Agg.avg,   'Wind Direction'),
        'windGust':             new meso.FieldDef('windGust',             mesowx.Unit.kph,        1,      meso.Agg.avg,   'Wind Gust'),
        'outHumidity':          new meso.FieldDef('outHumidity',          mesowx.Unit.perc,       1,      meso.Agg.avg,   'Out Humidity'),
        'barometer':            new meso.FieldDef('barometer',            mesowx.Unit.hPa,        1,      meso.Agg.avg,   'Barometric Pressure'),
        'heatindex':            new meso.FieldDef('heatindex',            mesowx.Unit.c,          1,      meso.Agg.avg,   'Heat Index'),
        'inTemp':               new meso.FieldDef('inTemp',               mesowx.Unit.c,          1,      meso.Agg.avg,   'In Temp'),
        'inHumidity':           new meso.FieldDef('inHumidity',           mesowx.Unit.perc,       1,      meso.Agg.avg,   'In Humidity'),
        'rxCheckPercent':       new meso.FieldDef('rxCheckPercent',       mesowx.Unit.perc,       0,      meso.Agg.avg,   'Rx Check'),
        'windBatteryStatus':    new meso.FieldDef('windBatteryStatus',    mesowx.Unit.perc,       0,      meso.Agg.avg,   'Wind BatteryStatus'),
        'rainBatteryStatus':    new meso.FieldDef('rainBatteryStatus',    mesowx.Unit.perc,       0,      meso.Agg.avg,   'Rain BatteryStatus'),
        'outTempBatteryStatus': new meso.FieldDef('outTempBatteryStatus', mesowx.Unit.perc,       0,      meso.Agg.avg,   'outTemp BatteryStatus'),
        'inTempBatteryStatus':  new meso.FieldDef('inTempBatteryStatus',  mesowx.Unit.perc,       0,      meso.Agg.avg,   'inTemp BatteryStatus')
    };
    
Luc

Josep Montamat

unread,
Nov 11, 2015, 2:35:12 PM11/11/15
to weewx...@googlegroups.com
Ok thanks good job
JM.

Luc Heijst

unread,
Nov 11, 2015, 4:17:07 PM11/11/15
to weewx-user
Josep,

I was wondering how mesoWX could do unit conversions. Somewhere there must be a definition of the weewx database fields.
The definition of the fields and units of the weewx database (which are to be send to the meso database) are in a setup file called config.json in location: http://your.website/web/meso/include

You have to specify both archive and loop data)

Archive data example:
            "columns" : {
                "dateTime" :    {"type" : "number", "unit" : "s"},
                "interval" :    {},
                "barometer" :   {"unit" : "hPa"},
                "inTemp" :      {"unit" : "c"},
                "outTemp" :     {"unit" : "c"},
                "inHumidity" :  {"unit" : "perc"},
                "outHumidity" : {"unit" : "perc"},
                "windSpeed" :   {"unit" : "kph"},
                "windDir" :     {"unit" : "deg"},
                "windGust" :    {"unit" : "mph"},
                "windGustDir" : {"unit" : "deg"},
                "rainRate" :    {"unit" : "cmHr"},
                "rain" :        {"unit" : "cm"},
                "dewpoint" :    {"unit" : "c"},
                "windchill" :   {"unit" : "c"},
                "heatindex" :   {"unit" : "c"},
                "extraTemp1" :   {"unit" : "c"},
                "extraTemp2" :   {"unit" : "c"},
                "rxCheckPercent" :       {"unit" : "perc"},
                "windBatteryStatus" :    {"unit" : ""},
                "rainBatteryStatus" :    {"unit" : ""},
                "outTempBatteryStatus" : {"unit" : ""},
                "inTempBatteryStatus" :  {"unit" : ""}
            },
            
Loop data example:
            "columns" : {
                "dateTime" :    {"type" : "number", "unit" : "s"},
                "barometer" :   {"unit" : "hPa"},
                "inTemp" :      {"unit" : "c"},
                "outTemp" :     {"unit" : "c"},
                "inHumidity" :  {"unit" : "perc"},
                "outHumidity" : {"unit" : "perc"},
                "windSpeed" :   {"unit" : "kph"},
                "windDir" :     {"unit" : "deg"},
                "windGust" :    {"unit" : "mph"},
                "windGustDir" : {"unit" : "deg"},
                "rainRate" :    {"unit" : "cmHr"},
                "rain" :        {"unit" : "cm"},
                "dewpoint" :    {"unit" : "c"},
                "windchill" :   {"unit" : "c"},
                "heatindex" :   {"unit" : "c"},
                "extraTemp1" :   {"unit" : "c"},
                "extraTemp2" :   {"unit" : "c"}
            },
            
Luc

Josep Montamat

unread,
Nov 12, 2015, 3:51:49 AM11/12/15
to weewx-user
Thanks Luc is a good representation of diagrams, work on it.

JM.

Andrew Milner

unread,
Dec 26, 2015, 1:04:19 AM12/26/15
to weewx-user
Luc
Is there any chance of you trying to create an updated version of raw.py along the same lines as the sync.py you created??  I am assuming that sync.py combines the functionality of both creating/maintaining the raw loop table in addition to doing the synching.  I am getting db errors from raw.py and I assume it is because it is rigged for the old db methods.

Andrew

Luc Heijst

unread,
Dec 26, 2015, 10:29:34 AM12/26/15
to weewx-user
Andrew,

I will give it a try, but I can't promise I will manage to get it working. The database calls in sync.py are not the same as in raw.py. The calls in raw.py use directly weedb.create, weedb.connect and weedb.Transaction. I will look at wxmanager.py as an example how to deal with it.

Luc 

Andrew Milner

unread,
Dec 26, 2015, 1:53:50 PM12/26/15
to weewx-user
Thanks Luc.  I assumed it was very similar to sync.py, since I saw that your site also has the meso graphs - which come from the raw table - so assumed that sync.py contained all the required elemenets of raw creation PLUS the sync stuff.

Andrew

Luc Heijst

unread,
Dec 26, 2015, 2:09:46 PM12/26/15
to weewx-user
Andrew,

Module sync.py contains indeed the raw data, but the logic to store the raw data in the remote mysql raw database resides on the web server (and is no part of weewx).
The raw.py module uses weewx calls to store the data in a local mysql raw database.

Luc

Josep Montamat

unread,
Dec 27, 2015, 1:32:21 PM12/27/15
to weewx...@googlegroups.com
Thanks Luc, after applying the definition of metric units in Config.js works perfectly in weewx 3.2 + Ubuntu Server 14.04.

JM.

On Wed, Nov 11, 2015 at 8:27 PM, Luc Heijst <ljm.h...@gmail.com> wrote:

Josep Montamat

unread,
Jan 4, 2016, 5:53:04 AM1/4/16
to weewx-user
I would like to add to mesowx appTemp, I have appTemp already included in weewx file, but do not understand how mesowx includes raw column in mysql?
Thank you.

L.J.M. Heijst

unread,
Jan 4, 2016, 11:42:52 AM1/4/16
to weewx...@googlegroups.com
Hi Josep,
Only loop data will be sent as raw data to the web server by sync.py. Not sure if your appTemp comes with the loop data. I use weewxWD for calculating appTemp and use a second syncWD.py for syncronizing the raw weewxWD data.
Luc

Verstuurd vanaf mijn iPad
--

Josep Montamat

unread,
Jan 5, 2016, 4:22:46 AM1/5/16
to weewx-user
Thanks Luc.
If i included in my cloudbase and appTemp weewx.archive to generate graphics with weewx, i would like to do with mesowx, I will continue investigating raw.py.

JM.

Luc Heijst

unread,
Jan 5, 2016, 7:49:43 AM1/5/16
to weewx-user
Sorry Josep,

It is still not clear for me what you already have and what you want to achieve.

mesowx can work with a remote database and with a shared database.
For a remote database you will need my modified sync_lh4.py module to send both archive and raw data to the remote server.

For a shared database the weewx database is used for the archive data and a local raw database with loop data is filled with help of module raw.py.
I have written a modified raw.py module that works with weewx v3.3.1 (it is still in test by Andrew).

The definitions of raw and archive data for mesowx is done in two places:
../web/js/config.js
../web/meso/include/config.json
In both directories you will find example files which helps you to get the idea.

To get data in the raw table, it has to be part of weewxs loop data. The loop data depends on the used weather station (and weewx driver). 
I'm not sure how you included the appTemp data in weewx. Just adding an extra field in the weewx schema won't work.
So my question is: how did you include appTemp in weewx? Can you see actual values in the weewx database?
What meso database do you want to use: remote or shared?

(May be you should write in your native language and let Google translate do the conversion to English)

Luc

Josep Montamat

unread,
Jan 5, 2016, 1:09:20 PM1/5/16
to weewx...@googlegroups.com
Luc, these are my answers (my English is very bad).

Use the example "electricity" Add a new type to the archive database: http://www.weewx.com/docs/customizing.htm#Adding_a_new_observation_type I have not looked at the data in my database but are correctly.

My database is shared.

Anyway now it is where you can work to include appTemp: (../web/js/config.js
../web/meso/include/config.json).

Thank you.

JM.
customschema.py
daytempchill-Bootstrap.png

Luc Heijst

unread,
Jan 5, 2016, 2:37:28 PM1/5/16
to weewx-user
Josep,

I wonder, vous pouvez parler français? Well, I don't speak French, I'm afraid, but I used site https://translate.google.com to translate my Dutch question (spreek je misschien frans?) into French.

I still don't know how your appTemp data is created. On my place appTemp is allways higher than the outTemp; in your place it is lower. Don't understand why.
Suppose your appTemp is part of the loop data (which I don't know yet), then you can copy the data to the local raw database with my modified raw.py module for weewx v3.3.1 (see attached file raw_0.4.1-lh.py).

I'm sorry if I can't be any more help for you.

Luc
raw_0.4.1-lh.py

Pat

unread,
Jan 5, 2016, 9:53:02 PM1/5/16
to weewx-user
Just wanted to say thanks! Been looking for an updated sync file!

Josep Montamat

unread,
Jan 6, 2016, 1:51:04 PM1/6/16
to weewx...@googlegroups.com
After include appTemp in  ../web/js/config.js  ../web/meso/include/config.json, appTemp  appears in weewx.raw.
My station is WMRS200 and weewx 3.21 and windchill  and appTemp are generated by software, this may be my problem?
Thank you.
JM.
raw.txt

Luc Heijst

unread,
Jan 6, 2016, 2:14:57 PM1/6/16
to weewx-user
Hi Josep,

Maybe because windchill and appTemp are generated in software they are not part of the so called 'loop' data. That would explain the NULL values in the raw table. 
However, you can use the appTemp and windchill data which is stored in archive in mesowx.
My advice: forget about appTemp and windchill as raw data and use them from the archive. Both values don't change generally that fast anyway. 

Luc

Josep Montamat

unread,
Jan 6, 2016, 2:22:58 PM1/6/16
to weewx...@googlegroups.com
If I have done so and it works well.

I made a good training in mesowx

Thanks for your interest.

JM.

Luc Heijst

unread,
Jan 20, 2016, 12:02:46 PM1/20/16
to weewx-user
To all,

Today I managed to get mesoWX (Highcharts) working on a local weewx system with the use of the weewx/archive (mySQL) database and a new meso/raw mySQL database which is populated by my for weewx v3 updated raw.py module. 
I will test it a few days and then publish the files with instructions on this forum.

Luc
mesoWX for weewx v3.jpg

Jean Labous

unread,
Jan 23, 2016, 11:16:09 AM1/23/16
to weewx-user


Hello everyone
For starters, some presentations:
I am an old beginner, who speaks only French and therefore appeals to Google for translation.
I started to Linux recently and very "light", Python: I know nothing.
 
I installed Weewx (3.3.1-1) on a mini-computer (Kubi .msi) that runs on Debian. it, it works.
I tried to install raw.py and sync.py: failure.
I use a "Vantage pro" station.

 
Weewx load the database, MYSQL, in my mini-computer, but I want to transfer it to my host (so I used a " remote database"?)
I wish I could see on my site, real-time data.

Luc says:
"Andrew,

Indeed sync.py Module contains the raw data, the purpose logic to store the raw data in the remote mysql raw database Resides on the web server (and is no share of weewx).
The unit uses weewx raw.py calls to store the data in a local mysql database raw. "

And later he said:
"Sorry Josep,

...
For a remote database you will need my modified sync_lh4.py module to send both archive and raw data to the remote server."



My two questions:
Should I install  sync.py only, so the version of Luc, or his version of sync.py and the old version of raw.py?

In all cases in which directory should we place them ???
On the site of Mesowx include: "WEEWX_HOME $ / bin / user /"
Luc says: "/ bin / user /"
 I did not understand, I have not found. !!!
Is the directory containing the file weewx.conf ? (with me it would be: / etc / weewx)

Thank you for your help and congratulations on what you are doing.
Jeans

Luc Heijst

unread,
Jan 23, 2016, 4:57:31 PM1/23/16
to weewx-user
Bonjour Jeans,

Welcome to the weewx forum!

For synchronizing both archive and raw (loop) data you only need my modified sync_lh4.py module.
Rename it to sync.py and put it in the WEEWX_HOME $ / bin / user / directory (overwriting the original sync.py module).
You don't need the raw module for remote databases.

Luc

L.J.M. Heijst

unread,
Jan 23, 2016, 5:57:33 PM1/23/16
to weewx...@googlegroups.com
Jeans,
For your situation it is directory /usr/share/weewx/user where sync.py should go.
Luc

Verstuurd vanaf mijn iPad
--

j.la...@free.fr

unread,
Jan 23, 2016, 7:38:49 PM1/23/16
to weewx-user

Bonjour Luc
Thank you for your support but sorry for here is the result:
 

[ ok ] Starting weewx (via systemctl): weewx.service.
root@jeanlinux:/# tail -f /var/log/syslog
Jan 24 01:15:45 jeanlinux weewx[13037]:     ****    File "/usr/share/weewx/weewx/engine.py", line 75, in __init__
Jan 24 01:15:45 jeanlinux weewx[13037]:     ****      self.loadServices(config_dict)
Jan 24 01:15:45 jeanlinux weewx[13037]:     ****    File "/usr/share/weewx/weewx/engine.py", line 136, in loadServices
Jan 24 01:15:45 jeanlinux weewx[13037]:     ****      self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
Jan 24 01:15:45 jeanlinux weewx[13037]:     ****    File "/usr/share/weewx/weeutil/weeutil.py", line 973, in _get_object
Jan 24 01:15:45 jeanlinux weewx[13037]:     ****      mod = __import__(module)
Jan 24 01:15:45 jeanlinux weewx[13037]:     ****    File "/usr/share/weewx/user/sync.py", line 6, in <module>
Jan 24 01:15:45 jeanlinux weewx[13037]:     ****      import urllib3
Jan 24 01:15:45 jeanlinux weewx[13037]:     ****  ImportError: No module named urllib3
Jan 24 01:15:45 jeanlinux weewx[13037]:     ****  Exiting.

What to do?

Good day and thank you

Jean

L.J.M. Heijst

unread,
Jan 23, 2016, 7:59:41 PM1/23/16
to weewx...@googlegroups.com
Hi Jean,
I do not know if this is the right answer (Matthew?) but I would try:
apt-get install urllib3
Luc

Verstuurd vanaf mijn iPad

j.la...@free.fr

unread,
Jan 23, 2016, 8:34:23 PM1/23/16
to weewx-user
Luc :
First :

root@jeanlinux:/# apt-get install urllib3
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances      
Lecture des informations d'état... Fait
E: Impossible de trouver le paquet urllib3

In English

jeanlinux root @: / # apt-get install urllib3
Reading package lists ... Done
Shaft Construction dependencies
Reading state information ... Done
E: Could not find package urllib3

After that  i make  :
apt-cache search urllib3

 the answer was:

python-pysocks - socket-like interface for tunneling through SOCKS - Python 2.x
python3-pysocks - socket-like interface for tunneling through SOCKS - Python 3.x
python-urllib3 - HTTP library with thread-safe connection pooling for Python
python-urllib3-whl - HTTP library with thread-safe connection pooling
python3-urllib3 - HTTP library with thread-safe connection pooling for Python3
python-requests - elegant and simple HTTP library for Python2, built for human beings
python-requests-whl - elegant and simple HTTP library for Python, built for human beings
python3-requests - elegant and simple HTTP library for Python3, built for human beings
python-awsauth - AWS authentication for Amazon S3 for the python-requests module
python3-awsauth - AWS authentication for Amazon S3 for the python3-requests module

 Know you tell me how to continue?
And thank you later, here it is night long
Jean

L.J.M. Heijst

unread,
Jan 23, 2016, 8:48:28 PM1/23/16
to weewx...@googlegroups.com
Jean,
Again, I'm not sure. I would go for python-urllib3. No idea how to install it. Sorry.
Luc

Verstuurd vanaf mijn iPad

Thomas Keffer

unread,
Jan 24, 2016, 7:46:52 AM1/24/16
to weewx-user
Perhaps by using pip?

sudo pip install urllib3

-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.
Message has been deleted

j.la...@free.fr

unread,
Jan 25, 2016, 5:04:55 AM1/25/16
to weewx-user

Thank you both

For
urllib3, that's OK, Luke was right, I installed urllib3 and this problem is solved.
Sorry for Tom but I arrived too late. I did the following:

apt-cache search urllib3
then
apt-get install ..........

But here's the result of my problems after installing the sync.py of Luc ("merci à lui") and restart Weewx:

  • The log

[ ok ] Starting weewx (via systemctl): weewx.service.
root@jeanlinux:/etc/weewx# tail -f /var/log/syslog
Jan 25 02:15:16 jeanlinux weewx[16890]:     ****    File "/usr/share/weewx/user/sync.py", line 176, in back_fill
Jan 25 02:15:16 jeanlinux weewx[16890]:     ****      last_datetime_synced = self.fetch_latest_remote_datetime()
Jan 25 02:15:16 jeanlinux weewx[16890]:     ****    File "/usr/share/weewx/user/sync.py", line 228, in fetch_latest_remote_datetime
Jan 25 02:15:16 jeanlinux weewx[16890]:     ****      http_response = self.make_http_request(self.latest_url, postdata)
Jan 25 02:15:16 jeanlinux weewx[16890]:     ****    File "/usr/share/weewx/user/sync.py", line 281, in make_http_request
Jan 25 02:15:16 jeanlinux weewx[16890]:     ****      raise SyncError, "sync archive: Failed to invoke %s after %d tries" % (url, self.http_max_tries)
Jan 25 02:15:16 jeanlinux weewx[16890]:     ****  SyncError: sync archive: Failed to invoke http://meteo-landeda.org/web/meso/data.php after 3 tries
Jan 25 02:15:16 jeanlinux weewx[16890]:     ****  Exiting.

  • And data.php in my browser:
Fatal error: Uncaught exception 'Exception' with message 'Must specify a entity_id' in /home/meteolan/public_html/web/meso/include/AggregateParameterParser.class.php:42 Stack trace: #0 /home/meteolan/public_html/web/meso/include/AggregateParameterParser.class.php(23): AggregateParameterParser->parseEntityId() #1 /home/meteolan/public_html/web/meso/data.php(52): AggregateParameterParser->parse() #2 {main} thrown in /home/meteolan/public_html/web/meso/include/AggregateParameterParser.class.php on line 42

thank you for your patience
J
ean

Luc Heijst

unread,
Jan 25, 2016, 7:28:09 AM1/25/16
to weewx-user
Hallo Jean,

Check all remote database settings in configuration file [your-webserver]/web/meso/include/config.json

Luc

j.la...@free.fr

unread,
Jan 25, 2016, 7:20:47 PM1/25/16
to weewx-user

Luc Good evening
I tried to do what you suggest, but I found nothing!
I remember my low skill level
If anyone has time to look at my file config.json , thank you to him

Jean
config.json

L.J.M. Heijst

unread,
Jan 25, 2016, 9:38:01 PM1/25/16
to weewx...@googlegroups.com
Jean,

The file config.json looks fine if you indeed created on your web server a database with name weewx and a database user with name weewx and password weewx.

The MesoWX setup instructions told you to create on the webserver a MySql database with name mesowx and a database user with name mesowx. If you did so, you will have to change in file config.json the name of the database from weewx to mesowx and the name of the user from weewx to mesowx. Also change the password of user mesowx from weewx to the password of user mesowx.

Note, on my webserver I was not free in choosing (the first part of) my database name. If so in your case, replace the database name with the one  you used.

Luc

Verstuurd vanaf mijn iPad
<config.json>

j.la...@free.fr

unread,
Jan 26, 2016, 12:32:23 PM1/26/16
to weewx-user
Luc
The
great thank you
I had already created the bdd house and what was with .... but there was no talk of this bdd anywhere else, so I do not understand what might
feeds it
I followed your instructions and now, miraculously !!! the mesowx bdd contains two tables: raw and archive, "raw" is updated every two seconds, and "archive" every 5 minutes
so I think this side is OK
But of course there was a "but"
The "index.html" page (currently meso_index.html) contained only the "console-mesowx" empty I looked a little, I changed the ID on Config.js and currently it works almost perfectly, I modified the units but the values are not Ok, I'll watch tonight, I hope from here I will become a little more independent


A small disappointment; I thought the real-time data were discounted faster?I miss your address and make you deliver the champagne? "See" you soon
J
ean

j.la...@free.fr

unread,
Jan 26, 2016, 12:36:00 PM1/26/16
to weewx-user

Sorry :


Le mardi 26 janvier 2016 18:32:23 UTC+1, j.la...@free.fr a écrit :
Luc
The
great thank you
I had already created the bdd mesowx and what was with .... 

Luc Heijst

unread,
Jan 26, 2016, 12:52:04 PM1/26/16
to weewx-user
Good news Jean,

I'm glad your databases are filled now with data!

You'll have to check your dimensions, though:
53.2 degrees Celsius? I think your database has the temps stored in Fahrenheit.
Also a value of 30.062 for "pression atmosphérique" looks more a value in inches Hg to me than a value in hecto Pascal.

Luc

Luc Heijst

unread,
Jan 26, 2016, 4:16:31 PM1/26/16
to weewx-user
Jean,
Change Config.realTimePollingInterval from 60000 (= 60s) to 2500 ( = 2.5 s) in Config.js
Luc
PS I love Champagne, but more I like the red Bordeaux wines!

Luc Heijst

unread,
Jan 26, 2016, 5:21:22 PM1/26/16
to weewx-user
Jean,

I had to do a little test first...

When you have set "target_unit = US" in weewx.conf, the stored temps are in degrees Fahrenheit, pressures in inHG, rain in inches and speeds in mph.
Your remote archive and raw databases have also their values in these units.

When you want to display the meso data in metric units, you will have to configure this as follows:
File ../web/meso/include/config.json - units the same as in the weewx database (in your case: US)
            "columns" : {
                "dateTime" :    {"type" : "number", "unit" : "s"},
                "interval" :    {},
                "barometer" :   {"unit" : "inHg"},
                "inTemp" :      {"unit" : "f"},
                "outTemp" :     {"unit" : "f"},
                "inHumidity" :  {"unit" : "perc"},
                "outHumidity" : {"unit" : "perc"},
                "windSpeed" :   {"unit" : "mph"},
                "windDir" :     {"unit" : "deg"},
                "windGust" :    {"unit" : "mph"},
                "windGustDir" : {"unit" : "deg"},
                "rainRate" :    {"unit" : "inHr"},
                "rain" :        {"unit" : "in"},
                "dewpoint" :    {"unit" : "f"},
                "windchill" :   {"unit" : "f"},
                "heatindex" :   {"unit" : "f"}
...
            "columns" : {
                "dateTime" :    {"unit" : "s"},
                "barometer" :   {"unit" : "inHg"},
                "inTemp" :      {"unit" : "f"},
                "outTemp" :     {"unit" : "f"},
                "inHumidity" :  {"unit" : "perc"},
                "outHumidity" : {"unit" : "perc"},
                "windSpeed" :   {"unit" : "mph"},
                "windDir" :     {"unit" : "deg"},
                "rainRate" :    {"unit" : "inHr"},
                "dayRain" :     {"unit" : "in"},
                "dewpoint" :    {"unit" : "f"},
                "windchill" :   {"unit" : "f"},
                "heatindex" :   {"unit" : "f"}

File ../web/js/Config.js - units as desired on Highstock graphs (in your case: metric)
    Config.fieldDefaults = {
        'dateTime':         new meso.FieldDef('dateTime',       meso.Unit.ms,           0,      meso.Agg.avg),
        'outTemp':          new meso.FieldDef('outTemp',        mesowx.Unit.c,          1,      meso.Agg.avg,   'Out Temp'),
        'dewpoint':         new meso.FieldDef('dewpoint',       mesowx.Unit.c,          1,      meso.Agg.avg,   'Dewpoint'),
        'rain':             new meso.FieldDef('rain',           mesowx.Unit.in,         2,      meso.Agg.sum,   'Rain'),
        'rainRate':         new meso.FieldDef('rainRate',       mesowx.Unit.mmHr,       2,      meso.Agg.max,   'Rain Rate'),
        'dayRain':          new meso.FieldDef('dayRain',        mesowx.Unit.mm,         2,      meso.Agg.max,   'Rain Today'),
        'windSpeed':        new meso.FieldDef('windSpeed',      mesowx.Unit.kph,        0,      meso.Agg.avg,   'Wind Speed'),
        'windDir':          new meso.FieldDef('windDir',        mesowx.Unit.deg,        0,      meso.Agg.avg,   'Wind Direction'),
        'windGust':         new meso.FieldDef('windGust',       mesowx.Unit.kph,        0,      meso.Agg.avg,   'Wind Gust'),
        'windGustDir':      new meso.FieldDef('windGustDir',    mesowx.Unit.deg,        0,      meso.Agg.avg,   'Wind Gust Direction'),
        'outHumidity':      new meso.FieldDef('outHumidity',    mesowx.Unit.perc,       1,      meso.Agg.avg,   'Out Humidity'),
        'barometer':        new meso.FieldDef('barometer',      mesowx.Unit.hPa,        3,      meso.Agg.avg,   'Barometric Pressure'),
        'windchill':        new meso.FieldDef('windchill',      mesowx.Unit.c,          1,      meso.Agg.avg,   'Wind Chill'),
        'heatindex':        new meso.FieldDef('heatindex',      mesowx.Unit.c,          1,      meso.Agg.avg,   'Heat Index'),
        'inTemp':           new meso.FieldDef('inTemp',         mesowx.Unit.c,          1,      meso.Agg.avg,   'In Temp'),
        'inHumidity':       new meso.FieldDef('inHumidity',     mesowx.Unit.perc,       1,      meso.Agg.avg,   'In Humidity')

Luc

On Tuesday, 26 January 2016 14:32:23 UTC-3, j.la...@free.fr wrote:

Luc Heijst

unread,
Jan 26, 2016, 5:30:56 PM1/26/16
to weewx-user
Correction: This line should have unit "mm" and not "in" as was stated in the previous message.
        'rain':             new meso.FieldDef('rain',           mesowx.Unit.mm,         2,      meso.Agg.sum,   'Rain'),

jean

unread,
Jan 31, 2016, 7:32:41 AM1/31/16
to weewx...@googlegroups.com
Luc
Hello
I board not forgotten you, but I have a little "worked":
http://www.meteo-landeda.org

I am happy with the result, although there is still plenty to do.
You allowed me to re-start because I was stuck between Weewx and Mesowx.
I have and I still have questions to ask, but I will create new topics on the forum
Thank you again for your advice (all wise)
  Jean


Le 26/01/2016 23:30, Luc Heijst a écrit :
Correction: This line should have unit "mm" and not "in" as was stated in the previous message.
        'rain':             new meso.FieldDef('rain',           mesowx.Unit.mm,         2,      meso.Agg.sum,   'Rain'),

Luc Heijst

unread,
Jan 31, 2016, 8:42:34 AM1/31/16
to weewx-user
WOW, Jean!

I'm impressed! You gave me lots of new ideas to work on. Thanks!

Luc

Thomas Keffer

unread,
Jan 31, 2016, 8:55:59 AM1/31/16
to weewx-user
Very nice! 

You sure live in a windy place!

-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.
Reply all
Reply to author
Forward
0 new messages