I've attached a syslog extract showing where weewx crashed. it seems that
"volt" is an invalid unit for my topic. i don't know why but for now I
commented out that topic and its parameters. Now, weewx will continue
running when subscribe is enabled, but subscribed topics are not being
posted to the database. Here is the first topic in weewx.conf:
# The first topic
# MQTT Topic
[[[snow/snowDepth]]]
# MQTT name
[[[[snowDepth]]]]
# weewx name
name = snowDepth
ignore = false
contains_total = false
conversion_type = float
units = inch
I used a terminal to publish "6" to snow/snowDepth on Mosquitto. Another
terminal window command to subscribe to snow/snowDepth received the "6" but
the database entries for snowDepth are null. Is this configuration of
topics still not correct. Thanks.
On Tuesday, October 6, 2020 at 1:43:31 PM UTC-6 Timothy Buchanan wrote:
> Thanks, Rich. I'll try it when I get back. I'll be in our second home for
> a few days: going to the gun range and the clothing-optional resort (not at
> the same time!).
>
> On Tuesday, October 6, 2020 at 1:19:26 PM UTC-6 [email protected] wrote:
>
>> So, the [[[first/topic]]] are meant to be replaced with the actual topic.
>> So it would be something like this
>> ```
>> [[Topics]]
>> [[[topic name that snowDepth is published on]]]
>> [[[[topic name that snowDepth is published on]]]]
>> name = snowDepth
>> [[[topic name that snowRate is published on]]]
>> [[[[topic name that snowRate is published on]]]]
>> name = snowRate
>> ```
>> The duplication is an artifact of dealing with json and keyword payloads.
>> The ```use_topic_as_fieldname``` option can be used to make the config a
>> bit prettier.
>> ```
>> [[Topics]]
>> use_topic_as_fieldname = true
>> [[[topic name that snowDepth is published on]]]
>> name = snowDepth
>> [[[topic name that snowRate is published on]]]
>> name = snowRate
>> ```
>> Note, if snowDepth is actually published on the topic snowDepth, the
>> ```name``` option can be left off.
>> I don’t think that you want to set contains_total=true for snowDepth.
>> This is used when the field contains a total and it needs to be converted
>> into an increment for WeeWX.
>>
>> I’ll work on clarifying the wiki.
>>
>> With that said, it shouldn’t have broken WeeWX. If you are up for it,
>> before changing the config, setting debug=1, restarting WeeWX for a couple
>> of archive intervals and attaching the log would be appreciated .
>>
>> rich
>>
>>
>>
>> On Tuesday, 6 October 2020 at 13:28:34 UTC-4 [email protected] wrote:
>>
>>> Attached is the extension material that I put into weewx.conf. But when
>>> I set enable = true, weewx stops archiving data. Is there an error in this
>>> configuration, or could subscribe be incompatible with another service? I'm
>>> using the Weatherflowudp driver with mqtt and GW1000 extensions.
>>>
>>> On Tuesday, October 6, 2020 at 9:17:07 AM UTC-6 Timothy Buchanan wrote:
>>>
>>>> Thanks, Rich, I should be able to edit weewx.conf based on the example
>>>> at the bottom of that page.
>>>>
>>>> I am using an ESP8266 board with an ultrasonic sensor and a temperature
>>>> sensor (to calibrate the speed of sound), and programming in the Arduino
>>>> IDE. I'll 3D print a case and mount it above my deck. The materials cost
>>>> about $15.
>>>>
>>>> I'd be happy to post the code here, under a new topic, once I get it
>>>> working.
>>>>
>>>> Timothy
>>>>
>>>> On Tuesday, October 6, 2020 at 8:53:45 AM UTC-6 [email protected]
>>>> wrote:
>>>>
>>>>> What type of sensor are you using for measuring snow depth?
>>>>>
>>>>>
>>>>>
--
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/886843b0-1a11-4fdc-8dd9-6b1d8cee9f12n%40googlegroups.com.
Oct 9 09:47:33 raspberrypi weewx[31856] INFO user.MQTTSubscribe: (Service)
Version is 1.6.1
Oct 9 09:47:33 raspberrypi weewx[31856] INFO user.MQTTSubscribe: (Service) Log
level: 0
Oct 9 09:47:33 raspberrypi weewx[31856] INFO user.MQTTSubscribe: (Service) Log
debug setting: 0
Oct 9 09:47:33 raspberrypi weewx[31856] INFO user.MQTTSubscribe: (Service) Log
console: None
Oct 9 09:47:33 raspberrypi weewx[31856] INFO user.MQTTSubscribe: (Service) Log
file: None
Oct 9 09:47:33 raspberrypi weewx[31856] INFO user.MQTTSubscribe: (Service)
overlap is 0.0
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: Caught
unrecoverable exception:
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** For
{'name': 'snowBatteryStatus', 'use_topic_as_field_name': False, 'ignore':
False, 'contains_total': False, 'conversion_type': 'float'} invalid units, volt
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** Traceback
(most recent call last):
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** File
"/usr/share/weewx/weewxd", line 148, in main
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: ****
engine = weewx.engine.StdEngine(config_dict)
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** File
"/usr/share/weewx/weewx/engine.py", line 75, in __init__
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: ****
self.loadServices(config_dict)
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** File
"/usr/share/weewx/weewx/engine.py", line 138, in loadServices
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** obj =
weeutil.weeutil.get_object(svc)(self,config_dict)
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** File
"/usr/share/weewx/user/MQTTSubscribe.py", line 1413, in __init__
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: ****
self.subscriber = MQTTSubscribe(service_dict, self.logger)
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** File
"/usr/share/weewx/user/MQTTSubscribe.py", line 1257, in __init__
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: ****
self.manager = TopicManager(topics_dict, self.logger)
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** File
"/usr/share/weewx/user/MQTTSubscribe.py", line 644, in __init__
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: ****
self.subscribed_topics[topic]['fields'][field] =
self._configure_field(topic_dict, topic_dict[field], topic, field, defaults)
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** File
"/usr/share/weewx/user/MQTTSubscribe.py", line 689, in _configure_field
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** raise
ValueError("For %s invalid units, %s" % (field, field_dict['units']))
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: ****
ValueError: For {'name': 'snowBatteryStatus', 'use_topic_as_field_name': False,
'ignore': False, 'contains_total': False, 'conversion_type': 'float'} invalid
units, volt
Oct 9 09:47:34 raspberrypi weewx[31856] CRITICAL __main__: **** Exiting.