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

Star Trek Watchface #1462

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ljahn
Copy link

@ljahn ljahn commented Nov 26, 2022

Description

I made a watch face inspired by Star Trek.

base

It supports all the icons and values of the standard digital face.
The status icons for Bluetooth, battery, power and notifications are on the left (the empty spot between battery and Bluetooth in the picture below is there because I could not make the small notification indicator "i" appear in InfiniSim).
Step count is under the main clock digits in brackets. The distance between the brackets leaves enough space for the default step goal of 10,000. It breaks down at 100,000 steps, where the number reaches over the right bracket.
If the heart rate measurement is enabled, it is displayed above the date section.
It also supports both 12h and 24h formats.

full

Technical stuff

I used the new external resources for the large number font and the small brackets.
I include the brackets as images, because I could not be bothered to draw them as rectangles and circles, like the rest of the display, because they are so detailed. They use up less space in total than the font.
I thought about saving only one and turning it to make the other, but I could not get lvgl to do this.

The font for the large time numbers is Edge of the Galaxy, which is public domain.
The smaller text for dates and stuff is the InfiniTime standard font.

Testing

I tested this on InfiniSim (thoroughly, because I had a memory leak at first [from not freeing the font in the destructor 🤦]) and also run it at my personal PineTime without crash so far.

Things that could be changed

One could change the small font to a font closer to the Star Trek displays, but since it is so tiny, I don't think it would enhance the watch face much (apart from maybe removing the dot from inside the zero).

I am no graphics designer and therefore not good at selecting a balanced color palette. This could use some doing by someone with that skill.

I am unsure if it is okay to call this watch face "Star Trek" in the end, because of licensing issues.

@ItzSwirlz
Copy link

This is cool!

In the future, I want to try to get a Stardate thing going - I've tried getting behind how the Star Trek Online Stardate works but perhaps as another time format that could be a nice future feature. https://www.stoacademy.com/tools/stardate.php

I don't think licensing will be a problem - I doubt for a FOSS project any bullets will be shot, but if it is a problem I suppose naming it after a character or a ship. TMI the only copyrighted thing is the actual show + logo

@Riksu9000 Riksu9000 added the new watchface This thread is about a new watchface label Dec 30, 2022
@CCF100
Copy link

CCF100 commented Mar 3, 2023

I love this watchface! I really hope it gets merged

@infinitytec
Copy link

infinitytec commented Mar 3, 2023

Nice work! For an alternate name idea, might I suggest "LCARS"?

@CCF100
Copy link

CCF100 commented Mar 6, 2023

Hey, you might want to look at the watch face initialization code, I've been running this watch face on my watch for a few days, and it's started rebooting whenever the watch attempts to chime on the hour/30 minute mark

It will also briefly display incorrectly right before it crashes...

@ljahn
Copy link
Author

ljahn commented Mar 6, 2023

Thanks for testing 👍. I never use the chimes, that's why I missed that. I will have a look into it.

@ljahn
Copy link
Author

ljahn commented Mar 6, 2023

I cannot replicate the crash.
Not on my watch, which is 1.11.0 plus the commits from this PR (#1462) and #1479,
Nor in InfiniSim with the same as on my watch or even just a build of this branch as is.

@CCF100 Could you please provide some info on what exactly you are running on your watch so I can replicate?

@CCF100
Copy link

CCF100 commented Mar 7, 2023

I cannot replicate the crash.
Not on my watch, which is 1.11.0 plus the commits from this PR (#1462) and #1479,
Nor in InfiniSim with the same as on my watch or even just a build of this branch as is.

@CCF100 Could you please provide some info on what exactly you are running on your watch so I can replicate?

I'm just running the changes in this PR. I haven't merged in any other branches.

Edit: It seems to take a few days of running before the watch crashes

@CCF100
Copy link

CCF100 commented Mar 9, 2023

PXL_20230309_153033709 MP
It will display like this right before it crashes

@ljahn
Copy link
Author

ljahn commented Mar 9, 2023

Aha! It is using the fallback font and the brackets are gone. This means that the external resources are missing somehow.
Is the time also wrong?

My watch has still not crashed since I enabled the chimes, but I am also not running the exact code in this branch.
You could try to build from this branch, which is just version 1.11 plus the watch face.
This branch here is rebased onto the develop (now main) branch from the time I created the pull request, maybe the instability comes from there.
The missing resources also hint at that.

@infinitytec
Copy link

infinitytec commented Mar 9, 2023

TBH, I kinda prefer the fallback font. It's more readable for me.

@ljahn
Copy link
Author

ljahn commented Mar 9, 2023

I had the fallback as the default font for some time while I developed the watch face (It is just the same as in the digital style watch face) and I also think it is more readable.
The Star Trek font looks more on theme, but it is definitely less legible when you just take a quick look at the watch.
I, however, got accustomed to it rather quickly, so I decided for it in the end.

I think increasing the "small gaps" in the font in size would already do a lot for legibility, so I might try to edit the .otf to try it out if I have some time.

@CCF100
Copy link

CCF100 commented Mar 9, 2023

Aha! It is using the fallback font and the brackets are gone. This means that the external resources are missing somehow. Is the time also wrong?

My watch has still not crashed since I enabled the chimes, but I am also not running the exact code in this branch. You could try to build from this branch, which is just version 1.11 plus the watch face. This branch here is rebased onto the develop (now main) branch from the time I created the pull request, maybe the instability comes from there. The missing resources also hint at that.

I think the problem might be rather it's having issues loading the external resources, causing it to crash and reboot. It has the external resources installed.

@CCF100
Copy link

CCF100 commented Mar 10, 2023

@ljahn I'm flashing the new branch to my watch now, will report back on any instability with this branch ^.^

@CCF100
Copy link

CCF100 commented Mar 15, 2023

@ljahn I still experience crashing when I have chimes enabled with the rebased branch :/
I think for some reason, it just fails to load the external resources when awoken with chimes enabled...

@FintasticMan
Copy link
Member

This is also an issue with the Infinineat and Casio watch faces, but in those cases it doesn't crash, just doesn't load the resources.

@ljahn
Copy link
Author

ljahn commented Mar 18, 2023

I think I found the problem.
I had a fallback font, but no fallback images, so when the external resources wouldn't load, displaying the brackets around the step count (which are images) would lead to crashes.
I added fallbacks for those now, too.

@CCF100 please test when you have time.
I was still unable to replicate the crash, maybe my watch has a golden flash chip that always delivers 😉.

@CCF100
Copy link

CCF100 commented Mar 28, 2023

I think I found the problem. I had a fallback font, but no fallback images, so when the external resources wouldn't load, displaying the brackets around the step count (which are images) would lead to crashes. I added fallbacks for those now, too.

@CCF100 please test when you have time. I was still unable to replicate the crash, maybe my watch has a golden flash chip that always delivers wink.
Haven't checked this PR in awhile, I'll check it in a few

@CCF100
Copy link

CCF100 commented Mar 30, 2023

I think I found the problem. I had a fallback font, but no fallback images, so when the external resources wouldn't load, displaying the brackets around the step count (which are images) would lead to crashes. I added fallbacks for those now, too.

@CCF100 please test when you have time. I was still unable to replicate the crash, maybe my watch has a golden flash chip that always delivers wink.
Haven't checked this PR in awhile, I'll check it in a few

Alas, the problem still exists. For whatever reason, enabling the chimes causes the watch to crash every time the chimes occurs...

@ljahn
Copy link
Author

ljahn commented Apr 6, 2023

TBH, I kinda prefer the fallback font. It's more readable for me.

I increased the small gaps in the digits. I thinks this makes it more readable while still keeping the style.

widergaps
WiderGapsWatchface

@github-actions
Copy link

github-actions bot commented Apr 6, 2023

Build size and comparison to main:

Section Size Difference
text 383404B 8876B
data 948B 0B
bss 63504B 16B

@ljahn
Copy link
Author

ljahn commented Apr 6, 2023

I think I found the problem. I had a fallback font, but no fallback images, so when the external resources wouldn't load, displaying the brackets around the step count (which are images) would lead to crashes. I added fallbacks for those now, too.
@CCF100 please test when you have time. I was still unable to replicate the crash, maybe my watch has a golden flash chip that always delivers wink.
Haven't checked this PR in awhile, I'll check it in a few

Alas, the problem still exists. For whatever reason, enabling the chimes causes the watch to crash every time the chimes occurs...

I am currently out of ideas what the reason could be.
It still has never happened for me and I checked through my code again if I can see anything obvious and found nothing.
When I wrote this, I took the digital watch face as a base and mainly edited stylistic stuff, I have not touched the fundamental clock logic or the interaction with the OS in any way (especially nothing related to chimes, since I do not use them).

So my hypothesis is that it it still something to do with the external resources, but I don't know what.
Do I have to free the image buffers in some way?
Does chiming for some reason use a lot of memory and the clock goes OOM under unlucky conditions, because the watch face is heavy and leaves not much free space?
I don't know 🤷

I am thankful for any additional testers and information on this 😃

@lman0
Copy link

lman0 commented Apr 8, 2023

@CCF100
Not in subject but
Where did you the bracelet ?
It so cool!

@CCF100
Copy link

CCF100 commented Apr 8, 2023

@CCF100
Not in subject but
Where did you the bracelet ?
It so cool!
@lman0
My girlfriend got it for me as an anniversary gift
PXL_20230408_205839186.MP.jpg

@ljahn ljahn force-pushed the starTrekWatchface branch from 9a04f59 to 6ecf80a Compare April 15, 2023 16:20
@ljahn
Copy link
Author

ljahn commented Apr 15, 2023

I updated the watch face to 1.12.0
The old version on 1.11.0 remains at starTrekOn1.11

@sonnatager
Copy link

Why is nothing happen here?

@ljahn
Copy link
Author

ljahn commented Sep 13, 2023

Well there is something happening 😉

I have channeled my inner masochist and drawn the detailed brackets around the step count fully in lvgl.
Furthermore, I have made the font of the time digits configurable via a menu that opens on long press (like with the the configurable watchfaces).
This means you can now choose if you want readability or style 😉 @infinitytec.
This also means no external resources are needed when running the system font.

Lastly, I think I found the bug causing the crash. @CCF100 The destructor of the watchface tried to free the font when it was closed. But if the fallback font was loaded, this would result in attempt to free the system font, which lead to a crash. This is fixed now as well.

This branch is now at 1.13.0, not at the current development status, so if you build this, you get 1.13.0 plus the StarTrek watchface.

@ljahn ljahn force-pushed the starTrekWatchface branch from 6fdef99 to 64283c1 Compare November 11, 2023 11:36
@ljahn
Copy link
Author

ljahn commented Nov 11, 2023

I continued to do more work on this and I now consider it ready for review @JF002

This watch face now supports all the usual icons and information like steps and heart rate.
I also added animations, to make it more lively (they can be disabled).
Additionally, we have weather (which I copied from PTS, I think one could do a thing like the BatteryIcon for the weather as well), a config option to display seconds or not, and an option to use the system font for better legibility.
It works without external resources, but then the Star Trek font is unavailable.

Here is a gif of what it looks like:
InfiniSim_2023-11-08_233900
The flickering at the bottom is an artifact of the gif, it does not happen on the watch.

The one thing that reaches deeper into the system is the startup animation. I added OnLCDWakeup() and OnLCDSleep() functions to the Screen class to be able to react to those events and call them in DisplayApp.

@ljahn
Copy link
Author

ljahn commented Nov 13, 2023

The clang-tidy check workflow is failing because of a problem with the submodules lvgl and littlefs.
It is complaining about multiple configurations for those and then fails with fatal: remote error: upload-pack: not our ref.
I don't think I have touched anything related to the submodules and I can also only find one configuration where the parameters in question, url and path, are defined (standard .gitmodules).

What could cause this?

@FintasticMan
Copy link
Member

FintasticMan commented Nov 13, 2023

Yeah, I can't see any reason why it should fail... I'll try re-running the workflow.

Edit: re-running hasn't seemed to help. Very strange that it's only that workflow that fails, not any others.

@ljahn
Copy link
Author

ljahn commented Nov 13, 2023

Well, it fixed itself 🎉 😉

@ljahn
Copy link
Author

ljahn commented Jan 16, 2024

I updated the watchface to version 1.14.0.
It now includes the WatchFaceTraits and all the stuff necessary for the new watchface handling.
I also changed out the weather service for the new SimpleWeatherService.

I tested on my PineTime and so far there is no problem. Alas, I cannot get Gadgetbridge Nightly to send weather to the watch (validated with PTS face), so there could be a problem with that, but I do not expect it, because I mostly copied the PTS code for weather again.

@mueller-ma
Copy link

I compiled this branch and also have issues with the weather. I'm using the latest stable version of Gadgetbridge. Weather is working on PineTimeStyle without any issues. On the Star Trek watchface the weather disappears quite often, e.g. after swiping to the right (to open the menu with brightness, flashlight, ...). Then I have to disable weather in the watch face settings and enable it again to make it work.

@ljahn
Copy link
Author

ljahn commented May 1, 2024

@mueller-ma By pure coincidence, I fixed this today 😄.
I had an error in the check if the weather was updated, which lead to it never receiving updates apart from when the weather mode was toggled.
Now it should work as intended.

Do you have any other input on the watch face?
I'm thinking about aligning the weather and date information a little more to the right, its a bit close to the border as it is now.

@mueller-ma
Copy link

Overall I really like the watch face. A few thoughts on it:

  • I like months as numbers more than as string ("05" instead of "May").
  • I'd prefer a "bluetooth not connected" icon instead of a missing bluetooth icon in that case.
  • I really like that the steps are written as number and as progress bar at the same time.
  • It's also good that the new font is optional as you cannot update external resources with Gadgetbridge right now and I haven't looked into other companion apps yet.
  • Maybe move the temperature next to the weather icon, similar to heartbeat.
  • Seconds can be displayed 👍
  • Maybe update the name, so it doesn't contain trademarks?

@w4tsn
Copy link

w4tsn commented Jun 3, 2024

Let me throw a link at you for an alternative LCARS watchface based on the older LCARS from Voyager. Maybe we can work together to get a bit more momentum back, as this one seems to be around since 2022?

#2072

@ljahn
Copy link
Author

ljahn commented Jun 4, 2024

@w4tsn True, there is not much happening here, but I don't intend to push people to get this merged in any way.

I made the watchface mainly for myself and for the challenge. I regularly update it to every new release, because I run it on my pinetime and of course want the newest features 😉.

I maintain this merge request to offer it to the infinitime community, but I am also perfectly fine with it never getting merged.

@Handrail9
Copy link

@ljahn Silly question, but do I have to compile this from source to use it? I am trying to compile it in docker but I keep running into an error :( Was wondering if youd be able to share the file

@ljahn ljahn force-pushed the starTrekWatchface branch from c5abbee to c9f1455 Compare October 31, 2024 09:46
@ljahn
Copy link
Author

ljahn commented Oct 31, 2024

I did the great rebase and squash that was long overdue. This is now all in one commit and back on top of current main.
I even incorporated color handling for the AOD mode.

@ljahn
Copy link
Author

ljahn commented Oct 31, 2024

Hi @Handrail9,
It should now build cleanly with the newest version of everything.
I compiled a pre release version that you can find here. That is just this branch as it is now.

@abrahamlnx
Copy link

man this is an amazing watchface, definitly the best I've seen

@abrahamlnx
Copy link

I was hoping to see this watchface added to the main 1.15 branch, welp I guess I'll skip this update to keep using this one

@ljahn
Copy link
Author

ljahn commented Dec 10, 2024

@abrahamlnx
Don't worry 😉. I just rebased this onto 1.15 and will run a few days of testing on my watch. Then I will push 1.15 as well 😄.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new watchface This thread is about a new watchface
Projects
None yet
Development

Successfully merging this pull request may close these issues.