gotracerwifi

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: LGPL-3.0 Imports: 5 Imported by: 0

README

Go Tracer WiFi

A Go package to communicate with an EPSolar Tracer A/AN charge controller equipped with the eBox-Wifi-01 or HiFlying Elfin EW11

Only tested with EPSolar Tracer3210AN equipped with a eBox-Wifi-01 and HiFlying Elfin EW11

Example

TCP example
package main

import (
	"encoding/json"
	"github.com/pterm/pterm"
	"github.com/Gaz492/gotracerwifi"
	"time"
)

func main()  {
	tracer, err := goTracerWiFi.Status("192.168.1.181", "8088", 5 * time.Second, "TCP")
	if err != nil {
		pterm.Fatal.Println(err)
	}

	response, err := json.Marshal(tracer)
	if err != nil {
		pterm.Error.Println(err)
		return
	}
	pterm.Info.Println(string(response))
}
RTU over TCP example
package main

import (
	"encoding/json"
	"github.com/pterm/pterm"
	"github.com/Gaz492/gotracerwifi"
	"time"
)

func main()  {
	tracer, err := goTracerWiFi.Status("192.168.1.181", "8088", 5 * time.Second, "RTU_TCP")
	if err != nil {
		pterm.Fatal.Println(err)
	}

	response, err := json.Marshal(tracer)
	if err != nil {
		pterm.Error.Println(err)
		return
	}
	pterm.Info.Println(string(response))
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.0.0

type Client struct {
	modbus.Client
}

func NewTCPClient added in v1.0.0

func NewTCPClient(ip string, port string, timeout time.Duration, protocol string) (Client, error)

func (Client) ConsumedAnnual added in v1.0.0

func (c Client) ConsumedAnnual() (float32, error)

func (Client) ConsumedDay added in v1.0.0

func (c Client) ConsumedDay() (float32, error)

func (Client) ConsumedMonth added in v1.0.0

func (c Client) ConsumedMonth() (float32, error)

func (Client) ConsumedTotal added in v1.0.0

func (c Client) ConsumedTotal() (float32, error)

func (Client) GeneratedAnnual added in v1.0.0

func (c Client) GeneratedAnnual() (float32, error)

func (Client) GeneratedDay added in v1.0.0

func (c Client) GeneratedDay() (float32, error)

func (Client) GeneratedMonth added in v1.0.0

func (c Client) GeneratedMonth() (float32, error)

func (Client) GeneratedTotal added in v1.0.0

func (c Client) GeneratedTotal() (float32, error)

func (Client) GetBatteryCurrent added in v1.0.0

func (c Client) GetBatteryCurrent() (float32, error)

func (Client) GetBatteryMaxVoltage added in v1.0.0

func (c Client) GetBatteryMaxVoltage() (float32, error)

func (Client) GetBatteryMin added in v1.0.0

func (c Client) GetBatteryMin() (float32, error)

func (Client) GetBatterySOC added in v1.0.0

func (c Client) GetBatterySOC() (float32, error)

func (Client) GetBatteryVoltage added in v1.0.0

func (c Client) GetBatteryVoltage() (float32, error)

func (Client) GetLoadCurrent added in v1.0.0

func (c Client) GetLoadCurrent() (float32, error)

func (Client) GetLoadPower added in v1.0.0

func (c Client) GetLoadPower() (float32, error)

func (Client) GetLoadStatus added in v1.0.0

func (c Client) GetLoadStatus() (int, error)

Load stuff

func (Client) GetLoadVoltage added in v1.0.0

func (c Client) GetLoadVoltage() (float32, error)

func (Client) GetPvCurrent added in v1.0.1

func (c Client) GetPvCurrent() (float32, error)

func (Client) GetPvPower added in v1.0.1

func (c Client) GetPvPower() (float32, error)

func (Client) GetPvVoltage added in v1.0.1

func (c Client) GetPvVoltage() (float32, error)

Solar stuff

func (Client) GetTemp added in v1.0.0

func (c Client) GetTemp() (float32, error)

func (Client) SetLoadOff added in v1.0.0

func (c Client) SetLoadOff() error

func (Client) SetLoadOn added in v1.0.0

func (c Client) SetLoadOn() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL