blopker / superduper

iOS and Android app to manage your ebike.
MIT License
35 stars 6 forks source link

[iOS] Connection state of app does not seem to match real world scenario #44

Open DympyDev opened 4 months ago

DympyDev commented 4 months ago

Describe the bug As briefly discussed in the Discord last weekend, I've been having some connection issues. I've now narrowed it (at least, my specific issue), down to a mismatch in the UI tot the real-world scenario. The initial connection seems to work correctly:

  1. I turned on my bike
  2. I opened the app (cold-start)
  3. I chose my bike
  4. It connected and I could turn my light on

However, shortly after this, the bike-details screen changed to the "Connect"-screen (buttons did nothing, and the Connected label was replaced with a "Connect"-button). The "Connect"-button didn't do a lot though, I had to go back to the main screen, and select the "Disconnect"-button before being able to reconnect.

It seems there is a mismatch in the application state, which might give the impression that there are connection issues. I've attached a log (where I replaced my WiFi SSID due to privacy concerns and whatnot) I grabbed through Xcode with a filter on "superduper".

To Reproduce Steps to reproduce the behavior:

  1. Turn on bike
  2. Open app
  3. Connect to bike
  4. Change some setting (such as light)
  5. Wait a bit so the UI updates to the disconnected state
  6. Can't change any setting (such as light)
  7. Navigate back to the main screen
  8. Disconnect bike
  9. Reconnect bike through the list
  10. Everything works as expected

Expected behavior Turn on bike, open app, choose bike, connects and works

Screenshots Not really applicable, see logs for extra information

Bike (please complete the following information):

Smartphone (please complete the following information):

Additional context The logs I pulled, the first few wifid logs were me trying to reconnect through the details screen (which didn't seem to work):

default 17:14:46.948405+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -65 {-65 0} Cca: 10 (S:0 O:1 I:8) Snr: 15 BcnPer: 0.0% (50, 50.2%) TxFrameCnt: 17 TxPer: 0.0% TxReTrans: 5 TxRetryRatio: 29.4% RxFrameCnt: 28 RxRetryFrames: 11 RxRetryRatio: 39.3% TxRate: 117000 RxRate: 520000 FBRate: 39000 TxFwFrms: 10 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 201.1secs fgApp: io.kbl.superduper
default 17:14:51.968555+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -66 {-66 0} Cca: 10 (S:0 O:1 I:8) Snr: 15 BcnPer: 0.0% (49, 50.2%) TxFrameCnt: 3 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 11 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 117000 RxRate: 526500 FBRate: 39000 TxFwFrms: 4 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 206.2secs fgApp: io.kbl.superduper
default 17:14:56.997056+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -65 {-65 0} Cca: 29 (S:0 O:3 I:26) Snr: 15 BcnPer: 0.0% (50, 50.2%) TxFrameCnt: 5 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 8 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 585000 RxRate: 520000 FBRate: 175500 TxFwFrms: 6 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 211.2secs fgApp: io.kbl.superduper
default 17:15:02.016710+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -65 {-65 0} Cca: 13 (S:0 O:0 I:0) Snr: 12 BcnPer: 0.0% (49, 50.2%) TxFrameCnt: 0 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 13 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 585000 RxRate: 520000 FBRate: 175500 TxFwFrms: 0 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 216.2secs fgApp: io.kbl.superduper
default 17:15:07.043745+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -67 {-67 0} Cca: 13 (S:0 O:0 I:0) Snr: 15 BcnPer: 0.0% (50, 50.2%) TxFrameCnt: 3 TxPer: 0.0% TxReTrans: 1 TxRetryRatio: 33.3% RxFrameCnt: 14 RxRetryFrames: 2 RxRetryRatio: 14.3% TxRate: 585000 RxRate: 520000 FBRate: 175500 TxFwFrms: 2 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 221.2secs fgApp: io.kbl.superduper
default 17:15:12.070723+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -66 {-66 0} Cca: 13 (S:0 O:0 I:0) Snr: 15 BcnPer: 0.0% (49, 50.2%) TxFrameCnt: 2 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 10 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 585000 RxRate: 520000 FBRate: 175500 TxFwFrms: 2 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 226.3secs fgApp: io.kbl.superduper
default 17:15:17.094063+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -65 {-65 -68} Cca: 13 (S:0 O:0 I:0) Snr: 15 BcnPer: 2.0% (50, 50.2%) TxFrameCnt: 6 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 45 RxRetryFrames: 1 RxRetryRatio: 2.2% TxRate: 585000 RxRate: 520000 FBRate: 195000 TxFwFrms: 11 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 231.3secs fgApp: io.kbl.superduper
default 17:15:22.122709+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -63 {-63 0} Cca: 13 (S:0 O:0 I:0) Snr: 14 BcnPer: 0.0% (49, 50.2%) TxFrameCnt: 6 TxPer: 0.0% TxReTrans: 4 TxRetryRatio: 66.7% RxFrameCnt: 18 RxRetryFrames: 1 RxRetryRatio: 5.6% TxRate: 585000 RxRate: 390000 FBRate: 195000 TxFwFrms: 8 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 236.3secs fgApp: io.kbl.superduper
default 17:15:27.145142+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -63 {-63 0} Cca: 13 (S:0 O:0 I:0) Snr: 15 BcnPer: 0.0% (50, 50.2%) TxFrameCnt: 0 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 4 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 585000 RxRate: 390000 FBRate: 195000 TxFwFrms: 0 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 241.3secs fgApp: io.kbl.superduper
default 17:15:32.170912+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -64 {-64 0} Cca: 13 (S:0 O:0 I:0) Snr: 14 BcnPer: 0.0% (49, 50.2%) TxFrameCnt: 0 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 20 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 585000 RxRate: 390000 FBRate: 195000 TxFwFrms: 0 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 246.4secs fgApp: io.kbl.superduper
default 17:15:34.233078+0200    bluetoothd  Received XPC message "CBMsgIdCancelPeripheralConnection" from session "io.kbl.superduper-central-4729-726"
default 17:15:34.233104+0200    bluetoothd  Device CC75B2F1-D9F3-E630-41E9-11C95B2D661A connectionUseCase (req 23) bundleIDs {(
    "io.kbl.superduper"
)}
default 17:15:34.233129+0200    bluetoothd  Disconnecting device "CC75B2F1-D9F3-E630-41E9-11C95B2D661A" for session "io.kbl.superduper-central-4729-726"
default 17:15:34.233151+0200    bluetoothd  App disconnecting - {cbuuid: CC75B2F1-D9F3-E630-41E9-11C95B2D661A, bundle: io.kbl.superduper}
default 17:15:34.233175+0200    bluetoothd  App disconnected - {cbuuid: CC75B2F1-D9F3-E630-41E9-11C95B2D661A, bundle: io.kbl.superduper, reconnecting: N}
default 17:15:34.268728+0200    bluetoothd  PowerLogger device "CC75B2F1-D9F3-E630-41E9-11C95B2D661A" disconnect for bundleIDs "io.kbl.superduper" peerType Other
default 17:15:37.202852+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -67 {-67 0} Cca: 13 (S:0 O:0 I:0) Snr: 14 BcnPer: 0.0% (49, 50.2%) TxFrameCnt: 0 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 10 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 585000 RxRate: 390000 FBRate: 195000 TxFwFrms: 0 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 251.4secs fgApp: io.kbl.superduper
default 17:15:37.747776+0200    bluetoothd  Received XPC message "CBMsgIdConnectPeripheral" from session "io.kbl.superduper-central-4729-726"
default 17:15:37.748454+0200    bluetoothd  Connect Requested for device CC75B2F1-D9F3-E630-41E9-11C95B2D661A by session io.kbl.superduper-central-4729-726 with options clientBundleID NoClientBundleID clientProcessID NoClientProcessID connectionUseCase 23 maxAllowedConnectionDelay 0
default 17:15:37.748608+0200    bluetoothd  Device CC75B2F1-D9F3-E630-41E9-11C95B2D661A connectionUseCase (req 23 computed 23) priority 0 bundleIDs {(
    "io.kbl.superduper"
)}
default 17:15:37.748879+0200    bluetoothd  App connecting - {cbuuid: CC75B2F1-D9F3-E630-41E9-11C95B2D661A, bundle: io.kbl.superduper}
default 17:15:37.748938+0200    bluetoothd  BLE Connecting ThirdPartyApp CC75B2F1-D9F3-E630-41E9-11C95B2D661A for io.kbl.superduper
default 17:15:37.749037+0200    bluetoothd  Connecting device "CC75B2F1-D9F3-E630-41E9-11C95B2D661A" for session "io.kbl.superduper-central-4729-726" with options (connect:0 disconnect:0 notify:0 delay:0 wantsObjectDiscoverData:0 transportBridging:0 disableLeGATT:0 ancsRequired:0)
default 17:15:37.934979+0200    bluetoothd  PowerLogger device "CC75B2F1-D9F3-E630-41E9-11C95B2D661A" connect for bundleIDs "io.kbl.superduper" peerType Other
default 17:15:38.675905+0200    bluetoothd  Dispatching connection status update for device "CC75B2F1-D9F3-E630-41E9-11C95B2D661A" to session "io.kbl.superduper-central-4729-726"
default 17:15:38.676337+0200    bluetoothd  App ready - {cbuuid: CC75B2F1-D9F3-E630-41E9-11C95B2D661A, bundle: io.kbl.superduper, transport: le, result: 0}
default 17:15:38.676422+0200    bluetoothd  BLE Connection Ready ThirdPartyApp CC75B2F1-D9F3-E630-41E9-11C95B2D661A for io.kbl.superduper
default 17:15:38.678132+0200    bluetoothd  Received XPC message "CBMsgIdPeripheralDiscoverServices" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.716689+0200    bluetoothd  Received XPC message "CBMsgIdServiceDiscoverCharacteristics" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.716972+0200    bluetoothd  Received XPC message "CBMsgIdServiceDiscoverCharacteristics" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.720236+0200    bluetoothd  Received XPC message "CBMsgIdServiceDiscoverCharacteristics" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.722470+0200    bluetoothd  Received XPC message "CBMsgIdServiceDiscoverCharacteristics" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.724216+0200    bluetoothd  Received XPC message "CBMsgIdServiceDiscoverCharacteristics" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.725755+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.727294+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.728600+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.728852+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.728919+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.728985+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.729274+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.730370+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.731249+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.731585+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.731652+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.731755+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:38.731841+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicDiscoverDescriptors" from session "io.kbl.superduper-central-4729-726"
default 17:15:40.726392+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicWriteValue" from session "io.kbl.superduper-central-4729-726"
default 17:15:40.843502+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicReadValue" from session "io.kbl.superduper-central-4729-726"
default 17:15:40.905772+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicWriteValue" from session "io.kbl.superduper-central-4729-726"
default 17:15:42.226411+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -66 {-66 0} Cca: 13 (S:0 O:0 I:0) Snr: 16 BcnPer: 0.0% (1, 50.2%) TxFrameCnt: 0 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 8 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 585000 RxRate: 390000 FBRate: 195000 TxFwFrms: 0 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 256.4secs fgApp: io.kbl.superduper
default 17:15:43.086225+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicWriteValue" from session "io.kbl.superduper-central-4729-726"
default 17:15:43.126303+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicReadValue" from session "io.kbl.superduper-central-4729-726"
default 17:15:47.248455+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -68 {-68 0} Cca: 13 (S:0 O:0 I:0) Snr: 16 BcnPer: 0.0% (49, 50.2%) TxFrameCnt: 3 TxPer: 0.0% TxReTrans: 2 TxRetryRatio: 66.7% RxFrameCnt: 6 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 526500 RxRate: 390000 FBRate: 175500 TxFwFrms: 2 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 261.4secs fgApp: io.kbl.superduper
default 17:15:50.091470+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicWriteValue" from session "io.kbl.superduper-central-4729-726"
default 17:15:50.140609+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicReadValue" from session "io.kbl.superduper-central-4729-726"
default 17:15:52.271508+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -69 {-69 0} Cca: 13 (S:0 O:0 I:0) Snr: 15 BcnPer: 0.0% (50, 50.2%) TxFrameCnt: 1 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 9 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 117000 RxRate: 390000 FBRate: 39000 TxFwFrms: 2 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 266.5secs fgApp: io.kbl.superduper
default 17:15:54.616008+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicWriteValue" from session "io.kbl.superduper-central-4729-726"
default 17:15:55.507261+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicWriteValue" from session "io.kbl.superduper-central-4729-726"
default 17:15:57.293689+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -66 {-66 0} Cca: 13 (S:0 O:0 I:0) Snr: 15 BcnPer: 0.0% (50, 50.2%) TxFrameCnt: 1 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 6 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 526500 RxRate: 390000 FBRate: 175500 TxFwFrms: 2 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 271.5secs fgApp: io.kbl.superduper
default 17:15:57.575913+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicWriteValue" from session "io.kbl.superduper-central-4729-726"
default 17:15:57.670850+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicReadValue" from session "io.kbl.superduper-central-4729-726"
default 17:16:02.317277+0200    wifid   __WiFiLQAMgrLogStats(<MY WIFI SSID>:Stationary): Channel: 100 Bandwidth: 80Mhz Rssi: -68 {-68 0} Cca: 13 (S:0 O:0 I:0) Snr: 15 BcnPer: 0.0% (49, 50.2%) TxFrameCnt: 2 TxPer: 0.0% TxReTrans: 0 TxRetryRatio: 0.0% RxFrameCnt: 15 RxRetryFrames: 0 RxRetryRatio: 0.0% TxRate: 117000 RxRate: 390000 FBRate: 39000 TxFwFrms: 4 TxFwFail: 0 Noise: -88 {-89 -88 1} time: 276.5secs fgApp: io.kbl.superduper
default 17:16:04.580267+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicWriteValue" from session "io.kbl.superduper-central-4729-726"
default 17:16:04.629648+0200    bluetoothd  Received XPC message "CBMsgIdCharacteristicReadValue" from session "io.kbl.superduper-central-4729-726"