oliexdev / openScale

Open-source weight and body metrics tracker, with support for Bluetooth scales
GNU General Public License v3.0
1.68k stars 292 forks source link

HealthifyMe Scale (QN-Scale) App crash #981

Open naks110 opened 1 year ago

naks110 commented 1 year ago

Describe the bug Instant app crash when OpenScale connects to the scale over BT. Scanning to add works & it can be added to list. QN-SCALE - HealthifyMe Scale - Model: CS20M

To Reproduce Steps to reproduce the behavior:

  1. Go to '...' try powering on scale by standing, then app will crash
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Reproduced with latest dev version: YES

Expected behavior It should connect with scale Additional context Build version: 2.5.2 Build date: 1981-01-01 01:01:02 Current date: 2023-08-12 13:46:18 Device: Samsung SM-M315F OS version: Android 12 (SDK 31)

Stack trace:
java.lang.NullPointerException: no valid characteristic provided at j$.util.Objects.requireNonNull(Unknown Source:5) at com.welie.blessed.BluetoothPeripheral.writeCharacteristic(BluetoothPeripheral.java:1229) at com.health.openscale.core.bluetooth.BluetoothCommunication.writeBytes(BluetoothCommunication.java:303) at com.health.openscale.core.bluetooth.BluetoothCommunication.writeBytes(BluetoothCommunication.java:291) at com.health.openscale.core.bluetooth.BluetoothQNScale.onNextStep(BluetoothQNScale.java:111) at com.health.openscale.core.bluetooth.BluetoothCommunication.nextMachineStep(BluetoothCommunication.java:610) at com.health.openscale.core.bluetooth.BluetoothCommunication.nextMachineStep(BluetoothCommunication.java:612) at com.health.openscale.core.bluetooth.BluetoothCommunication.nextMachineStep(BluetoothCommunication.java:612) at com.health.openscale.core.bluetooth.BluetoothCommunication.resumeMachineState(BluetoothCommunication.java:210) at com.health.openscale.core.bluetooth.BluetoothCommunication$1.onServicesDiscovered(BluetoothCommunication.java:464) at com.welie.blessed.BluetoothPeripheral$1$1.run(BluetoothPeripheral.java:210) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8751) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135) openScale_2023-08-12_13-48.txt

Debug log Attach a debug log (see Settings -> About -> Save debug log to file) that is captured while reproducing the issue.