openScale icon indicating copy to clipboard operation
openScale copied to clipboard

Renpho ES-CS20M: on connection OpenScale crashes

Open AtomicFS opened this issue 1 year ago • 5 comments

Describe the bug When attempting to connect to the scale the app immediately crashes.

To Reproduce Steps to reproduce the behavior:

  1. I did set-up a user
  2. Picked the scale (Renpho ES-CS20M)
  3. Clicked on connect button
  4. Crash

Additional context The scale is brand new. Afterwards I tried the official app, which works just fine. Then tried OpenScale again, with the same username, but issue still persists.

Official app reports firmware version v2.0 for the scale. The BLE MAC address does match in both apps, not sure why it shows up as QN-Scale.

Installed from F-droid.

Crash log

Build version: 2.5.3 
Build date: 1981-01-01 01:01:02 
Current date: 2025-02-19 20:23:32 
Device: Google Pixel 7a 
OS version: Android 15 (SDK 35) 
 
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:1224)
	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:213)
	at android.os.Handler.handleCallback(Handler.java:991)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8826)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:369)

Debug log

2025-02-19 22:20:57.324 Debug [2] AboutPreferences: Debug log enabled, openScale v2.5.3 (65), SDK 35, Google Pixel 7a
2025-02-19 22:20:57.326 Debug [2] AboutPreferences: Selected user id(1) name(atom) birthday(****) age(**) body height(**) scale unit(kg) gender(**) initial weight(**) goal enabled(true) goal weight(**) goal date(Wed Dec 31 01:00:00 GMT+01:00 2025) measure unt(cm) activity level(0) assisted weighing(false)
2025-02-19 22:21:34.205 Debug [2] MainActivity: Main Activity Bluetooth permission check
2025-02-19 22:21:34.209 Debug [2] MainActivity: SDK >= 31 request for Bluetooth Scan and Bluetooth connect permissions
2025-02-19 22:21:34.210 Debug [2] MainActivity: Permission already granted: android.permission.BLUETOOTH_SCAN
2025-02-19 22:21:34.211 Debug [2] MainActivity: Permission already granted: android.permission.BLUETOOTH_CONNECT
2025-02-19 22:21:34.219 Debug [2] OpenScale: Trying to connect to bluetooth device [FF:03:00:5E:4B:5B] (QN-Scale)
2025-02-19 22:21:34.228 Debug [2] BluetoothCommunication: Do LE scan before connecting to device
2025-02-19 22:21:34.241 Info [2] BluetoothCentralManager: scan started
2025-02-19 22:21:34.242 Debug [2] BluetoothCommunication: Stop machine state
2025-02-19 22:21:34.344 Debug [2] BluetoothCommunication: Found peripheral 'QN-Scale'
2025-02-19 22:21:34.348 Info [2] BluetoothCentralManager: scan stopped
2025-02-19 22:21:35.351 Debug [2] BluetoothCommunication: Try to connect to BLE device FF:03:00:5E:4B:5B
2025-02-19 22:21:35.462 Info [2] BluetoothPeripheral: connect to 'QN-Scale' (FF:03:00:5E:4B:5B) using transport LE
2025-02-19 22:21:35.486 Info [2] BluetoothPeripheral: peripheral 'FF:03:00:5E:4B:5B' is connecting
2025-02-19 22:21:35.759 Info [8] BluetoothPeripheral: connected to 'QN-Scale' (NONE) in 0.3s
2025-02-19 22:21:35.765 Debug [2] BluetoothPeripheral: discovering services of 'QN-Scale' with delay of 0 ms
2025-02-19 22:21:36.101 Debug [8] BluetoothPeripheral: connection parameters: interval=7.5ms latency=0 timeout=5s
2025-02-19 22:21:36.360 Info [8] BluetoothPeripheral: discovered 5 services for 'QN-Scale'
2025-02-19 22:21:36.372 Debug [2] BluetoothCommunication: connected to 'QN-Scale'
2025-02-19 22:21:36.376 Debug [2] BluetoothCommunication: Successful Bluetooth services discovered
2025-02-19 22:21:36.378 Debug [2] BluetoothCommunication: Resume machine state
2025-02-19 22:21:36.379 Debug [2] BluetoothCommunication: Step Nr 0
2025-02-19 22:21:36.387 Debug [2] BluetoothCommunication: Invoke set notification on 0xffe1
2025-02-19 22:21:36.388 Debug [2] BluetoothCommunication: Step Nr 1
2025-02-19 22:21:36.390 Debug [2] BluetoothCommunication: Invoke set indication on 0xffe2
2025-02-19 22:21:36.392 Debug [2] BluetoothCommunication: Step Nr 2
2025-02-19 22:21:36.394 Debug [2] BluetoothCommunication: Invoke write bytes [13 09 15 01 10 00 00 00 42] on 0xffe3
2025-02-19 22:21:36.440 Debug [8] BluetoothPeripheral: connection parameters: interval=30.0ms latency=0 timeout=5s

AtomicFS avatar Feb 19 '25 19:02 AtomicFS

same error for me.

safer57 avatar Feb 25 '25 07:02 safer57

please try out the latest dev version

oliexdev avatar Mar 15 '25 08:03 oliexdev

works with latest dev version openScale-debug.apk

thanks 👍

safer57 avatar Mar 15 '25 09:03 safer57

@oliexdev that fixed it! Thanks!

But I have observed another issue - sometimes the weight has wrong decimal point (instead of 100 Kg it measures 10.0 kg). Not sure if I should open new issue about that.

AtomicFS avatar Mar 21 '25 10:03 AtomicFS

same for me, most times it records 10% of my weight. or records the same weight 2 times in the app.

safer57 avatar Mar 25 '25 21:03 safer57