# @kafudev/react-native-esp-idf

> ReactNative Provisioning application for ESP-IDF Unified provisioning

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

## Install

```sh
npm install @kafudev/react-native-esp-idf
pnpm add @kafudev/react-native-esp-idf
yarn add @kafudev/react-native-esp-idf
bun add @kafudev/react-native-esp-idf
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2023-02-02 |
| First published | 2022-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 14.0.0 |
| Dependencies | 0 |
| Unpacked size | 97.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | kafudev |
| Maintainers | suisuinian |
| Keywords | react-native, ios, android |

## Links

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

## 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.4.0 (latest) — 2023-02-02
- 0.3.1 — 2022-11-24
- 0.3.0 — 2022-11-24
- 0.2.2 — 2022-11-24
- 0.2.1 — 2022-11-24
- 0.2.0 — 2022-11-24

## README

# react-native-esp-idf

ReactNative Provisioning application for ESP-IDF Unified provisioning

## Installation

```sh
npm install @kafudev/react-native-esp-idf
```

## Note
This package is based on [react-native-esp32-idf](https://www.npmjs.com/package/react-native-esp32-idf)
This package is based on [react-native-esp-idf](https://www.npmjs.com/package/react-native-esp-idf)

with the above package without connecting to bluetooth one cannot connect to wifi of esp device, to slove that issue made neccessary changes to the code .
Now one can connect to esp device wifi without connecting to bluetooth.

Supports Both Android and IOS


## Usage

```js
import RNEspIdf, {useProvisioning} from "@kafudev/react-native-esp-idf";

// ...

// connect to esp device through wifi
// first connect to the hotspot of the device and later
const devicePrefix = 'PROV_'
	const message: MessageInfo = {
		scanBle: 'Searching device...',
		scanWifi: 'Searching available Wi-Fi...',
		connectDevice: 'Connecting your device...',
		sendingWifiCredential: 'Sending Wi-Fi credentials',
		confirmWifiConnection: 'Confirming Wi-Fi connection',
		enableBluetooth: 'Please enable the Bluetooth to start scan device.',
		enableLocation:
			'Please grant location permission to start scan device.',
		scanBleFailed: 'Scan device failed, please try again.',
		connectFailed: 'Connect to device failed, please try again.',
		disconnected: 'device disconnected, please try again.',
		initSessionError: 'Reboot your device and retry.',
		applyError: 'Reset your device and retry.',
		completed: 'Device has been successfully provisioned!',
	}
	const {
		bleDevices,
		wifiAPs,
		loading,
		status,
		currentStep,
		currentWifi,
		currentDevice,
		results,
		setCurrentStep,
		configWifi,
		connectDevice,
		connectWifiDevice, //newly added
		doProvisioning,
	} = useProvisioning({ devicePrefix, message, pop: 'abcd1234' })



// android example
const connectToEspDevice = async()=>{
    try{
        const result = await RNEspIdf.connectWifiDevice("pop"); //proof of possession

    }
    catch(err){
        console.log(err)

    }
}


// ios example
const connectToEspDevice = async()=>{
	try{
		let pop = ""
		let SSID =""
		let Password=""
		const result = await RNEspIdf.connectWifiDevice(SSID,POP,Password)

	}
	catch(err){
		console.log(err)
	}
}



```

## 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/@kafudev/react-native-esp-idf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
