We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have the following code and I don't receive meter values:
package main import ( "errors" "fmt" "log" "os" "strings" "time" "github.com/voltbras/go-ocpp" "github.com/voltbras/go-ocpp/cs" "github.com/voltbras/go-ocpp/messages/v1x/cpreq" "github.com/voltbras/go-ocpp/messages/v1x/cpresp" ) func main() { ocpp.SetDebugLogger(log.New(os.Stdout, "DEBUG:", log.Ltime)) ocpp.SetErrorLogger(log.New(os.Stderr, "ERROR:", log.Ltime)) csys := cs.New() go csys.Run(":21022", func(req cpreq.ChargePointRequest, metadata cs.ChargePointRequestMetadata) (cpresp.ChargePointResponse, error) { fmt.Printf("EXAMPLE(MAIN): Request from %s\n", metadata.ChargePointID) fmt.Printf(">>>>>>> %v\n", req.Action()) switch req := req.(type) { case *cpreq.BootNotification: return &cpresp.BootNotification{ Status: "Accepted", CurrentTime: time.Now(), Interval: 60, }, nil case *cpreq.Heartbeat: return &cpresp.Heartbeat{CurrentTime: time.Now()}, nil case *cpreq.MeterValues: fmt.Println("This message is not displayed") fmt.Printf("METADATA %#v\n", metadata) fmt.Printf("REQ - metervalue: %#v\n", req.MeterValue) return &cpresp.MeterValues{}, nil case *cpreq.StatusNotification: fmt.Println("This works " + req.Status) if req.Status != "Available" { // chargepoint is unavailable } return &cpresp.StatusNotification{}, nil default: fmt.Printf("EXAMPLE(MAIN): action not supported: %s\n", req.Action()) return nil, errors.New("Response not supported") } }) select {} }
My charge point is configure to send meter values.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have the following code and I don't receive meter values:
My charge point is configure to send meter values.
The text was updated successfully, but these errors were encountered: