{"id":66439,"name":"go-ocpp","description":"v1.5 and v1.6 Open Charge Point Protocol implementation in Golang.","url":"https://github.com/voltbras/go-ocpp","last_synced_at":"2026-04-05T18:03:14.489Z","repository":{"id":43842946,"uuid":"171716245","full_name":"voltbras/go-ocpp","owner":"voltbras","description":"v1.5 and v1.6 OCPP implementation in Golang","archived":false,"fork":false,"pushed_at":"2022-02-16T10:02:22.000Z","size":191,"stargazers_count":49,"open_issues_count":5,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-03-12T10:24:28.993Z","etag":null,"topics":["charging-stations","chargingstation","electric-vehicles","emobility","ocpp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voltbras.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-20T17:11:54.000Z","updated_at":"2026-03-05T09:33:23.000Z","dependencies_parsed_at":"2022-09-26T21:51:16.800Z","dependency_job_id":null,"html_url":"https://github.com/voltbras/go-ocpp","commit_stats":null,"previous_names":["eduhenke/go-ocpp"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/voltbras/go-ocpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltbras%2Fgo-ocpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltbras%2Fgo-ocpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltbras%2Fgo-ocpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltbras%2Fgo-ocpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voltbras","download_url":"https://codeload.github.com/voltbras/go-ocpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltbras%2Fgo-ocpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30573997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-16T06:02:37.763Z","status":"ssl_error","status_checked_at":"2026-03-16T06:02:14.913Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"owner":{"login":"voltbras","name":"Voltbras","uuid":"64649105","kind":"organization","description":"","email":"contato@voltbras.com.br","website":"https://voltbras.com.br/","location":"Florianópolis","twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/64649105?v=4","repositories_count":2,"last_synced_at":"2023-03-10T03:25:26.155Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/voltbras","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2022-11-19T21:04:57.077Z","updated_at":"2023-03-10T03:25:26.169Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voltbras","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voltbras/repositories"},"packages":[{"id":3766366,"name":"github.com/voltbras/go-ocpp","ecosystem":"go","description":"","homepage":"https://github.com/voltbras/go-ocpp","licenses":"GPL-3.0","normalized_licenses":["GPL-3.0"],"repository_url":"https://github.com/voltbras/go-ocpp","keywords_array":[],"namespace":"github.com/voltbras","versions_count":3,"first_release_published_at":"2019-02-27T14:11:20.000Z","latest_release_published_at":"2021-02-17T00:52:08.000Z","latest_release_number":"v1.1.0","last_synced_at":"2026-04-03T17:01:01.464Z","created_at":"2022-04-11T16:19:46.292Z","updated_at":"2026-04-03T17:01:01.465Z","registry_url":"https://pkg.go.dev/github.com/voltbras/go-ocpp","install_command":"go get github.com/voltbras/go-ocpp","documentation_url":"https://pkg.go.dev/github.com/voltbras/go-ocpp#section-documentation","metadata":{},"repo_metadata":{"uuid":"171716245","full_name":"voltbras/go-ocpp","owner":"voltbras","description":"v1.5 and v1.6 OCPP implementation in Golang","archived":false,"fork":false,"pushed_at":"2022-02-16T10:02:22.000Z","size":191,"stargazers_count":41,"open_issues_count":5,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-03-10T03:26:06.495Z","etag":null,"topics":["charging-stations","chargingstation","electric-vehicles","emobility","ocpp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"logo_url":null,"metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-20T17:11:54.000Z","updated_at":"2023-03-06T14:57:38.000Z","dependencies_parsed_at":"2022-09-26T21:51:16.800Z","dependency_job_id":null,"html_url":"https://github.com/voltbras/go-ocpp","commit_stats":null,"repository_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltbras%2Fgo-ocpp","tags_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltbras%2Fgo-ocpp/tags","manifests_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltbras%2Fgo-ocpp/manifests","owner_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voltbras","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":108921946,"host_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"http://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names"}},"repo_metadata_updated_at":"2023-03-21T19:03:59.330Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":0,"rankings":{"downloads":null,"dependent_repos_count":9.345852080216646,"dependent_packages_count":6.999148183520997,"stargazers_count":3.6459765419393357,"forks_count":4.267836240245916,"average":6.064703261480724},"purl":"pkg:golang/github.com/voltbras/go-ocpp","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/go/github.com/voltbras/go-ocpp","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/go/github.com/voltbras/go-ocpp","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/go/github.com/voltbras/go-ocpp/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":{"last_synced_at":"2023-08-17T09:39:15.680Z","issues_count":10,"pull_requests_count":5,"avg_time_to_close_issue":8846458.833333334,"avg_time_to_close_pull_request":984525.75,"issues_closed_count":6,"pull_requests_closed_count":4,"pull_request_authors_count":2,"issue_authors_count":8,"avg_comments_per_issue":1.8,"avg_comments_per_pull_request":0.0,"merged_pull_requests_count":4,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":0,"past_year_pull_requests_count":0,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":null,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":0,"past_year_pull_request_authors_count":0,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":null,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":0},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fvoltbras%2Fgo-ocpp/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fvoltbras%2Fgo-ocpp/version_numbers","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fvoltbras%2Fgo-ocpp/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fvoltbras%2Fgo-ocpp/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Fvoltbras%2Fgo-ocpp/codemeta","maintainers":[],"registry":{"name":"proxy.golang.org","url":"https://proxy.golang.org","ecosystem":"go","default":true,"packages_count":2086703,"maintainers_count":0,"namespaces_count":779664,"keywords_count":112728,"github":"golang","metadata":{"funded_packages_count":53440},"icon_url":"https://github.com/golang.png","created_at":"2022-04-04T15:19:22.939Z","updated_at":"2026-04-05T05:09:06.732Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages","maintainers_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/maintainers","namespaces_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/namespaces"}}],"commits":{"id":1254141,"full_name":"voltbras/go-ocpp","default_branch":"master","total_commits":50,"total_committers":1,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":50.0,"dds":0.0,"past_year_total_commits":0,"past_year_total_committers":0,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":0.0,"past_year_dds":0.0,"last_synced_at":"2026-04-03T17:01:20.273Z","last_synced_commit":"e879173b1b8851fe976c782fbfb294c371500862","created_at":"2023-03-27T10:58:50.051Z","updated_at":"2026-04-03T17:01:17.946Z","committers":[{"name":"eduhenke","email":"eduardo_henke@hotmail.com","login":"eduhenke","count":50}],"past_year_committers":[],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltbras%2Fgo-ocpp/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-05T00:00:09.419Z","repositories_count":6211109,"commits_count":924749895,"contributors_count":35739385,"owners_count":1144280,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"voltbras/go-ocpp","html_url":"https://github.com/voltbras/go-ocpp","last_synced_at":"2025-11-09T18:09:15.210Z","status":"active","issues_count":10,"pull_requests_count":6,"avg_time_to_close_issue":8846458.833333334,"avg_time_to_close_pull_request":10848381.4,"issues_closed_count":6,"pull_requests_closed_count":5,"pull_request_authors_count":3,"issue_authors_count":8,"avg_comments_per_issue":1.8,"avg_comments_per_pull_request":0.0,"merged_pull_requests_count":4,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":0,"past_year_pull_requests_count":1,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":null,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":0,"past_year_pull_request_authors_count":1,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":0.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":0,"created_at":"2023-05-09T10:41:23.152Z","updated_at":"2025-11-09T18:09:15.210Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltbras%2Fgo-ocpp","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltbras%2Fgo-ocpp/issues","issue_labels_count":{},"pull_request_labels_count":{},"issue_author_associations_count":{"NONE":8,"MEMBER":2},"pull_request_author_associations_count":{"MEMBER":4,"NONE":2},"issue_authors":{"oscarjairIT":2,"eduhenke":2,"darkrain":1,"AlexMartSch":1,"FlorishL":1,"EstoyAburrido":1,"solanu":1,"michaelbironneau":1},"pull_request_authors":{"eduhenke":4,"JscorpTech":1,"hevanto":1},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-05T00:00:08.668Z","repositories_count":14091529,"issues_count":34424626,"pull_requests_count":112341142,"authors_count":11226297,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{},"past_year_pull_request_author_associations_count":{"NONE":1},"past_year_issue_authors":{},"past_year_pull_request_authors":{"JscorpTech":1},"maintainers":[{"login":"eduhenke","count":6,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/eduhenke"}],"active_maintainers":[]},"events":{"total":{"WatchEvent":1},"last_year":{}},"keywords":["charging-stations","chargingstation","electric-vehicles","emobility","ocpp"],"dependencies":[{"ecosystem":"go","filepath":"go.mod","sha":null,"kind":"manifest","created_at":"2022-09-26T21:51:16.395Z","updated_at":"2022-09-26T21:51:16.395Z","repository_link":"https://github.com/voltbras/go-ocpp/blob/master/go.mod","dependencies":[{"id":6165980164,"package_name":"github.com/google/uuid","ecosystem":"go","requirements":"v1.1.0","direct":true,"kind":"runtime","optional":false},{"id":6165980165,"package_name":"github.com/gorilla/websocket","ecosystem":"go","requirements":"v1.4.1","direct":true,"kind":"runtime","optional":false},{"id":6165980166,"package_name":"github.com/stretchr/testify","ecosystem":"go","requirements":"v1.6.1","direct":true,"kind":"runtime","optional":false}]},{"ecosystem":"go","filepath":"go.sum","sha":null,"kind":"lockfile","created_at":"2022-09-26T21:51:16.664Z","updated_at":"2022-09-26T21:51:16.664Z","repository_link":"https://github.com/voltbras/go-ocpp/blob/master/go.sum","dependencies":[{"id":6165980265,"package_name":"github.com/davecgh/go-spew","ecosystem":"go","requirements":"v1.1.0","direct":false,"kind":"runtime","optional":false},{"id":6165980266,"package_name":"github.com/google/uuid","ecosystem":"go","requirements":"v1.1.0","direct":false,"kind":"runtime","optional":false},{"id":6165980267,"package_name":"github.com/gorilla/websocket","ecosystem":"go","requirements":"v1.4.1","direct":false,"kind":"runtime","optional":false},{"id":6165980268,"package_name":"github.com/pmezard/go-difflib","ecosystem":"go","requirements":"v1.0.0","direct":false,"kind":"runtime","optional":false},{"id":6165980269,"package_name":"github.com/stretchr/objx","ecosystem":"go","requirements":"v0.1.0","direct":false,"kind":"runtime","optional":false},{"id":6165980270,"package_name":"github.com/stretchr/testify","ecosystem":"go","requirements":"v1.6.1","direct":false,"kind":"runtime","optional":false},{"id":6165980271,"package_name":"gopkg.in/check.v1","ecosystem":"go","requirements":"v0.0.0-20161208181325-20d25e280405","direct":false,"kind":"runtime","optional":false},{"id":6165980272,"package_name":"gopkg.in/yaml.v3","ecosystem":"go","requirements":"v3.0.0-20200313102051-9f266ea9e77c","direct":false,"kind":"runtime","optional":false}]}],"score":null,"created_at":"2023-09-18T13:12:07.114Z","updated_at":"2026-04-05T18:03:14.490Z","avatar_url":"https://github.com/voltbras.png","language":"Go","category":"Consumption","sub_category":"Mobility and Transportation","monthly_downloads":0,"total_dependent_repos":0,"total_dependent_packages":0,"readme":"# go-ocpp\n\nOCPP(1.5/1.6) implementation in Golang.\n\n- v1.5, it's assumed it is SOAP\n- v1.6, it's assumed it is JSON\n\n## Usage\n\n### Central System\n\nJust pass a handler that takes in a `cpreq.ChargePointRequest` and returns a `(cpresp.ChargePointResponse, error)`.\n\nIn SOAP, error messages will be sent back via Fault, as specified in OCPP v1.5\n\nIn Websockets, error messages will be sent back as specified in OCPP-J v1.6\n\n```go\ncsys := cs.New()\ngo csys.Run(\":12811\", func(req cpreq.ChargePointRequest, metadata cs.ChargePointRequestMetadata) (cpresp.ChargePointResponse, error) {\n    // Return an error to the Station communicating to the Central System\n    //\n    // station, isAuthorized := getStation(metadata.ChargePointID)\n    // if !isAuthorized {\n    //   return nil, errors.New(\"charger not authorized to join network\")\n    // }\n    // ---\n    // Or check some specific header in the underlying HTTP request:\n    // \n    // if shouldBlock(metadata.HTTPRequest) {\n    //   return nil, errors.New(\"charger should send appropriate headers\")\n    // }\n\n    switch req := req.(type) {\n    case *cpreq.BootNotification:\n        // accept chargepoint in the network\n        return \u0026cpresp.BootNotification{\n            Status:      \"Accepted\",\n            CurrentTime: time.Now(),\n            Interval:    60,\n        }, nil\n\n    case *cpreq.Heartbeat:\n        return \u0026cpresp.Heartbeat{CurrentTime: time.Now()}, nil\n\n    case *cpreq.StatusNotification:\n        if req.Status != \"Available\" {\n            // chargepoint is unavailable\n        }\n        return \u0026cpresp.StatusNotification{}, nil\n\n    default:\n        return nil, errors.New(\"Response not supported\")\n    }\n}\n```\n\n### Charge Point\n\nPass the required parameters to the constructor function, and then just send any request(`cpreq.*`).\n\nTODO: assertion of the response type should be done inside the `.Send`?\n\n```go\nstationID := \"id01\"\ncentralSystemURL := \"ws://localhost:12811\"\nst, err := cp.NewChargePoint(stationID, centralSystemURL, ocpp.V16, ocpp.JSON, nil, handler) // or ocpp.SOAP\nif err != nil {\n    fmt.Println(\"could not create charge point:\", err)\n    return\n}\nrawResp, err := st.Send(\u0026cpreq.Heartbeat{})\nif err != nil {\n    fmt.Println(\"could't send heartbeat:\", err)\n    return\n}\nresp, ok := rawResp.(*cpresp.Heartbeat)\nif !ok {\n    fmt.Println(\"response is not a heartbeat response\")\n    return\n}\nfmt.Println(\"got reply:\", resp)\n```\n\n### Logs\n\nFor more useful logging, do:\n\n```go\nocpp.SetDebugLogger(log.New(os.Stdout, \"DEBUG:\", log.Ltime))\nocpp.SetErrorLogger(log.New(os.Stderr, \"ERROR:\", log.Ltime))\n```\n","funding_links":[],"readme_doi_urls":[],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":[],"project_url":"https://ost.ecosyste.ms/api/v1/projects/66439","html_url":"https://ost.ecosyste.ms/projects/66439"}