Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code
I opened an issue for this feature. It is here https://github.com/bellrichm/WeeWX-MQTTSubscribe/issues/15 It should be the next feature I work on. But I do need to do some additional code cleanup around bad data, edge cases, etc. Rich On Friday, 26 April 2019 02:42:27 UTC-4, Eugen66 wrote: > > Thank you again, that did it :) > Yes, that's what I meant, because I have different sensors and they do not > publish to Weather/, for instance I have a barometer that publish > to SPA/Barometer_SPA, this one I can change but it is used for something > else so I'd rather not. But I think this service is great to add different > sensor and have the flexibility to subscribe to different topics. > I actually would like to use the SDR-RTL to publish everything to MQTT > and let Weewx subscribe to that, along with other home automation. > best regards > Atle > > fredag 26. april 2019 01.42.54 UTC+2 skrev Rich Bell følgende: >> >> It’s software, so almost anything is possible :) >> Is the use case that the same “field name” might be in different topics? >> Something like this, topic indoor/temp maps to inTemp and outdoor/temp maps >> to outTemp. If so, I’d probably add an option to concatenate the topic >> into the field name and use the current mapping functionality. This would >> mean that all input would need a mapping, because all “field names” would >> be prepended with the higher/parent topic. >> But, with that said, my focus is on adding tests to the test suite before >> adding more functionality. >> - rich >> >> On Thu, Apr 25, 2019 at 4:42 PM Eugen66 wrote: >> >>> I was missing ' at the unit selection... >>> >>> Thank you so much :) >>> I was wondering, is it possible for instance to have a "mapping" in the >>> conf file to map values to specific and different topics, inTemp = >>> sensor/inTemp , outTemp= Weather/outTemp as an example? >>> >>> best regards >>> Atle >>> >>> >>> torsdag 25. april 2019 21.45.54 UTC+2 skrev bell...@gmail.com følgende: >>>> >>>> I was just going to ask about the password. After the problem with >>>> keepalive, I was afraid this bug would show up. My guess is that I need to >>>> convert the payload to float. If you want to try patching it, around line >>>> 208 change from >>>> >>>> data[self.label_map.get(key,key)] = msg.payload >>>> >>>> to >>>> >>>> data[self.label_map.get(key,key)] = to_float(msg.payload) >>>> >>>> >>>> Right now I don’t have a great environment for the “individual” >>>> payload type, so it will take a bit to really dig in on this. >>>> >>>> Thanks for your help. Rich >>>> >>>> On Thu, Apr 25, 2019 at 3:30 PM Eugen66 wrote: >>>> >>>>> Sorrry :( My bad...Found the mqtt disconnected with result code 5... >>>>> Wrong passwd i conf. >>>>> So now it connect and find the data, but Weewx exit's with this: >>>>> >>>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing >>>>> interval: 1556220434.00 1556220467.00 >>>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Queue size is: 6 >>>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Processing: >>>>> dateTime: 1556220439.64, extraTemp2: 13.5, usUnits: 1 >>>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: engine: Main loop exiting. >>>>> Shutting engine down. >>>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: restx: Shut down MQTT >>>>> thread. >>>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: MQTTSS: Disconnected with >>>>> result code 0 >>>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: shutdown >>>>> process rtl_433 -M utc -F json -G >>>>> Apr 25 21:27:51 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting >>>>> for stdout-thread >>>>> Apr 25 21:27:52 weewx-hyggebu weewx[30607]: sdr: MainThread: waiting >>>>> for stderr-thread >>>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: timed out >>>>> waiting for stderr-thread >>>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close >>>>> stdout >>>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: sdr: MainThread: close >>>>> stderr >>>>> Apr 25 21:28:02 weewx-hyggebu weewx[30607]: eng
Re: [weewx-user] Re: MQTT client service - proof of concept/alpha code
I saw some drivers, but did not find any services that processed MQTT. So, this was developed as a service to augment data from a weather station. I also had my own driver that shared much of the code, so it just made sense to merge the two. When running as a driver the one difference is that a specific topic can be treated as archive records. I use this to publish loop and archive data from my “production” install and get the exact loop and archive data on other machines, like development, dedicated reporting, etc. Rich -- 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 weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[weewx-user] MQTT client service - proof of concept/alpha code
After experimenting and developing more, I decided this needs it own repository. You can now find it here, https://github.com/bellrichm/WeeWX-MQTTSubscribe The service now supports binding to either new loop packets or new archive records. Since much of the code was similar to my MQTT driver, this has been added to the module. It is still a manual install process, but some documentation has been added. -rich -- 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 weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[weewx-user] Re: MQTT client service - proof of concept/alpha code
Thanks. Since that is a driver, it gets to generate loop packets and then the StdArchive service can software create the archive record. My goal is to write a service that can add “archive data” to an existing WeeWX install/station/driver. So, I need to manage the incoming data and add it to an existing archive record. I’ve got something up and running. Still very rough around the edges. The more I delve into the details of WeeWX, the more I am impressed with the work Tom and company have done. If only more software was so well architected. - Rich -- 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 weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[weewx-user] MQTT client service - proof of concept/alpha code
To further my WeeWX/MQTT/Python knowledge, I have written a WeeWX multi-threaded service. One thread receives the MQTT messages and puts them on a queue. In the other thread, when a NEW_ARCHIVE_RECORD event is received, it process the queue and updates the archive record with the data. Currently, processing of the queue means - take the last element and use its data to update the archive record. My next big education will be to develop some type of accumulation of these (essentially software generation). Also, the MQTT payload is expected to be json. I am hoping that other formats can easily be supported by creating a subclass and overriding the function that maps the MQTT payload to a WeeWX like dictionary. Being a proof of concept, documentation is lacking, error handling is minimal, limited functionality, no install support, etc. But, I thought even in this form it might be useful/educational. If interested, it can be found here, https://github.com/bellrichm/weewx-addons/blob/master/user/MQTTSubscribeService.py - Rich -- 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 weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [weewx-user] Re: Raspian Stretch and timesyncd
It does appear that removing fake-hwclock and installing ntp might enough. On a new install, I removed fake-hwclocked, installed ntp, and disabled networking. On reboot the time stayed at the "default". My net, if you are running WeeWX on a computer without an RTC, do your homework... read the logs, test network slowness/failures, etc. Or just spring for a RTC ;) rich On Tuesday, 12 March 2019 22:44:26 UTC-4, vince wrote: > > >> On Tue, Mar 12, 2019 at 1:48 PM vince wrote: >> >>> >>> Yes - systemd will run its own (not so good) time sync function by >>> default. You really don't have to disable it, if you install ntpd systemd >>> detects that and lets ntpd drive things re: time. >>> >>> >>> > On Tuesday, March 12, 2019 at 3:20:15 PM UTC-7, Thomas Keffer wrote: >> >> But, does it still record the time and try to use that on startup? >> >> > I don't know > Certainly no harm in disabling it in systemd to try to make sure, but then > also do the normal disabling of fake-hwclock too I guess. > > Bottom line is we probably want a system with no battery-backed-up clock > to power up cleanly with a time old enough so weewx does its "wait for good > time before starting" thing. That was something like 'wait until the > system clock is newer than the modification date of weewx.conf' or the > like, wasn't it ? > > This stuff'll make you crazy. > > -- 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 weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[weewx-user] Raspian Stretch and timesyncd
It seems that in Raspian Stretch, timesyncd is enabled by default. And, it too attempts to read the date/time from a file when booting. I had removed fake-hwclock, but still had some problems with the date/time on reboot. Looking into syslog I saw the following Mar 11 15:39:47 systemd-timesyncd[342]: System clock time unset or jumped backwards, restoring from recorded timestamp: Mon 2019-03-11 15:39:46 EDT I ended up disabling timesyncd via sudo systemctl disable systemd-timesyncd and installing ntpd via sudo apt-get install ntp On reboot I now see that weewx is "Waiting for sane time.". Hope this helps others who might not have installed an RTC. Rich -- 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 weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.