sap-labs-france / ev-server Goto Github PK
View Code? Open in Web Editor NEWThe Open e-Mobility Charging Station management backend server (check also ev-dashboard and ev-mobile)
Home Page: https://open-e-mobility.fr/
License: Apache License 2.0
The Open e-Mobility Charging Station management backend server (check also ev-dashboard and ev-mobile)
Home Page: https://open-e-mobility.fr/
License: Apache License 2.0
During a load test against a tenant made with ev-simulator, unknown users and charging stations try to begin a charging session. To do so, users and charging station need to be manually 'attached' to the tenant.
Could you let me know if a new transaction model has been introduced since d825e2b. After merging master branch, all my tests failed due to differences between expectations and actual transaction after getting them:
Before:
{
connectorId: connectorId,
tagID: context.user.tagIDs[0],
chargeBoxID: context.chargeBoxIdentity,
chargeBox: {
id: context.chargeBoxIdentity,
connectors: [
{
activeTransactionID: transactionId,
connectorId: connectorId,
currentConsumption: 0,
totalConsumption: 0,
status: 'Available',
errorCode: 'NoError',
info: null,
vendorErrorCode: null
}
]
}
}
Now:
{
connectorId: connectorId,
tagID: context.user.tagIDs[0],
chargeBoxID: context.chargeBoxIdentity,
id: transactionId,
timestamp: currentTime.toISOString(),
"user": {
"firstName": context.user.firstName,
"id": context.user.id,
"name": context.user.name,
}
}
@LucasBrazi06, Is it a new model expected or is there an issue there ?
Today new users are activated by an Admin during registration.
This process has to be done automatically via Auto Activation of email account.
For now, to run the ev-server, we need mongo installed and also a local mailserver available.
In order to ease this process and have the same environment for all developers we could use docker.
It should:
Status:
idea is to simulate the charging station without being obliged to have a real car connected to the charging station.
Since @lucasbrazi has the trace of the data, we can do something automatic
Remove unused SCSS files in ev-dashboard-new\src\assets\scss and its sub-folders
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'hasOwnProperty' of undefined
at Function._0x44d47c (/usr/app/dist/webpack:/src/utils/Logging.js:390:1)
at Function.logInfo (/usr/app/dist/webpack:/src/utils/Logging.js:137:1)
at Function.migrate (/usr/app/dist/webpack:/src/migration/MigrationHandler.js:23:1)
at Function.start (/usr/app/dist/webpack:/src/start.js:63:1)
at process._tickCallback (internal/process/next_tick.js:68:7)
To reproduce, just create a docker image of the backend.
It is possible that the station sends a message with a connectorId = 0.
According to the standard it represents information about the charge point main controller.
Not sure what it means and how it should be handle. Anywa yit currently creates an error due to the fact that we try to access the array with connectorId-1.
Gireve is requesting to have the amperage and voltage returned part of the Locations service at level of EVSE.
The list (Log, Companies, Sites, SiteAreas, Users, Vehicles, Vehicle Manufacturers, ChargingStations, Transactions) must be ordered case insensitive.
Implement server/charger communication over WebSocket and using JSON message format
To reproduce:
The issue is located here
Object.assign(Constants.REST_RESPONSE_SUCCESS, {id: newSite.getID()})
Documentation of the assign method:
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param source The source object from which to copy properties.
*/
assign<T, U>(target: T, source: U): T & U;
Possible fix:
Object.assign({id: newSite.getID()}, Constants.REST_RESPONSE_SUCCESS)
{
"method": "POST",
"url": "/client/api/SiteAreaCreate",
"data": {
"siteID": "5bd08640f2244f598431c7fb",
"name": "Dare LLC",
"accessControl": true
},
"baseURL": "http://127.0.0.1:8082"
}
{
"status": 200,
"statusText": "OK",
"data": {
"status": "Success",
"id": "5bd08640f2244f598431c7fd"
}
}
{
"method": "DELETE",
"url": "/client/api/SiteDelete",
"params": {
"ID": "5bd08640f2244f598431c7fb"
},
"baseURL": "http://127.0.0.1:8082"
}
{
"status": 200,
"statusText": "OK",
"data": {
"status": "Success",
"id": "5bd08640f2244f598431c7fd"
}
}
Add the ChargeBoxID filter in th get transactions service.
impossible to create a new Site.
trace:
Company is not defined
at Function.company (/Users/i058319/devel/ev/ev-server/dist/webpack:/src/server/front-end/service/SiteService.js:211:1)
at SiteService (/Users/i058319/devel/ev/ev-server/dist/webpack:/src/server/front-end/CentralRestServerService.js:95:1)
at Layer.handle [as handle_request] (/Users/i058319/devel/ev/ev-server/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/i058319/devel/ev/ev-server/node_modules/express/lib/router/index.js:317:13)
at /Users/i058319/devel/ev/ev-server/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/Users/i058319/devel/ev/ev-server/node_modules/express/lib/router/index.js:335:12)
at next (/Users/i058319/devel/ev/ev-server/node_modules/express/lib/router/index.js:275:10)
at complete (/Users/i058319/devel/ev/ev-server/node_modules/passport/lib/middleware/authenticate.js:263:13)
at /Users/i058319/devel/ev/ev-server/node_modules/passport/lib/middleware/authenticate.js:270:15
at pass (/Users/i058319/devel/ev/ev-server/node_modules/passport/lib/authenticator.js:431:14)
The SiteService does not import the Company class.
Monitor the traffic/cpu/mem for each topic and generate charts so we can compare each load.
You can create a dedicated tenant in production so we can test real perfs and also the UI with this amount of data.
Try also to provide when creating the chargers, valid GPS coordinates so we can show them in SAC
When I enabled the debug mode in config.json (Authorization) I got the error below;
After checking the code, unfortunately the method does not exist in branch master
{
"_id" : ObjectId("5bbfb0d3d17f541a17019e5b"),
"level" : "E",
"source" : "Central Server",
"type" : "S",
"module" : null,
"method" : null,
"timestamp" : ISODate("2018-10-11T20:21:39.145Z"),
"action" : "User",
"message" : "Authorizations.switchTraceOn is not a function",
"detailedMessages" : "[{\"stack\":\"TypeError: Authorizations.switchTraceOn is not a function\\n at Function.canPerformAction (/home/mobile/Documents/charge-angel/ev-server/src/authorization/Authorizations.js:660:19)\\n at Function.canReadUser (/home/mobile/Documents/charge-angel/ev-server/src/authorization/Authorizations.js:412:25)\\n at Function.handleGetUser (/home/mobile/Documents/charge-angel/ev-server/src/server/front-end/service/UserService.js:362:24)\\n at process._tickCallback (internal/process/next_tick.js:68:7)\"}]",
"userID" : null,
"actionOnUserID" : null
}
As discussed the whole topic below:
Remove also the entry in the Rest API, the views (Tenant not found) and clean up the related components (guards...)
Login screen on the wrong tenant should return the message of the wrong login ('Wrong email or password') but should be logged correctly in the master tenant's logging ('User with email 'xyz' tried to log in with an unknown tenant 'xyz'!)
Scenario
On a enlevé le badge ID de Patrice pendant qu’il affichait le détail d’une borne.
Dans ce cas, on trigger un isAuthorize() dans le backend avec le badgeID qui est dans le token.
Comme le badge n’est plus dans la base ca va créer un ‘User Unknown’.
Solution
Il faut invalider le token d’un user à chaque fois qu’il est modifié par un admin.
Construire un hash qui serait dans le token et qui serait une concaténation des champs présents dans le profil du user (last update) et des components activés (Pricing...)
Si une de ces valeurs change on invalide le token cote backend.
Il faudrait donc une méthode qui construit ce hash et une autre qui le check de manière central a chaque requete qui requiert d'etre loggé.
When running Transaction_test.js
, the server failed with the following stacktrace:
TypeError: Site.getSite is not a function
at SiteArea.getSite (/Users/i058319/devel/ev/ev-server/src/model/SiteArea.js:93:26)
at Function.checkAndGetIfUserIsAuthorizedForChargingStation (/Users/i058319/devel/ev/ev-server/src/authorization/Authorizations.js:210:29)
at process._tickCallback (internal/process/next_tick.js:68:7)
It appears that a cross dependency between Site
and SiteArea
forbids to use Site class inside SiteArea.
This issue is also present between the classes Site
and User
.
Found by eslint
C:\SAPDevelop\gitwork\chargeangels\ev-server\src\entity\ChargingStation.js
788:5 warning 'timeDiffDuration' is never reassigned. Use 'const' instead prefer-const
793:5 warning 'dateTimeString' is never reassigned. Use 'const' instead prefer-const
1483:82 error 'key' is not defined no-undef
1483:100 error 'value' is not defined no-undef
throw new BackendError(this.getID(),
Cannot set the configuration param ${key} with value ${value} to ${this.getID()}, "ChargingStation", "requestChangeConfiguration")
This code is not correctly called in ChargingStationService line 427 with two parameters instead of one
result = await chargingStation.requestChangeConfiguration('maxintensitysocket', filteredRequest.maxIntensity);
In order to retrieve the logs from multiple users, the server must support query parameters with multi values. Several options are available:
During a transaction, the returned ChargeBoxID
is not the same as the one sent. In fact, it is an hexadecimal string representing it.
ChargeBoxID sent JX5HM5JMDHS9
to start a new transaction.
ChargeBoxID received 4a5835484d354a4d44485339
when reading the transaction from the server.
Implement Test Framework in the Backend
If several filters are set, the button should clear them all like if the user entered to the view the first time.
Should be a button with an icon and a text (make a proposal)
Also propose where to put it.
Needed by session UI.
Implement new Variant management in the backend.
New collection in DB: variants
View ID (Logs, Chargers...)
User ID (optionel)
List of variants
Variant Name
List filters
Filter ID
Filter content
in ChargingStation.js
, the function requestGetConfiguration
is called without providing params.
Running OCPPSoap15Test.js
will pass but if you check the logs you can see:
{ source: undefined,
module: undefined,
method: undefined,
action: 'RequestConfiguration',
message: 'Cannot destructure property `keys` of \'undefined\' or \'null\'.',
detailedMessages:
[ { stack: 'TypeError: Cannot destructure property `keys` of \'undefined\' or \'null\'.\n at SoapChargingStationClient.getConfiguration (/Users/i058319/devel/ev/ev-server/src/client/soap/SoapChargingStationClient.js:236:22)\n at ChargingStation.requestGetConfiguration (/Users/i058319/devel/ev/ev-server/src/model/ChargingStation.js:1357:46)\n at <anonymous>\n at process._tickCallback (internal/process/next_tick.js:189:7)' } ],
type: 'S',
level: 'E',
timestamp: 2018-10-29T15:21:32.066Z }
when updating a user from the UI, the server always return an error mentioning that the phone is not valid. But the phone is valid. the regex checking it is not correct.
Related to #218
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.