Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazfish Port for PinePhone? #156

Open
je-nix opened this issue Jan 3, 2021 · 19 comments
Open

Amazfish Port for PinePhone? #156

je-nix opened this issue Jan 3, 2021 · 19 comments

Comments

@je-nix
Copy link

je-nix commented Jan 3, 2021

I recently bought a PinePhone 0 and plan to replace my SFOS XperiaX once the software gets stable enough. The only thing currently missing is support for my Amazfish GTS.
So I was wondering, if Amazfish could be ported / build for native Linux? The base architecture of the PinePhone is the same as SFOS (aarch64) and the library dependencies should hopefully be available. The main issue would probably be the UI, since most distros for PinePhone rely on qt5.
Unfortunately, I have no experience with building / adapting software to other platforms. I also couldn't find any build instructions for Amazfish to determine if this would even be feasible. Can you please help me out here?

Thanks.

@piggz
Copy link
Owner

piggz commented Jan 3, 2021

Since 1.8, the amazfish UI has been completely re-written just for ths purpose. I already have some people using it on manjaro. Best way to proceed would be to ask distro packagers for whatever distro you use to contribute.

@je-nix
Copy link
Author

je-nix commented Jan 3, 2021

This sounds amazing, especially since I'm looking forward to use the Manjaro builds on my Pine. Do you know if there are precompiled packages or building instructions somewhere?

@dano6
Copy link

dano6 commented Jan 6, 2021

It should be possible to install on Manjaro-arm, see https://gitlab.manjaro.org/manjaro-arm/packages/community/plasma-mobile/amazfish/

@je-nix
Copy link
Author

je-nix commented Jan 10, 2021

@dano6 Thank you so much for the link. Are you in any way involved with the PKGBUILD for Manjaro? I tried to build it on my Pinephone with the Manjaro Posh Beta 4, but the build keeps failing because of a missing dependency for the daemon.pro target:

Project ERROR: libkmcal-qt5 development package not found

From my research, it seems that kmcal is a kcal port for the MER Project and thus probably not available for Manajaro?
It could be, the required libraries are present in plasma-mobile. If so, it would be great to add them to the dependencies in the PKGBUILD.

@je-nix
Copy link
Author

je-nix commented Jan 22, 2021

Nice. In the meantime, the PKGBUILD file was updated to include the missing dependencies (although not all it seems, as at least kirigami2 is missing). Building Amazfish on the Pinephone with Manjaro-Phosh now works.
And amazfish is now available in the community repo and can be installed via a simple 'pacman -S amazfish'. That is great.

Unfortunately, while the GUI can now be started, the service fails to start:

harbour-amazfish.service: Failed to locate executable /usr/bin/invoker: No such file or directory

From my understanding, the invoker binary at /usr/bin/invoker is SFOS specific. Is this an error in the code or a build configuration error?
Thanks again for your support.

@piggz
Copy link
Owner

piggz commented Jan 22, 2021

Ah ok, does editing the service to remove the need for infoker allow it all to work correctly? It shouldnt be too difficult to have a non-sfos service file.

@je-nix
Copy link
Author

je-nix commented Jan 22, 2021

Editing the systemd service file at /usr/lib/systemd/user/harbour-amazfish.service (setting 'ExecStart=/usr/bin/harbour-amazfishd' ) allows the service to start.
Pairing with my GTS still does not seem to work. I get to the point where I can select the BT device, it also detects my GTS, but when I click on it, nothing happens.
The shell output of harbour-amazfish-ui only produces:

void DaemonInterface::pair(const QString&, QString)

I have the impression that communication with bluez may not work. When looking into the systems bluetooth settings, no connection with the smartwatch was established. Pairing the watch there seems to also not work (amazfish still hangs on the pairing screen).

According to the service logs, the application may not be properly connected to D-Bus (though I'm no expert here):

Jan 22 10:40:07 manjaro-arm systemd[3801]: Started Amazfish daemon.
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: Starting amazfish daemon
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: : QML MprisManager: Failed attempting to connect to DBus
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: watchfish-NotificationMonitor: Could not connect to the session bus
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: void NavigationInterface::connectDaemon()
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: Interface is not valid
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: Registering service on dbus uk.co.piggz.amazfish
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: DeviceFactory::createDevice: requested device of type: ""
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: DeviceFactory::createDevice: no suitable devices found, creating a Bip device as default
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: Creating DBUS HRM
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: "Not connected to D-Bus server"
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: DRIVERS: ("org.kde.kdb.mysql", "org.kde.kdb.postgresql", "org.kde.kdb.sqlite")
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: Database is: "/home/manjaro/.local/share/harbour-amazfish/harbour-amazfish/amazfish.kexi"
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: KDbConnection object created.
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: KDbConnection::connect() OK.
Jan 22 10:40:07 manjaro-arm harbour-amazfishd[7049]: ("mi_band_activity", "sports_data", "sports_meta")

@piggz
Copy link
Owner

piggz commented Feb 3, 2021

Could you try the latest versions. The daemon systemd unit didnt specify the correct DBUS path for regular linux desktops so this may be fixed now.

@je-nix
Copy link
Author

je-nix commented Feb 3, 2021

Awesome! Just built 1.9.3 on my PinePhone (posh) and it seems to be running well. Pairing my Amazfish GTS worked fine, data sync seems to be working as well (steps are synced, triggering of hearth rate measurement from the app works).
However, the connection does not seem to be stable. I get random "connected to watch" notifications every few seconds (on average every 20 seconds, in a range between 8 to 60 seconds) hinting that the connection was lost and reestablished.

A few observations that will need further investigations:

  • the service can't be enabled to be automatically started on boot. Not sure if this is related to systemd not knowing the service file (potential missing link from /var/lib/systemd/user/harbour-amazfish.service to a directory where systemd reads service files)
  • pairing seems to not work after a reboot (amazfish seems to be stuck during connecting. The menu shows a disabled "disconnect from watch" entry). I had to remove pairing and pair my watch again to get amazfish to connect to it. I will do further tests to see if this happens regulary
  • The UI is a bit rough: the 'forward' button is on the bottom of the screen, the 'backward' one in top in the menu structure. Swiping left works to go back, swiping right doesn't work / brings up the menu when swiping over the edge.
  • The application is currently missing an icon (it's displayed with a round ? in the menu)

@piggz
Copy link
Owner

piggz commented Feb 5, 2021

Just tagged 1.9.4, which should fix an issue with the service.

@je-nix
Copy link
Author

je-nix commented Feb 6, 2021

Thanks. Just built and installed 1.9.4. Unfortunately, I can't see any improvements regarding the service, it still can't be enabled in amazfish and the systemd service is unknown to systemd ("No files found for harbour-amazfish.service.")

@piggz
Copy link
Owner

piggz commented Feb 17, 2021

are you using systemctl --user ?

@je-nix
Copy link
Author

je-nix commented Feb 20, 2021

I'm not quite sure how to check that, but I think the system does (systemd services are spawned from the '/usr/lib/systemd/systemd --user' parent and run with the user when checking with 'ps faux').

@ell1e
Copy link

ell1e commented Jun 21, 2021

Would it be possible to have amazfish added to flathub as an ARM64 flatpak? This would possibly fix the whole getting it packaged right for every distro issue

@piggz
Copy link
Owner

piggz commented Jun 21, 2021

i would absolutely accept any PRs or contributions for such packaging .... i think the whole systemd daemon causes issues with things like flatpak/snap though ............ in the end, it doesnt have to be a systemd service, it just needs to talk over dbus so maybe that could be changed, so long as there was still a way to manage as something like a service to bring it up on boot/user-session

@ell1e
Copy link

ell1e commented Jun 21, 2021

@piggz personally I wouldn't care at all if it just wasn't collecting any data/syncing notifications while the app wasn't running. So maybe the background functionality just could be left out entirely? Not that I would mind if it was added one day, but that seems somewhat unnecessary to me to just be able to see any of the data at all without an Android phone and make it mostly work as a start.

@neovalis
Copy link

neovalis commented Oct 5, 2022

Any update on being able to "Select Device Type"? I just compiled on PPP Mobian and can't select InfiniTime or Pinetime. It just flashes. Additional sub-menus open for some other devices.

@ell1e
Copy link

ell1e commented Oct 9, 2022

What are even the install steps for the PinePhone? The README seems to be SailfishOS specific. And just any sort of precompiled release for ARM64 would be really nice, although a flatpak probably the easiest to install.

@jmlich
Copy link
Contributor

jmlich commented Apr 29, 2024

The merge request flathub/flathub#5173 closes this issue if flathub is enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants