Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SoftAP mode #6

Open
mateogianolio opened this issue Oct 3, 2023 · 7 comments
Open

Support SoftAP mode #6

mateogianolio opened this issue Oct 3, 2023 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@mateogianolio
Copy link
Member

mateogianolio commented Oct 3, 2023

We currently do not have a device to test SoftAP provisioning with so any help appreciated!

@mateogianolio mateogianolio added the help wanted Extra attention is needed label Dec 15, 2023
@toni1703
Copy link

Hello, i have installed your library and I like it very much. I have a device for testing. Let's talk

@mateogianolio
Copy link
Member Author

Fantastic! I'm on vacation until January 2nd, if I have time before that I'll look through the code and compile a list of what needs to be tested.

@toni1703
Copy link

Fantastic! I'm on vacation until January 2nd, if I have time before that I'll look through the code and compile a list of what needs to be tested.

Hi again, Do you have time to test this?

@mateogianolio
Copy link
Member Author

mateogianolio commented Jan 16, 2024

Sure, we should be able to test it in the example app.

As far as I can tell we need to adjust some code in createESPDevice on Android because now it assumes BLE transport (checks for espDevice?.bluetoothDevice). But it might work if you scan for devices first like this:

let prefix = 'PROV_';
let transport = ESPTransport.softap;
let security = ESPSecurity.secure2;
const devices = await ESPProvisionManager.searchESPDevices(
  prefix,
  transport,
  security
);

// ... get device from list...

On iOS it should work with current code, but they say "SoftAP search is not supported in iOS currently." so you would need to configure the device like this:

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

const device = new ESPDevice({
  name: 'name',
  transport: ESPTransport.softap,
  security: ESPSecurity.secure2,
});

Then, on both Android and iOS connect with:

const proofOfPossession = 'proof of possession'; // or null if ESPSecurity.unsecure
const softAPPassword = 'softAPPassword';
const username = 'username'; // or null if ESPSecurity.unsecure or ESPSecurity.secure1

await device.connect(proofOfPossession, softAPPassword, username)

@fullychargedup
Copy link

Did you ever get this to work for Soft AP?

@mateogianolio
Copy link
Member Author

Hey there! Unfortunately, we haven't had time to try it yet because we only do BLE setup at the company. So the above code might or might not work.

@egidiusmengelberg
Copy link

Hi, any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants