John,

is this a problem to write the loop-data.txt file every 2sec on a SSD 
regarding durability!?
Or would it be better to place it on a ramdisk (tmpfs) like /dev/shm ...

Regards,

Christian 

[email protected] schrieb am Mittwoch, 15. Juli 2020 um 21:35:27 UTC+2:

> Great news!
>
> The purpose of LoopData is to be able to add to any skin, but it does 
> require knowledge of JavaScript.
>
> On Jul 15, 2020, at 12:33 PM, John Kline <[email protected]> wrote:
>
> 
>
> 
> tail -f loop-data.txt won’t work because a new file is created on every 
> loop.
>
> You can use:
> watch cat loop-data.txt
>
> You screen shots are not of any javascript errors that might be on the 
> page.
>
> Would you send me the following file?
> /var/www/html/weewx/weatherboard/index.html
>
> On Jul 15, 2020, at 12:07 PM, '[email protected]' via weewx-user <
> [email protected]> wrote:
>
> ok...last post for now...maybe this is the problem, see screenshot...
>
> [email protected] schrieb am Mittwoch, 15. Juli 2020 um 20:54:42 
> UTC+2:
>
>> ...and the error form the browser after changes as screenshot....
>>
>> [email protected] schrieb am Mittwoch, 15. Juli 2020 um 20:49:18 
>> UTC+2:
>>
>>> Ok, 
>>>
>>> cat /var/www/html/weewx/loop-data.txt 
>>>
>>> {"current.dateTime.raw": 1594838795, "current.windDir.ordinal_compass": 
>>> "NW", "day.rain.sum": "3,0 mm", "current.dewpoint": "8,9\u00b0C", 
>>> "current.outTemp": "16,7\u00b0C", "current.rainRate": "0,0 mm/h", 
>>> "current.windSpeed": "3,2 km/h", "day.windGust.max": "27,4 km/h", 
>>> "10m.windGust.max": "8,0 km/h", "current.windSpeed.raw": 3.218688}
>>>
>>> (with missing "current.windSpeed.raw")
>>>
>>> ....
>>>
>>>
>>>
>>>
>>>
>>>
>>> [email protected] schrieb am Mittwoch, 15. Juli 2020 um 20:39:01 
>>> UTC+2:
>>>
>>>> John,
>>>>
>>>> strange...maybe I really should delete anything and start from scratch?
>>>>
>>>> But before one more try.. I'm sure the loopdata is made, see some 'cat' 
>>>> of the file:
>>>>
>>>> *cat /var/www/html/weewx/loop-data.txt {"current.dateTime.raw": 
>>>> 1594836959, "current.windDir.ordinal_compass": "NW", "day.rain.sum": "3,0 
>>>> mm", "current.dewpoint": "8,7\u00b0C", "current.outTemp": "17,1\u00b0C", 
>>>> "current.rainRate": "1,2 mm/h", "current.windSpeed": "3,2 km/h", 
>>>> "day.windGust.max": "27,4 km/h", "10m.windGust.max": "14,5 km/h"}*
>>>>
>>>>
>>>> *cat /var/www/html/weewx/loop-data.txt {"current.dateTime.raw": 
>>>> 1594836976, "current.windDir.ordinal_compass": "NNW", "day.rain.sum": "3,0 
>>>> mm", "current.dewpoint": "8,7\u00b0C", "current.outTemp": "17,1\u00b0C", 
>>>> "current.rainRate": "1,0 mm/h", "current.windSpeed": "8,0 km/h", 
>>>> "day.windGust.max": "27,4 km/h", "10m.windGust.max": "14,5 km/h"}*
>>>>
>>>>
>>>> *cat /var/www/html/weewx/loop-data.txt {"current.dateTime.raw": 
>>>> 1594836979, "current.windDir.ordinal_compass": "NNW", "day.rain.sum": "3,0 
>>>> mm", "current.dewpoint": "8,7\u00b0C", "current.outTemp": "17,1\u00b0C", 
>>>> "current.rainRate": "1,0 mm/h", "current.windSpeed": "6,4 km/h", 
>>>> "day.windGust.max": "27,4 km/h", "10m.windGust.max": "14,5 km/h"}*
>>>>
>>>>
>>>>
>>>> * cat /var/www/html/weewx/loop-data.txt {"current.dateTime.raw": 
>>>> 1594836981, "current.windDir.ordinal_compass": "NNW", "day.rain.sum": "3,0 
>>>> mm", "current.dewpoint": "8,7\u00b0C", "current.outTemp": "17,1\u00b0C", 
>>>> "current.rainRate": "1,0 mm/h", "current.windSpeed": "6,4 km/h", 
>>>> "day.windGust.max": "27,4 km/h", "10m.windGust.max": "14,5 km/h"} *
>>>>
>>>>
>>>>
>>>> *cat /var/www/html/weewx/loop-data.txt {"current.dateTime.raw": 
>>>> 1594836985, "current.windDir.ordinal_compass": "NW", "day.rain.sum": "3,0 
>>>> mm", "current.dewpoint": "8,7\u00b0C", "current.outTemp": "17,1\u00b0C", 
>>>> "current.rainRate": "1,0 mm/h", "current.windSpeed": "4,8 km/h", 
>>>> "day.windGust.max": "27,4 km/h", "10m.windGust.max": "14,5 km/h"}# *
>>>>
>>>> What I think is a little bit strange, a: 
>>>>
>>>> *tail -f /var/www/html/weewx/loop-data.txt *
>>>>
>>>> doesn't show any changes after two seconds? Is there some caching....I 
>>>> dont use the rsync.... Anyway...
>>>> '
>>>> by the way, I sometimes see floats at the time value like 
>>>> "current.dateTime.raw": 1594837199.0..? 
>>>>
>>>> Yes, I added this 
>>>>
>>>> *report_services = weewx.engine.StdPrint, weewx.engine.StdReport, 
>>>> user.loopdata.LoopData*
>>>>
>>>> and if I turn on debug=1 I see the file is written every loop.
>>>> a 
>>>> *cat /var/www/html/weewx/loop-data.txt*:
>>>> {"current.dateTime.raw": 1594837649, "current.windDir.ordinal_compass": 
>>>> "N", "day.rain.sum": "3,0 mm", "current.dewpoint": "9,0\u00b0C", 
>>>> "current.outTemp": "16,8\u00b0C", "current.rainRate": "0,0 mm/h", 
>>>> "current.windSpeed": "4,8 km/h", "day.windGust.max": "27,4 km/h", 
>>>> "10m.windGust.max": "11,3 km/h"}
>>>> {"current.dateTime.raw": 1594837577, "current.windDir.ordinal_compass": 
>>>> "NW", "day.rain.sum": "3,0 mm", "current.dewpoint": "9,1\u00b0C", 
>>>> "current.outTemp": "16,9\u00b0C", "current.rainRate": "0,0 mm/h", 
>>>> "current.windSpeed": "6,4 km/h", "day.windGust.max": "27,4 km/h", 
>>>> "10m.windGust.max": "11,3 km/h"}
>>>>
>>>> a* ls -laht /var/www/html/weewx/weatherboard*
>>>>
>>>> drwxr-xr-x 12 www-data www-data 4,0K Jul 15 20:28 ..
>>>> drwxr-xr-x  2 root     root     4,0K Jul 15 20:27 .
>>>> -rw-r--r--  1 root     root      12K Jul 15 20:27 index.html
>>>> -rw-r--r--  1 root     root     1,7K Jul 15 19:41 weatherboard.css
>>>> -rw-r--r--  1 root     root     3,5K Jul 15 19:41 favicon.ico
>>>>
>>>> So I'm not familiar with .js, I hope I opened the right one in my FF 
>>>> browser. Never did anything with JavaScript! :-O  But I got some errors, 
>>>> see attached screenshot. 
>>>> Thanks for your patience!
>>>> Maybe something is blocked by Apache2 (I host the site by myself)....
>>>>
>>>> Regards,
>>>>
>>>> Christian 
>>>> [email protected] schrieb am Mittwoch, 15. Juli 2020 um 20:12:27 
>>>> UTC+2:
>>>>
>>>>> 
>>>>> 
>>>>> Hi Christian,
>>>>>
>>>>> wee_extension should not have been using python2 if you did a python3 
>>>>> install of weewx; but let’s put that aside.
>>>>>
>>>>> Of course, you should care that WeatherBoard is not updating on every 
>>>>> loop cycle, that’s the whole point of it.
>>>>>
>>>>> I might be better if you deleted all you have done manually and do a 
>>>>> proper install, but let’s try to work with what you have.
>>>>>
>>>>> Are you sure loop-data.txt is being generated?
>>>>>
>>>>> If in weewx.conf, under [Engine][[Services]], on the report_services 
>>>>> line, do you see user.loopdata.LoopData?
>>>>>
>>>>> Would you send me a copy of /var/www/html/weewx/loop-data.txt?
>>>>>
>>>>> Would you send me a directory listing of /var/www/html/weewx/
>>>>> weatherboard?
>>>>>
>>>>> Lastly, from your browser, would you bring up the JavaScript console 
>>>>> and tell me the error(s) you see?
>>>>>
>>>>> On Jul 15, 2020, at 10:53 AM, 'Christian Peters' via weewx-user <
>>>>> [email protected]> wrote:
>>>>>
>>>>> 
>>>>> John,
>>>>>
>>>>> I struggeld installing the extension. I got:
>>>>> Traceback (most recent call last):
>>>>>   File "/usr/share/weewx/wee_extension", line 13, in <module>
>>>>>     import weecfg.extension
>>>>>   File "/usr/share/weewx/weecfg/__init__.py", line 22, in <module>
>>>>>     import configobj
>>>>> ImportError: No module named configobj
>>>>>
>>>>> ..but the module was installed! 
>>>>> I then figured out that wee_extension uses python2 but not python3 so 
>>>>> the module was missing in python 2!  ;-)
>>>>> I treid to gove Python3 a try with weewx this time as I reinstalled it!
>>>>> I changed in we_extension the first line to 
>>>>>
>>>>> #!/usr/bin/env python3
>>>>>
>>>>> and it works. 
>>>>>
>>>>> But first I installed the loop-data exxtension by hand...but I think 
>>>>> all is in the right place as the loop-data.txt is build.
>>>>>
>>>>> The WeatherBoardReport section in weewx.conf:
>>>>>
>>>>>     [[WeatherBoardReport]]
>>>>>         HTML_ROOT = /var/www/html/weewx/weatherboard
>>>>>         enable = true
>>>>>         skin = WeatherBoard
>>>>>         [[[Extras]]]
>>>>>             meta_title = Live-Wetter Langenseifen, Hessen  Weather at 
>>>>> a Glance WeatherBoard&trade;
>>>>>             title = Live-Wetter Langenseifen Hessen WeatherBoard&trade
>>>>> ;
>>>>>             subtitle = Fortlaufend aktualisiert.
>>>>>             logo = ""
>>>>>             loop_data_file = ../loop-data.txt
>>>>>             contact_email = ""
>>>>>             expiration_time = 4
>>>>>             page_update_pwd = foobar
>>>>>             googleAnalyticsId = ""
>>>>>             analytics_host = ""
>>>>>             show_purple = False
>>>>>         [[[Labels]]]
>>>>>             [[[[Generic]]]]
>>>>>                 air_quality_index = Air Quality Index
>>>>>                 contact = Kontakt
>>>>>                 legend = Legende
>>>>>                 rain_today = Regen heute
>>>>>                 ten_min_max_gust = 10min Boee
>>>>>                 time_of_day = Uhrzeit
>>>>>                 high_gust_today = Booe max.
>>>>>         [[[Units]]]
>>>>>             [[[[StringFormats]]]]
>>>>>                 mile_per_hour = %.1f
>>>>>                 degree_C = %.1f
>>>>>                 km_per_hour = %.1f
>>>>>                 degree_F = %.1f
>>>>>
>>>>> This section I added at the end of weewx.conf by hand:
>>>>>
>>>>> # 
>>>>> ====================================================================================
>>>>> # Options for extension 'weewx-loopdata'
>>>>>
>>>>> [LoopData]
>>>>>     [[FileSpec]]
>>>>>         loop_data_dir = /var/www/html/weewx
>>>>>         filename = loop-data.txt
>>>>>     [[Formatting]]
>>>>>         target_report = WeatherBoardReport
>>>>>     [[RsyncSpec]]
>>>>>         enable = false
>>>>>         remote_server = foo.bar.com
>>>>>         remote_user = root
>>>>>         remote_dir = /var/www/html
>>>>>         compress = False
>>>>>         log_success = False
>>>>>         ssh_options = -o ConnectTimeout=1
>>>>>         timeout = 1
>>>>>         skip_if_older_than = 3
>>>>>     [[Include]]
>>>>>         fields = current.dateTime.raw, current.windDir.ordinal_compass
>>>>> , day.rain.sum, current.dewpoint, current.outTemp, current.rainRate, 
>>>>> current.windSpeed, day.windGust.max, 10m.windGust.max, current.
>>>>> windSpeed
>>>>>
>>>>> But there is even a skin.conf at /etc/weew/skinWeatherboard/ ...
>>>>>
>>>>> # Copyright (C)2020 by John A Kline ([email protected])
>>>>> # Distributed under the terms of the GNU Public License (GPLv3)
>>>>> # See LICENSE for your rights.
>>>>>
>>>>> [Extras]
>>>>>     # Fill path of loop data file.  If not a full path,
>>>>>     # it will be interpreted as relative to this skin's HTML_ROOT.
>>>>>     loop_data_file = '../loop-data.txt'
>>>>>
>>>>>     # Refresh rate is the rate at which the report should refresh with
>>>>>     # the latest readings.  A good choice is the rate at which your
>>>>>     # weather stations driver is feeing loop data.  Expressed in units
>>>>>     # of seconds.  Default: 2 seconds.
>>>>>     refresh_rate = 2
>>>>>
>>>>>     # Fill in a sutiable title/subtitle for the report.
>>>>>     title = 'my-weather-website.com WeatherBoard&trade;'
>>>>>     subtitle = 'Updated continuously.'
>>>>>
>>>>>     # If you have a log, specify it here.
>>>>>     logo = ''
>>>>>
>>>>>     # Fill in contact email to display on the report.
>>>>>     contact_email = '[email protected]'
>>>>>
>>>>>     # Choose your own password.  without ?page_update_pwd='xxx'
>>>>>     # at the end of the URL, auto updating will timeout.
>>>>>     # Note: This password will be viaible to users looking
>>>>>     # at page source in their browser.
>>>>>     page_update_pwd = 'foobar'
>>>>>
>>>>>     # Page expiration time is the number of hours the report will 
>>>>> request
>>>>>     # loop data and update.  After which, a mouse clice will be needed
>>>>>     # to start refreshing again.  Default 4 hours.
>>>>>     expiration_time = 4
>>>>>
>>>>>     # If you have a google analytics id, uncomment the following line
>>>>>     # and fill in the ID.
>>>>>     # googleAnalyticsId =
>>>>>     # If you only want to use the ID on a certain host, uncomment the
>>>>>     # following line and fill in the hostname.
>>>>>     # analytics_host = www.example.com
>>>>>
>>>>>     # If a PurpleAir sensor is set up and both weewx-purple and
>>>>>     # purple-proxy are installed, or just weewx-purple is installed;
>>>>>     # change the 'False' below to 'True'.
>>>>>     # The weewx-purple extension can be found here:
>>>>>     #    https://github.com/chaunceygardiner/weewx-purple
>>>>>     # The purple-proxy server can be found here:
>>>>>     #    https://github.com/chaunceygardiner/purple-proxy
>>>>>     # It is preferable to install both weewx-purple and purple proxy
>>>>>     # as the proxy returns averages over the archive period (as
>>>>>     # opposed to one shot readings).
>>>>>     show_purple = False
>>>>>
>>>>> [Labels]
>>>>>     [[Generic]]
>>>>>         # Some specialized labels
>>>>>         air_quality_index = Air Quality Index
>>>>>         contact           = Contact
>>>>>         legend            = Legend
>>>>>         rain_today        = Rain Today
>>>>>         ten_min_max_gust  = 10m Gust
>>>>>         time_of_day       = Time
>>>>>         high_gust_today   = Today's High Gust
>>>>>
>>>>> [CheetahGenerator]
>>>>>     encoding = html_entities
>>>>>     [[ToDate]]
>>>>>         [[[index]]]
>>>>>             template = index.html.tmpl
>>>>>
>>>>> [CopyGenerator]
>>>>>     copy_once = favicon.ico, weatherboard.css
>>>>>     copy_always = ,
>>>>>
>>>>> [Generators]
>>>>>         generator_list = weewx.cheetahgenerator.CheetahGenerator, 
>>>>> weewx.reportengine.CopyGenerator
>>>>>
>>>>> Do I have to care about!? 
>>>>>
>>>>> The WeatherBoard site seems to update with the interval given in weewx 
>>>>> (here 1min)....but the JS seems not to work?
>>>>> It's starnge too that there are some obersavervations missing and the 
>>>>> time not catched and printed on the WB site...but Temp is changein (all 
>>>>> 1min while refreshing)?
>>>>>
>>>>> Hope you could figure something out of my setting!?
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>> Christian 
>>>>>
>>>>> Am Mittwoch, 15. Juli 2020 16:11:06 UTC+2 schrieb John Kline:
>>>>>>
>>>>>> Hi Christian,
>>>>>>
>>>>>> Please let me know what was tricky about installing loop-data.
>>>>>>
>>>>>> Since you are getting loop-data, I suspect that the LoopData 
>>>>>> extension and the WeatherBoard extension don’t agree about where to find 
>>>>>> the loop-data.txt file.
>>>>>>
>>>>>> Would you send both the LoopData section and the WeatherBoard section 
>>>>>> of weewx.conf?
>>>>>>
>>>>>> Cheers,
>>>>>> John
>>>>>>
>>>>>> On Jul 15, 2020, at 5:16 AM, 'Christian Peters' via weewx-user <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>> 
>>>>>> John,
>>>>>>
>>>>>> I just installed the loop-data extension and the weatherboard skin to 
>>>>>> give it a try. :-) 
>>>>>> A really nice extension. 
>>>>>>
>>>>>> It was a bit tricky to install it but I hope loop-data is running. I 
>>>>>> get this 
>>>>>> /var/www/html/weewx/loop-data.txt file with this text:
>>>>>>
>>>>>> {"current.dateTime.raw": 1594814866, 
>>>>>> "current.windDir.ordinal_compass": "N", "day.rain.sum": "2,6 mm", 
>>>>>> "current.dewpoint": "11,3\u00b0C", "current.outTemp": "20,3\u00b0C", 
>>>>>> "current.rainRate": "0,0 mm/h", "current.windSpeed": "6,4 km/h", 
>>>>>> "day.windGust.max": "19,3 km/h", "10m.windGust.max": "11,3 km/h"}
>>>>>>
>>>>>> It updates every 2 sec, winddir for example changes....so it seems to 
>>>>>> work I think. 
>>>>>>
>>>>>> What not works it the wartherboard skin. 
>>>>>>
>>>>>> https://livewetter.hcpeters.de
>>>>>>
>>>>>> It doesn't update (only if I do a manual refresh on the borwser and 
>>>>>> not every time it really refreshes to the most recent values). 
>>>>>> and there is something not working as the time field is missing, even 
>>>>>> 10m.windGust.max and day.windGust.max ... see screenshot.
>>>>>>
>>>>>> Am I doing something wrong? I got the most recent .zip files from 
>>>>>> your site (today). But I'm not sure where to tweak the weatherboard skin 
>>>>>> ( 
>>>>>> in weewx.conf or in weatherboard/skin/skin.conf ) ?
>>>>>>
>>>>>> Thanks in advance for any idea or hint!
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Christian 
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> -- 
>>>>>> 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 [email protected].
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/weewx-user/adaaa9c1-dbdd-4534-bda8-784875ce2103o%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/weewx-user/adaaa9c1-dbdd-4534-bda8-784875ce2103o%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> <weatherboard.png>
>>>>>>
>>>>>> -- 
>>>>> 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 [email protected].
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/weewx-user/155cc6a5-2234-44a0-94f2-99f6fbda1057o%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/weewx-user/155cc6a5-2234-44a0-94f2-99f6fbda1057o%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> -- 
> 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/c28e82d7-4a36-42f2-832c-4eed5cb5438dn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/weewx-user/c28e82d7-4a36-42f2-832c-4eed5cb5438dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> <Bildschirmfoto 2020-07-15 um 21.05.54.png>
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/31847230-f79f-4b2d-a74c-e2c167bf1c2dn%40googlegroups.com.

Reply via email to