TTGO T-WATCH-2020

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
vlad
Posts: 5
Joined: Mon Aug 24, 2020 1:31 pm

Re: TTGO T-WATCH-2020

Post by vlad » Mon Sep 21, 2020 2:13 pm

Hi guys,
I found the following statement in husky's code :

wasp.py ....
def request_tick(self, period_ms=None):
"""Request (and subscribe to) a periodic tick event.
Note: With the current simplistic timer implementation sub-second
tick intervals are not possible.

I'm, trying to build the metronome app for t-watch 2020. Would it be possible at all to achieve any accuracy with timer ?
I definitely need the sub-second intervals :-(

Is Timer the only option I have ?
Could you please recommend the the suitable library for t-watch 2020 to generate the sub-second ticks for the metronome ?

Cheers,
Vlad

husky
Posts: 17
Joined: Wed Jul 15, 2020 7:46 am

Re: TTGO T-WATCH-2020

Post by husky » Mon Sep 21, 2020 3:02 pm

:cry: Sorry to leave that comment from the original wasp-os. In my fork the ticks are expressed in milliseconds.
Ignore that comment.

vlad
Posts: 5
Joined: Mon Aug 24, 2020 1:31 pm

Re: TTGO T-WATCH-2020

Post by vlad » Mon Sep 21, 2020 3:39 pm

Thanks a lot !
BTW can I utilize "request_tick" somehow to get the events for the metronome ?

I think using the while loop is not the best option for that if I need to draw on the screen and activate a vibration motor on each tick.

Do you have an example of such a code handy ?

Cheers,
Vlad

User avatar
Angainor
Posts: 15
Joined: Thu Sep 24, 2020 9:14 am

Re: TTGO T-WATCH-2020

Post by Angainor » Thu Sep 24, 2020 9:39 am

husky wrote:
Sun Sep 20, 2020 5:27 pm
Thanks for the feedback. I really have to do documentation of how to configure the wifi and how to make applications that need internet and background tasks.
Regarding the use of the ST7789 driver, I have used the wasp-os driver for application compatibility. But I think I can make a proxy to use the official ST7789
But every time I do things in this fork I find it more difficult to maintain compatibility with the original wasp-os project. I have already separated a lot from the Core, to the way of managing the apps and the battery management. At first I was going to do a PR on the main project. But now I think it is better to keep this project independent.
opinions?
Next things I want to do:
I would like the battery to last 72 hours.
I am working on a weather app.
Hi Husky,

First of all, many thanks for your port and the efforts you put in it.
Much appreciated and very, very helpful!

As for the fork options, please allow me to give some personal opinion:
One of the strength of wasp-os is its architecture and doc, plus the fact that it evolves.
For an app dev, you have all tooling and can mostly abstract the hardware, all being documented.

To me, it would make sense to be as close to the original as possible, mostly for that reason.
Anything you change (like changing case for core variables, was that really mandatory?) means you make it harder for an app to be ported between archs, plus you then need to write and update doc instead of pointing to the original one.
Did you sync with Daniel to see how your fork could be merged, how he would deal with the significant hardware changes?

I really think a unified core - and doc - would be a huge step toward adoption and usage.
As a dev myself, I do understand the pulsion to make things like you like them and tweak the core to your liking instead of Daniel's guidelines and arch, but I feel you're isolating yourself doing that.
(This is not a critic and I could have done the exact same or worse)
Also, merging goes both ways. Daniel already committed several things since your fork, this is lost to you or will require more work.

Now for a debug question:
I tried your wasp os port, "develop" branch, on a TWatch2020.
I used the following micropython, tailored for TWatch2020 with all drivers (plus lvgl)
https://github.com/OPHoperHPO/lilygo-tt ... icropython
I built it from source.

Once your wasp-os fork is installed, the watch does run, no error in console, but it does only displays the time.
(wifi ok, time auto set ok but 2 hours offset)
However, I can't swipe to anything.
Touch events are detected and DEBUG:Touch printed, but this triggers nothing, watch sticks to the time screen.

Any idea what could be wrong?

User avatar
Angainor
Posts: 15
Joined: Thu Sep 24, 2020 9:14 am

Re: TTGO T-WATCH-2020

Post by Angainor » Thu Sep 24, 2020 10:37 am

Answering to myself:

Works if I slide vvveeerrryyy slow, looks like "just" a perf/speed issue.
(and needs a real reboot, does not survive a soft reboot)

uraich
Posts: 56
Joined: Tue Mar 26, 2019 12:24 pm

Re: TTGO T-WATCH-2020

Post by uraich » Fri Sep 25, 2020 10:27 am

Angainor, did you use the st7789 driver included in the micropython branch for TWatch2020 or did you use the driver included in husky's wasp-os fork?
I still have not understood how to build a simplistic lvgl app on the TWatch2020 using the micropython port for the t-watch.
The examples I saw were written for the ili9341 driver and they import ili9XXX. When I try to import st7789 micropython tells me that the module does not exists. To me it looks like the automatically generated micropython bindings are missing. Any idea?

User avatar
Angainor
Posts: 15
Joined: Thu Sep 24, 2020 9:14 am

Re: TTGO T-WATCH-2020

Post by Angainor » Fri Sep 25, 2020 11:03 am

uraich wrote:
Fri Sep 25, 2020 10:27 am
Angainor, did you use the st7789 driver included in the micropython branch for TWatch2020 or did you use the driver included in husky's wasp-os fork?
I still have not understood how to build a simplistic lvgl app on the TWatch2020 using the micropython port for the t-watch.
The examples I saw were written for the ili9341 driver and they import ili9XXX. When I try to import st7789 micropython tells me that the module does not exists. To me it looks like the automatically generated micropython bindings are missing. Any idea?
I'm using this micropython:
https://github.com/OPHoperHPO/lilygo-tt ... icropython

Once properly compiled, comes with everything.
After some struggling, I came up with a working minimal example of starting lvgl, and have a very dirty lvgl version of trimmed down wasp os.

Will post the minimal sample soon.

Btw, came across the same concern as Husky: how to blend major changes (like here, i'd like to use lvgl for all apps) while keeping as much compatibility as possible with the original code.

uraich
Posts: 56
Joined: Tue Mar 26, 2019 12:24 pm

Re: TTGO T-WATCH-2020

Post by uraich » Fri Sep 25, 2020 1:13 pm

Well, I am still in the state of "struggling"! I have the same version of micropython and I managed to compile it.
I also tried to put the t-watch board specific files into https://github.com/lvgl/lv_micropython, which is under continued development. This also works.
So, I am very curious to see your minimal lvgl example as well as your wasp-os implementation be it clean or dirty.

User avatar
Angainor
Posts: 15
Joined: Thu Sep 24, 2020 9:14 am

Re: TTGO T-WATCH-2020

Post by Angainor » Fri Sep 25, 2020 1:41 pm

There you ttgo:

Minimal lvgl app demo with micropython on T-Watch 2020, st7789 and axp202.
https://gist.github.com/AngainorDev/63e ... 651eee1005

uraich
Posts: 56
Joined: Tue Mar 26, 2019 12:24 pm

Re: TTGO T-WATCH-2020

Post by uraich » Fri Sep 25, 2020 4:24 pm

Extremely helpful! Many thanks. I just tried it and had no problem to get it to work.
Can you also give us access to your wasp-os work?

Post Reply