lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
275 stars 126 forks source link

Remote Start Transaction #100

Closed sea-blorin closed 2 years ago

sea-blorin commented 3 years ago

It is possible from CS, starts the Remote Transaction?

19augello commented 3 years ago

I too have encountered the same problem, also I would like to understand how to integrate the reading of MeterValues in the example script

lorenzodonini commented 3 years ago

It is possible from CS, starts the Remote Transaction?

The central system can request a charge point to start a transaction using a RemoteStartTransactionRequest message. The library itself only transports the messages though. It is up to your application to actually start the transaction on the charge point.

The exact intended behavior is described in the OCPP specs, and summarized in the library's godoc.

Did I misunderstand your question? If so, please let me know, otherwise I'll close this issue.

lorenzodonini commented 3 years ago

I too have encountered the same problem, also I would like to understand how to integrate the reading of MeterValues in the example script

Are you referring to https://github.com/lorenzodonini/ocpp-go/blob/master/example/1.6/cs/handler.go#L90?

The example is not meant to give you a full implementation, but just to show you the boilerplate code, so you can easily start your own implementation. It is up to your central system to read the meter values, received from the charge point, and handle them how you see fit (write to a DB, send them to another microservice, and so on).

Meter values come in batches (therefore an array), each of which contains sampled values collected by the charge point. Every sampled value contains the value and the metadata to describe it (e.g. the Measurand field tells you what type of reading it is). Which values are contained in each batch, how many and in which interval is entirely implementation-specific (and based on hardware/configuration). I recommend reading the OCPP specs, if you need more information about this.

selislamp commented 3 years ago

How I can try the "Unlock connector" remotly?

lorenzodonini commented 3 years ago

How I can try the "Unlock connector" remotly?

Like this:

myCallback := func(confirmation *core.UnlockConnectorConfirmation, err error) {
    if err != nil {
        // Handle error
    } else if confirmation.Status == core.UnlockStatusUnlockFailed {
        // Unlock failed
    } else if confirmation.Status == core.UnlockStatusNotSupported {
        // Unlock not supported by charge point
    }  else {
           // Success
    }
}

err := centralSystem.UnlockConnector("1234", myCallback, 1)
if err != nil {
    log.Printf("error sending message: %v", err)
}
selislamp commented 3 years ago

Thanks