RfidResearchGroup / ChameleonUltra

The new generation chameleon based on NRF52840 makes the performance of card emulation more stable. And gave the chameleon the ability to read, write, and decrypt cards.
https://chameleonultra.com
GNU General Public License v3.0
838 stars 144 forks source link

Unable to clear ble bonds after update to v1.0 #138

Closed georgikoemdzhiev closed 11 months ago

georgikoemdzhiev commented 11 months ago

Things to try before submitting a bug report

Compilation problems Try compiling with verbose. Use make VERBOSE=1 for the firmware and the software/src tools. Include the verbose compilation logs.

flashing problems Have you followed the instructions properly?

Describe the bug Unable to clear ble bonds after update to v1.0. I am also unable to connect to the device using the ChamelionUltraGUI app as well.

To Reproduce

  1. I updated my ChamelionUltra to the latest version using the ChamelionUltraGUI app
  2. I connected the device to my PC and connected it using Serial
  3. I executed hw ble bonds clear

Expected behavior The Bluetooth bonds get cleared without errors

Actual behaviour I am getting this error:

[USB] chameleon --> hw ble bonds clear
Serial Error device reports readiness to read but returned no data (device disconnected or multiple access on port?), thread for receiver exit.

Screenshots n/a

Host (please complete the following information):

Additional context After I "Forgot" the device on my phone and retried connecting to the chamelionUltra it was able to connect to it without issues.

xianglin1998 commented 11 months ago

This is a bug, and pairing is disabled by default in the new firmware. In this case, the API that clears binding records should unconditionally return success without performing any operations, otherwise it will cause the chameleon to crash.

aramova commented 11 months ago

On a Pixel 7 device, all BT pairings removed with the latest GUI (Commit 290) fresh install with no data or cache in place and Ultra firmware Version: v1.0 (dev-142-g0dc83b4-dirty the following occurs:

Connected via USB with cli:

  1. Enable ble pairing via CLI
  2. Scan with GUI on Phone
  3. Attempt to pair via the GUI
  4. CLI shows the subsequent "No task wait process $NNNN" values shown below
  5. GUI fails as timeout waiting for response to command 1000
[USB] chameleon --> hw settings blepair
 - Is ble pairing enable: No
[USB] chameleon --> hw settings blepair -e 1
 - Is ble pairing enable: No
 - Successfully change ble pairing to Enable state.
[USB] chameleon --> hw settings store
Storing settings...
 - Store success @.@~
[USB] chameleon --> No task wait process: $1019
No task wait process: $1025
No task wait process: $1000
[USB] chameleon --> hw version
 - Version: v1.0 (dev-142-g0dc83b4-dirty)
doegox commented 11 months ago

I think you need to quit the CLI before attempting to connect via the GUI

aramova commented 11 months ago

You're correct. It's odd cause it worked in prior versions, I went back and checked some screen recordings I was making for firmware update/cli interaction how-tos. Maybe it was a bug prior allowed for that behavior?

I'll withdraw my report as this appears to be WAI.

xianglin1998 commented 11 months ago

Fixed by 98605be

In this commit, must initialize the pairing manager. However, whether to handle BLE events in the pairing manager is determined by the setting parameters loaded during the first wake-up.