TTGO T-WATCH-2020

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
vandys
Posts: 7
Joined: Mon Aug 10, 2020 9:06 pm

Re: TTGO T-WATCH-2020

Post by vandys » Mon Sep 28, 2020 7:14 pm

Are there two hardware versions of the 2020 TTGO watch? I have seen source which appears to use GPIO for the backlight; on my watch, it's the vibrator motor. And I keep finding some TTGO 2020 images which bootloop:

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:QIO, clock div:1
load:0x3f400020,len:2044892

and others which work. Puzzling!

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

Re: TTGO T-WATCH-2020

Post by vlad » Fri Oct 09, 2020 10:27 am

Hi guys,
Did anyone try to implement the MQTT or any other messenger client for T-Watch2020 yet?

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

Re: TTGO T-WATCH-2020

Post by uraich » Sun Oct 11, 2020 5:05 pm

I don't know what you want to use MQTT for but the umqtt module in micropython-lib does the job.
Here is a small example I wrote as a demo for a presentation on IoT.
The connect() function from the module wifi_connect just connects to my WiFi network. I started mosquitto on my Linux PC as well as the mosquitto_sub client subscribing to the ASP2020 (African School of Physics) topic.
Attachments
mqttDemo.png
mqttDemo.png (41.65 KiB) Viewed 1219 times
mqttDemoResult.png
mqttDemoResult.png (43.94 KiB) Viewed 1219 times

GilGoldman
Posts: 1
Joined: Wed Dec 02, 2020 4:58 pm

Re: TTGO T-WATCH-2020

Post by GilGoldman » Wed Dec 02, 2020 5:08 pm

husky wrote:
Wed Aug 19, 2020 2:39 pm
I have finished version 0.1 of the wasp project adapted to twatch 2020.
It works: clock, stopwatch, flashlight, settings.
in this version the clock wakes up every 5 minutes and tries to connect to the internet to do certain tasks, right now just synchronize the time.
This version will have many errors that I will correct, but it is already a watch that can be used.
https://github.com/sactre/wasp-os/tree/develop/wasp
To test it, load micropython on the clock, then copy the contents of the wasp folder to the clock.

Hi Husky!
This looks incredible and would definitely save days of work trying to to get the T-Watch-2020 functioning.

I've tried doing as you said (Watch loaded with Micropython via OPHoper's firmware (available here: https://github.com/OPHoperHPO/lilygo-tt ... icropython)), and pulled the contents of the wasp subdirectory to the watch.

It is now stuck in an infinite boot cycle, displaying the same issue (listed below).

Do you know how to stop it and re-establish REPL connection, or, better yet, how to fix it?

Best,

Gil

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:5124
load:0x40078000,len:12844
load:0x40080400,len:3472
entry 0x40080638
* initializing pins
* initializing mpu
* Detect PMU Type is AXP202
I (30370) wifi:wifi driver task: 3ffd6ebc, prio:23, stack:6656, core=0
I (34717) wifi:wifi firmware version: aa5336b
I (34717) wifi:config NVS flash: enabled
I (34717) wifi:config nano formating: disabled
I (34717) wifi:Init dynamic tx buffer num: 32
I (34717) wifi:Init data frame dynamic rx buffer num: 32
I (34727) wifi:Init management frame dynamic rx buffer num: 32
I (34727) wifi:Init management short buffer num: 32
I (34737) wifi:Init static rx buffer size: 1600
I (34737) wifi:Init static rx buffer num: 10
I (34747) wifi:Init dynamic rx buffer num: 32
Traceback (most recent call last):
File "wasp.py", line 300, in run
File "uasyncio/core.py", line 1, in run
File "uasyncio/core.py", line 1, in run_until_complete
File "uasyncio/core.py", line 1, in run_until_complete
File "wasp.py", line 310, in main_loop
File "wasp.py", line 97, in init_apps
MemoryError: memory allocation failed, allocating 136 bytes
ets Jun 8 2016 00:22:5

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

Re: TTGO T-WATCH-2020

Post by uraich » Thu Jan 07, 2021 5:49 pm

After an initial successful try with husky's 0.1 version of the wasp project for the t-watch2020 I decided that I first had to learn more about lvgl and wasp before being able to make a reasonable contribution.
In the meantime I ported all programs in lv_examples from C to Micropython and you should be able to run these on the twatch.
I also wrote an analogue watch application and a few additional programs for the t-watch:
https://github.com/uraich/lv_mpy_exampl ... h_examples
I also upgraded OPHoper's micropython port to the latest lvgl and lv_bindings versions. When doing this I had to make small modifications to his code:
https://github.com/uraich/twatch-2020-micropython
In addition, Mike Teachman's i2s driver has been added to this Micropython version. I gave it a quick try but for the moment the twatch keeps silent.
In order to build the lv_micropython version for the t-watch type:
make -f Make_TWATCH in .../ports/esp32

You can also create a unix version of lv_micropython:
make VARIANT=dev
in .../port/unix. You will find the binary in micropython-dev. This allows you to test lvgl programs on your Unix machine before compiling and uploading them to the t-watch.
With the knowledge acquired I will now try to work on the t-watch. I am however not sure yet if I should start with wasp or try to port the "official" twatch program:
https://github.com/sharandac/My-TTGO-Watch
which is written in C++ for the Arduino.

newb
Posts: 36
Joined: Wed Jan 10, 2018 8:19 pm
Location: Bulgaria

Re: TTGO T-WATCH-2020

Post by newb » Thu Jan 07, 2021 7:51 pm

if you have a compiled binary could you please upload that to your git repo? I just got my watch and want to try it without compiling from scratch. :D

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

Re: TTGO T-WATCH-2020

Post by uraich » Fri Jan 08, 2021 9:37 am

Done!
You will find the binary under:
...ports/esp32/build-LILYGO_T_WATCH_2020_V1/firmware.bin
You also get the binary for lv_micropython that you can run (as simulator) on your Unix machine under
.../ports/unix/micropython-dev

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

Re: TTGO T-WATCH-2020

Post by uraich » Fri Jan 08, 2021 11:27 am

Just for the record:
I will document my progress on
https://afnog.iotworkshop.africa/do/vie ... 20/WebHome
There is a box named: The LilyGo t-watch 2020
It does not contain much yet but you will find a big number of links to hardware description, git repositories related to the t-watch, data sheets etc.
I hope it will help you to find a way through the jungle of information.

newb
Posts: 36
Joined: Wed Jan 10, 2018 8:19 pm
Location: Bulgaria

Re: TTGO T-WATCH-2020

Post by newb » Fri Jan 08, 2021 6:05 pm

Great! Just flashed it and it works good so far.
I haven't dealt with wasp-os before and I need to figure out the file structure and how to get wifi going. I'll follow your progress on this :)

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

Re: TTGO T-WATCH-2020

Post by uraich » Sat Jan 09, 2021 9:19 pm

Sorry, I made some configuration errors for the st7789 display controller. These are corrected now.
The binary has been updated as well.
Now that you have MicroPython running you may want to try some applications on the watch.
I have written 4 such applications for the moment, none of which should be considered final. Nevertheless you may want to give them a try:
https://github.com/uraich/lv_mpy_exampl ... h_examples
Here are some screen dumps:
calculator.png
calculator.png (8.4 KiB) Viewed 829 times
calendar.png
calendar.png (12.71 KiB) Viewed 829 times
numclock.png
numclock.png (6.2 KiB) Viewed 829 times
aclock.png
aclock.png (10.91 KiB) Viewed 829 times
In order to get date and time from ntp (network) you have to change the call to connect to the WiFi network. Instead of just calling "connect()" please call connect(ssid="your wifi ssid",password="your wifi password")
The wifi_connect module is already frozen into your MicroPython binary.
Let me know it this works for you.
Of course these applications, running with a display permanently switched on, must be changed because otherwise the battery will be drained very quickly. They should run ok on a watch which is permanently powered however.

Post Reply