*_REMOTE_*.txt
*.md
*.db
-*tags-template.*
+*idtags-template.*
*config-template.*
*cf-template.*
manifest-*.yml
src/assets/config*.json
!src/assets/config-template.json
src/scripts/scriptConfig.json
-src/assets/*tags*.json
-!src/assets/authorization-tags-template.json
+src/assets/*idtags*.json
+!src/assets/idtags-template.json
mikro-orm.config*.ts
!mikro-orm.config-template.ts
manifest*.yml
## Initial configuration
Copy the configuration template file [src/assets/config-template.json](src/assets/config-template.json) to [src/assets/config.json](src/assets/config.json).
-Copy the authorization RFID tags template file [src/assets/authorization-tags-template.json](src/assets/authorization-tags-template.json) to [src/assets/authorization-tags.json](src/assets/authorization-tags.json).
+Copy the RFID tags template file [src/assets/idtags-template.json](src/assets/idtags-template.json) to [src/assets/idtags.json](src/assets/idtags.json).
Tweak them to your needs by following the section [configuration files syntax](README.md#configuration-files-syntax).
All charging station configuration templates are in the directory [src/assets/station-templates](src/assets/station-templates).
-A list of RFID tags must be defined for the automatic transaction generator with a default location and name: `src/assets/authorization-tags.json`. A template file is available at [src/assets/authorization-tags-template.json](src/assets/authorization-tags-template.json).
+A list of RFID tags must be defined for the automatic transaction generator in a file with a default location and name: `src/assets/idtags.json`. A template file is available at [src/assets/idtags-template.json](src/assets/idtags-template.json).
**Configuration files hierarchy and priority**:
| ocppPersistentConfiguration | true/false | true | boolean | enable persistent OCPP parameters storage by charging stations 'hashId'. The persistency is ensured by the charging stations configuration files in [dist/assets/configurations](dist/assets/configurations) |
| stationInfoPersistentConfiguration | true/false | true | boolean | enable persistent station information and specifications storage by charging stations 'hashId'. The persistency is ensured by the charging stations configuration files in [dist/assets/configurations](dist/assets/configurations) |
| wsOptions | | {} | ClientOptions & ClientRequestArgs | [ws](https://github.com/websockets/ws) and node.js [http](https://nodejs.org/api/http.html) clients options intersection |
-| authorizationFile | | undefined | string | RFID tags list file relative to src/assets path |
+| idTagsFile | | undefined | string | RFID tags list file relative to src/assets path |
| baseName | | undefined | string | base name to build charging stations id |
| nameSuffix | | undefined | string | name suffix to build charging stations id |
| fixedName | true/false | false | boolean | use the baseName as the charging stations unique name |
COPY .npmrc package.json pnpm-lock.yaml tsconfig.json rollup.config.mjs build-requirements.mjs skip-preinstall.cjs prepare.cjs ./
COPY src ./src
COPY docker/config.json ./src/assets/config.json
-COPY docker/authorization-tags.json ./src/assets/authorization-tags.json
+COPY docker/idtags.json ./src/assets/idtags.json
RUN set -ex \
&& apk add --no-cache --virtual .gyp build-base python3 \
&& corepack enable \
[ -z $emobility_service_type ] && { echo "emobility env service type variable not found, exiting"; exit 1; }
cp $emobility_install_dir/dist/assets/configs-aws/$emobility_server_type-$emobility_service_type-$emobility_landscape.json $emobility_install_dir/dist/assets/config.json
- cp $emobility_install_dir/dist/assets/configs-aws/$emobility_server_type-$emobility_service_type-$emobility_landscape-tags.json $emobility_install_dir/dist/assets/authorization-tags.json
+ cp $emobility_install_dir/dist/assets/configs-aws/$emobility_server_type-$emobility_service_type-$emobility_landscape-idtags.json $emobility_install_dir/dist/assets/idtags.json
else
echo "no emobility env defined, start with default configuration"
fi
{
- "authorizationFile": "authorization-tags.json",
+ "idTagsFile": "idtags.json",
"baseName": "CS-ABB",
"chargePointModel": "MD_TERRA_53",
"chargePointVendor": "ABB",
{
- "authorizationFile": "authorization-tags.json",
+ "idTagsFile": "idtags.json",
"baseName": "CS-ABB",
"chargePointModel": "MD_TERRA_53",
"chargePointVendor": "ABB",
{
- "authorizationFile": "authorization-tags.json",
+ "idTagsFile": "idtags.json",
"baseName": "CS-CHARGEX",
"chargePointModel": "Aqueduct 1.0",
"chargePointVendor": "ChargeX GmbH",
{
"supervisionUrlOcppConfiguration": true,
"supervisionUrlOcppKey": "ocppcentraladdress",
- "authorizationFile": "authorization-tags.json",
+ "idTagsFile": "idtags.json",
"baseName": "CS-EVLINK",
"chargePointModel": "MONOBLOCK",
"chargePointVendor": "Schneider Electric",
{
- "authorizationFile": "authorization-tags.json",
+ "idTagsFile": "idtags.json",
"baseName": "CS-KEBA",
"chargePointModel": "KC-P30-ESS400C2-E0R",
"chargePointVendor": "Keba AG",
{
"supervisionUrlOcppConfiguration": true,
"supervisionUrlOcppKey": "ocppcentraladdress",
- "authorizationFile": "authorization-tags.json",
+ "idTagsFile": "idtags.json",
"baseName": "CS-SCHNEIDER",
"chargePointModel": "MONOBLOCK",
"chargePointVendor": "Schneider Electric",
{
"supervisionUrlOcppConfiguration": true,
"supervisionUrlOcppKey": "ocppcentraladdress",
- "authorizationFile": "authorization-tags.json",
+ "idTagsFile": "idtags.json",
"baseName": "CS-SCHNEIDER",
"chargePointModel": "MONOBLOCK",
"chargePointVendor": "Schneider Electric",
{
- "authorizationFile": "authorization-tags.json",
+ "idTagsFile": "idtags.json",
"baseName": "CS-SIEMENS",
"fixedName": true,
"chargePointModel": "SIEMENSXX213",
{
- "authorizationFile": "authorization-tags.json",
+ "idTagsFile": "idtags.json",
"baseName": "CS-BASIC",
"chargePointModel": "Simulator simple",
"chargePointVendor": "Ovomaltin",
{
- "authorizationFile": "authorization-tags.json",
+ "idTagsFile": "idtags.json",
"baseName": "CS-BASIC",
"chargePointModel": "Simulator simple",
"chargePointVendor": "Ovomaltin",
{
- "authorizationFile": "authorization-tags.json",
+ "idTagsFile": "idtags.json",
"baseName": "CS-SIMU",
"chargePointModel": "Simulator connectors",
"chargePointVendor": "Ovomaltin",
public logPrefix = (): string => {
return Utils.logPrefix(
` ${
- (Utils.isNotEmptyString(this?.stationInfo?.chargingStationId) &&
- this?.stationInfo?.chargingStationId) ??
- ChargingStationUtils.getChargingStationId(this.index, this.getTemplateFromFile()) ??
- ''
+ (Utils.isNotEmptyString(this?.stationInfo?.chargingStationId)
+ ? this?.stationInfo?.chargingStationId
+ : ChargingStationUtils.getChargingStationId(this.index, this.getTemplateFromFile())) ??
+ 'Error at building log prefix'
} |`
);
};
public hasIdTags(): boolean {
- const idTagsFile = ChargingStationUtils.getAuthorizationFile(this.stationInfo);
+ const idTagsFile = ChargingStationUtils.getIdTagsFile(this.stationInfo);
return Utils.isNotEmptyArray(this.idTagsCache.getIdTags(idTagsFile));
}
'supervisionUrl',
'supervisionUrls'
);
+ ChargingStationUtils.warnDeprecatedTemplateKey(
+ stationTemplate,
+ 'authorizationFile',
+ this.templateFile,
+ this.logPrefix(),
+ "Use 'idTagsFile' instead"
+ );
+ ChargingStationUtils.convertDeprecatedTemplateKey(
+ stationTemplate,
+ 'authorizationFile',
+ 'idTagsFile'
+ );
const stationInfo: ChargingStationInfo =
ChargingStationUtils.stationTemplateToStationInfo(stationTemplate);
stationInfo.hashId = ChargingStationUtils.getHashId(this.index, stationTemplate);
import path from 'node:path';
import { fileURLToPath } from 'node:url';
+import chalk from 'chalk';
import moment from 'moment';
import type { ChargingStation } from './internal';
logMsgToAppend = ''
): void {
if (!Utils.isUndefined(template[key])) {
- logger.warn(
- `${logPrefix} Deprecated template key '${key}' usage in file '${templateFile}'${
- Utils.isNotEmptyString(logMsgToAppend) && `. ${logMsgToAppend}`
- }`
- );
+ const logMsg = `Deprecated template key '${key}' usage in file '${templateFile}'${
+ Utils.isNotEmptyString(logMsgToAppend) ? `. ${logMsgToAppend}` : ''
+ }`;
+ logger.warn(`${logPrefix} ${logMsg}`);
+ console.warn(chalk.yellow(`${logMsg}`));
}
}
return defaultVoltageOut;
}
- public static getAuthorizationFile(stationInfo: ChargingStationInfo): string | undefined {
+ public static getIdTagsFile(stationInfo: ChargingStationInfo): string | undefined {
return (
- stationInfo.authorizationFile &&
+ stationInfo.idTagsFile &&
path.join(
path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../'),
'assets',
- path.basename(stationInfo.authorizationFile)
+ path.basename(stationInfo.idTagsFile)
)
);
}
connectorId: number
): string {
const hashId = chargingStation.stationInfo.hashId;
- const idTagsFile = ChargingStationUtils.getAuthorizationFile(chargingStation.stationInfo);
+ const idTagsFile = ChargingStationUtils.getIdTagsFile(chargingStation.stationInfo);
switch (distribution) {
case IdTagDistribution.RANDOM:
return this.getRandomIdTag(hashId, idTagsFile);
}
private getConnectorAffinityIdTag(chargingStation: ChargingStation, connectorId: number): string {
- const file = ChargingStationUtils.getAuthorizationFile(chargingStation.stationInfo);
+ const file = ChargingStationUtils.getIdTagsFile(chargingStation.stationInfo);
const idTags = this.getIdTags(file);
const hashId = chargingStation.stationInfo.hashId;
const addressableKey = file + hashId;
chargingStation.hasIdTags() === true &&
Utils.isNotEmptyString(
chargingStation.idTagsCache
- .getIdTags(ChargingStationUtils.getAuthorizationFile(chargingStation.stationInfo))
+ .getIdTags(ChargingStationUtils.getIdTagsFile(chargingStation.stationInfo))
?.find((idTag) => idTag === commandPayload.idTag)
)
) {
protected handleRequestClearCache(chargingStation: ChargingStation): ClearCacheResponse {
chargingStation.idTagsCache.deleteIdTags(
- ChargingStationUtils.getAuthorizationFile(chargingStation.stationInfo)
+ ChargingStationUtils.getIdTagsFile(chargingStation.stationInfo)
);
return OCPPConstants.OCPP_RESPONSE_ACCEPTED;
}
ocppPersistentConfiguration?: boolean;
stationInfoPersistentConfiguration?: boolean;
wsOptions?: WsOptions;
- // FIXME: rename to idTagFile
- authorizationFile?: string;
+ idTagsFile?: string;
baseName: string;
nameSuffix?: string;
fixedName?: boolean;
) {
console.error(
chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage in section '${sectionName}'${
- logMsgToAppend.trim().length > 0 && `. ${logMsgToAppend}`
+ logMsgToAppend.trim().length > 0 ? `. ${logMsgToAppend}` : ''
}}`
);
} else if (!Utils.isUndefined(Configuration.getConfig()[key])) {
console.error(
chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage${
- logMsgToAppend.trim().length > 0 && `. ${logMsgToAppend}`
+ logMsgToAppend.trim().length > 0 ? `. ${logMsgToAppend}` : ''
}}`
);
}
ocppStrictCompliance?: boolean;
ocppPersistentConfiguration?: boolean;
stationInfoPersistentConfiguration?: boolean;
- authorizationFile?: string;
+ idTagsFile?: string;
nameSuffix?: string;
fixedName?: boolean;
iccid?: string;