npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@general-galactic/capacitor-esp-idf-provisioning

v0.0.97

Published

A capacitor plugin that wraps the Espressif IDF Provisioning libraries for iOS and Android.

Downloads

245

Readme

@general-galactic/capacitor-esp-idf-provisioning

A capacitor plugin that wraps the Espressif IDF Provisioning libraries for iOS and Android.

Using this library will allow you to use an Ionic app to provision Espressif devices running the WiFi provisioning stack.

NOTE:

I've regained access to our npm organization so this package is now published on npm instead of github packages. To consume future versions you should remove the github packages config for this repo.

Android Support

This project will only work in Android apps using SDK Level 25 or higher. Android SDK Distribution Stats

Install

npm install @general-galactic/capacitor-esp-idf-provisioning
npx cap sync

Initial Integration into an Android App

Apps will need to add the maven repo to their build.gradle file so that the ESPProvision library from Espressif can be included:

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' } // <-- Add This line
    }
}

Troubleshooting

Android build won't run after adding the npm dependency You need to add the https://jitpack.io repository to your build.gradle. See 'Initial Integration into an Android App' above.

ESPProvisioning is not implemented on [iOS|Android] You need to run npx cap sync

API

checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Check the status of system permissions:

  • ble - Bluetooth access
  • location - Location access, android only

Returns: Promise<PermissionStatus>


requestPermissions()

requestPermissions() => Promise<PermissionStatus>

Have the system prompt the user for access to the proper permissions - Android only.

Returns: Promise<PermissionStatus>


checkStatus()

checkStatus() => Promise<EspProvisioningStatus>

See if the bluetooth adapter is up and running

Returns: Promise<EspProvisioningStatus>


searchESPDevices(...)

searchESPDevices(options: { devicePrefix: string; transport: ESPTransport; security: ESPSecurity; }) => Promise<{ devices?: ESPDevice[]; }>

Perform a BLE scan to find devices that are connection with the given devicePrefix. The transport and security parameters map directly to ESPProvision's own values.

| Param | Type | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | options | { devicePrefix: string; transport: ESPTransport; security: ESPSecurity; } |

Returns: Promise<{ devices?: ESPDevice[]; }>


connect(...)

connect(options: { deviceName: string; proofOfPossession: string; }) => Promise<{ connected: boolean; }>

Connect to the device with the given name using the given proofOfPossession.

| Param | Type | | ------------- | --------------------------------------------------------------- | | options | { deviceName: string; proofOfPossession: string; } |

Returns: Promise<{ connected: boolean; }>


scanWifiList(...)

scanWifiList(options: { deviceName: string; }) => Promise<{ networks?: ESPNetwork[]; }>

Request a list of available WiFi networks from the device with the given name.

| Param | Type | | ------------- | ------------------------------------ | | options | { deviceName: string; } |

Returns: Promise<{ networks?: ESPNetwork[]; }>


provision(...)

provision(options: { deviceName: string; ssid: string; passPhrase?: string; }) => Promise<{ success: boolean; }>

Provision the device onto WiFi using the given ssid and passPhrase.

| Param | Type | | ------------- | ----------------------------------------------------------------------- | | options | { deviceName: string; ssid: string; passPhrase?: string; } |

Returns: Promise<{ success: boolean; }>


sendCustomDataString(...)

sendCustomDataString(options: { deviceName: string; path: string; dataString: string; }) => Promise<{ success: boolean; returnString?: string; }>

Send a custom string to the device with the given name. This is usefull if you need to share other data with your device during provisioning. NOTE: Android will truncate returned strings to around 512 bytes. If you need to send more than 512 bytes back on a read you'll need to implement a mechanism to do so.

| Param | Type | | ------------- | ---------------------------------------------------------------------- | | options | { deviceName: string; path: string; dataString: string; } |

Returns: Promise<{ success: boolean; returnString?: string; }>


disconnect(...)

disconnect(options: { deviceName: string; }) => Promise<void>

Disconnect from the device.

| Param | Type | | ------------- | ------------------------------------ | | options | { deviceName: string; } |


openLocationSettings()

openLocationSettings() => Promise<{ value: boolean; }>

Open the user's location settings for your app. Android only.

Returns: Promise<{ value: boolean; }>


openBluetoothSettings()

openBluetoothSettings() => Promise<{ value: boolean; }>

Open the user's bluetooth settings for your app. Android only.

Returns: Promise<{ value: boolean; }>


openAppSettings()

openAppSettings() => Promise<{ value: boolean; }>

Open the OS settings for your app.

Returns: Promise<{ value: boolean; }>


enableLogging()

enableLogging() => Promise<void>

Enable extra logging - useful for troubleshooting. Best on iOS because the iOS ESPProvision library offers much more verbose logging when enabled.


disableLogging()

disableLogging() => Promise<void>

Disable detailed logging.


Interfaces

PermissionStatus

| Prop | Type | | -------------- | ----------------------------------------------------------- | | ble | PermissionState | | location | PermissionState |

EspProvisioningStatus

| Prop | Type | | -------------- | -------------------------------------------------------------------------- | | ble | { supported: boolean; allowed: boolean; poweredOn: boolean; } | | location | { allowed: boolean; } |

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

ESPDevice

{ name: string // Your devices must have a unique name advertisementData?: ESPDeviceAdvertisingData }

ESPDeviceAdvertisingData

{ localName?: string isConnectable?: number manufacturerData?: any serviceUUIDs?: string[] }

ESPNetwork

{ ssid: string rssi: number auth: 'open' | 'wep' | 'wpapsk' | 'wpawpa2psk' | 'wpa2enterprise' | 'unknown' }

Enums

ESPTransport

| Members | Value | | ------------ | --------------------- | | ble | 'ble' | | softap | 'softap' |

ESPSecurity

| Members | Value | | -------------- | ----------------------- | | unsecure | 'unsecure' | | secure | 'secure' |