Standalone data logger for TFA Klimalogg pro weather station to make latest weather data accessible via API.
Inspired by https://github.com/matthewwall/weewx-klimalogg
- obviously a TFA Klimalogg pro plus usb transceiver dongle
- libusb installed
- go installed (to build project)
- checkout project
- either build executable using
go build
or rungo run main.go
to execute program - to pair console press and hold USB button as described in manual
- execute kl-logger immediately after console switched into paring mode
- once console is paired, one can press USB button again to reconnect if connection got lost
- current weather data is available via http at
http://localhost:8088/weather
(see Endpoints for more)
Usage of kl-logger:
-apiPort int
Port to serve http api requests (default 8088)
-log string
Logfile (default "stdout")
-logLevel string
Log level (e.g. error, info, debug, trace) (default "info")
-usbTrace
Trace usb control messages
URI | Description |
---|---|
GET /weather |
Latest weather information received from paired klimalogg console |
GET /weather/{sensor:[0-8]} |
Latest weather information by sensor id |
GET /config |
Current console configuration |
GET /config/{sensor:[0-8]} |
Current console configuration by sensor id |
GET /debug/transceiver/trace?seconds=5 |
Trace usb transceiver control messages |
GET /debug/pprof |
Profiling endpoints provided by go net/http/pprof |
libusb usually needs superuser permissions to access usb devices on linux. That can be fixed using udev rules to change device permissions as described here.
- create new rule file in
/etc/udev/rules.d
(e.g.10-klimalogg.rules
) - define a rule to grant permissions for certain group (e.g.
SUBSYSTEM=="usb", ATTR{idVendor}=="6666", ATTR{idProduct}=="5555", GROUP="dialout"
)