
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
@orbital-systems/react-native-esp-idf-provisioning
Advanced tools
Android and iOS wrapper for ESP IDF provisioning
Android and iOS bridge for ESP IDF provisioning. Provides a unified interface for BLE and SoftAP provisioning using the libraries provided by Espressif:
SoftAP mode is not tested and probably does not work yet. Feel free to help with this. See #6.
QR code scanning is deliberately not supported. This can be done using other react-native libraries.
npm install @orbital-systems/react-native-esp-idf-provisioning
import {
ESPProvisionManager,
ESPDevice,
ESPTransport,
ESPSecurity,
} from '@orbital-systems/react-native-esp-idf-provisioning';
// Method 1.
// Get devices...
let prefix = 'PROV_';
let transport = ESPTransport.ble;
let security = ESPSecurity.secure2;
const devices = await ESPProvisionManager.searchESPDevices(
prefix,
transport,
security
);
// ... and select device (using picklist, dropdown, w/e)
const device: ESPDevice = 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 proofOfPossession
const proofOfPossession = 'pop';
await device.connect(proofOfPosession);
// Connect to device with proofOfPossession + username
const proofOfPossession = 'pop';
const username = 'username';
await device.connect(proofOfPosession, null, username);
// Connect to device with softAP password
const softAPPassword = 'password';
await device.connect(null, softAPPassword, null);
// Get wifi list
const wifiList = await device.scanWifiList();
// Provision device
const ssid = 'ssid';
const passphrase = 'passphrase';
await device.provision(ssid, passphrase);
// Disconnect
device.disconnect();
There have been several attempts to create a react-native bridge of Espressif's native libraries.
Below are a few examples:
We wanted something that is guaranteed to be compatible with the latest versions of Android and iOS. We also needed it to work with the latest (or almost latest) version of react-native.
The examples above were great for inspiration, but they were all abandoned a while ago.
Since this is something we as a company (Orbital Systems) rely on for our current and future IoT devices, we decided it was worth it to create and maintain a library with help from the community.
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,
}
See AndroidManifest.xml in the example project.
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.
To use BLE, you must add an entry for NSBluetoothAlwaysUsageDescription to your app.json.
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
Android and iOS wrapper for ESP IDF provisioning
We found that @orbital-systems/react-native-esp-idf-provisioning demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.
Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.