I haven't died, just busy with work.
Robert, my driver does not read JSON, it's only simple key-value pairs in a
string. So for example, it doesn't know to strip the quotes off the key or
the value here:
"altimeter": "30.4916869968"
It wants
altimeter: 30.4916869968
I am planning on adopting WYSIWYG (Frederic's) approach of a separate MQTT
topic for each value.
On Saturday, 25 March 2017 11:37:35 UTC-3, Robert Mantel wrote:
>
> So I tried changing the topic to weather/loop because that appears to have
> the full json tuple format with the paired label:values that the wxMesh
> driver needs but I get this error:
>
> Mar 25 15:35:47 ubuntu-freenas weewx[5297]: engine: RealTimeGaugeData will
> generate gauge-data.txt. min_interval is 120 seconds
> Mar 25 15:35:47 ubuntu-freenas weewx[5297]: engine: Finished loading
> service user.rtgd.RealtimeGaugeData
> Mar 25 15:35:47 ubuntu-freenas weewx[5297]: engine: Starting up weewx
> version 3.7.1
> Mar 25 15:35:47 ubuntu-freenas weewx[5297]: engine: Station does not
> support reading the time
> Mar 25 15:35:47 ubuntu-freenas weewx[5297]: engine: Starting main packet
> loop.
> Mar 25 15:35:47 ubuntu-freenas weewx[5297]: wxMesh: Working on payload :
> Empty
> Mar 25 15:35:47 ubuntu-freenas weewx[5297]: wxMesh: Sleeping for 5
> Mar 25 15:35:47 ubuntu-freenas weewx[5297]: manager: Daily summary version
> is 2.0
> Mar 25 15:35:47 ubuntu-freenas weewx[5297]: manager: Daily summary version
> is 2.0
> Mar 25 15:35:47 ubuntu-freenas weewx[5297]: rtgdthread: Zambretti is
> installed: False
> Mar 25 15:35:52 ubuntu-freenas weewx[5297]: wxMesh: Working on payload :
> Empty
> Mar 25 15:35:52 ubuntu-freenas weewx[5297]: wxMesh: Sleeping for 5
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: Got message {"soc":
> "68.8047", "altimeter": "30.4916869968", "outHumidity": "63.0", "dayRain":
> "0.0", "rainin": "0.0", "voltage": "3.9688", "dailyrainin": "0.132",
> "windspeedmph": "4.4383", "kilopascals": "100.941", "heatindex": "29.534",
> "rainmm": "0.0", "windspeedmps": "1.9841", "hpa": "1009.4", "hourRain":
> "0.0", "windGustDir": "90.0", "tempc": "-1.37", "barometer":
> "30.5439450745", "windchill": "29.534", "dewpoint": "18.4883", "windrun":
> "32.3367", "windspdmps_avg2m": "1.3076", "windspeedkmph": "7.1427",
> "humidex": "29.534", "winddir": "90.0", "pressure": "29.8079", "rain":
> "0.0", "rainRate": "0.0", "dewptc": "-7.5065", "usUnits": "1.0", "altm":
> "33.1085", "appTemp": "22.7487311772", "altf": "108.6236", "interval":
> "2.0", "dateTime": "1490455920.0", "windDir": "53.0", "outTemp": "29.534",
> "windSpeed": "2.9333", "rain24": "0.363", "windGust": "11.8354", "rssi":
> "-71.0", "cloudbase": "3141.49934286"}
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: Working on payload :
> {"soc": "68.8047", "altimeter": "30.4916869968", "outHumidity": "63.0",
> "dayRain": "0.0", "rainin": "0.0", "voltage": "3.9688", "dailyrainin":
> "0.132", "windspeedmph": "4.4383", "kilopascals": "100.941", "heatindex":
> "29.534", "rainmm": "0.0", "windspeedmps": "1.9841", "hpa": "1009.4",
> "hourRain": "0.0", "windGustDir": "90.0", "tempc": "-1.37", "barometer":
> "30.5439450745", "windchill": "29.534", "dewpoint": "18.4883", "windrun":
> "32.3367", "windspdmps_avg2m": "1.3076", "windspeedkmph": "7.1427",
> "humidex": "29.534", "winddir": "90.0", "pressure": "29.8079", "rain":
> "0.0", "rainRate": "0.0", "dewptc": "-7.5065", "usUnits": "1.0", "altm":
> "33.1085", "appTemp": "22.7487311772", "altf": "108.6236", "interval":
> "2.0", "dateTime": "1490455920.0", "windDir": "53.0", "outTemp": "29.534",
> "windSpeed": "2.9333", "rain24": "0.363", "windGust": "11.8354", "rssi":
> "-71.0", "cloudbase": "3141.49934286"}
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: {"soc" value:
> "68.8047"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "altimeter"
> value: "30.4916869968"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "outHumidity"
> value: "63.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "dayRain" value:
> "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "rainin" value:
> "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "voltage" value:
> "3.9688"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "dailyrainin"
> value: "0.132"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "windspeedmph"
> value: "4.4383"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "kilopascals"
> value: "100.941"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "heatindex"
> value: "29.534"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "rainmm" value:
> "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "windspeedmps"
> value: "1.9841"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "hpa" value:
> "1009.4"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "hourRain"
> value: "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "windGustDir"
> value: "90.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "tempc" value:
> "-1.37"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "barometer"
> value: "30.5439450745"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "windchill"
> value: "29.534"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "dewpoint"
> value: "18.4883"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "windrun" value:
> "32.3367"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key:
> "windspdmps_avg2m" value: "1.3076"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "windspeedkmph"
> value: "7.1427"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "humidex" value:
> "29.534"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "winddir" value:
> "90.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "pressure"
> value: "29.8079"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "rain" value:
> "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "rainRate"
> value: "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "dewptc" value:
> "-7.5065"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "usUnits" value:
> "1.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "altm" value:
> "33.1085"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "appTemp" value:
> "22.7487311772"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "altf" value:
> "108.6236"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "interval"
> value: "2.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "dateTime"
> value: "1490455920.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "windDir" value:
> "53.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "outTemp" value:
> "29.534"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "windSpeed"
> value: "2.9333"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "rain24" value:
> "0.363"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "windGust"
> value: "11.8354"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "rssi" value:
> "-71.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: key: "cloudbase"
> value: "3141.49934286"}
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "windrun"': could not convert string to float: "32.3367"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "windGust"': could not convert string to float: "11.8354"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "windchill"': could not convert string to float: "29.534"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "rainmm"': could not convert string to float: "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "voltage"': could not convert string to float: "3.9688"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "altm"': could not convert string to float: "33.1085"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "windspdmps_avg2m"': could not convert string to float: "1.3076"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "altimeter"': could not convert string to float: "30.4916869968"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "barometer"': could not convert string to float: "30.5439450745"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "pressure"': could not convert string to float: "29.8079"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "windspeedmps"': could not convert string to float: "1.9841"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "rainRate"': could not convert string to float: "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "windspeedkmph"': could not convert string to float: "7.1427"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "windspeedmph"': could not convert string to float: "4.4383"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "altf"': could not convert string to float: "108.6236"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "dewpoint"': could not convert string to float: "18.4883"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "windGustDir"': could not convert string to float: "90.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "windSpeed"': could not convert string to float: "2.9333"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "outTemp"': could not convert string to float: "29.534"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "dateTime"': could not convert string to float: "1490455920.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "outHumidity"': could not convert string to float: "63.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "dewptc"': could not convert string to float: "-7.5065"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "hpa"': could not convert string to float: "1009.4"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "interval"': could not convert string to float: "2.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "winddir"': could not convert string to float: "90.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "kilopascals"': could not convert string to float: "100.941"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "rain24"': could not convert string to float: "0.363"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "heatindex"': could not convert string to float: "29.534"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "appTemp"': could not convert string to float: "22.7487311772"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "usUnits"': could not convert string to float: "1.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "rssi"': could not convert string to float: "-71.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "tempc"': could not convert string to float: "-1.37"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "dayRain"': could not convert string to float: "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "dailyrainin"': could not convert string to float: "0.132"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "humidex"': could not convert string to float: "29.534"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "windDir"': could not convert string to float: "53.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "cloudbase"': could not convert string to float: "3141.49934286"}
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "hourRain"': could not convert string to float: "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> '{"soc"': could not convert string to float: "68.8047"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "rainin"': could not convert string to float: "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: wxMesh: cannot read value for
> ' "rain"': could not convert string to float: "0.0"
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: engine: Main loop exiting.
> Shutting engine down.
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: rtgd: Shut down Thread-1
> thread.
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: engine: Caught unrecoverable
> exception in engine:
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** 'dateTime'
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** Traceback (most
> recent call last):
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** File
> "/usr/share/weewx/weewx/engine.py", line 871, in main
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** engine.run()
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** File
> "/usr/share/weewx/weewx/engine.py", line 190, in run
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: ****
> self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet))
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** File
> "/usr/share/weewx/weewx/engine.py", line 223, in dispatchEvent
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** callback(event)
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** File
> "/usr/share/weewx/weewx/wxservices.py", line 45, in new_loop_packet
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: ****
> self.calc.do_calculations(event.packet, 'loop')
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** File
> "/usr/share/weewx/weewx/wxservices.py", line 189, in do_calculations
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** getattr(self,
> 'calc_' + obs)(data_us, data_type)
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** File
> "/usr/share/weewx/weewx/wxservices.py", line 306, in calc_maxSolarRad
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: ****
> data['dateTime'], self.atc)
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** KeyError: 'dateTime'
> Mar 25 15:35:57 ubuntu-freenas weewx[5297]: **** Exiting.
>
> Seems like it gets part way reading the payload, but then dies on trying
> to convert the values? Not sure Bill, is what I'm trying to do here
> possible?
>
> On Friday, 24 March 2017 20:23:37 UTC-4, mwall wrote:
>>
>>
>>
>> On Friday, March 24, 2017 at 8:13:57 PM UTC-4, Robert Mantel wrote:
>>>
>>> Bill, I have a question about the format of the MQTT message. I have my
>>> raspberry pi running weewx, I also have that unit using mathew's mqtt
>>> publisher to push data to my mosquitto server. I set up another virtual
>>> machine running weewx with your driver, but for the life of me cannot get
>>> your driver to pick up the info from it. It keeps saying the payload is
>>> empty, but I have mqtt dashboard running on my android phone that I tested
>>> with and get updates just fine. My goal is to actually migrate from my
>>> fileparse setup on my PI to an mqtt based server on the freenas box.
>>> Presumably Mathiew's mqtt implimentation will use the standard weewx
>>> labels so I would assume I wouldn't even need a label map for the wxMesh
>>> driver. Unless I'm way off on that.
>>>
>>
>> the weewx-mqtt uploader publishes to the topic specified in [[MQTT]],
>> which is 'weather' by default.
>>
>> so if you subscribe to /weather/+ you should see everything
>>
>> other mqtt uploader options:
>>
>> [StdRESTful]
>> [[MQTT]]
>> topic = weather
>> append_units_label = True # should the units name be appended to
>> the observation name?
>> retain = False
>> aggregation = individual, aggregate # upload each observation
>> individually, and/or all in a single message
>> unit_system = None # convert to the indicated unit system 'US',
>> 'METRIC', or 'METRICWX'
>> binding = archive # how often to emit data, either 'loop' or
>> 'archive'
>>
>> you can also specify units and formatting for each observation, if
>> necessary.
>>
>> m
>>
>