Ralph/Bill Good job you pinged me privately as I was not subscribed to this thread for some reason.....anyway....
My MQTT fork has been running as a service along with OWFS driver for about 6 months with no big issues. Most of my problems are due to my One-wire system hanging. I have a separate piece of code polling a yoctopuce <https://www.yoctopuce.com/EN/products/usb-electrical-sensors/yocto-millivolt-rx>USB analogue to digital converter connected to my apogee SP-110 <https://www.apogeeinstruments.com/sp-110-ss-self-powered-pyranometer/> pyranometer, this posts to mosquito. My mqtt service pulls in this data from mosquito The rest of my system is one-wire running as a driver I have not dabbled with my MQTT code since I shoe stringed it together so what I have is dirty and not really something I'd want to brag about, it still needs work to be robust and kind to failures/exceptions. The code is on github, the commit comment is "Messy but functional. No exception catches" https://github.com/nellyt/ESP8266-MQTT-WEEWX/commit/26127c5da24fd814b5871640e2c896a395fee0a0 This was I recall a fork of bonjour81's fork of Bill's. I recall I was using this because of the way i structured my MQTT data I think if you look at some of the standard include drivers/services from Mwalll/Tom you will see that they support both driver or service. By looking at a simple one of these you can understand how to convert your code to a service....I think I based mine on the deltas between service/driver in Mwalls OWFS plugin. There may well be more elegant coding ways of achieving this now...i was running code from at least a year ago when i did this. Also relevant is a read of http://www.weewx.com/docs/customizing.htm#service_engine and http://www.weewx.com/docs/customizing.htm#Adding_2nd_source I would suggest looking at what I did and then incorporating similar changes in your code (Bill), certainly dont fork mine as I think you are multiple bug fixes ahead of me! I will keep track of thread but afraid I have little time available at present. :( Neil On Thursday, 12 April 2018 06:14:28 UTC+12, Bill Morrow wrote: > > On Monday, 21 August 2017 08:25:59 UTC-3, Neil Trimboy wrote: >> >> Correct.... The standard OWFS running as a driver for my main inputs and >> my modified version of yours that now runs as a service to obtain >> additional data from some other sensors > > > Neil, is your re-implementation as a service available anywhere? It seems > like the preferred way to go. Most people have a driver to commercial > weather instrument, and want to augment it with the odd datum from some > other sensor. So it the MQTT subscriber driver (wxMesh is not a good name > anymore) turns in to a service, that becomes possible. > >
