# ocpp-eliftech

> OCPP 1.6: Open Charge Point Protocol

Latest version **1.0.2** (published 2019-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install ocpp-eliftech
pnpm add ocpp-eliftech
yarn add ocpp-eliftech
bun add ocpp-eliftech
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-04-24 |
| First published | 2018-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 387.6 KB |
| Known vulnerabilities | 0 (+4 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 68 |
| Author | Vitalii Savchuk |
| Maintainers | esvit |

## Links

- npm: https://www.npmjs.com/package/ocpp-eliftech
- Repository: https://github.com/elifTech/cpd-ocpp
- Homepage: https://github.com/elifTech/cpd-ocpp#readme
- Issues: https://github.com/elifTech/cpd-ocpp/issues
- npm.io page: https://npm.io/package/ocpp-eliftech

## Dependencies (6)

- [ws](https://npm.io/package/ws.md) ^4.0.0
- [joi](https://npm.io/package/joi.md) ^13.1.2
- [uuid](https://npm.io/package/uuid.md) ^3.2.1
- [debug](https://npm.io/package/debug.md) ^3.1.0
- [enjoi](https://npm.io/package/enjoi.md) ^3.2.2
- [joi-date-extensions](https://npm.io/package/joi-date-extensions.md) ^1.1.1

## Recent versions

- 1.0.2 (latest) — 2019-04-24
- 1.0.1 — 2018-02-21
- 1.0.0 — 2018-02-17

## README

# Open Charge Point Protocol 1.6

[![Build Status](https://travis-ci.org/elifTech/cpd-ocpp.svg?branch=master)](https://travis-ci.org/elifTech/cpd-ocpp)

This repository contain abstraction layer for easy work with OCPP and validate input and output requests.
Currently implemented only version 1.6 JSON. Whereas OCPP2.0 will support only JSON have no plans to implement SOAP.

## Article

https://www.eliftech.com/blog/48-a-diy-charging-point-for-an-electric-car-perspective-protocol-and-prototype

## Installation
```
npm install --save ocpp-eliftech
```

## Overview

Open Charge Point Protocol (OCPP, <http://www.openchargealliance.org/>) is a communication protocol between multiple charging stations ("charge points") and a single management software ("central system").

## Usage

Server

```js
import { OCPPServer, OCPPCommands } from 'ocpp-eliftech';

const server = new OCPPServer();

server.listen(9220);

server.onRequest = async function(command) {
    // Handle different commands
    if (command instanceof OCPPCommands.BootNotification) {
        return {
            status: 'Accepted',
            currentTime: new Date().toISOString(),
            interval: 60
        };
    }
}
```

Client

```js
import { OCPPClient, OCPPCommands } from 'ocpp-eliftech';

const client = new OCPPClient({
    serverUrl: 'http://localhost:9220/webServices/ocpp/CP1111'
});

await client.connect();

const boot = new OCPPCommands.BootNotification({
    chargePointVendor: 'BrandX',
    chargeBoxSerialNumber: 'AQ1234VB5678',
    chargePointSerialNumber: '123',
    chargePointModel: '12'
});

let answer = await client.send(boot);
console.info(answer);
```

### P.S.

If you need professional support with your IOT projects contact us http://www.eliftech.com/.

---
_Source: https://npm.io/package/ocpp-eliftech · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
