Belchertown MQTT update time is chaotic

183 views
Skip to first unread message

Keimpe Bleeker

unread,
May 18, 2020, 1:44:51 PM5/18/20
to weewx-user
Another try to find a solution for a weird problem! 

Problem: MQTT updates are working perfect, but the text and time of the last update on the website is chaotic (see screenshot and website). All the other dates and times served by moments.js are 100% OK. Everything is built from scratch on a formatted SDcard, because the same problem occurred since I upgraded Weewx 3.9.# and Belchertown...

System info:
- Raspberrry Pi 4 Model B Rev 1.2, Debian 10.4, 32GB
- Weewx 4.0
- Belchertown 1.1

As far as I know, all the envolved skin.conf issues are:
...
...
    belchertown_locale = "auto"
belchertown_locale = "nl_NL.utf8"  #checked this setting, without results
    theme = light
...
...
     # MQTT Websockets defaults
     mqtt_websockets_enabled = 1
     mqtt_websockets_host = my.external.ip.address
     mqtt_websockets_port = 9001
     mqtt_websockets_ssl = 0
     mqtt_websockets_topic = weather/loop
     disconnect_live_website_visitor = 1800000
...
...
    # Show an alert if the page updated timestamp is older than expected with this setting. Does not apply to MQTT Websocket enabled websites
    # The late time threshold is defined in seconds. This should be greater than your archive_interval from weewx.conf.
    # Typically you would want this 2 or 3 times archive_interval
    show_last_updated_alert = 0
    last_updated_alert_threshold = 1800

    # If mqtt_websockets_enabled is set to 0, but want the page to full reload on an interval, specify this below in milliseconds. 300000 = 5 minutes
    webpage_autorefresh = 0
...
...
        header_last_updated                = Laatste update
        mqtt_websockets_connecting   = Real-time verbonden met weerstation
        mqtt_websockets_waiting         = Verbonden, wacht op data.
        mqtt_websockets_connected    = Real-time verbonden met weerstation
        mqtt_websockets_stopped        = Real-time updates zijn gestopt
        mqtt_websockets_continue       = Updates hervatten
        mqtt_websockets_failed            = Verbinding verbroken
        mqtt_websockets_lost               = Verbinding verbroken
...
...
        # moment.js default labels formats
        time_earthquake                                        = "LLL"
        time_lastUpdated                                       = "LL, LTS"
        time_snapshot_records_today_header      = "dddd, LL"
        time_snapshot_records_month_header     = "MMMM YYYY"
        time_sunrise                                               = "LT"
        time_sunset                                                = "LT"
        time_darksky_alert_expires                       = "LLL"
        time_darksky_forecast_date                      = "ddd DD/M"
        time_forecast_last_updated                       = "LLL"
        time_mqtt_websockets_last_updated        = "LL, LTS"
        time_records_page_full_date                     = "LLL"
        time_records_page_month_day_year        = "LL"
        time_records_page_rainfall_range_begin  = "MMMM DD"
        time_records_page_rainfall_range_end    = "LL"
...
...

The website is running in DEBUG-mode (http://oentsjerk.eu/?debug=true), if you like to spend a minute to investigate, you are very welcome!

Regards, Keimpe
Screenshot-WwxOkrk_18052020.jpg

Keimpe Bleeker

unread,
May 22, 2020, 1:39:39 PM5/22/20
to weewx-user
Reinstalled Belchertown, unfortunately no success :( 



Op maandag 18 mei 2020 19:44:51 UTC+2 schreef Keimpe Bleeker:

Jaap de Munck

unread,
May 23, 2020, 2:41:33 PM5/23/20
to weewx-user
Hallo Keimpe,

I use

belchertown_locale = nl_NL.UTF-8

and that is ok.

Regards,
Jaap



Op maandag 18 mei 2020 19:44:51 UTC+2 schreef Keimpe Bleeker:
Another try to find a solution for a weird problem! 

Keimpe Bleeker

unread,
May 24, 2020, 1:47:05 AM5/24/20
to weewx-user
Thanks Jaap, tried that allready without result. Searching now for the module or routine where text 'Laatste update' and time are compiled to the string which has to be presented in the webpage. Weird, because that should be standard and not influenced by config settings.

Jacques Terrettaz

unread,
May 24, 2020, 4:09:44 AM5/24/20
to weewx-user
HI,

Could you verify the line 281 of  your Belcherton skin.conf ?

By default the line is
time_last_updated                       = "LL, LTS"

What is yours ?

Jacques Terrettaz

unread,
May 24, 2020, 4:13:36 AM5/24/20
to weewx-user
I think I have found the problem :

In your first post I see :

    # moment.js default labels formats
        time_earthquake                                        = "LLL"
        time_lastUpdated                                       = "LL, LTS"
        time_snapshot_records_today_header      = "dddd, LL"
        time_snapshot_records_month_header     = "MMMM YYYY"
        ...

You should replace 
 time_lastUpdated by time_last_updated :

 # moment.js default labels formats
        time_earthquake                                        = "LLL"
        time_last_updated                                       = "LL, LTS"
        time_snapshot_records_today_header      = "dddd, LL"
        time_snapshot_records_month_header     = "MMMM YYYY"
        ....      


Keimpe Bleeker

unread,
May 24, 2020, 1:38:27 PM5/24/20
to weewx-user
Thank you so much Jacques Terrettaz, you have solved my time-issue; it seems that I have spoiled a variable!

Last issue is to get the text 'Connected to weather station live. Data received <date, time>' up and running. 


Brackets_24052020.jpg

As you can see on the screencap, I only get (in Dutch) 'Connected to weatherstation' between brackets and single quotes...




Op zondag 24 mei 2020 10:13:36 UTC+2 schreef Jacques Terrettaz:

Jacques Terrettaz

unread,
May 24, 2020, 2:03:47 PM5/24/20
to weewx-user
The text is defined by the variable mqtt_websockets_connected  in skin.conf.

If it does not correspond, check your skin.conf as well as your weewx.conf to be sure that you have not the variable   mqtt_websockets_connected  defined also elsewhere.
If you have changed something in the template weewx/skins/Belchetown/js/belchertown.js.tmpl, verify that the line 839 is :

updated_text = "$obs.label.mqtt_websockets_connected " + updated;

Keimpe Bleeker

unread,
May 24, 2020, 2:54:46 PM5/24/20
to weewx-user
Thanks for your much appreciated assistance!

I would not dare to change someting deep in de system like in /weewx/skins/Belchetown/js/belchertown.js.tmpl. Nevertheless and on your advice, I checked line 839 and it is exactly as you mentioned.

In /weewx/skins/Belchertown/skin.conf I have these Dutch terms:

        header_last_updated         = Laatste update
        mqtt_websockets_connecting  = Verbinden met weerstation,
        mqtt_websockets_waiting     = Verbonden, wacht op data.
        mqtt_websockets_connected   = Verbonden met weerstation,
        mqtt_websockets_stopped     = Updates zijn gestopt
        mqtt_websockets_continue    = Updates hervatten
        mqtt_websockets_failed      = Verbinding verbroken
        mqtt_websockets_lost        = Verbinding verbroken

In weewx.conf the term '...websockets...' was not found.  





Op zondag 24 mei 2020 20:03:47 UTC+2 schreef Jacques Terrettaz:

Manfred Maier

unread,
May 24, 2020, 3:22:38 PM5/24/20
to weewx-user
I guess the system can't properly work with your commas and dots in your translation. Try to either delete the commas or put the translation in quotes "Verbonden met weerstation,"

Manfred 

gjr80

unread,
May 24, 2020, 4:11:23 PM5/24/20
to weewx-user
WeeWX uses the python package configobj to parse .conf files. When configobj encounters a comma in a config setting the setting is interpreted as a list of values separated at the coma and not as a single setting. So if you have a setting that needs a comma included in the setting text you must enclose the setting in single or double quotation marks.

Gary

Keimpe Bleeker

unread,
May 26, 2020, 12:49:29 PM5/26/20
to weewx-user
Thanks Jacques, you solved a major problem!

What remains is the correct connection of text segments, but trhat is realy minor a minor issue!

Again thanks!

 

Op zondag 24 mei 2020 10:13:36 UTC+2 schreef Jacques Terrettaz:
I think I have found the problem :

Keimpe Bleeker

unread,
May 26, 2020, 12:55:20 PM5/26/20
to weewx-user
Hi Manfred, Tried everything with commas, dots, quotation marks, ... But stil I see only 'connected to weatherstation - <date><time>', while 'Date received' is missing for the real-time update. Strange enough the sentence is correctly presented with the text 'Connected, waiting for...'.


Op zondag 24 mei 2020 21:22:38 UTC+2 schreef Manfred Maier:

Jacques Terrettaz

unread,
May 26, 2020, 12:55:53 PM5/26/20
to weewx...@googlegroups.com
Hi,

Text segments ? What do you mean ?

Jacques Terrettaz

unread,
May 26, 2020, 2:24:59 PM5/26/20
to weewx-user
In the original skin.conf of Belchertown v 1.1 , i see :

mqtt_websockets_connected   = Connected to weather station live. Data received

On my side, I have a running Belchertown 1.1 template, translated in French,  ( see http://meteo-sciez.fr/weewx/belchertown/ with :

mqtt_websockets_connected   = Connecté à la station. Mesures du

On your side, if you have for instance :

mqtt_websockets_connected   = Verbonden met weerstation. Data received on 

with "Data received on"  translated in your language,  does it works ?

If not, I really don't know where is the cause of your problem.


 

Keimpe Bleeker

unread,
May 27, 2020, 5:14:19 AM5/27/20
to weewx-user
How simple it can be sometimes ... I was thinking in a stove-pipe and was looking much too deep. 

Thanks for all assistance, as far as I am concerned, item closed.


Op dinsdag 26 mei 2020 20:24:59 UTC+2 schreef Jacques Terrettaz:
Reply all
Reply to author
Forward
0 new messages