# react-native-esp-idf-provisioning

> Android and iOS wrapper for ESP IDF provisioning

Latest version **0.2.0** (published 2023-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-esp-idf-provisioning
pnpm add react-native-esp-idf-provisioning
yarn add react-native-esp-idf-provisioning
bun add react-native-esp-idf-provisioning
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2023-10-02 |
| First published | 2023-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 18.0.0 |
| Dependencies | 1 |
| Unpacked size | 94.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 59 |
| Author | Mateo Gianolio |
| Maintainers | mateogianolio |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-esp-idf-provisioning
- Repository: https://github.com/orbital-systems/react-native-esp-idf-provisioning
- Homepage: https://github.com/orbital-systems/react-native-esp-idf-provisioning#readme
- Issues: https://github.com/orbital-systems/react-native-esp-idf-provisioning/issues
- npm.io page: https://npm.io/package/react-native-esp-idf-provisioning

## Dependencies (1)

- [buffer](https://npm.io/package/buffer.md) ^6.0.3

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2023-10-02

## README

# react-native-esp-idf-provisioning

Android (not yet) and iOS wrapper for ESP IDF provisioning.

## Installation

```sh
npm install @orbital-systems/react-native-esp-idf-provisioning
```

## Usage

```ts
import {
  ESPProvisionManager,
  ESPDevice,
  ESPTransport,
  ESPSecurity,
} from '@orbital-systems/react-native-esp-idf-provisioning';

// Method 1.
// Get devices...
const devices = ESPProvisionManager.searchESPDevices('prefix');
// ... and select device (using picklist, dropdown, w/e)
const device = devices[0];

// Method 2.
// If you know device name and transport/security settings, create a device class instance
const device = new ESPDevice({
  name: 'name',
  transport: ESPTransport.ble,
  security: ESPSecurity.secure2,
});

// Connect to device with proofOfPossesion
const proofOfPossesion = 'pop';
await device.connect(proofOfPosession);

// Get wifi list
const wifiList = await device.scanWifiList();

// Provision device
const ssid = 'ssid';
const passphrase = 'passphrase';
await device.provision(ssid, passphrase);

// Disconnect
device.disconnect();
```

## Enums

```ts
enum ESPTransport {
  ble = 'ble',
  softap = 'softap',
}

enum ESPSecurity {
  unsecure = 0,
  secure = 1,
  secure2 = 2,
}

enum ESPWifiAuthMode {
  open = 0,
  wep = 1,
  wpa2Enterprise = 2,
  wpa2Psk = 3,
  wpaPsk = 4,
  wpaWpa2Psk = 5,
}
```

## Permissions

### Android

See AndroidManifest.xml in the example project.

### iOS

- Since iOS 13, apps that want to access SSID (Wi-Fi network name) are required to have the location permission. Add key `NSLocationWhenInUseUsageDescription` in Info.plist with proper description. This permission is required to verify iOS device is currently connected with the SoftAP.

- Since iOS 14, apps that communicate over local network are required to have the local network permission. Add key `NSLocalNetworkUsageDescription` in Info.plist with proper description. This permission is required to send/receive provisioning data with the SoftAP devices.

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)

---
_Source: https://npm.io/package/react-native-esp-idf-provisioning · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
