Skip to content

Releases: lorenzodonini/ocpp-go

v0.18.0

13 Mar 22:44
Compare
Choose a tag to compare
v0.18.0 Pre-release
Pre-release

Additions and improvements

Generic

Bugfixes

Generic

  • Updated ProfileName constants by @xBlaz3kx in #248
  • Fixed race in DefaultServerDispatcher.Start() by @andig in #228
  • Fixed races in websocket and ocppj by @andig in #233

v2.0.1

  • Fixed required validation for idToken value except NoAuthorization type by @dwibudut in #226
  • Allowed empty group ID tokens for NoAuthorization token type by @Jonesywolf in #250
  • Fixed typo field iso15118CertificateHashData on AuthorizeRequest by @dwibudut in #256
  • Fixed custom v1.6 and v2.0.1 validations that would override each other by @dwibudut in #224
  • Removed connection profile URL validation by @Jonesywolf in #238

Full Changelog: v0.17.0...v0.18.0

v0.17.0

10 Sep 20:33
Compare
Choose a tag to compare
v0.17.0 Pre-release
Pre-release

Additions and improvements

v1.6

  • Added the IsConnected getter to charge point instances

v2.0.1

  • Added the IsConnected getter to charging station instances
  • SampleValue.Value field is not required anymore
  • Added the missing CertificateHashDataChain optional field in GetInstalledCertificateIds response
  • Added the missing V2GCertificateChain CertificateUse enum value
  • Added the missing ISO15693 and MacAddress enum values of IdTokenType

Websocket

  • The default subprotocol is now set correctly during initial negotiation and may be enforced via the SetRequestedSubProtocol on the websocket client
  • The server now supports adding additional HTTP handlers, via an underlying router

Generic

  • Upgraded lib to min Go version 1.16
  • Upgraded some dependencies
  • Message callbacks are now invoked within dedicated goroutines to prevent the called from being blocked
  • Added debug logs for outgoing/incoming raw JSON messages
  • Added support for HTML escaping
  • Added the SetNewChargingStationValidationHandler on server endpoints for checking incoming connections before the websocket upgrade takes place
  • Improved error handling when sending responses/errors
  • Added optional SetInvalidMessageHook handler to intercept and handle invalid messages on ocppj layer

Bugfixes

v1.6

  • stopTime parameter in GetDiagnosticsRequest is now named correctly
  • ChargingProfileStatusNotSupported value in SetChargingProfile message
  • ClearChargingProfileStatus validation in ClearChargingProfile confirmation
  • ConfigurationKey validation in GetConfiguration message
  • Several validation keys are not overwritten by the v2.0.1 package anymore due to name duplication

v2.0.1

  • idToken type
  • Removed incorrect validation for idToken in RequestTransaction request
  • AttributeStatus validation in SetVariables response
  • messagesInQueue json field in GetTransactionStatus response
  • certificateType field in GetInstalledCertificateIds request
  • Update FormatViolation ocpp-j error type
  • SerialNumber updated to max length 40 in CertificateHashData and OCSPRequestDataType

Generic

  • Incoming ocpp-j errors with empty details field are now parsed correctly
  • Invalid ocpp-j message types are now parsed and handled correctly
  • Fixed deadlock caused by double invocation on client.Stop

Generic improvements and bugfixes

23 Jul 13:44
Compare
Choose a tag to compare
Pre-release

Additions and Improvements

v1.6

  • Changed the StopTransactionRequest.MeterStop field to allow negative values

OCPP-J

  • Added a onDisconnectedHandler callback to the Client struct, which allows to be notified if a connection is interrupted and the dispatcher paused
  • Added a onReconnectedHandler callback to the Client struct, which allows to be notified when a connection is re-established and the dispatcher resumed
  • Added a timeout option for outgoing server requests: if a response is not received within the configured timeframe, the request is discarded and an error is returned to the sender. The feature is available by invoking the SetTimeout method on a ServerDispatcher
  • Added support for disabling message validation entirely, via the SetMessageValidation package function
  • Added support for verbose logging (using an optional logging.Logger)

Websockets

  • Added a RemoteAddr function to websockets for retrieving the address of the remote host
  • Added support for disabling ping/pong mechanism, by setting PingWait = 0 within the timeout configuration
  • Added support for verbose logging (using an optional logging.Logger)

Generic

  • Moved logging interfaces to a dedicated ocpp-go/logging package

Bugfixes

  • Fixed a bug that occurred when sending messages over a closed websocket channel
  • Fixed a bug that would deadlock a newly created websocket, if the NewClientHandler callback contained blocking code
  • Fixed several other race conditions in the ocpp-j layer
  • Fixed a crash caused by incoming empty json requests/responses
  • Fixed a crash caused by incoming OCCP errors not containing a description field
  • Fixed the default subprotocol for v2 to be ocpp2.0.1

Websocket and generic improvements

25 Jul 09:50
Compare
Choose a tag to compare
Pre-release

Breaking Changes

Some breaking changes in the central system's function callbacks were introduced in this release:

  • The ChargePointConnection reference is passed to callbacks on the server (replaces the standalone charge point ID)
  • Handler functions in client and server now use type aliases
  • ConfigurationKey (used by the GetConfiguration feature) now uses pointers to values, to differentiate between empty and nil values. This fixes omissions of empty strings in GetConfiguration messages

All implementations will work as before, but the method signatures have slightly changed and will need to be updated. Please refer to the updated example or refer to a748928 for updating your implementation.

Additions and improvements

Websocket

  • Added an Addr method to the websocket server for retrieving the listening address
  • Added a StopConnection function on the websocket server, to close a single existing connection
  • Added a graceful shutdown mechanism on the websocket server, which now sends a close message to every open connection
  • Charge point IDs now contain only the ID, stripping any prefix from the path
  • Subprotocols are now correctly handled and enforced by the server,
  • New connections with unsupported subprotocol now get closed only after completing the handshake

Generic

  • Added missing OCPP 2.0.1 features (examples and documentation still WIP)
  • Improved OCPP error messages
  • An InternalError is now sent, instead of a ProtocolError, when sending errors as a message response
  • Improved ClientDispatcher.SendRequest signature

Bugfixes

  • Fixed several race conditions causing hanging and other issues when closing/restarting connections
  • Fixed some field constraints that were too restrictive in:
    • RemoteStopTransaction
    • StartTransaction
    • StopTransaction
    • CancelReservation
    • ReserveNow
    • ClearChargingProfile
  • Fixed panics when attempting to parse unknown responses
  • New connections with the same ID no longer override previous connections but are closed immediately with a PolicyViolation error instead

Automatic reconnection and concurrency improvements

02 May 14:01
Compare
Choose a tag to compare

Breaking changes

The following interfaces in the ocppj package changed slightly, affecting existing custom implementations:

  • ClientDispatcher
  • ServerDispatcher
  • PendingRequestState was split into ClientState and ServerState
  • ocppj.NewClient and ocppj.NewServer now accept the respective state interface

Websocket clients now include the following new methods:

  • SetDisconnectedHandler
  • SetReconnectedHandler
  • IsConnected

Additions & improvements

  • Client websockets automatically reconnect to server after connection loss
  • Added network tests for re-connection and timeouts
  • Added full support for concurrent requests in ocpp16 and ocpp2
  • Automatically clear all callbacks when a charge point/central system is stopped
  • Improved test coverage for websockets
  • Improved test coverage for ocpp-j layer
  • Added logger interface for getting library debug logs
  • Added TLS connection state accessor to websocket Channel struct
  • Use slices instead of linked lists in FIFO queues

Bugfixes

  • Fixed concurrency issues in websockets
  • Fixed concurrency and state management issues in ocpp-j dispatchers
  • Fixed concurrency issues in ocpp16 package
  • Fixed several nil panics in websockets, ocppj and dispatcher
  • Don't set clientReadyMap status in request dispatcher if not ready
  • Notify charge point of failed requests with onRequestTimeout callbacks

Websocket improvements and request queuing

26 Dec 10:56
Compare
Choose a tag to compare

Additions & improvements

  • Replaced websocket package logs with channel errors
  • Improved websocket package structure
  • Added support for websocket header and origin
  • Added support for custom websocket timeout configuration
  • Created dedicated dispatchers for managing ocpp-j state and transmission
  • Added support for multiple pending requests

Bugfixes

  • Fix panics and logs in 1.6 examples
  • Use SANs in x509 certificates, due to breaking changes in Go 1.15

Fixes and improvements for OCPP 1.6

10 Sep 19:11
bf7b631
Compare
Choose a tag to compare
Pre-release

Breaking changes

The following changes are small bugfixes/improvements, but will break previous implementations:

  • Modify several optional primitive types to pointers
  • Fix field name in v1.6 SetChargingProfile
  • Fix field name in v1.6 MeterValues

Additions & improvements

  • Added support for basic authentication in client and server
  • Added support TLS config on websocket server
  • Added update firmware logic in 1.6 example
  • Updated more tests and types in v1.6 features
  • Added more logging and error handling in cp1.6 example
  • Improved documentation for websocket package

Updated OCPP 1.6 examples

06 Jun 15:08
Compare
Choose a tag to compare
Pre-release

Breaking changes

  • Renamed profile handlers in 1.6
  • Changed file and folder structure of examples

Additions & Improvements

  • Added example routine for central system
  • Added basic configuration support to example charge point
  • Added docker-compose.tls for easy TLS testing
  • Added create-test-certificates.sh utility script
  • Using alpine base image for examples
  • Added godoc, coverage and test report badges
  • Update README and example documentation

Bugfixes

  • Pending requests are now deleted automatically on disconnect

Ocpp v1.6 beta refactored

23 May 18:50
0c9d005
Compare
Choose a tag to compare
Pre-release

OCPP 1.6

Breaking changes

  • Renamed Confirmation interface to Response
  • Moved profiles (functional blocks) into separate packages
  • Moved shared OCPP 1.6 types into a separate types package
  • Changed all listener names to handler
  • Renamed CentralSystem and ChargePoint OCPP-J structs to Server and Client respectively

Examples were updated according to the changes.

Additions & Improvements:

  • Moved some logic from v16.go into separate files
  • RFC3339 standard is now used for dateTime formatting
  • Added MessageTypeNotSupported error code in OCPP-J
  • Checks for unsupported feature when sending a request
  • Improved documentation for OCPP-J and OCPP 1.6

OCPP 2.0

Added partial implementation of the OCPP 2.0 specification. No full examples are available yet.

Ocpp v1.6 beta

16 Jan 09:25
Compare
Choose a tag to compare
Ocpp v1.6 beta Pre-release
Pre-release

OCPP 1.6

Library supporting the following profiles on charge point and central system endpoints:

  • Core
  • Local Auth List
  • Firmware Management
  • Reservation
  • Remote Trigger
  • Smart Charging

Tests and examples for all profiles are provided.