Help testing an extension.

102 views
Skip to first unread message

John Kline

unread,
Jul 4, 2020, 9:59:43 PM7/4/20
to weewx-development
Hi all,

I have an extension, LoopData, that can be used to update weewx report web pages on each loop packet (of course, JavaScript is needed in the web pages).

I’ve tested it with US, METRIC and METRICWX databases targeting US and metric reports.

Alas, I have only tested it with the the RainWise CC3000 and IP100 drivers and the simulator.  I suspect there will be issues when other drivers are tried.

It’s been tried by a couple of people on weewx-users, but at this point, I’d prefer weewx-developers give it a try.

I would appreciate it if some of you could try it.  Running it just for a couple of loop cycles is fine—to see if the loop-data.txt file is being produced and to verify the contents of it look good.

The install sets loop_data_dir to/home/weewx/public_html (yes, it should use a symbolic here).  Change it as necessary.

The file is named loop-data.txt (by default).

Please note, one user complained, after installing many versions, that one version of loopdata broke his installation.  He’s since fixed his weewx.conf.  I don’t believe the very simple install did that; but I feel it necessary to make you aware this.  If you do find this issue. Simply copy over the backup of weewx.conf that the install makes and restart.  (And of course, report the issue.)

The aim is for loop-data.txt to yield exactly what the JavaScript needs right out of the box.  Please let me know what issues you run into.

Install at head from https://github.com/chaunceygardiner/weewx-loopdata. Detailed installation instructions are there.

Details of LoopData
(BTW, credit to Gary for his great rtgd work that inspired this.)

To use LoopData, you pick a report to target (e.g., SeasonsReport) and then all scalar observations, along with day high (w/ time), low (w/time), average, weighted average and sums are available in a form appropriate for the report.  That is, all of these are automatically converted and formatted to match the target report.  As such, if the SeasonsReport is targeted, and one changes windSpeed in the SeasonsReport to be in meters per second with three decimal places, windSpeed in the loop-data.txt file will also be in meters per second with three decimal places.  Formatting with a label is achieved simply by prepending FMT_ to the observation.  As such, FMT_SUM_rain would yield “FMT_SUM_rain”: “0.03 in” in loop-data.txt if .03 inches of rain fell today (even if the database was METRIC).

Of course, if all of this data would make for an enormous loop-data.txt file: <obs>, FMT_<obs>, SUM_<obs>, FMT_SUM_<obs>, AVG_<obs>, FMT_AVG_<obs> and so on and so forth).  As such, it is possible to only include what you are going to use.

For example:
   [[Include]]
        fields = dateTime, windSpeed, COMPASS_windDir, DESC_barometerRate, FMT_barometer, FMT_SUM_rain, FMT_dewpoint, FMT_heatindex, FMT_outHumidity, FMT_outTemp, FMT_rainRate, FMT_windchill, FMT_windSpeed, FMT_HI_windGust, FMT_10mMaxGust, pm2_5_aqi, pm2_5_aqic

Yields a loop-data.txt file containing the following.  This is assuming everything in the include is in the loop packet.  Anything not in the loop packet will, of course, not be present in loop-data.txt.

{"dateTime": 1593911456, "windSpeed": "4.4", "COMPASS_windDir": "N", "DESC_barometerRate": "Falling Slowly", "FMT_barometer": "29.965 inHg", "FMT_SUM_rain": "0.00 in", "FMT_dewpoint": "55.4\u00b0F", "FMT_heatindex": "88.2\u00b0F", "FMT_outHumidity": "33%", "FMT_outTemp": "88.2\u00b0F", "FMT_rainRate": "0.00 in/h", "FMT_windchill": "88.2\u00b0F", "FMT_windSpeed": "4.4 mph", "FMT_HI_windGust": "12.6 mph", "FMT_10mMaxGust": "9.1 mph", "pm2_5_aqi": "46", "pm2_5_aqic": "11204096"}

Please let me know if you were successful and/or any issues that arose.

Cheers,
John

Tom Keffer

unread,
Jul 5, 2020, 2:52:10 PM7/5/20
to John Kline, weewx-development
Using Python v3.7.3 I get

Jul  5 11:47:29 nuc weewx[158105] INFO weewx.engine: Using archive interval of 60 seconds (specified by hardware)
Jul  5 11:47:29 nuc weewx[158105] INFO weewx.restx: StationRegistry: Registration not requested.
Jul  5 11:47:29 nuc weewx[158105] INFO weewx.restx: Wunderground: Posting not enabled.
Jul  5 11:47:29 nuc weewx[158105] INFO weewx.restx: PWSweather: Posting not enabled.
Jul  5 11:47:29 nuc weewx[158105] INFO weewx.restx: CWOP: Posting not enabled.
Jul  5 11:47:29 nuc weewx[158105] INFO weewx.restx: WOW: Posting not enabled.
Jul  5 11:47:29 nuc weewx[158105] INFO weewx.restx: AWEKAS: Posting not enabled.
Jul  5 11:47:29 nuc weewx[158105] CRITICAL __main__: Caught unrecoverable exception:
Jul  5 11:47:29 nuc weewx[158105] CRITICAL __main__:     ****  invalid syntax (loopdata.py, line 59)
Jul  5 11:47:29 nuc weewx[158105] CRITICAL __main__:     ****  Traceback (most recent call last):
Jul  5 11:47:29 nuc weewx[158105] CRITICAL __main__:     ****    File "./bin/weewxd", line 148, in main
Jul  5 11:47:29 nuc weewx[158105] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
Jul  5 11:47:29 nuc weewx[158105] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 76, in __init__
Jul  5 11:47:29 nuc weewx[158105] CRITICAL __main__:     ****      self.loadServices(config_dict)
Jul  5 11:47:29 nuc weewx[158105] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 139, in loadServices
Jul  5 11:47:29 nuc weewx[158105] CRITICAL __main__:     ****      obj = weeutil.weeutil.get_object(svc)(self, config_dict)
Jul  5 11:47:30 nuc weewx[158105] CRITICAL __main__:     ****    File "/home/weewx/bin/weeutil/weeutil.py", line 1093, in get_object
Jul  5 11:47:30 nuc weewx[158105] CRITICAL __main__:     ****      mod = __import__(module)
Jul  5 11:47:30 nuc weewx[158105] CRITICAL __main__:     ****    File "/home/weewx/bin/user/loopdata.py", line 59
Jul  5 11:47:30 nuc weewx[158105] CRITICAL __main__:     ****      COMPASS_OBSERVATIONS: List[str] = ['windDir', 'windGustDir']
Jul  5 11:47:30 nuc weewx[158105] CRITICAL __main__:     ****                          ^
Jul  5 11:47:30 nuc weewx[158105] CRITICAL __main__:     ****  SyntaxError: invalid syntax
Jul  5 11:47:30 nuc weewx[158105] CRITICAL __main__:     ****  Exiting.

Incidentally, I strongly encourage coding to the same support matrix as WeeWX itself: Python v2.7 and V3.5 and later. Otherwise, you'll exclude a lot of potential users.

-tk

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/C255B03F-8498-48D9-A7A2-0D5EEACEF6C1%40johnkline.com.

John Kline

unread,
Jul 5, 2020, 3:33:04 PM7/5/20
to Tom Keffer, weewx-development
Thanks Tom.  I appreciate you trying this out.

Another tester reported this and I’ve subsequently updated the extension to check for Python 3.7.  And updated the README accordingly.

I’d rather not give up the type annotations and I do understand this limits potential users.  I’m also not listing any of my stuff in any WeeWX 4 compatible lists (or any lists for that matter) as I think it would be misleading considering the limitation.

Cheers,
John

On Jul 5, 2020, at 11:52 AM, Tom Keffer <tke...@gmail.com> wrote:



Michael

unread,
Jul 9, 2020, 4:21:59 AM7/9/20
to weewx-development
Hi John,

I'm just about to test your extension. The installation is on a raspi that gets its data only via SDR. There is no station connected. Barometer data is not available on this test system.
shortly after the start of weewx there is this error:

Jul  9 10:14:02 raspberrypi systemd[1]: Started Session c3 of user pi.
Jul  9 10:14:14 raspberrypi systemd[1]: Stopping LSB: weewx weather system...
Jul  9 10:14:14 raspberrypi weewx[2147]: Stopping weewx weather system: weewx not running....
Jul  9 10:14:14 raspberrypi systemd[1]: weewx.service: Succeeded.
Jul  9 10:14:14 raspberrypi systemd[1]: Stopped LSB: weewx weather system.
Jul  9 10:14:14 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Jul  9 10:14:15 raspberrypi weewx[2167] INFO __main__: Initializing weewx version 4.0.0
Jul  9 10:14:15 raspberrypi weewx[2167] INFO __main__: Using Python 3.7.3 (default, Dec 20 2019, 18:57:59) #012[GCC 8.3.0]
Jul  9 10:14:15 raspberrypi weewx[2167] INFO __main__: Platform Linux-4.19.118-v7+-armv7l-with-debian-10.4
Jul  9 10:14:15 raspberrypi weewx[2167] INFO __main__: Locale is 'de_DE.UTF-8'
Jul  9 10:14:15 raspberrypi weewx[2167] INFO __main__: PID file is /var/run/weewx.pid
Jul  9 10:14:15 raspberrypi weewx[2171] INFO __main__: Using configuration file /home/weewx/weewx.conf
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.engine: Loading station type SDR (user.sdr)
Jul  9 10:14:15 raspberrypi weewx[2157]: Starting weewx weather system: weewx.
Jul  9 10:14:15 raspberrypi systemd[1]: Started LSB: weewx weather system.
Jul  9 10:14:15 raspberrypi weewx[2171] INFO user.sdr: driver version is 0.77
Jul  9 10:14:15 raspberrypi weewx[2171] INFO user.sdr: sensor map is {'outTemp': 'temperature.1:8.HidekiTS04Packet', 'outHumidity': 'humidity.1:8.HidekiTS04Packet', 'extraTemp1': 'temperature.2:10.HidekiTS04Packet', 'extraHumid1': 'humidity.2:10.HidekiTS04Packet', 'batteryStatus1': 'battery.2:10.HidekiTS04Packet', 'extraTemp2': 'temperature.3:1.HidekiTS04Packet', 'extraHumid2': 'humidity.3:1.HidekiTS04Packet', 'batteryStatus2': 'battery.3:1.HidekiTS04Packet', 'extraTemp3': 'temperature.4:13.HidekiTS04Packet', 'extraHumid3': 'humidity.4:13.HidekiTS04Packet', 'batteryStatus3': 'battery.4:13.HidekiTS04Packet', 'extraTemp4': 'temperature.5:8.HidekiTS04Packet', 'extraHumid4': 'humidity.5:8.HidekiTS04Packet', 'batteryStatus4': 'battery.5:8.HidekiTS04Packet', 'extraTemp6': 'temperature.220.inFactoryPacket', 'extraHumid6': 'humidity.220.inFactoryPacket', 'batteryStatus6': 'battery.220.inFactoryPacket', 'extraTemp7': 'temperature.15.inFactoryPacket', 'extraHumid7': 'humidity.15.inFactoryPacket', 'batteryStatus7': 'battery.15.inFactoryPacket', 'extraTemp8': 'temperature.3:12.HidekiTS04Packet', 'extraHumid8': 'humidity.3:12.HidekiTS04Packet', 'batteryStatus8': 'battery.3:12.HidekiTS04Packet', 'extraTemp9': 'temperature.3:14.HidekiTS04Packet', 'extraHumid9': 'humidity.3:14.HidekiTS04Packet', 'batteryStatus9': 'battery.3:14.HidekiTS04Packet', 'extraTemp10': 'temperature.3:15.HidekiTS04Packet', 'extraHumid10': 'humidity.3:15.HidekiTS04Packet', 'batteryStatus10': 'battery.3:15.HidekiTS04Packet', 'windSpeed': 'wind_speed.4:7.HidekiWindPacket', 'windDir': 'wind_dir.4:7.HidekiWindPacket', 'windGust': 'wind_gust.4:7.HidekiWindPacket', 'windBatteryStatus': 'battery.4:7.HidekiWindPacket'}
Jul  9 10:14:15 raspberrypi weewx[2171] INFO user.sdr: deltas is {'rain': 'rain_total', 'strikes': 'strikes_total'}
Jul  9 10:14:15 raspberrypi weewx[2171] INFO user.sdr: startup process '/usr/local/bin/rtl_433 -f 433.92M -M utc -F json -M oldmodel'
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.engine: StdConvert target unit is 0x10
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.wxservices: The following values will be calculated: pressure=prefer_hardware, barometer=prefer_software, altimeter=prefer_hardware, windchill=prefer_hardware, heatindex=prefer_hardware, dewpoint=prefer_hardware, inDewpoint=prefer_hardware, rainRate=prefer_hardware, maxSolarRad=prefer_hardware, cloudbase=prefer_software, humidex=prefer_hardware, appTemp=prefer_hardware, ET=prefer_hardware, windrun=prefer_hardware
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.wxservices: The following algorithms will be used for calculations: altimeter=aaASOS, maxSolarRad=RS
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.engine: Archive will use data binding wx_binding
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.engine: Record generation will be attempted in 'hardware'
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.engine: Using archive interval of 300 seconds (specified in weewx configuration)
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.restx: StationRegistry: Registration not requested.
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.restx: Wunderground: Posting not enabled.
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.restx: PWSweather: Posting not enabled.
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.restx: CWOP: Posting not enabled.
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.restx: WOW: Posting not enabled.
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.restx: AWEKAS: Posting not enabled.
Jul  9 10:14:15 raspberrypi weewx[2171] INFO user.loopdata: Service version is 1.3.17.
Jul  9 10:14:15 raspberrypi weewx[2171] INFO user.loopdata: LoopData file is: /home/weewx/public_html/loop-data.txt
Jul  9 10:14:15 raspberrypi weewx[2171] INFO __main__: Starting up weewx version 4.0.0
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.engine: Using binding 'wx_binding' to database 'weewx_sdr2'
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.manager: Starting backfill of daily summaries
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.engine: Starting main packet loop.
Jul  9 10:14:15 raspberrypi weewx[2171] INFO weewx.engine: Main loop exiting. Shutting engine down.
Jul  9 10:14:15 raspberrypi weewx[2171] INFO user.sdr: shutdown process /usr/local/bin/rtl_433 -f 433.92M -M utc -F json -M oldmodel
Jul  9 10:14:30 raspberrypi weewx[2171] INFO user.sdr: timed out waiting for stderr-thread
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__: Caught unrecoverable exception:
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****  must be real number, not NoneType
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****  Traceback (most recent call last):
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****    File "/home/weewx/bin/weewxd", line 154, in main
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****      engine.run()
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 177, in run
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****      self.dispatchEvent(weewx.Event(weewx.PRE_LOOP))
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 224, in dispatchEvent
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****      callback(event)
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****    File "/home/weewx/bin/user/loopdata.py", line 257, in pre_loop
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****      barometer_readings = self.fill_in_barometer_readings_at_startup(dbm)
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****    File "/home/weewx/bin/user/loopdata.py", line 288, in fill_in_barometer_readings_at_startup
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****      timestamp_to_string(reading.timestamp), reading.value))
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****  TypeError: must be real number, not NoneType
Jul  9 10:14:37 raspberrypi weewx[2171] CRITICAL __main__:     ****  Exiting.

kind regards
Michael

John Kline

unread,
Jul 9, 2020, 10:17:39 AM7/9/20
to Michael, weewx-development
Hi Michael,

Thank you for testing my extension.  I added a check for barometer value of None in the database.  Would you give 1.3.18 a try?

Cheers,
John

On Jul 9, 2020, at 1:22 AM, Michael <wee...@gmx.de> wrote:


--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Michael

unread,
Jul 11, 2020, 9:56:57 AM7/11/20
to weewx-development
Hi John,

great, thankyou. Now weewx-loopdata works as expected

But now I have another question: I installed the Skin Weatherboard. What do I have to do, so that the page refreshes automatically when the values are updated. Until now I have to update the page manually with F5. Then in 5 minutes rhythm updated values are displayed.

Kind Regards
Michael
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

John Kline

unread,
Jul 11, 2020, 11:23:02 AM7/11/20
to Michael, weewx-development
Asssuming loop-data.txt is being generated on every loop, some questions:

Is WeatherBoard pointed to the correct location where loop-data.txt is located?

Did you add the fields required by WeatherBoard (see WeatherBoard README) to the fields entry in the LoopData section of weewx.conf?

Perhaps you are missing a field that WeatherBoard requires?  Do you see any JavaScript errors on the WeatherBoard page (Developer Tools->View JavaScript console or something of that sort).  If so, would you tell me what those errors are?
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/a1b6662f-2d26-4cd4-8b66-d85ac19f25bao%40googlegroups.com.

John Kline

unread,
Jul 11, 2020, 11:55:30 PM7/11/20
to Michael, weewx-development
Hi Michael,

I rewrote LoopData to use the same names as Cheetah (rather than keeping my home-grown naming scheme).

If you are planning on going further with LoopData (and WeatherBoard) I recommend that you switch to:
and

You’ll find the names you can include much more familiar.  Here’ my loop-data.txt now:
{"current.dateTime.raw": 1594525666, "current.windSpeed.raw": 0.0, "current.windSpeed": "0.0 mph", "current.windDir.ordinal_compass": "N/A", "trend.barometer.desc": "Rising Slowly", "current.barometer": "29.976 inHg", "day.rain.sum": "0.00 in", "current.dewpoint": "55.5\u00b0F", "current.heatindex": "68.2\u00b0F", "current.outHumidity": "64%", "current.outTemp": "68.2\u00b0F", "current.rainRate": "0.00 in/h", "current.windchill": "68.2\u00b0F", "day.windGust.maxtime": "07/11/2020 03:58:52 PM", "day.windGust.max": "13.8 mph", "10m.windGust.max": "4.4 mph", "current.pm2_5_aqi.raw": 29.0, "current.pm2_5_aqic.raw": 2746368, "day.wind.maxtime": "07/11/2020 03:58:52 PM", "day.wind.max.formatted": "13.8", "day.wind.gustdir.formatted": "45", "day.outTemp.maxtime": "07/11/2020 02:01:02 PM", "day.outTemp.max.formatted": "87.2", "day.outTemp.mintime": "07/11/2020 06:15:54 AM", "day.outTemp.min.formatted": "53.2", "day.heatindex.maxtime": "07/11/2020 02:01:02 PM", "day.heatindex.max.formatted": "87.2", "day.windchill.mintime": "07/11/2020 06:15:54 AM", "day.windchill.min.formatted": "53.2", "day.dewpoint.maxtime": "07/11/2020 07:59:56 AM", "day.dewpoint.max.formatted": "61.4", "day.dewpoint.mintime": "07/11/2020 06:15:54 AM", "day.dewpoint.min.formatted": "51.8", "day.outHumidity.maxtime": "07/11/2020 07:06:56 AM", "day.outHumidity.max.formatted": "96", "day.outHumidity.mintime": "07/11/2020 02:03:02 PM", "day.outHumidity.min.formatted": "34", "day.barometer.maxtime": "07/11/2020 10:36:58 AM", "day.barometer.max.formatted": "30.025", "day.barometer.minttime": "day.barometer.minttime", "day.barometer.min.formatted": "29.945", "day.rain.sum.formatted": "0.00", "day.rainRate.maxtime": "07/11/2020 12:00:02 AM", "day.rainRate.max.formatted": "0.00", "day.wind.avg.formatted": "2.0", "day.wind.rms.formatted": "2.6", "day.wind.vecavg.formatted": "1.8", "day.wind.vecdir.formatted": "357", "current.consBatteryVoltage": "5.3 V", "current.supplyVoltage": "6.6 V"}
current and day are pretty much all there.  You can’t use .format(xxx); but you can use .formatted (which is the same as .format(add_label=False).
unit.label.<obs> works.
Trend only has barometer and it’s for a hard coded (at present) 3-hour barometer trend:
trend.barometer
Also, trend.barometer.desc is a made up, not currently localized, way of getting steady, falling slowly, etc.  I’ve got to figure something out for that.
Lastly, there’s also a 15m period just for windGust.
15m.windGust.max
15m.windGust.maxtime

Cheers,
John


On Jul 11, 2020, at 8:23 AM, John Kline <jo...@johnkline.com> wrote:



Michael

unread,
Jul 12, 2020, 6:36:20 AM7/12/20
to weewx-development
Hi John,

Unfortunately I was a bit hasty with my message that everything works as desired.
Unfortunately I only watched the logfile for a short time during startup and did not see the error message that appeared later:

Jul 11 17:50:11 raspberrypi weewx[15962] CRITICAL user.loopdata:     ****  Traceback (most recent call last):
Jul 11 17:50:11 raspberrypi weewx[15962] CRITICAL user.loopdata:     ****    File "/home/weewx/bin/user/loopdata.py", line 359, in process_queue
Jul 11 17:50:11 raspberrypi weewx[15962] CRITICAL user.loopdata:     ****      self.save_barometer_reading(pkt_time, pkt)
Jul 11 17:50:11 raspberrypi weewx[15962] CRITICAL user.loopdata:     ****    File "/home/weewx/bin/user/loopdata.py", line 847, in save_barometer_reading
Jul 11 17:50:11 raspberrypi weewx[15962] CRITICAL user.loopdata:     ****      _, _, _, _, sum, count, _, _ = self.arc_per_accum['barometer'].getStatsTuple()
Jul 11 17:50:11 raspberrypi weewx[15962] CRITICAL user.loopdata:     ****  KeyError: 'barometer'
Jul 11 17:50:23 raspberrypi weewx[15962] INFO weewx.manager: Added record 2020-07-11 17:50:00 CEST (1594482600) to database 'weewx_sdr2'
Jul 11 17:50:24 raspberrypi weewx[15962] INFO weewx.manager: Added record 2020-07-11 17:50:00 CEST (1594482600) to daily summary in 'weewx_sdr2'
Jul 11 17:50:24 raspberrypi weewx[15962] INFO weewx.cheetahgenerator: Generated 1 files for report WeatherBoardReport in 0.38 seconds
Jul 11 17:50:24 raspberrypi weewx[15962] INFO weewx.reportengine: Copied 2 files to /var/www/html/weatherboard

LOOP_DATA_VERSION = '1.3.19'

Kind Regard
Michael


Am Samstag, 11. Juli 2020 17:23:02 UTC+2 schrieb John Kline:
Asssuming loop-data.txt is being generated on every loop, some questions:

Is WeatherBoard pointed to the correct location where loop-data.txt is located?

Did you add the fields required by WeatherBoard (see WeatherBoard README) to the fields entry in the LoopData section of weewx.conf?

Perhaps you are missing a field that WeatherBoard requires?  Do you see any JavaScript errors on the WeatherBoard page (Developer Tools->View JavaScript console or something of that sort).  If so, would you tell me what those errors are?

On Jul 11, 2020, at 6:56 AM, Michael <wee...@gmx.de> wrote:


Hi John,

great, thankyou. Now weewx-loopdata works as expected

But now I have another question: I installed the Skin Weatherboard. What do I have to do, so that the page refreshes automatically when the values are updated. Until now I have to update the page manually with F5. Then in 5 minutes rhythm updated values are displayed.

Kind Regards
Michael


.

Michael

unread,
Jul 12, 2020, 6:39:16 AM7/12/20
to weewx-development
Hi John,

I have just tested the version LOOP_DATA_VERSION = '2.0.b2'.
the following error appears after a few minutes runtime:

Jul 12 12:35:08 raspberrypi weewx[31676] CRITICAL user.loopdata:     ****  Traceback (most recent call last):
Jul 12 12:35:08 raspberrypi weewx[31676] CRITICAL user.loopdata:     ****    File "/home/weewx/bin/user/loopdata.py", line 335, in process_queue
Jul 12 12:35:08 raspberrypi weewx[31676] CRITICAL user.loopdata:     ****      self.save_barometer_reading(pkt_time, pkt)
Jul 12 12:35:08 raspberrypi weewx[31676] CRITICAL user.loopdata:     ****    File "/home/weewx/bin/user/loopdata.py", line 855, in save_barometer_reading
Jul 12 12:35:08 raspberrypi weewx[31676] CRITICAL user.loopdata:     ****      value = self.arc_per_accum['barometer'].avg
Jul 12 12:35:08 raspberrypi weewx[31676] CRITICAL user.loopdata:     ****  KeyError: 'barometer'
Jul 12 12:35:18 raspberrypi weewx[31676] INFO user.sdr: unmapped: ['{"time" : "2020-07-12 10:35:14", "model" : "HIDEKI TS04 sensor", "rc" : 0, "channel" : 3, "battery" : "OK", "temperature_C" : 28.700, "humidity" : 43, "mic" : "CRC"}\n'] ({'dateTime': 1594550114, 'usUnits': 16, 'temperature.3:0.HidekiTS04Packet': 28.7, 'humidity.3:0.HidekiTS04Packet': 43.0, 'battery.3:0.HidekiTS04Packet': 0})
Jul 12 12:35:18 raspberrypi weewx[31676] INFO user.sdr: unmapped: [] ({'dateTime': 1594550114, 'usUnits': 16, 'temperature.3:0.HidekiTS04Packet': 28.7, 'humidity.3:0.HidekiTS04Packet': 43.0, 'battery.3:0.HidekiTS04Packet': 0})
Jul 12 12:35:22 raspberrypi weewx[31676] INFO weewx.manager: Added record 2020-07-12 12:35:00 CEST (1594550100) to database 'weewx_sdr2'
Jul 12 12:35:23 raspberrypi weewx[31676] INFO weewx.manager: Added record 2020-07-12 12:35:00 CEST (1594550100) to daily summary in 'weewx_sdr2'
Jul 12 12:35:23 raspberrypi weewx[31676] INFO weewx.cheetahgenerator: Generated 1 files for report WeatherBoardReport in 0.31 seconds
Jul 12 12:35:23 raspberrypi weewx[31676] INFO weewx.reportengine: Copied 2 files to /var/www/html/weatherboard
Kind Regards
Michael



Am Sonntag, 12. Juli 2020 05:55:30 UTC+2 schrieb John Kline:
Hi Michael,

I rewrote LoopData to use the same names as Cheetah (rather than keeping my home-grown naming scheme).

If you are planning on going further with LoopData (and WeatherBoard) I recommend that you switch to:
and

You’ll find the names you can include much more familiar.  Here’ my loop-data.txt now:
{"current.dateTime.raw": 1594525666, "current.windSpeed.raw": 0.0, "current.windSpeed": "0.0 mph", "current.windDir.ordinal_compass": "N/A", "trend.barometer.desc": "Rising Slowly", "current.barometer": "29.976 inHg", "day.rain.sum": "0.00 in", "current.dewpoint": "55.5\u00b0F", "current.heatindex": "68.2\u00b0F", "current.outHumidity": "64%", "current.outTemp": "68.2\u00b0F", "current.rainRate": "0.00 in/h", "current.windchill": "68.2\u00b0F", "day.windGust.maxtime": "07/11/2020 03:58:52 PM", "day.windGust.max": "13.8 mph", "10m.windGust.max": "4.4 mph", "current.pm2_5_aqi.raw": 29.0, "current.pm2_5_aqic.raw": 2746368, "day.wind.maxtime": "07/11/2020 03:58:52 PM", "day.wind.max.formatted": "13.8", "day.wind.gustdir.formatted": "45", "day.outTemp.maxtime": "07/11/2020 02:01:02 PM", "day.outTemp.max.formatted": "87.2", "day.outTemp.mintime": "07/11/2020 06:15:54 AM", "day.outTemp.min.formatted": "53.2", "day.heatindex.maxtime": "07/11/2020 02:01:02 PM", "day.heatindex.max.formatted": "87.2", "day.windchill.mintime": "07/11/2020 06:15:54 AM", "day.windchill.min.formatted": "53.2", "day.dewpoint.maxtime": "07/11/2020 07:59:56 AM", "day.dewpoint.max.formatted": "61.4", "day.dewpoint.mintime": "07/11/2020 06:15:54 AM", "day.dewpoint.min.formatted": "51.8", "day.outHumidity.maxtime": "07/11/2020 07:06:56 AM", "day.outHumidity.max.formatted": "96", "day.outHumidity.mintime": "07/11/2020 02:03:02 PM", "day.outHumidity.min.formatted": "34", "day.barometer.maxtime": "07/11/2020 10:36:58 AM", "day.barometer.max.formatted": "30.025", "day.barometer.minttime": "day.barometer.minttime", "day.barometer.min.formatted": "29.945", "day.rain.sum.formatted": "0.00", "day.rainRate.maxtime": "07/11/2020 12:00:02 AM", "day.rainRate.max.formatted": "0.00", "day.wind.avg.formatted": "2.0", "day.wind.rms.formatted": "2.6", "day.wind.vecavg.formatted": "1.8", "day.wind.vecdir.formatted": "357", "current.consBatteryVoltage": "5.3 V", "current.supplyVoltage": "6.6 V"}
current and day are pretty much all there.  You can’t use .format(xxx); but you can use .formatted (which is the same as .format(add_label=False).
unit.label.<obs> works.
Trend only has barometer and it’s for a hard coded (at present) 3-hour barometer trend:
trend.barometer
Also, trend.barometer.desc is a made up, not currently localized, way of getting steady, falling slowly, etc.  I’ve got to figure something out for that.
Lastly, there’s also a 15m period just for windGust.
15m.windGust.max
15m.windGust.maxtime

Cheers,
John

.

John Kline

unread,
Jul 12, 2020, 9:48:48 AM7/12/20
to Michael, weewx-development
Hi Michael,

Would you give 2.0.b3 a try and let me know how it goes?

If it doesn’t work, I’ll run with the simulator (and no barometer/pressure) before I push another version.

Cheers,
John

On Jul 12, 2020, at 3:39 AM, Michael <wee...@gmx.de> wrote:


--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

John Kline

unread,
Jul 12, 2020, 3:15:11 PM7/12/20
to Michael, weewx-development
Hi Michael,

I just pushed new versions of LoopData and WeatherBoard on the development branches.

I’ve now tested LoopData with a simulator without barometer and pressure readings.

I’ve also updated the WeatherBoard JavaScript to be resistant to missing observations.

If you try these, please let me know how it goes.

Cheers,
John

On Jul 12, 2020, at 6:48 AM, John Kline <jo...@johnkline.com> wrote:



Michael

unread,
Jul 13, 2020, 7:57:17 AM7/13/20
to weewx-development
Hi, John,

I made the updates. There are no more error messages now and the file loop-data.txt is permanently re-created.
But there was a problem with the paths.
When I use some of the defaults:

[LoopData]
    [[FileSpec]]
        loop_data_dir = /home/weewx/loop-data
       
and:

  [[WeatherBoardReport]]
        # HTML_ROOT = public_html/weatherboard
        HTML_ROOT = /var/www/html/weatherboard
        skin = WeatherBoard
        [[[Extras]]]
            title = my-weather-website.com WeatherBoard&trade;
            subtitle = Updated continuously
            logo = ""
            loop_data_file = ../loop-data.txt


with this configuration loop-data.txt not found.
Change to:
    [[FileSpec]]
        loop_data_dir = /var/www/html
        filename = loop-data.txt

all is fine.
the page updates itself automatically every few seconds.
Thanks for your help and patience

Kind Regards
Michael


Am Sonntag, 12. Juli 2020 21:15:11 UTC+2 schrieb John Kline:
Hi Michael,

John Kline

unread,
Jul 13, 2020, 9:25:54 AM7/13/20
to Michael, weewx-development
Hi Michael,

Thank you for trying it out!  I thank you for your help and patience.

I’ll need to fix the default paths.

Cheers,
John

On Jul 13, 2020, at 4:57 AM, Michael <wee...@gmx.de> wrote:


--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages