GridAPPS-D IEEE 2030.5 Server
Overview
The GridAPPS-D IEEE 2030.5 Server implements the Common Smart Inverter Profile (CSIP). The server
can work in both in-band and out-of-band registration models detailed in CCIP Implementation Guide v2
section 6.1.3 and 6.1.4 respectively.
Setup
Installing from pypi
The recommended way to install this project from pypi is in a virtual environment. Create a virtual environment and install
2030.5 server as follows.
# creates an environment 'env' in the current directory
python3 -m venv env
# Activate the environment in the current shell
source env/bin/activate
# Install 2030.5 server
pip install gridappsd_2030_5
Configuration
The server requires two configuration files. The first is for generation of certificates and keys for the system (openssl.cnf). Currently
we shell out to openssl for key/cert/ca generation during runtime. Each time the server is started up it will attempt to regenerate
key/certs/ca unless --no-create-certs is passed to the server startup method. The second is the configuration for the server itself.
The configuration file holds the definitions for controls, der, end devices and other settings that will be used during the runtime
of the server.
The following files, openssl.cnf and config.yml, should be placed in the same directory where the server is started from.
Example openssl.cnf
HOME = .
RANDFILE = $ENV::HOME/.rnd
oid_section = new_oids
[ new_oids ]
tsa_policy1 = 1.2.3.4.1
tsa_policy2 = 1.2.3.4.5.6
tsa_policy3 = 1.2.3.4.5.7
[ ca ]
default_ca = CA_default
[ CA_default ]
dir = $ENV::HOME/tls
certs = $dir/certs
database = $dir/index.txt
new_certs_dir = $dir/certs
certificate = $dir/certs/ec-cacert.pem
serial = $dir/serial
crlnumber = $dir/crlnumber
private_key = $dir/private/ec-cakey.pem
name_opt = ca_default
cert_opt = ca_default
default_days = 365
default_crl_days= 30
default_md = sha256
preserve = no
policy = policy_match
[ policy_match ]
countryName = optional
stateOrProvinceName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ req ]
default_bits = 2048
default_md = sha256
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
x509_extensions = v3_ca
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = IN
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Some-State
localityName = Locality Name (eg, city)
localityName_default = BANGALORE
0.organizationName = Organization Name (eg, company)
0.organizationName_default = GoLinuxCloud
organizationalUnitName = Organizational Unit Name (eg, section)
commonName = Common Name (eg, your name or your server\'s hostname)
commonName_max = 64
emailAddress = Email Address
emailAddress_max = 64
[ req_attributes ]
challengePassword = A challenge password
challengePassword_min = 4
challengePassword_max = 20
unstructuredName = An optional company name
[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
[ v3_ca ]
# Extensions for a typical CA
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer
basicConstraints = critical,CA:true
[ crl_ext ]
# issuerAltName=issuer:copy
authorityKeyIdentifier=keyid:always
---
server: 127.0.0.1
https_port: 7443
proxy_hostname: 0.0.0.0:8443
tls_repository: "./tls"
openssl_cnf: "openssl.cnf"
server_mode: enddevices_create_on_start
lfdi_mode: lfdi_mode_from_cert_fingerprint
generate_admin_cert: True
log_event_list_poll_rate: 60
device_capability_poll_rate: 60
devices:
- id: dev1
deviceCategory: FUEL_CELL
pin: 111115
programs:
- description: Program 1
ders:
- capabilities:
modesSupported: "1110000000000000"
type: 83
- capabilities:
modesSupported: "1110000000000000"
type: 83
rtgMaxW: 600
rtgMaxVA: 600
rtgNormalCategory: 1
rtgAbnormalCategory: 1
rtgMaxVar: 600
rtgMaxVarNeg: 600
rtgMaxChargeRateW: 600
rtgMaxChargeRateVA: 600
rtgVNom: 120
rtgMaxV: 128
rtgMinV: 116
- id: dev2
deviceCategory: FUEL_CELL
pin: 12345
nameplate:
programs:
- description: Program 1
default_control: Control 1
controls:
- Control 2
- Control 3
curves:
- Curve 1
primacy: 89
controls:
- description: Control 1
setESDelay: 30
base:
opModConnect: True
opModMaxLimW: 9500
- description: Control 2
- description: Control 3
events:
- control: 0
curves:
- description: Curve 1
curveType: opModVoltVar
CurveData:
- xvalue: 5
yvalue: 5
- description: Curve 2
curveType: opModFreqWatt
CurveData:
- exitation: 10
xvalue: 5
yvalue: 5
Starting the server
After installing one can start the server by the folloing command:
2030_5_server --no-validate config.yml
To learn about other options please use the help module.
2030_5_server --help
Installing from source
The installation requires poetry version 1.2 or greater. https://python-poetry.org/docs/#installation
- Clone the repository
- run
poetry install
from the root of the repository directory.
Clone the repository
git clone https://github.com/GRIDAPPSD/gridappsd-2030_5 -b develop
cd gridappsd-2030_5
Install Requirements
poetry install
Run the Server
usage: 2030_5_server [-h] [--no-validate] [--no-create-certs] [--debug] config
positional arguments:
config Configuration file for the server.
optional arguments:
-h, --help show this help message and exit
--no-validate Allows faster startup since the resolving of addresses for devices is not done.
--no-create-certs If specified certificates for for client and server will not be created.
--debug Put server in debug mode (more logging)
Using the 2030.5 proxy
The proxy is used to keep a http 1.1 connection alive rather than doing the tls setup
more than one time.
usage: 2030_5_proxy [-h] [--debug] config
positional arguments:
config Configuration file for the server.
optional arguments:
-h, --help show this help message and exit
--debug Turns debugging on for logging of the proxy.
Client Connectivity
The server will expose an endpoint of beginning with https://myserver/dcap. From there
a client will be able to traverse and do any PUT, POST, GET, and DELETE operations specified
in the 2030.5 test procedures.
Function Sets Implemented