{"id":15971164,"url":"https://github.com/glurp/ocpp_simulator","last_synced_at":"2025-03-18T00:30:47.121Z","repository":{"id":11518922,"uuid":"14000538","full_name":"glurp/ocpp_simulator","owner":"glurp","description":"Simulation of a electrical Charge Point via OCPP protocol","archived":false,"fork":false,"pushed_at":"2018-06-26T20:15:44.000Z","size":534,"stargazers_count":20,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T05:57:27.769Z","etag":null,"topics":["emobility","ocpp","simulator"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glurp.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":"2013-10-30T21:42:24.000Z","updated_at":"2024-06-20T12:59:59.000Z","dependencies_parsed_at":"2022-09-05T22:13:20.883Z","dependency_job_id":null,"html_url":"https://github.com/glurp/ocpp_simulator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glurp%2Focpp_simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glurp%2Focpp_simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glurp%2Focpp_simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glurp%2Focpp_simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glurp","download_url":"https://codeload.github.com/glurp/ocpp_simulator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893848,"owners_count":20364918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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"}},"keywords":["emobility","ocpp","simulator"],"created_at":"2024-10-07T20:08:21.781Z","updated_at":"2025-03-18T00:30:45.859Z","avatar_url":"https://github.com/glurp.png","language":"Ruby","funding_links":[],"categories":["Tools and Resources"],"sub_categories":["OCPP"],"readme":"ocpp_simulator\n==============\n\nSimulator of a Charge Point via OCPP protocol\n\nSOAP is used via xml templates, so this gem do not depend on any soap stack ...\n\n5 usages :\n* client.rb : invoke CP-\u003eCS dialog. Alone can invoke a SOAP request to a scada\n* server.rb : serve a CS-\u003eCP dialog, as CP. Alone it print request/responses,  responses are always status=Accepted. \n              server api : invoke a client callback foreach request received\n              see tc.rb for simulate CS\n* cp.rb : simulate one Charge Point with multiple connectorId, use client.rb and serveur.rb for \n  scada dialogs, make some start/stop transactions, some notifications.\n* tc.rb : client as scada: send commandes to chargePoints\n* parc_sim.rb : simulate a set of charge point.\n\nSome tools developped with the framework:\n* hmi_test.rb : simple HMI for simulate a charge point in plaforme : test central ocpp configuration\n* tc_batch.rb : loop with some centrale commands for stimulate charge point\n* rcrelai.rb  : ocpp cs-\u003ecp router : receive commands on listen socket and route as client to another IP:port addresse\n                From/To/MessageId are updated, timing is calculate\nNews\n====\n\n21/06/2017\n* dataTransfert in hmi_test\n* support https for soap-client\n\nTODO\n=====\nA mini-scada, for fun, with OCPP and Ruiby/SVG Gui                \n\nClient\n======\n\nExamples :\n\n    \u003eruby client.rb  http://ns8363.ovh.net:6060/ocpp   CB1000 bootNotification\n    \u003eruby client.rb  http://ns8363.ovh.net:6060/ocpp   CB1002 hbeat\n    \u003eruby client.rb  http://ns8363.ovh.net:6060/ocpp   CB1002 dataTransfert\n    \u003eruby client.rb  http://ns8363.ovh.net:6060/ocpp   CB1001 meterValue\n    \u003eruby client.rb  http://ns8363.ovh.net:6060/ocpp   CB1000 startTransaction CONID 1\n    \u003eruby client.rb  http://ns8363.ovh.net:6060/ocpp   CB1000 startTransaction CONID 1 TAGID 11223344\n    \u003eruby client.rb  http://ns8363.ovh.net:6060/ocpp   CB1000 stopTransaction TRANSACTIONID 818101 \n\n    \u003eruby client.rb  http://localhost:8080/ocpp   CB1000 reset  TYPE Hard \n    \u003eruby client.rb  http://localhost:8080/ocpp   CB1000 remoteStopTransaction  TRANSACTIONID 818101 \n\n    \u003eruby  server.rb  8080 \u0026\n\n    \u003eruby client.rb  http://localhost:6061/ocpp   CB1000  meterValues CONI 1 V1 1 V2 2 V3 3 V4 4 V5 5 V6 6 V7 7 V8 8 V9 9 V10 10 V11 11 V12 12 V13 13 \n    \u003eruby client.rb  http://localhost:6060/ocpp CB1000  startTransaction  CONID 1   TAGID 12345678 METERSTART 11 \n    \u003eruby client.rb  http://localhost:6060/ocpp CB1000  stopTransaction TRANSACIF 765701  METERSTOP 23 \n    \u003eruby client.rb  http://localhost:6060/ocpp CB1000  statusNotification CONID 1 STATUS Faulted ERRORC PowerMeterFailure \n    \u003eruby client.rb  http://localhost:6060/ocpp CB1000  statusNotification CONID 1 STATUS Faulted ERRORC NoError \n\nServer\n=====\n\ntraces exemples (with -d) :\n```\n\u003e\u003e\n\"connexion... #\u003cTCPSocket:0x357b7a8\u003e\"\n\"reading 757...\"\nRequest : {\"ACTION\"=\u003e\"ChangeConfiguration\"}\nResponse: {\"ACTION\"=\u003e\"ChangeConfiguration\", \"HCHARGEBOXID\"=\u003enil, \"HMESSID\"=\u003e1383169016773, \"HRELMESSIDTO\"=\u003e\"urn:uuid:dd6f6442-a5e7-4055-84fd-ac9174005674\", \"HTO\"=\u003e\"http://ocpp.server.org\"}\ndata : \u003c\u003c\n  wsa:Action                     /ChangeConfiguration\n  wsa:RelatesTo                  urn:uuid:dd6f6442-a5e7-4055-84fd-ac9174005674\n  wsa:To                         http://ocpp.server.org\n  wsa:MessageID                  1383169016773\n  ocppCs15:status                Accepted\n\u003e\u003e\n\"connexion... #\u003cTCPSocket:0x3578e38\u003e\"\n\"reading 875...\"\nRequest : {\"ACTION\"=\u003e\"GetDiagnostics\"}\nResponse: {\"ACTION\"=\u003e\"GetDiagnostics\", \"HCHARGEBOXID\"=\u003enil, \"HMESSID\"=\u003e1383169016783, \"HRELMESSIDTO\"=\u003e\"urn:uuid:68f17156-8a2a-4dba-a53e-90e42eb3059c\", \"HTO\"=\u003e\"http://ocpp.server.org\"}\ndata : \u003c\u003c\n  wsa:Action                     /GetDiagnostics\n  wsa:RelatesTo                  urn:uuid:68f17156-8a2a-4dba-a53e-90e42eb3059c\n  wsa:To                         http://ocpp.server.org\n  wsa:MessageID                  1383169016783\n  ocppCs15:fileName              toto.html\n\u003e\u003e\n\"connexion... #\u003cTCPSocket:0x35860e0\u003e\"\n\"reading 731...\"\nRequest : {\"ACTION\"=\u003e\"UnlockConnector\", \"CONID\"=\u003enil}\nResponse: {\"ACTION\"=\u003e\"UnlockConnector\", \"HCHARGEBOXID\"=\u003enil, \"HMESSID\"=\u003e1383169095099, \"HRELMESSIDTO\"=\u003e\"urn:uuid:e245a17c-f301-4815-b2cd-b6d2fba7c39d\", \"HTO\"=\u003e\"http://ocpp.server.org\"}\ndata : \u003c\u003c\n  wsa:Action                     /UnlockConnector\n  wsa:RelatesTo                  urn:uuid:e245a17c-f301-4815-b2cd-b6d2fba7c39d\n  wsa:To                         http://ocpp.server.org\n  wsa:MessageID                  1383169095099\n  ocppCs15:status                Accepted\n\u003e\u003e\n```\n\n\nCP : simulation of a ChargePoint\n=============================== \nUsage: \n    \u003e ruby cp.rb  name    ip        port path    url_server                  c1 c2 c3...\n    \u003e ruby cp.rb  SIEM001 localhost 6061 /ocpp   http://localhost:9090/ocpp  1 2 3 4\n\nWhat is simulate:\n* boot, lock , ask autorize, start charge, stop charge : autonomous (tempo/random/duration)\n* energies imported, send it by meterValues periodicly\n* start / stop charge by remote commande (suppose that (transactionId%100) =\u003e connectorId !!)\n* change Availlibility by remote commande (Inoperative ==\u003e reboot)\n\nWhat is missing:\n* statusNotification with errorCode\n* diagnostic, dataTransfered,updateFirmware (!), getConfiguration,reset, \n* localList of tag (the tag is alays the same : '12345678')\n* reservation\n\n\nParc_sim\n========\nCreate a bunch of ChargePoint\n\n       \u003e ruby parc_sim.rb  nbChargePoint  ip  port0 path  url_server  nb_connector_by_cp\n       \u003e ruby parc.rb  10 localhost 6060 /ocpp   http://localhost:9090/ocpp  1 2 3 4\n\nThis will create :\n* 10 chargePoints, 4 connector on each, \n* first ChargePoint will use port 6060, seconde 6061 .. and so on\n* all cp will send data to asoap server a locolhost:9090/ocpp\n\nConfiguration\n=============\n\nAll Soap requests/responses are configured in templateOCPP.rb\n\nClient : each SOAP request/response are configured with\n* request: xml template to send, each 'value' place are represented  with a key\n* request: list the  key in request (replace strings) to be use a parameters\n* response : list of filter of value to extract from request\n\nServer : each SOAP request/response are configured with\n* request: hash of  'xpath' to be use for extract data, value of hash are varnames. So a request\n  received is represented by a hash of varname=\u003evalue \n* response : (as request of client) : string template, list of key\n\nLIMITATION !!! : all that SOAP stuff work only with xml with statics structure !\n* you can't extract a list of tagid received from CS\n* you can't send a free list of measures\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglurp%2Focpp_simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglurp%2Focpp_simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglurp%2Focpp_simulator/lists"}