Comments (24)
Just works(LEGACY) pairing is disabled by default for ESP32 Nimble stack in FreeRTOS. So, in addition to above config changes, you need to enable stack level config by 'make menuconfig--> Component config --> Bluetooth --> Enable NimBLE host stack --> Security manager legacy pairing'
or by setting 'CONFIG_NIMBLE_SM_LEGACY=y
in sdkconfig.
Please let us know if this works for you.
from amazon-freertos-ble-ios-sdk.
Hey, when you first connect to the device, did you see a popup to confirm pairing, and also accept the pairing on the device (by connect via serial and type 'y' to accept) ?
from amazon-freertos-ble-ios-sdk.
No, I didn't see a popup asking me to confirm pairing, nor did I see a prompt on the serial connection to type 'y' to confirm.
When I start the demo app, the ESP32 is shown in the list of devices (it's the only device in the list).
When I tap the device name in the list, a green vertical bar appears to the right of the device name.
When I tap the device name again, a popup menu asks me if I want to do MQTT Proxy, Network Config or Custom GATT MQTT. If I choose "Network Config" then I get the screen that should be listing all the SSIDs available, but no SSIDs are shown.
from amazon-freertos-ble-ios-sdk.
I see, one thing to rule out is old BLE bonding on iOS. Have you connected with this ESP device before with this phone? If so could you go to settings > bluetooth > and forget the ESP device. If this didn't work, please restart the phone as there may be other cached BLE info.
from amazon-freertos-ble-ios-sdk.
Yes, I had connected previously with this phone. So I deleted the ESP32 from the list of BT devices in iOS Settings, and just for good measure, I rebooted the phone.
This time when I started the demo app I did get a "pairing" confirmation on the phone and a 'y' confirmation on the serial connection However, after confirming those two prompts, I still get an empty list of scanned networks (and I see the same error in the debug log).
from amazon-freertos-ble-ios-sdk.
Could you post the debug log from the ESP so we could debug further?
from amazon-freertos-ble-ios-sdk.
Here are the logs from the esp32 and ios app.
esp32.log
ios.log
from amazon-freertos-ble-ios-sdk.
Hi @jkeiththomson,
WiFi provisioning is not enabled by default on Amazon FreeRTOS devices, so you need to explicitly enableby defining the following config to 1 in the file iot_ble_config.h
#define IOT_BLE_ENABLE_WIFI_PROVISIONING ( 1 )
Let us know if this fixes the problem.
from amazon-freertos-ble-ios-sdk.
It didn't fix the problem but we did get a little further along. Here are the new logs.
esp32-1.log
ios-1.log
from amazon-freertos-ble-ios-sdk.
from the log: GATT_INSUF_AUTHENTICATION: MITM required
it looks like we are still having a bonding issue, could you forget the device in the settings and try again? btw, are you erasing the flash when updating the firmware on the ESP, that will remove the bonding from the ESP so you may have to redo the bonding.
from amazon-freertos-ble-ios-sdk.
Redoing the bonding did the trick! Thank you! I can now enumerate the WiFi networks around me and connect to my home network.
I will take care not to erase the flash before updating the firmware next time.
Thanks again for your help.
from amazon-freertos-ble-ios-sdk.
Sorry - I have another question. Why do I need to hit 'y' on the serial connection to the ESP to confirm the bonding? That won't be possible for our end users to do. Is that just a debugging thing?
from amazon-freertos-ble-ios-sdk.
So by default we use the highest security setting BLE offers which is Numeric Comparison that requires you to confirm that you are seeing the same number on both the phone and the device (by pressing Y), however if the device you are building does not have a screen or input, you could choose to use a lower security setting. The 'Pairing procedure and I/O capabilities' graph here is a good reference of these settings. https://medium.com/rtone-iot-security/deep-dive-into-bluetooth-le-security-d2301d640bfc
I'll ask @ravibhagavandas to point you to the file where you can change these settings.
from amazon-freertos-ble-ios-sdk.
Hi,
To enable just works pairing ( pairing without numeric comparison ) you want to override the following config in iot_ble_config.h
#define IOT_BLE_ENABLE_NUMERIC_COMPARISON ( 0 )
#define IOT_BLE_ENABLE_SECURE_CONNECTION ( 0 )
#define IOT_BLE_INPUT_OUTPUT ( eBTIONone )
from amazon-freertos-ble-ios-sdk.
@ravibhagavandas @xuaninbox i have set these setting but it wont work i just want to remove press y key
from amazon-freertos-ble-ios-sdk.
when i am changing values i am getting error
E (6161) AFR-BLE: Just works in Secure Connections only mode
#define IOT_BLE_ENABLE_NUMERIC_COMPARISON ( 1 )
#define IOT_BLE_ENABLE_SECURE_CONNECTION ( 1 )
#define IOT_BLE_INPUT_OUTPUT (eBTIONone )
and if i change it to
#define IOT_BLE_ENABLE_NUMERIC_COMPARISON ( 1 )
#define IOT_BLE_ENABLE_SECURE_CONNECTION ( 1 )
#define IOT_BLE_INPUT_OUTPUT (eBTIODisplayOnly )
it asking me for password if i entered 0000 or 1234 but still i its didnt get provision
i just want to remove y key confirmation from device side because we dont have any input or display to our device
from amazon-freertos-ble-ios-sdk.
As mentioned above, to enable Just Works Pairing you need to set the following configs as below in iot_ble_config.h
#define IOT_BLE_ENABLE_NUMERIC_COMPARISON ( 0 )
#define IOT_BLE_ENABLE_SECURE_CONNECTION ( 0 )
#define IOT_BLE_INPUT_OUTPUT ( eBTIONone )
Let me know if this configuration worked for you.
from amazon-freertos-ble-ios-sdk.
Hi!
We're not able to make the Just Works Pairing works.
Using the configuration:
#define IOT_BLE_ENABLE_NUMERIC_COMPARISON ( 0 )
#define IOT_BLE_ENABLE_SECURE_CONNECTION ( 0 )
#define IOT_BLE_INPUT_OUTPUT ( eBTIONone )
The app is not able to pair with the ESP32. The connectionStatus never gets BLE_CONNECTED value.
On the other hand if I try with other configurations, everything works fine. For example, we just tried the "Y" confirmation at ESP side and the pairing was good.
Any hints about what we are doing wrong?
Thanks in advance
from amazon-freertos-ble-ios-sdk.
yes with the y confirmation pairing done smoothly but i just want to remove the confirmation from esp side as @ravibhagavandas mention i tried with the above configuration but its not working for me its showing error like afr:ble works in secure mode only
or after some time getting massage like
GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=187 adv_itvl_max=375
5 4020 [ble] [INFO ][DEMO][40200] BLE disconnected with remote device, connId = 0
when i search for ble i found esp when i select it "more..."option should be available but it is not and getting above massage
i am using android SDK app with Bluetooth version 5
from amazon-freertos-ble-ios-sdk.
@ravibhagavandas i think iot_ble_config_defaults.h is also need to change or keep it as it is
from amazon-freertos-ble-ios-sdk.
Thanks for your inputs.
We are able to reproduce an issue with ESP32 device when trying to pair in Just Works mode with IOS SDK. We are debugging this issue further and will get back to you on this.
from amazon-freertos-ble-ios-sdk.
@ravibhagavandas thanks for response i will also try to find the solution hope soon we will get output
from amazon-freertos-ble-ios-sdk.
We see an issue with ESP (NIMBLE) porting layer for BLE, for Just Works pairing mode. The issue is reproducible with our IoS and Android SDKs. We are in touch with ESP team regarding this, and will post as soon as we get some updates.
from amazon-freertos-ble-ios-sdk.
hi @ravibhagavandas i have tested and its works fine thank you for solution ;)
from amazon-freertos-ble-ios-sdk.
Related Issues (19)
- Wi-Fi provisioning fails on ESP32 board with "Failed to allocate taskpool" error HOT 3
- Unable to access secure values after disconnecting from device HOT 7
- Return error when incorrect password is provided HOT 8
- CBOR encoding crashes when saving a network SSID with UTF characters HOT 5
- Get afrVersion spelled gatAfrVersionOfPeripheral HOT 2
- Trying to compile demo throws errors on unknown symbols for arm64 HOT 1
- XCode 13 / Swift 5.5 Support, Cut new release? HOT 2
- Replace JSON with CBOR for efficiency HOT 1
- Bluetooth is not getting connected in one go HOT 2
- AFR LTS Release HOT 16
- Published (demo) app in appstore HOT 1
- Undefined symbols for architecture arm64 HOT 10
- PIN-Based Bluetooth Connection without Default Popup HOT 4
- Make Large Object Transfer as its own service and expose in SDK HOT 1
- Terminating app due to uncaught exception 'NSInvalidArgumentException' HOT 9
- https://github.com/aws/amazon-freertos-ble-ios-sdk.git: No such file or directory HOT 4
- Add auto reconnect on disconnect HOT 1
- pod is throwing the error: The SWIFT_VERSION is missing for "AWSMobileClient" & "CBORSWift". HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-freertos-ble-ios-sdk.