Skip to content

Simple go package to read data from USB-WDE weather data logger (ELV)

License

Notifications You must be signed in to change notification settings

fako1024/usbwde

Repository files navigation

Simple go package to read data from USB-WDE weather data logger (ELV)

Github Release GoDoc Go Report Card Build/Test Status

This package allows to extract structured data from a USB-WDE weather station device (available from here). Usage is fairly trivial (see examples directory for a simple console logger implementation).

Features

  • Extraction of USBWDE RF sensor data
    • Up to 8 temperature / humidity sensors
    • Hybrid sensor providing temperature / humidity, wind speed and precipitation data

Installation

go get -u github.com/fako1024/usbwde

Example

// Initialize a new USBWDE sensor / station
sensor, err := usbwde.New("/dev/ttyUSB0")
if err != nil {
    logrus.StandardLogger().Fatalf("Error opening /dev/ttyUSB0: %s", err)
}

// Continuously throw a log message upon reception of updated data
for {

    // Read single data point
    dataPoint, err := sensor.Read()
    if err != nil {
        logrus.StandardLogger().Errorf("Error reading data from %s: %s", devicePath, err)
    }

    // Log data
    logrus.StandardLogger().Infof("Read data from %s: %s", devicePath, dataPoint)
}