Which driver should i target for my custom weather station?

188 views
Skip to first unread message

Pavocracy

unread,
Feb 5, 2024, 2:03:29 AM2/5/24
to weewx-user
Hello all,

I am working on a hobby project where i am trying to build my own "weather station" from an esp8266 and a bunch of sensors. I am very keen on using weewx to display the post the data, and so i am looking at the supported drivers and wondering if there is an obvious answer to which driver i should be targeting for my weather station output.

Is there an obvious choice for which driver supports the most data, or perhaps is the easiest data to read or is there a driver that is the most robust? (particularly for serial connections)

any thoughts or experience on the matter would be greatly appreciated :)

p q

unread,
Feb 5, 2024, 8:45:25 AM2/5/24
to weewx...@googlegroups.com
If I was going to do this, I would look into mqtt options. 

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/831bd64d-0271-459c-9b52-929817b02319n%40googlegroups.com.

Pavocracy

unread,
Feb 6, 2024, 5:07:05 AM2/6/24
to weewx-user
I'm not sure if im misunderstanding what you are saying, or if i am not doing a good job at explaining my question, but even if i choose mqtt as my location to push the data, the data still needs to be in some specific format for weewx to understand it no?

So on the esp8266, that has a bunch of sensors attached to it, in my embedded code i need to collect the data point for the sensor, and then put it in some specific format to send along somewhere that weewx will read. Reading through the source code it looked like the drivers are where these message formats are interrupted, but i could be wrong?

michael.k...@gmx.at

unread,
Feb 6, 2024, 5:50:57 AM2/6/24
to weewx-user
A few thoughts:

Building the "station" on a ESP8266 doesn't sound like you are planning to get too far with your project. Compared to it's successor, it is very limited and has some really weird flaws.
Why would you connect the station with a serial interface, when it has WIFI on board?
p q's MQTT suggestion is a not a bad one. Let your station emit every single sensor reading as a MQTT message, and let weewx receive it with MQTT Subscribe
Either MQTT Subscribe as a service, augmenting any off-the-shelf station supported by weewx with your sensors data, or use it as a driver. Encapsulating sensor data in JSON for the MQTT payload is commonly done and supported by MQTT Subscribe.

p q

unread,
Feb 6, 2024, 8:28:05 AM2/6/24
to weewx...@googlegroups.com
Yeah. I'm assuming you will be running Weewx on some computer other than the ESP and have a network connection between the ESP and the computer. I would use MQTT to publish the sensor data to a MQTT broker running somewhere on your network, likely Mosquitto running on the same machine as Weewx. Weewx would subscribe to the sensor data and go from there. I am not up on the Weewx MQTT driver, but I would look into using it. I personally use the Accurite driver as my original system is an Accurite. Over time as I've added new sensors or replaced crummy ones, I've started to use MQTT as my preferred method of sending data from microcontrollers to Weewx with various hacks on the Accurite driver.



--
Peter Quinn
(415)794-2264

Pavocracy

unread,
Feb 12, 2024, 1:58:33 AM2/12/24
to weewx-user
So just to clarify, can weewx pull weather data from mqtt? I dont see a driver for that. I can see there is community projects for enable both subscribing to mqtt and also to publish to mqtt for data it already has in its own database, but i cant find any documentation or examples of this kind of picture:

weather data collected by esp8266 ---> publish to mqtt (still isn't clear what kind of message structure i would need to follow for weewx to understand this) --> weewx subscribes to the mqtt messages and so can see them and puts it into its own database

If thats only possible through third party extensions, this leads me back to instead wanting to just "emulate" a specific drivers data format to be able to use the built in driver support instead. Because what i really want is to really only have 2 pieces of the puzzle here. My esp8266 with sensors attached, and in micropython i collect data points and put them into a data structure directly understood by weewx, which then sends those messages to a weewx instance running on a machine. But to do this, obviously i need to understand the exact data structure of a given weewx driver, which is the part i was asking about and can't easily find documented anywhere, i was basically looking at the driver code and trying to see how it maps packet data to weather data.
Message has been deleted

michael.k...@gmx.at

unread,
Feb 12, 2024, 5:30:36 AM2/12/24
to weewx-user
> So just to clarify, can weewx pull weather data from mqtt? 
Yes

> I dont see a driver for that.
MQTTSubscribe can be run as a driver, as already mentioned above:
"Either MQTT Subscribe as a service, augmenting any off-the-shelf station supported by weewx with your sensors data, or use it as a driver."
I even posted the link.

> but i cant find any documentation or examples of this kind of picture
It's behind the link above

> If thats only possible through third party extensions
If you don't want to use such extension, why would you use WeeWX in the first place?

> weather data collected by esp8266 ---> publish to mqtt (still isn't clear what kind of message structure i would need to follow for weewx to understand this)
It's described in behind the link above:
WeeWX-MQTTSubscribe

A Weewx service and driver that receives data from multiple MQTT topics.

Currently MQTT payloads of json, keyword (field1=value, field2=value..), and individual (each topic contains a single observation) are supported.


tl;dr; Click this link, all your questions are answered there.

Pavocracy

unread,
Feb 12, 2024, 5:41:06 AM2/12/24
to weewx-user
Yeah sorry, the link you posted is what i was referring to when i said i could only see third party options. My wording was very correct, but when i was saying i cant see a "driver" i was really meaning i can't see a standard driver in the code base for mqtt.

But yes, i can see you already have me the answer here, and its the third party option, and there is no way to use mqtt natively with weewx. and as you point out, its a fair argument to say thats kind of weewx's idea, as its suppose to be a module and extendable platform and so completely writing off the possibly of using third party extensions to solve my problem does seem silly in retrospect. Sorry if such a viewpoint lead you to be frustrated while trying to help me though that viewpoint too.

I really do appreciate taking the time to respond and share a github project of a solution to the problem i was trying to solve.  I will build out my micropython code to send messages via mqtt and give it a go :) I can still attempt to emulate one of the built in drivers later too and it would likely be easier once i already have data that is being collected and formatted into messages anyway.

Pavocracy

unread,
Feb 12, 2024, 5:41:54 AM2/12/24
to weewx-user
bah you can't edit messages. correction: "my wording was very INCORRECT".

michael.k...@gmx.at

unread,
Feb 12, 2024, 6:35:38 AM2/12/24
to weewx-user
No problem here :) Ask once, and if you don't get the point, ask a second time. It isn't all that easy to understand.
Reply all
Reply to author
Forward
0 new messages