# iot-mock-clients

> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Latest version **1.0.5** (published 2017-06-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install iot-mock-clients
pnpm add iot-mock-clients
yarn add iot-mock-clients
bun add iot-mock-clients
```

## 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.5 |
| Published | 2017-06-21 |
| First published | 2017-06-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | nsalgado |

## Links

- npm: https://www.npmjs.com/package/iot-mock-clients
- Repository: https://bitbucket.org/umwerk/iot-mock-clients
- Homepage: https://bitbucket.org/umwerk/iot-mock-clients#readme
- npm.io page: https://npm.io/package/iot-mock-clients

## Dependencies (1)

- [aws-iot-device-sdk](https://npm.io/package/aws-iot-device-sdk.md) ^1.0.14

## Recent versions

- 1.0.5 (latest) — 2017-06-21
- 1.0.4 — 2017-06-14
- 1.0.3 — 2017-06-14
- 1.0.2 — 2017-06-14
- 1.0.1 — 2017-06-14

## README

# README #
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Overview ##

The iot-mock-clients.js package includes a demo client application which is based on the [aws-iot-device-sdk for Javascript](https://github.com/aws/aws-iot-device-sdk-js) package and will give you a short Introduction about the AWS Iot Platform.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
## Installation ##

Installing with npm:

```
npm install iot-mock-clients
```

Installing from Bitbucket:


```
git clone https://git@bitbucket.org/umwerk/iot-mock-clients.git
cd  iot-mock-clients
npm install
```

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Creating / connecting a thing ##

In order to connect a JS Client it is necessary to register a thing within the AWS IoT device registry. Furthermore a client certificate is required.
The folder certs/default/ contains a valid certificate (with all access policies set), so this one can be used.

1. create a thing in the AWS device registry (with a unique thingName) -  http://docs.aws.amazon.com/iot/latest/developerguide/thing-registry.html
2. (optional) create a new client certificate and attach it to the policy "umwerk-test-3-Policy"
3. attach the thing to the certificate from step 2 OR to the default certificate (cert/992c74a19b162bdc649ff352fa862fa141ea04a3e98ec641032684b445142526)

Note: The thingName must be unique. If a second client with the same thingName connects, the other one will be disconnected by the AWS IoT Hub.

Certificate files generated by AWS IoT have the following format:
 
* <certName>-private.pem.key 
* <certName>-certificate.pem.crt 
* root-CA.crt

If the default certificate is used, the client can be started like this (in the root folder):

`node index.js --thingName <thingName>`

If a new certificate was created:

`node index.js --thingName <thingName> --certFolder <path/to/cert-folder> --certName <certName>`

It is also possible to provide an alternative path for the root certificate (by defaul the root cert is expected in the same folder as the client cert). Param: caPath

`node index.js --thingName <thingName> --certFolder <path/to/cert-folder> --certName <certName> --caPath certs/default/root-CA.crt`

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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