jim-easterbrook / pywws

Python software for USB Wireless WeatherStations
https://pywws.readthedocs.io/
GNU General Public License v2.0
204 stars 62 forks source link

MQTT Template in weather.ini being ignored #69

Closed GeekyTim closed 5 years ago

GeekyTim commented 6 years ago

I have updated the MQTT template in weathwer.ini, and restarted pywws, but it is still sending out the old default template defined in mqtt.py. For example, I don't have the temp_out_f, but it is still being received on the broker and subscribers.

jim-easterbrook commented 6 years ago

Is this after upgrading to commit 4ca8d5b or later? Earlier versions were ignoring template manipulation done after initialising the base class. Running at very high verbosity (run the class directly with 'python -m pywws.service.mqtt -vvvv data_dir') should print out the template.

GeekyTim commented 6 years ago

I'll upgrade again :-)

jim-easterbrook commented 6 years ago

If you haven't already done so, read this before running pywws after upgrading. https://groups.google.com/d/msg/pywws/5p6tP8Z9r0s/dLaisMGZAgAJ

GeekyTim commented 6 years ago

The update worked! Thanks.

jim-easterbrook commented 6 years ago

Thanks for volunteering to test all this for me. (-:

GeekyTim commented 6 years ago

No problem :-)

GeekyTim commented 6 years ago

Further to this one, I think that the multi_topic and retain are being ignored. When I'm monitoring the weather station over mqtt I am seeing both the multi-topic and single message values, and also the messages are being retained.

jim-easterbrook commented 6 years ago

Just for completeness, what values have you got in weather.ini for those two settings?

GeekyTim commented 6 years ago

multi-topic = True retain = False

jim-easterbrook commented 6 years ago

No quotation marks or anything?

GeekyTim commented 6 years ago

No. Does it need them?

jim-easterbrook commented 6 years ago

No. But if they were there it would explain your problem.

jim-easterbrook commented 6 years ago

As you have multi_topic = True I would expect you to see multi-topic messages when you monitor it. It doesn't stop the usual single topic message.

The retain value is passed to the mosquitto.Client session, so if it's being ignored that sounds like a bug in paho.mqtt.client.

GeekyTim commented 6 years ago

Ah! Misunderstood the multi-topic config. That's working fine then :-)

retain does seem to be being ignored. I'll look further.