Sign inSign up

jchonig/tempest_influx

By jchonig

•Updated 5 days ago

Container to receive WeatherFlow Tempest WX UDP broadcasts and forward them to InfluxDB

Image
0

2.8K

jchonig/tempest_influx repository overview

⁠tempest_influx

Go program to convert WeatherFlow Tempest WX UDP broadcasts to influx wire protocol.

The Tempest Weather System⁠ sends UDP broadcasts with weather data and system status periodically. This program receives those broadcasts and generates InfluxDB wire protocol messages to import the data into InfluxDB.

This program will forward selected data to InfluxDB⁠ or a Telegraf⁠ proxy.

Docker host networking is required to receive the UDP broadcasts, unless some type of proxy is used.

⁠Tempest WX Broadcast Formats

The format of the UDP broadcasts are documented here⁠.

The reports of interest are the obs_st message which has full weather data and the rapid_wind has instantaneous Wind data. The later is generated every few seconds and the former once a minute.

⁠Configuration

There are three ways to pass configuration information:

  1. A optional YAML configuration file may be provided in /config/tempest_influx.yml* which is read at startup.
  2. Environement variables as described in the table below. These override configuration file data.
  3. Command line flags, also described in the table below. These override configuration file adata and environment variables.
ValueConfig FileEnvironmentFlagDefault
Read buffer sizebufferTEMPEST_INFLUX_BUFFER--buffer10240
Listen Addresslisten_addressTEMPEST_INFLUX_LISTEN_ADDRESS--listen_address:50222
InfluxDB write URLinflux_urlTEMPEST_INFLUX_INFLUX_URL--influx_urlhttps://localhost:8086/api/v2/write⁠
Influx authentication tokeninflux_tokenTEMPEST_INFLUX_INFLUX_TOKEN--influx_token
Influx bucketinflux_bucketTEMPEST_INFLUX_INFLUX_BUCKET--influx_bucket
Influx bucket for rapid windinflux_bucket_rapid_windTEMPEST_INFLUX_INFLUX_BUCKET_RAPID_WIND--influx_bucket_rapid_wind
Verbose loggingverboseTEMPEST_INFLUX_VERBOSE-v, --verboseFalse (True if Debug set)
Debug loggingdebugTEMPEST_INFLUX_DEBUG-d, --debugFalse
Do not send packetsnoopTEMPEST_INFLUX_NOOP-n, --noopFalse
Send rapid wind reports (every 3s)rapid_windTEMPEST_RAPID_WIND-rapid_windFalse

Notes:

  • influx_token is required by InfluxDB or Telegraf to authenticate requests.
  • influx_bucket is not required if configured on the receiving end.

⁠TODO

  • Hack around firmware_version being and int and string in different packets
  • Optionally send device_status and hub_status data
    • Allow specification of a bucket
    • Structure config?

⁠Examples

⁠docker-compose.yml

Following is a sample docker-compose file to run this container.

version: "3"

services:
  tempest_influx:
	image: "jchonig/tempest_influx:latest"
    network_mode: host
	environment:
	  TEMPEST_INFLUX_INFLUX_URL: "https://metrics.example.com:8086/api/v2/write"
      TEMPEST_INFLUX_INFLUX_TOKEN: "SOMEARBITRARYSTRING"
      TEMPEST_INFLUX_INFLUX_BUCKET: "weather"
    ports:
	  - 50222/udp
⁠Telegraf

The output is designed to be passed to Telegraf for forwarding to InfluxDB via the influxdb_v2_listener, for example:

[[inputs.influxdb_v2_listener]]
  service_address = ":8086"
  tls_cert = "/etc/telegraf/keys/cert.pem"
  tls_key = "/etc/telegraf/keys/key.pem"
  token = "SOMEARBITRARYSTRING"

⁠Credits

Core UDP packet processing code based on code in udpproxy⁠

Tag summary

Content type

Image

Digest

sha256:cd1290ff9…

Size

6.5 MB

Last updated

5 days ago

docker pull jchonig/tempest_influx