This repository contains a Navigation Service Provider (NSP) implementation that follows the Open Charge Point Interface (OCPI) protocol, along with custom extensions for enhanced functionality. The service includes a React application for managing smart location information.
- Credentials (v2.2): For registering and authenticating with other OCPI parties
- Versions (v2.2): For discovering available OCPI versions and modules
- Locations (v2.2.1): For managing charging station location data
- Smart Locations: Enhanced location data management with additional features
- OCN Credentials: Management of Open Charging Network credentials
- Hub Client Info: Management of hub client information, connection status, and supported modules
The repository includes a React-based web application that provides a user interface for:
- Viewing and managing smart location information
- Monitoring charging station status
- Configuring location-specific parameters
The UI can be accessed at /navigator/ui after starting the service.
- Java 17+
- Maven 3.6+
- MongoDB 4.4+
- Access to an OCN node (if using OCN functionality)
Create an application.properties or application.yml file in the src/main/resources directory with the following properties:
# Server Configuration
server.port=8080
# Party Configuration
party.url=http://localhost:8080
party.tokenB=your-token-b-here
party.role=NSP
party.api-prefix=/ocpi/emsp
party.api-non-ocpi-prefix=/non-ocpi/emsp
party.command-timeout=60
party.private-key=your-private-key-here
party.party-id=YOUR-PARTY-ID
party.country-code=US
party.zone-id=Europe/Berlin
party.collection-prefix=nsp_
# MongoDB Configuration
spring.data.mongodb.uri=mongodb://localhost:27017/navigation-service
spring.data.mongodb.auto-index-creation=true
# OCN Node Configuration
ocn-node.updating-party=true
ocn-node.url=https://your-ocn-node-url
ocn-node.admin-key=your-ocn-admin-key
ocn-node.signing-supported=true
# Logging
logging.level.com.sharenergy=DEBUG
logging.level.org.springframework.data.mongodb=WARN
# Swagger/OpenAPI
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.api-docs.path=/api-docs-
Basic Configuration:
party.url: The base URL where this service is hostedparty.tokenB: A secure token for authenticating with other partiesparty.role: Set toNSPfor this serviceparty.party-idandparty.country-code: Your unique identifiers in the e-mobility ecosystem
-
MongoDB Configuration:
- Configure the MongoDB connection URI
- The
party.collection-prefixwill be added to all MongoDB collection names
-
OCN Node Configuration (if using OCN):
ocn-node.url: URL of your OCN nodeocn-node.admin-key: Admin key for OCN node accessparty.private-key: Your private key for signing OCN messagesocn-node.signing-supported: Set to true if using signed messages
# Build the project
mvn clean package
# Run the application
java -jar target/banula-navigation-service-0.0.1-SNAPSHOT.jar# Build Docker image
docker build -t banula-navigation-service .
# Run Docker container
docker run -p 8080:8080 -v /path/to/config:/app/config banula-navigation-service- Access the Swagger UI at
http://localhost:8080/swagger-ui.htmlto explore the API - Test the version endpoint at
http://localhost:8080/ocpi/emsp/2.2/versions - Access the React UI at
http://localhost:8080/navigator/ui
To connect with other OCPI parties:
- Use the credentials module to register with the other party
- Exchange tokens through the OCPI registration process
- Begin sharing location data through the locations module
For detailed integration steps, refer to the OCPI Documentation.
The Smart Locations module extends standard OCPI locations with additional features:
- Enhanced POI information
- Dynamic status updates
- Custom attributes for specific use cases
Use the React UI or the API endpoints to manage smart location data.
Unique MeLo / MaLo. A metering_location_id, market_location_id or malo belongs to one smart location only: two locations sharing one would read the same meter readings and settle the same energy twice. A smart location update (POST/PATCH /api/v1/internal/locations/{cc}/{party}/{id}) that sets a value another location already holds is rejected with status 2001 and names that location. In the CSV bulk import the same conflict does not fail the request: it returns HTTP 200 and reports the row in errors (row number, location key and message, no status code), while the other rows are still imported. At startup each of the three fields also gets a partial unique index (unique_meteringLocationId, unique_marketLocationId, unique_malo, only where the value is set); while stored data still holds a duplicate the index is skipped and the conflicting locations are logged as ERROR, and it is built on the first start after the data is fixed. The CDR Adapter builds the same indexes on its mirror.
Common issues and their solutions:
- Connection refused errors: Check MongoDB connection settings
- Authentication failures: Verify your tokens and credentials
- OCN handshake errors: Ensure OCN node URL and credentials are correct
- Missing collections: Verify MongoDB permissions and database existence
For more detailed logs, adjust the logging levels in the properties file.
OLI Systems GmbH
Contributors: