Skip to content

Releases: johnheenan/TTGO-T-Wristband

UTC Offsets and DST Regions on T-Wristband

15 May 02:42
Compare
Choose a tag to compare

Modifications in this branch by John Heenan

From commit notes:

"Edit README with hardware model information and OTA upgrade information

"Add either UTC offset or TZ code to clock screen (if code entered)

"IMU info in README, enum isDstNS for quad state answers

"Added information to README about what toggling IMU on and off does and about IMU hardware and board design change in May 2020

"Added in a quad state enum isDStNS for isDstSouth() and a new isDstNorth()"

Hardware

This code is for the T-Wristband from LilyGo at https://www.aliexpress.com/item/4000527495064.html with the previous hardware version with MPU9250 IMU.

The code will be updated for the current T-Wristband on sale with LSM9DS1 IMU.

Uploading Firmware File

This OTA update method has been tested with the T-Wristband with firmware from source at https://github.com/TioRuben/TTGO-T-Wristband and https://github.com/johnheenan/TTGO-T-Wristband.

It will be tested with firmware form other sources such as https://github.com/Xinyuan-LilyGO/T-Wristband and with original shipped firmware.

If you have got a working version of TioRuben's code on your T-Wristband then you can OTA the firmware file for this source code, firmware.bin, from the release section of this github repo, tagged as v0.1c-alpha.

It can be OTA uploaded to the T-Wristband with:

espota.py --auth=wristbandpass --progress -i <ip address> -f firmware.bin

For example if the screen shows IP address 192.168.1.177 then

espota.py --auth=wristbandpass --progress -i 192.168.1.177 -f firmware.bin

Screen changes

Screen Skipping in mod Long Press Original Long Press Modifed
Orange Local Time No Update Time with NTP Update Time with NTP
Green UTC Time No Update Time with NTP Set DST Region or UTC Offset
Battery Level No None Toggle IMU on or off for power saving
Orange Compass Degrees Yes in mod if IMU off Calibrate Compass Calibrate Compass
Red Temperature Yes in mod if IMU off None None
OTA (upgrade firmware) No Update firmware Update firmware
Deep Sleep Yes in mod if plugged in N/A N/A

In the original there are two types of key presses

Brief press changes screen and a key press of one second chooses an action

So IMU can be toggled on or off by holding down the the button on the battery screen

What toggling IMU on or off does

When IMU is toggled on you can view two extra screens (Compass Degrees and Temperature). You can also use movement gestures to wake the watch up from deep sleep.

Currently when the IMU is toggled off battery drain is reduced substantially, increasing the time required between battery recharges. This is for two reasons: battery current in deep sleep is reduced with IMU off and the chance of accidental wake ups is reduced. When woken up the current used is dramatically increased compared to when in deep sleep, so accidental wake ups are a battery drain issue.

When IMU is off you can use the button to wake up.

There is relevant information at TioRuben#5

In May 2020 a new hardware version of the T-Wristband went on sale with a different IMU and without a pullup resistor on an interrupt line. The pullup resistor on the previous version drains current unnecessarily in deep sleep due to keeping the interrupt line low during deep sleep.

With the hardware changes mentioned above and software changes in the future, toggling the IMU off may not be as big an issue.

Key Press Behaviour Changes For UTC and DST Menus

The behaviour of key presses change changes in the UTC action to change DST Regions or UTC Offsets

  1. A key press advances either the DST Regions or the UTC Offset screen.
  2. A key press of one second choose an option and backs out
  3. No key press for five seconds backs out and chooses nothing

UTC Offsets Menu

There are 49 choices: 48 for each half hour increment in day and a choice to move to DST Regions menu instead. If you choose DST regions then go back in to view after being backed out.

DST Regions Menu

The sample firmware had four choices and one other to move to UTC Offsets menu

If you choose UTC Offsets then go back to view after being backed out.

The four choices are

  • Europe, Central
  • China
  • Brisbane
  • Sydney

A region does not have to be a DST region to put an entry in (such as China and Brisbane)

You can code up to 100 DST regions in the timezones.cpp file and give each whatever name you want, up to 20 characters (but only the middle 12 or so charcters will be displayed). Each entry only requires one line. An up to 10 character zone code, such as "CST" is shown in the local time screen. If preferred you can use a 10 character code code such as as "+8hr" or "+10:30". You can also leave it blank as in "".

NVS (as EEPROM) Settings preserved

If the settings structure has the same size as before then settings are preserved across firmware updates, unless the EEPROM_VER value in platformio.ini is changed

Additional Documentation and TODOs

There are strings in the code that partially serve as documentation. Just search or grep through code for "doco" and "todo jh", such as:

  • grep -r doco *
  • grep -r "todo jh" *

Miscellaneous Notes

platformio.ini documents various build time choices.

The WiFi Manager screen that appears if a WiFi connection fails shows name of AP to connect to (T-Wristband) and when connected what IP to use in a web browser. The screen now times out after two minutes

Internally, since the NTP library code tries many times to get an answer, the code only makes one attempt to get time the time through the library. If there is a failure, just try again later.

The NTP library code was modified minimally.

A firmware ID screen such as "200515,jh,branch,tr" appears in the IMU on/off screen. 200515 means 15 May 2020. "jh,branch,tr" means branch of John Heenan from TioRuben.

UTC Offsets and DST Regions on T-Wristband

12 May 14:05
Compare
Choose a tag to compare

Please see updated release v0.1x-alpha above