diff --git a/charger/ocpp/instance.go b/charger/ocpp/instance.go index 792d9a8fc..73da687c5 100644 --- a/charger/ocpp/instance.go +++ b/charger/ocpp/instance.go @@ -6,6 +6,12 @@ import ( "github.com/evcc-io/evcc/util" ocpp16 "github.com/lorenzodonini/ocpp-go/ocpp1.6" + "github.com/lorenzodonini/ocpp-go/ocpp1.6/core" + "github.com/lorenzodonini/ocpp-go/ocpp1.6/firmware" + "github.com/lorenzodonini/ocpp-go/ocpp1.6/localauth" + "github.com/lorenzodonini/ocpp-go/ocpp1.6/remotetrigger" + "github.com/lorenzodonini/ocpp-go/ocpp1.6/reservation" + "github.com/lorenzodonini/ocpp-go/ocpp1.6/smartcharging" "github.com/lorenzodonini/ocpp-go/ocppj" "github.com/lorenzodonini/ocpp-go/ws" ) @@ -23,7 +29,12 @@ func Instance() *CS { server := ws.NewServer() server.SetTimeoutConfig(timeoutConfig) - cs := ocpp16.NewCentralSystem(nil, server) + dispatcher := ocppj.NewDefaultServerDispatcher(ocppj.NewFIFOQueueMap(0)) + dispatcher.SetTimeout(time.Minute) + + endpoint := ocppj.NewServer(server, dispatcher, nil, core.Profile, localauth.Profile, firmware.Profile, reservation.Profile, remotetrigger.Profile, smartcharging.Profile) + + cs := ocpp16.NewCentralSystem(endpoint, server) instance = &CS{ log: util.NewLogger("ocpp"),