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

variable name typo leads to unable to create device session #34

Closed
tri-bao opened this issue Jan 1, 2024 · 1 comment
Closed

variable name typo leads to unable to create device session #34

tri-bao opened this issue Jan 1, 2024 · 1 comment

Comments

@tri-bao
Copy link

tri-bao commented Jan 1, 2024

Both our app and the example app in this repo could't pass the wifi scan after connecting to a device. In the example app, we can scan for the list of devices; we can select a device; but after selecting BLE, Secure1 and entering PoP, we're unable to scan Wifi.

The error message that toasted on the screen was Failed to create session

The native log in logcat was onCharacteristicWrite, status : 4
The native stack trace was

java.lang.Exception: Write to BLE failed
at com.espressif.provisioning.transport.BLETransport$1.onCharacteristicWrite(BLETransport.java:377)
at android.bluetooth.BluetoothGatt$1$7.run(BluetoothGatt.java:562)
at android.bluetooth.BluetoothGatt.runOrQueueCallback(BluetoothGatt.java:959)
at android.bluetooth.BluetoothGatt.-$$Nest$mrunOrQueueCallback(Unknown Source:0)
at android.bluetooth.BluetoothGatt$1.onCharacteristicWrite(BluetoothGatt.java:557)
at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:279)
at android.os.Binder.execTransactInternal(Binder.java:1351)
at android.os.Binder.execTransact(Binder.java:1310)

After much of debugging, I found the cause at file NativeEspIdfProvisioning.ts, method createESPDevice. The argument proofOfPossesion is misspelled (missing one s), here is it. While its koltlin counterpart in class EspIdfProvisioningModule is proofOfPossession. That make the PoP always passed to the native code as empty string which cause the session creation fails.

Could you help fix this and pump a new version? Otherwise, the plugin won't work with any secured BLE devices

@tri-bao
Copy link
Author

tri-bao commented Jan 1, 2024

It turns out the issue is difference. Named parameter is not used in this style thus the typo won't impact.

I described the real issue here: #35

@tri-bao tri-bao closed this as completed Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant