tioruben / ttgo-t-wristband Goto Github PK
View Code? Open in Web Editor NEWFirst steps with TTGO T-Wristband
License: MIT License
First steps with TTGO T-Wristband
License: MIT License
Hello,
Can you help me with a detailed step-by-step plan of how to flash this repo on the T-wristband?
I have been testing the wristband with the accelerometer permanently asleep and skipped with button press.
The results are very encouraging and makes the wristband much more practical for me.
These are the steps I have taken so far:
Added to build_flags in plarform.ini:
-DIMU_SKIP
After initMPU() in setup() in main.cpp
#ifdef IMU_SKIP
mpuSleep();
#endif
In showPage() in pages.cpp
case 3:
#ifndef IMU_SKIP
max_time_out = 60000;
pageBearing(initialLoad);
break;
#else
page++;
#endif
case 4:
#ifndef IMU_SKIP
max_time_out = 30000;
pageTemperature(initialLoad);
break;
#else
page++;
#endif
In handleSleep() of hardware/sleep.cpp
#ifndef IMU_SKIP
mpuSleep();
#endif
also:
#ifndef IMU_SKIP
esp_sleep_enable_ext1_wakeup(GPIO_SEL_33 | GPIO_SEL_39, ESP_EXT1_WAKEUP_ANY_HIGH);
#else
// 39 is from IMU but has label IO38. 33 is from touch capacitor
esp_sleep_enable_ext1_wakeup(GPIO_SEL_33, ESP_EXT1_WAKEUP_ANY_HIGH);
#endif
For completeness but not required: in handleAction() in pages/pages.cpp:
case 3:
#ifndef IMU_SKIP
actionBearing();
#endif
break;
John Heenan
Whenever I try to connect to an wifi and i cancel the connection the wristband hangs on updating time... And heats up. The only way to stop this is waiting for the battery to discharge or pressing the reset button on the daughter board
I have tagged a branch at https://github.com/johnheenan/TTGO-T-Wristband/tree/v0.1-alpha which adds menu for UTC Offsets and DST Regions as well as other improvements.
The tag is at the current head of the poweropts branch.
There is a firmware file attached which can be OTA uploaded if you have a working version of TioRuben's code.
There is a branch available which enables a button press to put the IMU (accelerometer etc) into deep sleep and lower power usage.
When off the watch will not wake up by moving it. There is a discussion of this issue at #5 (comment).
The IMU is toggled on or off by a long press on the battery screen, which used to be used activate OTA. The battery screen also lets you know if the IMU is on or off. The OTA screen can still be used to enable OTA download. The IMU on/off setting is recalled from NVS after wakeup.
When the IMU is turned off two screens are skipped.
The branch is further progress to allow a UTC offset and timezones to be set by button by allowing IMU_SKIP and timezone settings to be set to and recalled from NVS.
The platformio.ino setting -DIMU_SKIP
now controls what the initial setting of the IMU is after firmware upload. IMU_SKIP set means leave IMU off by putting into a deep sleep after firmware upload. To force all settings to be reinitialised from firmware settings instead of NVS settings each time with a wake up use -DEEPROM_REINIT
. For now this is only relevant to the IMU_SKIP firmware setting.
I am happy to make a PR from the branch, which can be downloaded by:
git clone https://github.com/johnheenan/TTGO-T-Wristband.git
cd TTGO-T-Wristband
git checkout -b origin/poweropts
Discussions are welcome
John Heenan
The customise the code for different time zones hardcoding is required in two files: wifi/ntp.cpp and hardware/clock.cpp.
In function isDST (for is Daylight Savings Time) the return line:
return previousSunday >= 20;
looks OK for month 3 but not for month 10.
Suggested change:
if (now.month == 3)
return previousSunday >= 20;
else // now.month can now only be 10
return previousSunday < 20;
John Heenan
Entire isDST() function:
bool isDST(RTC_Date now)
{
uint8_t dayOfWeek = rtc.getDayOfWeek(now.day, now.month, now.year);
if (now.month < 3 || now.month > 10)
{
return false;
}
if (now.month > 3 && now.month < 10)
{
return true;
}
int previousSunday = now.day - dayOfWeek;
return previousSunday >= 20;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.