# react-native-smartconfig-iot

> react-native ESP8266 smartconfig module

Latest version **0.3.3** (published 2020-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-smartconfig-iot
pnpm add react-native-smartconfig-iot
yarn add react-native-smartconfig-iot
bun add react-native-smartconfig-iot
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.3 |
| Published | 2020-10-13 |
| First published | 2020-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 194.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | zbwang |
| Keywords | react-native, react, native, iot, esp8266, smartconfig, esptouch, airkiss |

## Links

- npm: https://www.npmjs.com/package/react-native-smartconfig-iot
- npm.io page: https://npm.io/package/react-native-smartconfig-iot

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.3.3 (latest) — 2020-10-13
- 0.3.2 — 2020-10-13
- 0.3.1 — 2020-10-13
- 0.3.0 — 2020-10-13
- 0.2.9 — 2020-10-13
- 0.2.8 — 2020-10-13
- 0.2.7 — 2020-10-13
- 0.2.6 — 2020-10-13
- 0.2.5 — 2020-10-13
- 0.2.4 — 2020-10-11
- 0.2.3 — 2020-10-10
- 0.2.2 — 2020-10-10

## README

## Description

[react-native](https://github.com/facebook/react-native) module for [ESP8266 ESPTOUCH Smart config](https://github.com/EspressifApp)

- Forked from [tuanpmt/react-native-smartconfig](https://github.com/tuanpmt/react-native-smartconfig).

- Improvements are made to increase its stablity and become compatible with higher versions of react-native (e.g. 6.3.1)

- Example app is provided if you want to test or improve this repo again.

## Features
* Support both IOS and Android
* React Native Promise support
* Fast way to do configure wifi network for IOT device
* Log can be sent to js module

## Getting started
### Mostly automatic install (RN >= 0.60 )
1.  yarn add react-native-smartconfig-iot
2.  yarn android or yarn ios

### Manually install
please refer to [this part](https://github.com/tuanpmt/react-native-smartconfig#manual-install)

### Test this repo locally
```bash
// move example to the same folder level of react-native-smartconfig-iot
+-- example
+-- react-native-smartconfig-iot
|   +-- android
|   +-- ios

cd ../example
yarn && yarn android

// if you want to update this repo and retest, execute the following command after every change
rm -rf node_modules\react-native-smartconfig-iot && yarn --force && yarn android
```

## Usage

```javascript
import Smartconfig from 'react-native-smartconfig-iot';

Smartconfig.start({
  type: 'esptouch', //or airkiss, now doesn't not effect
  ssid: 'wifi-network-ssid',
  bssid: 'filter-device', //"" if not need to filter (don't use null)
  password: 'wifi-password',
  timeout: 50000 //now doesn't not effect
}).then(function(results){
  //Array of device success do smartconfig
  console.log(results);
  /*[
    {
      'bssid': 'device-bssi1', //device bssid
      'ipv4': '192.168.1.11' //local ip address
    },
    {
      'bssid': 'device-bssi2', //device bssid
      'ipv4': '192.168.1.12' //local ip address
    },
    ...
  ]*/
}).catch(function(error) {

});

Smartconfig.stop(); //interrupt task
```

## Todo

* [ ] Support automatic get current wifi network ssid
* [ ] Set timeout effect
* [ ] Support airkiss

## LICENSE

```
  The MIT License (MIT)

  Copyright (c) 2015 <TuanPM> https://twitter.com/tuanpmt

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.
```

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