piggz / harbour-amazfish

Amazfit Bip support for SailfishOS
GNU General Public License v3.0
103 stars 51 forks source link

clickable/lomiri support (second try) #265

Closed jmlich closed 11 months ago

jmlich commented 1 year ago

The https://github.com/piggz/harbour-amazfish/pull/147 seems to be a little outdated.

I would like to provide my changes to others who may be interested. I was able to compile it, but not to run it yet. It looks like most of components are ready to use with ubports.

piggz commented 1 year ago

thanks for taking this on

jmlich commented 1 year ago

I managed to run it using clickable desktop Screenshot_ubuntu20 04_2023-08-07_11:24:30

piggz commented 1 year ago

How are you handling starting the service? Normally its started by systemd, but doesnt need to be.

jmlich commented 1 year ago

I didn't checked service yet. I need to go step by step. I was following packaging of https://github.com/fredldotme/harbour-owncloud/ which have run-daemon.sh, but I don't see hook which starts it.

piggz commented 1 year ago

If using without systemd, there is a build option to disable it, which should remove the buttons from the UI

jmlich commented 1 year ago

It seems generic/qtquickcontrols ui are not accessible, because #ifdef MER_SDK points to directory #else was points to qrc with hardcoded kirigami. Therefore I have introduced UUITK_EDITION define. The clickable path is always ./share, but I didn't introduced DATADIR variable same as pure-maps https://github.com/rinigus/pure-maps/blob/master/CMakeLists.txt#L132

Additionally, I had issues with pageStack. The app.pages is working for me, but I don't have prepared develepoment environment to check with other platforms such as sailfishos.

Current status can be seen at https://www.youtube.com/watch?v=YyLfKOkJjZI

Unfortunately, my PineTime died and I am waiting for new delivery so I cannot test it with real hardware.

jmlich commented 1 year ago

The change in DateNavigation.qml will affect layout in other flavors. It looks like, that RowLayout needs width and height. It seems the Icon.width is undefined, and as consequence IconButtonPL width is undefined. The paintedWidth and paintedHeight aren't available for Lomiri Icon.

jmlich commented 1 year ago

Similar for heartrate page. See screenshot before and after change:

Screenshot_ubuntu20 04_2023-08-15_10:37:21 Screenshot_ubuntu20 04_2023-08-15_10:37:58

jmlich commented 1 year ago

I have finally PineTime to test, however, I am not able to pair device so far

Sep 05 17:37:48 ubuntu-phablet aa-exec[100671]: library "libpq_cust.so" not found
Sep 05 17:37:48 ubuntu-phablet aa-exec[100671]: Creating a QMirClientScreen now
Sep 05 17:37:48 ubuntu-phablet aa-exec[100671]: ("/usr/share/icons", ":/icons") ("/usr/share/pixmaps", ":qml/custom-icons")
Sep 05 17:37:48 ubuntu-phablet aa-exec[100671]: Connecting to daemon signals
Sep 05 17:37:48 ubuntu-phablet aa-exec[100671]: void DaemonInterface::changeConnectionState()
Sep 05 17:37:48 ubuntu-phablet aa-exec[100671]: No drivers found
Sep 05 17:37:49 ubuntu-phablet aa-exec[100671]: O2ReplyServer: Starting
Sep 05 17:37:49 ubuntu-phablet aa-exec[100671]: qml: Checking if feature is supported: 1 false
Sep 05 17:37:49 ubuntu-phablet aa-exec[100671]: qml: Checking if feature is supported: 1 false
Sep 05 17:37:49 ubuntu-phablet aa-exec[100671]: qml: Checking if feature is supported: 8 false
Sep 05 17:37:49 ubuntu-phablet aa-exec[100671]: qml: Checking if feature is supported: 8 false
Sep 05 17:37:49 ubuntu-phablet aa-exec[100671]: qml: Checking if feature is supported: 8 false
Sep 05 17:37:49 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/pages/FirstPage.qml:79:13: QML LabelPL: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
Sep 05 17:37:49 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/pages/FirstPage.qml:90:13: QML BusyIndicator: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
Sep 05 17:37:50 ubuntu-phablet aa-exec[100671]: qml: pairing
Sep 05 17:37:50 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/harbour-amazfish.qml:82: TypeError: Property 'processCurrentItem' of object StackPL_QMLTYPE_38(0x5747dae820) is not a function
Sep 05 17:37:50 ubuntu-phablet aa-exec[100671]: qml: Start timer triggered
Sep 05 17:37:50 ubuntu-phablet aa-exec[100671]: "SELECT date(timestamp_dt), sum(steps) FROM mi_band_activity WHERE date(timestamp_dt) >= date('2023-09-05T00:00:00','-10 day') AND timestamp_dt <= '2023-09-05T23:59:59' GROUP BY date(timestamp_dt) ORDER BY timestamp_dt ASC"
Sep 05 17:37:50 ubuntu-phablet aa-exec[100671]: [PERFORMANCE]: Last frame took 40 ms to render.
Sep 05 17:39:48 ubuntu-phablet aa-exec[100671]: QObject::startTimer: Timers cannot be started from another thread
Sep 05 17:41:17 ubuntu-phablet aa-exec[100671]: QObject: Cannot create children for a parent that is in a different thread.
Sep 05 17:41:17 ubuntu-phablet aa-exec[100671]: (Parent is QInputInfoManagerMir(0x74ba544018), parent's thread is QThread(0x5747bd96f0), current thread is QThread(0x74c809c070)
Sep 05 17:41:19 ubuntu-phablet aa-exec[100671]: QObject::killTimer: Timers cannot be stopped from another thread
Sep 05 17:41:19 ubuntu-phablet aa-exec[100671]: QObject::startTimer: Timers cannot be started from another thread
Sep 05 17:41:36 ubuntu-phablet aa-exec[100671]: [PERFORMANCE]: Last frame took 118 ms to render.
Sep 05 17:41:38 ubuntu-phablet aa-exec[100671]: [PERFORMANCE]: Last frame took 37 ms to render.
Sep 05 17:41:38 ubuntu-phablet aa-exec[100671]: [PERFORMANCE]: Last frame took 140 ms to render.
Sep 05 17:41:41 ubuntu-phablet aa-exec[100671]: qml: Manager operational: false null
Sep 05 17:41:41 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/pages/PairPage.qml:179: TypeError: Cannot read property 'discovering' of null
Sep 05 17:41:41 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/pages/PairPage.qml:153: TypeError: Cannot read property 'discovering' of null
Sep 05 17:41:41 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/pages/PairPage.qml:169: TypeError: Cannot read property 'discovering' of null
Sep 05 17:41:41 ubuntu-phablet aa-exec[100671]: qml: Delayed Manager operational: true DeclarativeAdapter(0x5748b3a500)
Sep 05 17:42:04 ubuntu-phablet aa-exec[100671]: QObject::killTimer: Timers cannot be stopped from another thread
Sep 05 17:42:04 ubuntu-phablet aa-exec[100671]: QObject::startTimer: Timers cannot be started from another thread
Sep 05 17:42:18 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/pages/PairPage.qml:169: TypeError: Cannot read property 'discovering' of null
Sep 05 17:42:18 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/pages/PairPage.qml:153: TypeError: Cannot read property 'discovering' of null
Sep 05 17:42:18 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/pages/PairPage.qml:179: TypeError: Cannot read property 'discovering' of null
Sep 05 17:42:18 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/pages/PairPage.qml:169: TypeError: Type error
Sep 05 17:42:18 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/pages/PairPage.qml:153: TypeError: Type error
Sep 05 17:42:18 ubuntu-phablet aa-exec[100671]: file:///opt/click.ubuntu.com/harbour-amazfish/2.1.3/share/harbour-amazfish-ui/qml/pages/PairPage.qml:179: TypeError: Type error
Sep 05 17:43:45 ubuntu-phablet aa-exec[100671]: QObject: Cannot create children for a parent that is in a different thread.
Sep 05 17:43:45 ubuntu-phablet aa-exec[100671]: (Parent is QInputInfoManagerMir(0x74ba544018), parent's thread is QThread(0x5747bd96f0), current thread is QThread(0x74c809c070)
Sep 05 17:43:46 ubuntu-phablet aa-exec[100671]: qml: Manager operational: true DeclarativeAdapter(0x5748b3a500)
Sep 05 17:43:47 ubuntu-phablet aa-exec[100671]: qml: Delayed Manager operational: true DeclarativeAdapter(0x5748b3a500)
Sep 05 17:43:48 ubuntu-phablet aa-exec[100671]: void DaemonInterface::pair(const QString&, QString)
Sep 05 17:44:01 ubuntu-phablet aa-exec[100671]: void DaemonInterface::pair(const QString&, QString)
Sep 05 17:44:11 ubuntu-phablet aa-exec[100671]: void DaemonInterface::pair(const QString&, QString)
Sep 05 17:44:11 ubuntu-phablet aa-exec[100671]: void DaemonInterface::pair(const QString&, QString)
jmlich commented 1 year ago

I have some pictures to share. There is still missing some integration.

screenshot20230906_194342790 image20230906_194053479 (copy)

piggz commented 1 year ago

Looking really good, thx for this, will surely bring more users

jmlich commented 1 year ago

I am wondering what features should I expect to work with pinetime. So far does work:

What doesn't work

Bluetooth connection seems to be unreliable. The phone is loosing connection often (it may be device model specific issue phone or smartwatch, it may be device item specific issue). The connection

I haven't tried flashing.

Current TODO:

I may attach logs from UI/daemon to evaluate if something needs attention.

jmlich commented 12 months ago

As I can see in https://www.ncartron.org/review-of-amazfish-on-sailfishos.html mentioned features wasn't working ever before

jmlich commented 11 months ago

I have fixed all obvious issues and I think that now it works more less fine.

piggz commented 11 months ago

Ok thats great ... quite a bit to review, but it makes sens to check it in, and improve later on. Perhaps you can find a dbus interface to listen on for UT calls?