Giter Club home page Giter Club logo

t-watch-2020's Introduction

T-watch-2020

a watch project for the TTGO T-watch-2020 version 1

This work is licensed under the BSD 3-clause license. See LICENSE.txt.

This builds with Arduino IDE version 1.8.13. It also requires:

This is a "sketch" in Arduino parlance, not a library. That means you should do the "git clone" or unpack the zip file in the place where your Arduino sketches live. It also means that you should rename the directory in which the code lives to "DudleyWatch", so it matches the name of the .ino file. Or change the name of the .ino file to be the same as the directory (but with the .ino extension); I think either one should work.

Also note that when building with the Arduino IDE, you must set the partitioning to the special T-watch partitioning scheme: 2x6.5 MB APP, 3.6MB SPIFFS.

For more on building this sketch, see Using this code on your watch, below. For beginner/newbie instructions, starting from "I have a computer, but have not installed Arduino", then read these beginner instructions.

I took bits from Dan Geiger's watch code (https://www.instructables.com/Lilygo-T-Watch-2020-Arduino-Framework/), and bits from SimpleWatch (the shipped demo), and added many new features.

Existing Features

  • Dan's Jupiter's moon's calculator is mostly unchanged.
  • Dan's accelerometer demo is now tarted up a little as a "Level"
  • Dan's battery app is mostly unchanged.
  • Dan's "Basic" watch face has been enhanced with step counter, battery charge icon.
  • Dan's "LCARS" watch face has been enhanced with step counter, battery charge icon, more.
  • Dan's Bitcoin app is mostly unchanged.

New Features

  • choice of Analog, "Basic digital", "LilyGoGui", or LCARS watch face. LCARS and Basic are derived from Dan Geiger's watch. LilyGoGui derived from the demo code that comes with the watch.
  • The ability to show time in your local time zone plus your home time zone if you're travelling
  • If you attempt to use WiFi with an unfamiliar access point, the watch will open a page where you can choose from the available SSIDs and then enter the password associated with that SSID. This information is stored in a "file" in the SPIFFs part of the flash. This is not overwritten when you re-upload the program from the Arduino IDE, so your WiFi SSID's and passwords are stored "forever".
  • step counter (can be disabled in Settings)
  • MQTT monitor and control (for your home automation system, for example)
  • 9 pages of Settings in three groups (alarm, weather and "other") using the LVGL framework. Settings are stored in EEPROM.
  • A "maze" game. Swipe or tilt watch left, right, up, down to move your cursor. Try to move it to the red endpoint. CW circle gesture to exit.
  • A simple stopwatch. Beep function added by Frank Scholl (Fra4prg) on 2021-01-13. Documentation for the beep function is here. A Tea Timer function was added by Frank Scholl (Fra4prg) on 2021-01-31. Documentation for that feature is here.
  • A function to set the time from NTP. If that fails, run's Dan Geiger's "SetTime" app.
  • Storage for multiple WiFi credential sets, so the watch can connect to any SSID you regularly visit
  • An alarm clock function. Alarm is interpreted in the current timezone, so 08:00 is always 08:00 local time.
  • The world's stupidest "paint" program
  • Polish postfix scientific calculator.
  • Conway's game of life. (No user controls, "yet"). Randomly populates the "board" and runs forever. Touch the screen to exit.
  • Recognition of 6 gestures (left, right, up, down, cw circle, ccw circle). (The FT6236 chip claims to recognize gestures, but it doesn't.)
  • Battery level icon, "is plugged into charger" icon, and step counter icon.
  • A Mandelbrot/Julia set app, written by "FabriceA6" (sorry, I couldn't find better attribution).
  • The WiFi access points database is now stored in a file acc_pts.txt in the SPIFFs filesystem. If you try to use any WiFi app to connect to a new access point, the app will open up a settings page where you can enter the password and timezone for this new access point, and then it will be appended to the file acc_pts.txt.
  • Most clocks (not LCARS) now can show either 12 or 24 hour clocks. Setting is controlled in 4th page of Settings app.
  • A simple calendar app. Shows one month at a time, and you can navigate to any month using +month, -month, +year, -year buttons. At compile time, you can define your own holidays and events like birthdays, which are highlighted different colors on the calendar display. Touch anywhere not on a button to exit the app.
  • An app to allow deletion of WiFi access point from the internal flash storage (SPIFF file acc_pts.txt). This is useful if you enter the password incorrectly, or the password changes. Simply delete the SSID and then re-enter it by using the NTP Time app or the Weather app, which will ask you for the credentials when it fails to connect to wifi.
  • A weather app. The app attempts to figure your location using your IP address, which works pretty well with WiFi that is not a cell phone hotspot. The reason cell phone hotspots give a bad location is that your cell data may be routed to a city 100 miles away before it gets a routable IP address and gets to the internet. So the weather location may be off by quite a bit when using a cell phone hotspot for connectivity. You'll need an OpenWeatherMap.org API key, which was free at time of writing. Also note the LIBRARY REQUIREMENT listed at the beginning of the file. The weather app shows today's conditions, the conditions for the next week, and any National Weather Service alerts if there are any for "your" location. Swipe left and right to see different pages, swipe down to exit.
  • A weather settings app. Allows you to set your home latitude, home longitude, the openweathermap.org API key, and metric/imperial units. When changing a text box content, make sure to hit the check icon on the keyboard to tell the GUI that you've made a change.
  • A WiFi scanner app. It supplies two views: (1) list of access points, channel, RSSI; (2) graphical representation, channel vs strength. Swipe left or right to switch views. Swipe down to exit.
  • A Color Picker app. It displays a palette of many colors, and when you touch the screen, it displays the R,G,B values. To exit the app, touch the lower left corner (outlined with light grey lines).

Using this code on your watch

To use this code, edit personal_info.h to have the IP, port, username, password of your MQTT server (assuming you have one), plus your home latitiude, longitude, and city, and also your openweathermap.org API key. Edit my_WiFi.h to have the SSID's, passwords, and timezones of all the WiFi access points you want your watch to connect with. If you have an MQTT installation, edit appMQTT.h to change my topics to your topics. Finally, compile and upload to your watch.

warning about the LVGL User Interface

The LVGL UI is used to build the setup, WiFi, and alarm screens with all the dropdowns, buttons, etc. The text entry boxes put up a keyboard when touched. When you have finished entering your text into the box (WiFi password, for example), make sure that you hit the checkmark on the keyboard. This ensures that the characters you have entered are seen by the UI.

Gestures Mapping

From the watch display, the following gestures work:

  • swipe down : go to app select screen
  • swipe right : run Battery app to see battery charge level, etc.
  • swipe left : go to alarm settings. If alarm is beeping, silence alarm.
  • CW circle : run MQTT app
  • CCW circle : run Settings app.
In the scientific calculator, the following gestures work:
  • swipe right : exit app
  • swipe down : push value onto stack
  • swipe up : pop stack and discard the value
  • swipe left : backspace to erase most recently typed digit
  • CW circle : put the value of pi on the top of the stack (3.141...)
  • CCW circle : switch to second keyboard, where most of the transcendental functions live, plus "CHS" (change sign), "CLX" (clear "x" or top of stack), swap X <-> Y
To compute 2 + 3, do: 2, swipe down, 3, +

Screen Shots


"LCARS" watch face

"LilyGoGui" watch face

Analog watch face

Conway's Life

settings page 4

alarm settings page 1

MQTT client sensor page

MQTT client control page

Stop Watch

Scientific Calculator page 1

Scientific Calculator page 2

Maze game

Weather App

WiFi scanner App

Stop Watch App

Stop Watch App, Tea Timer function

Stop Watch App, Tea Timer function

Stop Watch App, Tea Timer function

t-watch-2020's People

Contributors

federicobusero avatar fra4prg avatar guyou avatar wfdudley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

t-watch-2020's Issues

Unable to compile RTC_INT undefined

There are a lot of mentions of RTC_INT in the code, but it's not defined anywhere. Which gpio is it?

exit status 1
'RTC_INT' was not declared in this scope
  attachInterrupt(RTC_INT, [] {
      rtcIrq = 1;
      BaseType_t xHigherPriorityTaskWoken = pdFALSE;
      EventBits_t  bits = xEventGroupGetBitsFromISR(isr_group);
      if (bits & WATCH_FLAG_SLEEP_MODE)
      {
	  //! For quick wake up, use the group flag
	  xEventGroupSetBitsFromISR(isr_group, WATCH_FLAG_SLEEP_EXIT | WATCH_FLAG_AXP_IRQ, &xHigherPriorityTaskWoken);
      } else
      {
	  uint8_t data = Q_EVENT_AXP_INT;
	  xQueueSendFromISR(g_event_queue_handle, &data, &xHigherPriorityTaskWoken);
      }
      if (xHigherPriorityTaskWoken)
      {
	  portYIELD_FROM_ISR ();
      }
  }, FALLING);```

Searching where to disable wake up on accel

I have 8h of autonomy usng the default firmware , but i can clearly see that the wathc is waking up all the time , even when i don't need to look at time . I'm totally of with having to use the push button to look at the time .

I just can't find where you programmed the waking up on accel ?

Gestures are broken & other things

Hi, maybe I've gotten something very wrong here, but this project doesn't seem to work to me. I was able to build and flash using the Arduino IDE after changing the name of the folder to "DudleyWatch" and installing the following libraries:

https://github.com/Xinyuan-LilyGO/TTGO_TWatch_Library
https://github.com/bxparks/AceTime
https://github.com/Bodmer/TFT_eSPI
https://github.com/bxparks/AceCommon
https://github.com/bblanchon/ArduinoJson
https://github.com/arduino-libraries/Ethernet
https://github.com/knolleary/pubsubclient/
https://github.com/earlephilhower/ESP8266Audio

That's where my problems started. None of the given gestures seem to work for me. I seem to have access to only two things:
(1) the MQTT app (which is proceeded by a "scan networks" page which does seem able to connect to my wifi), accessed by swiping in any direction on the home screen
(2) the settings app, accessed by CCW rotation

I can't seem to launch the app select screen reliably - most of the time, it opens the MQTT app instead. I was able to bring it up once, but have not been able to repeat. Also, fonts seem to be messed up on the display - non-half-height lines overlap with each other. My timezone info seems to be ignored (assumes I'm in Perth). Finally, the time did not seem to sync from NTP the one time I was able to run the NTP sync app.

Am I just bad at swiping? :P

Edit: here's the output of a two fast near-vertical swipes down with DEBUG_GESTURES 1

i = 100, p = 252
max_lrud[] = 110, 120, 1, 239
pts_lrud[] = 232, 1, 2, 233
x0 = 120, x = 110, xdir = -10
y0 = 1, y = 239, ydir = 238, amax = 238
maybe a circle
max_order[4] = 1, 2, 0, 3
dir_order = RULDRULD
found CCW CIRCLE
ccw circle

i = 100, p = 427
max_lrud[] = 99, 104, 5, 239
pts_lrud[] = 0, 407, 2, 408
x0 = 99, x = 104, xdir = 5
y0 = 5, y = 239, ydir = 234, amax = 234
maybe a circle
max_order[4] = 0, 2, 1, 3
dir_order = LURDLURD
found CW CIRCLE
cw circle

here's a slow vertical swipe down (which is not recognized at all?):

i = 100, p = 1356
max_lrud[] = 134, 149, 11, 239
pts_lrud[] = 0, 1336, 2, 1337
x0 = 134, x = 149, xdir = 15
y0 = 11, y = 239, ydir = 228, amax = 228
maybe a circle
max_order[4] = 0, 2, 2, 2
dir_order = LUUULUUU

here's what it looks like when I try to draw a CW circle (up, right, down, left):

i = 100, p = 1339
max_lrud[] = 37, 201, 69, 207
pts_lrud[] = 1321, 887, 471, 3
x0 = 75, x = 37, xdir = -38
y0 = 207, y = 195, ydir = -12, amax = 38
maybe a circle
max_order[4] = 3, 2, 1, 1
dir_order = DURRDURR

WiFi.onEvent(WiFiEvent); should only be called once

Each time the app 'NTP Time' or 'Weather' is executed, WiFi.onEvent(WiFiEvent); is executed, but this should only be called once at setup time. If the app NTP time has been opended 10 times, a wifi connection that is created will result in 10x calling the function WiFiEvent, which can be seen on the debug window: you will see 10 times

WiFi connected! IP address: ...

Clear hour/minute/seconds display area before going to sleep

When i activate clock it is usually shows old time (which was at before sleep) and real time will be shown after delay for redraw (half of second or so). This is quite annoying as i have to remember to wait for the screen redraw.

As hotfix i've added ttgo->tft->fillScreen() right before ttgo->displaySleep() in lowEnergy() function but this clears whole screen which is not needed. I think, better way is to clear only box where hour/minute/seconds are displayed and redraw them first, then all other fields but that will require to implement a function in every skin code.

Unable to connect to Wifi

I modified the my_WiFi.h to look like this:

EXTERN WIFIAP AccessPoints[]
#ifdef WIFIMAIN
= {
{ "Guest123", "ThisIsmypassword1", TZ_EST }, // Home
{ "Not Your A10", "thisismypassword2", TZ_EST }, // my phone hotspot
{ "work-ssid", "password4job", TZ_EST }, // my job's WiFi
{ "friend #1 ssid", "pass#2word", TZ_PST }, // friend one's WiFi
{ "2nd friend SSID", "passwo#4rd", TZ_CST }, // friend two's WiFi
{ "dentist-ssid", "pa#5ssword", TZ_EST }, // my dentist's WiFi
{ "\xE9\x93\xAD\xE5\xBE\xB7\xE7\xBE\x8E\xE5\xAE\xB6" "1-2301", "mingde2301", TZ_CHINA }, // an AirBnB in China, kept as example of non-ASCII chars
{ "friend 3 SSID", "passwor#6d", TZ_EST } // friend three's WiFi
}
#endif

Unfortunately, It never connects to wifi. If I tap on 'weather', it finds all nearby access points, including the ones I configured, but it then freezes at this screen. If I tap on 'delete wifi', I see the pre-configured AP's, but not mine. I then changed the MQTT default password to see if it changed, and it didn't. After making the changes, I saved the file, recompiled, and then uploaded. I'm guessing I'm doing something wrong, or need to somehow wipe the watch before uploading?

UPDATE: I erased the T-Watch 2020 using the Espressif tool, and reflashed. Wifi still doesn't connect, but when I go to the menu option to delete wifi, the watch displays "no wifi data file (acc_pts.txt) found!"

Cannot find the implementation of draw_keyboard

Dear William,

I got your code working on my TTGO watch.
It is really great fun and I am making changes to your code so that the watch looks and works the way I want it.

So far, I have fixed the temperature meter (was in the far left of the screen and is now on the coloured scale).
I also increased the font size of the battery stats.

Now I would like to increase the font size of the menu buttons, but I cannot find the place where these buttons are drawn on the screen. I did find the spot where I can change the labels (which will be needed if I finally succeed to increase the font).
I also found the spot where the calculator buttons are drawn on the screen (there the font size is 4, which is OK).
So my question to you is: where can I find the implementation of the blue button menu?

I found this in the header file, but cannot find the implementation of this function.

void draw_keyboard(uint8_t, const char **, uint8_t, bool, char *);

I found out that the third argument is the font size. But what does the bool do? And could I somehow add pictograms instead of text?

Hope you can help me out, since I do not know where to look further.

Kind regards,

Koen.

Missing AceTime.h

When I tried to compile, I got an error message. I also got a bunch of Multiple Libraries warnings. I suspect the multiple libraries were due to my trying to install other versions of the watch programs. I can delete the multiple libraries but where do I get the AceTime.h?

Arduino: 1.8.10 (Windows 10), Board: "TTGO T-Watch, Enabled, Default (2 x 6.5 MB app, 3.6 MB SPIFFS), 2000000, None"

DudleyWatch:26:21: error: AceTime.h: No such file or directory

compilation terminated.

Multiple libraries were found for "SPIFFS.h"
Used: C:\Users\Bill\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\SPIFFS
Multiple libraries were found for "WiFi.h"
Used: C:\Users\Bill\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi
Not used: C:\Program
Multiple libraries were found for "LilyGoWatch.h"
Used: C:\Users\Bill\Documents\Arduino\libraries\TTGO_TWatch_Library-master
Multiple libraries were found for "SPI.h"
Used: C:\Users\Bill\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\SPI
Multiple libraries were found for "Ticker.h"
Used: C:\Users\Bill\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\Ticker
Multiple libraries were found for "Wire.h"
Used: C:\Users\Bill\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\Wire
Multiple libraries were found for "FS.h"
Used: C:\Users\Bill\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\FS
exit status 1
AceTime.h: No such file or directory

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Err for dayOfWeek with Lilygo Skin

Thanks for the hard work, the code works fantastic, watch looks good. Only issue I am having is for the Day of week in the Lilygo skin, it shows Err everyday. Cannot get the day of week showing correctly. Date, month, year shows correctly. Cannot find the issue, thanks.

unable to push a new branch

modfiles.zip
Hello Bill,

first of all thank you for this great project.
It’s the best T-Watch I found so far.

I made some additions to the stop watch and I would appreciate if you could merge this into your project.
Please apologise, I'm new to Github and it was a nightmare to configure everything but I still get an error when I try to push my branch: "remote:Permission to wfdudley/T-watch-2020.git denied to Fra4prg..."
I don't know: Isn't it allowed to submit a branch to a foreign project?
How else could I submit my proposal?
I added my changed/added files here as modfiles.zip. All changes are marked with the comment // Fra4prg:

Description of my changes:
Added "Smart Sound" option ("HeliTimer")
"Smart Sound" enables you to hear the number of minutes without having to look on the display.
The idea behind this is that human brain can identify the number of 3 beeps as triple without counting them even if they are very short and fast.
So up to 3 beeps are played slowly and preceeding triples are faster.
For every 10 minutes a sweep sound is preceeding.
A new top left button switches modes between [no sound] - [vibration + sound] - [only sound]

Some examples to show the sequence:
Minute 1: C5
Minute 2: C5-E5
Minute 3: C5-E5-G5
Minute 4: triple - C5
Minute 5: triple - C5-E5
...
Minute 9: triple - triple - C5-E5-G5
Minute 10: sweep
...
Minute 18: sweep - triple - triple - C5-E5
and so on...

As you can see this works well for short times up to 10 minutes then it gets weird...
The idea came up when I was flying model helicopters where I had to control the flight time due to small batteries and must not loose visual contact to my heli model.
So I made a small Arduino based timer called HeliTimer.
But this function fits perfect to the T-watch :-)

Step counter reset issues.

I keep the RTC in GMT, so that changing timezones is easy, and you can even have dual timezones displayed. However,
the step counter clears when the RTC rolls over at midnight. This means that at 8PM in the Eastern US time zone, the step counter resets to 0, when using the LilyGoGui watch.

Compilation Error: Sketch uses 1839173 bytes (140%) of program storage space.

When I compile I get the following error:

"Arduino: 1.8.13 (Windows 10), Board: "TTGO T1, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

Sketch uses 1839173 bytes (140%) of program storage space. Maximum is 1310720 bytes.text section exceeds available space in board

Global variables use 116472 bytes (35%) of dynamic memory, leaving 211208 bytes for local variables. Maximum is 327680 bytes.

Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.

Error compiling for board TTGO T1."

Has anyone else had the same problem ? and how did you fix it. I would be happy to lose some of the extensive range of features but I don't know where to start doing that.

Uploading error.

Hello i have all the same libraries as in your list and that from other sites. I can upload Dan code that this was based off of. however i get a error when trying to upload. Error is below. I never saw any of theses errors before.

Invalid library found in C:\Users\jJcSystems\Documents\Arduino\libraries\TTGO-T-Watch-master: no headers files (.h) found in C:\Users\jJcSystems\Documents\Arduino\libraries\TTGO-T-Watch-master In file included from C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020\DudleyWatch\DudleyWatch.ino:33:0: C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020/DudleyWatch.h:44:8: error: 'RTC_Date' does not name a type EXTERN RTC_Date tnow; ^ C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020/DudleyWatch.h:130:8: error: 'TFT_eSPI' does not name a type EXTERN TFT_eSPI *tft; ^ C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020/DudleyWatch.h:131:8: error: 'AXP20X_Class' does not name a type EXTERN AXP20X_Class *power; ^ C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020/DudleyWatch.h:231:8: error: 'TTGOClass' does not name a type EXTERN TTGOClass *ttgo; ^ C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020\DudleyWatch\DudleyWatch.ino: In function 'void update_step_counter()': DudleyWatch:47:18: error: 'ttgo' was not declared in this scope step_counter = ttgo->bma->getCounter(); ^ C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020\DudleyWatch\DudleyWatch.ino: In function 'void resetStepCounter()': DudleyWatch:51:3: error: 'ttgo' was not declared in this scope ttgo->bma->resetStepCounter(); ^ C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020\DudleyWatch\DudleyWatch.ino: In function 'void bright_check()': DudleyWatch:57:7: error: 'power' was not declared in this scope if (power->isVBUSPlug()) { ^ DudleyWatch:66:5: error: 'ttgo' was not declared in this scope ttgo->setBrightness(screen_brightness); // 0-255 ^ C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020\DudleyWatch\DudleyWatch.ino: In function 'void low_energy()': DudleyWatch:78:9: error: 'ttgo' was not declared in this scope if (ttgo->bl->isOn()) { ^ DudleyWatch:95:53: error: 'AXP202_INT' was not declared in this scope erret = gpio_wakeup_enable ((gpio_num_t)AXP202_INT, GPIO_INTR_LOW_LEVEL); ^ DudleyWatch:99:53: error: 'BMA423_INT1' was not declared in this scope erret = gpio_wakeup_enable ((gpio_num_t)BMA423_INT1, GPIO_INTR_HIGH_LEVEL); ^ DudleyWatch:135:35: error: 'lv_disp_trig_activity' was not declared in this scope lv_disp_trig_activity(NULL); ^ C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020\DudleyWatch\DudleyWatch.ino: In function 'void Serial_timestamp()': DudleyWatch:179:29: error: 'ttgo' was not declared in this scope Serial.printf("%s UTC\n", ttgo->rtc->formatDateTime()); ^ C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020\DudleyWatch\DudleyWatch.ino: In function 'void setup()': DudleyWatch:213:16: error: 'EEPROM_SIZE' was not declared in this scope EEPROM.begin(EEPROM_SIZE); ^ DudleyWatch:253:3: error: 'ttgo' was not declared in this scope ttgo = TTGOClass::getWatch(); ^ DudleyWatch:253:10: error: 'TTGOClass' has not been declared ttgo = TTGOClass::getWatch(); ^ DudleyWatch:255:3: error: 'tft' was not declared in this scope tft = ttgo->tft; // just a shorthand for ttgo->tft ^ DudleyWatch:256:3: error: 'power' was not declared in this scope power = ttgo->power; // just a shorthand for ttgo->power ^ DudleyWatch:258:19: error: 'TFT_BLACK' was not declared in this scope tft->fillScreen(TFT_BLACK); ^ DudleyWatch:259:21: error: 'TFT_YELLOW' was not declared in this scope tft->setTextColor(TFT_YELLOW, TFT_BLACK); // Note: the new fonts do not draw the background colour ^ DudleyWatch:264:21: error: 'AXP202_BATT_VOL_ADC1' was not declared in this scope power->adc1Enable(AXP202_BATT_VOL_ADC1 | AXP202_BATT_CUR_ADC1 | AXP202_VBUS_VOL_ADC1 | AXP202_VBUS_CUR_ADC1, AXP202_ON); ^ DudleyWatch:264:44: error: 'AXP202_BATT_CUR_ADC1' was not declared in this scope power->adc1Enable(AXP202_BATT_VOL_ADC1 | AXP202_BATT_CUR_ADC1 | AXP202_VBUS_VOL_ADC1 | AXP202_VBUS_CUR_ADC1, AXP202_ON); ^ DudleyWatch:264:67: error: 'AXP202_VBUS_VOL_ADC1' was not declared in this scope power->adc1Enable(AXP202_BATT_VOL_ADC1 | AXP202_BATT_CUR_ADC1 | AXP202_VBUS_VOL_ADC1 | AXP202_VBUS_CUR_ADC1, AXP202_ON); ^ DudleyWatch:264:90: error: 'AXP202_VBUS_CUR_ADC1' was not declared in this scope power->adc1Enable(AXP202_BATT_VOL_ADC1 | AXP202_BATT_CUR_ADC1 | AXP202_VBUS_VOL_ADC1 | AXP202_VBUS_CUR_ADC1, AXP202_ON); ^ DudleyWatch:264:112: error: 'AXP202_ON' was not declared in this scope power->adc1Enable(AXP202_BATT_VOL_ADC1 | AXP202_BATT_CUR_ADC1 | AXP202_VBUS_VOL_ADC1 | AXP202_VBUS_CUR_ADC1, AXP202_ON); ^ DudleyWatch:265:20: error: 'AXP202_VBUS_REMOVED_IRQ' was not declared in this scope power->enableIRQ(AXP202_VBUS_REMOVED_IRQ | AXP202_VBUS_CONNECT_IRQ | AXP202_CHARGING_FINISHED_IRQ, AXP202_ON); ^ DudleyWatch:265:46: error: 'AXP202_VBUS_CONNECT_IRQ' was not declared in this scope power->enableIRQ(AXP202_VBUS_REMOVED_IRQ | AXP202_VBUS_CONNECT_IRQ | AXP202_CHARGING_FINISHED_IRQ, AXP202_ON); ^ DudleyWatch:265:72: error: 'AXP202_CHARGING_FINISHED_IRQ' was not declared in this scope power->enableIRQ(AXP202_VBUS_REMOVED_IRQ | AXP202_VBUS_CONNECT_IRQ | AXP202_CHARGING_FINISHED_IRQ, AXP202_ON); ^ DudleyWatch:269:25: error: 'AXP202_EXTEN' was not declared in this scope power->setPowerOutPut(AXP202_EXTEN, AXP202_OFF); ^ DudleyWatch:269:39: error: 'AXP202_OFF' was not declared in this scope power->setPowerOutPut(AXP202_EXTEN, AXP202_OFF); ^ DudleyWatch:270:25: error: 'AXP202_DCDC2' was not declared in this scope power->setPowerOutPut(AXP202_DCDC2, AXP202_OFF); ^ DudleyWatch:271:25: error: 'AXP202_LDO3' was not declared in this scope power->setPowerOutPut(AXP202_LDO3, AXP202_OFF); // audio device ^ DudleyWatch:272:25: error: 'AXP202_LDO4' was not declared in this scope power->setPowerOutPut(AXP202_LDO4, AXP202_OFF); ^ DudleyWatch:283:11: error: 'BMA423_INT1' was not declared in this scope pinMode(BMA423_INT1, INPUT); ^ DudleyWatch:304:11: error: 'AXP202_INT' was not declared in this scope pinMode(AXP202_INT, INPUT); ^ C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020\DudleyWatch\DudleyWatch.ino: In function 'void loop()': DudleyWatch:392:12: error: 'ttgo' was not declared in this scope rlst = ttgo->bma->readInterrupt(); ^ DudleyWatch:397:2: error: 'power' was not declared in this scope power->readIRQ(); ^ DudleyWatch:425:12: error: 'ttgo' was not declared in this scope rlst = ttgo->bma->readInterrupt(); ^ DudleyWatch:428:8: error: 'ttgo' was not declared in this scope if (ttgo->bma->isStepCounter()) { ^ DudleyWatch:434:2: error: 'power' was not declared in this scope power->readIRQ(); ^ DudleyWatch:539:7: error: 'ttgo' was not declared in this scope ttgo->tft->fillScreen(TFT_BLACK); ^ DudleyWatch:539:29: error: 'TFT_BLACK' was not declared in this scope ttgo->tft->fillScreen(TFT_BLACK); ^ DudleyWatch:540:7: error: 'tft' was not declared in this scope tft->setTextSize(1); ^ Multiple libraries were found for "WiFi.h" Used: C:\Users\jJcSystems\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi Not used: C:\Program Files (x86)\Arduino\libraries\WiFi Multiple libraries were found for "SD.h" Used: C:\Users\jJcSystems\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\SD Not used: C:\Program Files (x86)\Arduino\libraries\SD Multiple libraries were found for "Ethernet.h" Used: C:\Users\jJcSystems\Documents\Arduino\libraries\Ethernet Not used: C:\Program Files (x86)\Arduino\libraries\Ethernet exit status 1 'ttgo' was not declared in this scope

Joseph

Having trouble compiling

Getting the following errors when attempting to compile...

Arduino: 1.8.13 (Linux), Board: "TTGO T-Watch, Enabled, Default (2 x 6.5 MB app, 3.6 MB SPIFFS), 2000000, None"

sketch/SPIFF_fns.cpp: In function 'void build_acc_pts_file()':
SPIFF_fns.cpp:189:25: error: 'sizeof_Access_Points' was not declared in this scope
     for(int i = 0 ; i < sizeof_Access_Points ; i++) {
                         ^
sketch/SPIFF_fns.cpp: In function 'int read_acc_pts_file_and_compare_with_SSIDs(WiFiAp*)':
SPIFF_fns.cpp:230:27: error: 'number_of_networks' was not declared in this scope
       for (int i = 0; i < number_of_networks; ++i) {
                           ^
Multiple libraries were found for "WiFi.h"
 Used: /home/XXXX/.arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi
 Not used: /opt/arduino-1.8.13/libraries/WiFi
Multiple libraries were found for "SD.h"
 Used: /home/XXXX/.arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/SD
 Not used: /opt/arduino-1.8.13/libraries/SD
exit status 1
'sizeof_Access_Points' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

LVGL "7 segment" font is proportional, not fixed spacing.

In the LilyGoGui watch face, the 7 segment font is rendered proportionally, when it should be fixed width spacing. So times with a "1" in them look stupid. One way to fix would be to write each digit individually, so placement could be controlled accurately.

my_tz.cpp:11:8: error: 'ace_time::BasicZoneManager' is not a template

My device is T-watch-2020 v2.
Unable to compile this project, and prompt an error: my_tz.cpp:11:8: error: 'ace_time::BasicZoneManager' is not a template.

 static BasicZoneManager<CACHE_SIZE> manager(
        ^
my_tz.cpp:12:53: error: no matching function for call to 'ace_time::BasicZoneManager::BasicZoneManager(const uint16_t&, const ace_time::basic::ZoneInfo* const [258])'
     zonedb::kZoneRegistrySize, zonedb::kZoneRegistry);
                                                     ^
In file included from C:\Users\81274664\Documents\Arduino\libraries\AceTime\src/AceTime.h:53:0,
                 from C:\Users\81274664\Documents\Arduino\DudleyWatch\my_tz.cpp:3:
C:\Users\81274664\Documents\Arduino\libraries\AceTime\src/ace_time/ZoneManager.h:224:5: note: candidate: ace_time::BasicZoneManager::BasicZoneManager(uint16_t, const ace_time::basic::ZoneInfo* const*, ace_time::BasicZoneProcessorCacheBase&)
     BasicZoneManager(
     ^
C:\Users\81274664\Documents\Arduino\libraries\AceTime\src/ace_time/ZoneManager.h:224:5: note:   candidate expects 3 arguments, 2 provided
C:\Users\81274664\Documents\Arduino\DudleyWatch\play_sound.cpp: In function 'void beep(int8_t)':
play_sound.cpp:64:20: error: 'TWATCH_DAC_IIS_BCK' was not declared in this scope
     out->SetPinout(TWATCH_DAC_IIS_BCK, TWATCH_DAC_IIS_WS, TWATCH_DAC_IIS_DOUT);
                    ^
play_sound.cpp:64:40: error: 'TWATCH_DAC_IIS_WS' was not declared in this scope
     out->SetPinout(TWATCH_DAC_IIS_BCK, TWATCH_DAC_IIS_WS, TWATCH_DAC_IIS_DOUT);
                                        ^
play_sound.cpp:64:59: error: 'TWATCH_DAC_IIS_DOUT' was not declared in this scope
     out->SetPinout(TWATCH_DAC_IIS_BCK, TWATCH_DAC_IIS_WS, TWATCH_DAC_IIS_DOUT);
                                                           ^
exit status 1
'ace_time::BasicZoneManager' is not a template

Do any process I miss to do?

image

below is my config.h
image

Add License

This is a nice project.
But a LICENSE file is missing, helping people to reuse it while following your own choices.

appWeather.cpp units

Hi,
As I am using centigrade I noticed a few issues with the weather app module.
Formatting and units mostly.

Just a few lines to change to correct this so listing them below:

378
-	tft->printf("%.0f %c hi %.0f lo",
+	tft->printf("%.0f %c hi %.0f %c lo",

381
-	  OWOC.forecast[0].temperatureLow
+	  OWOC.forecast[0].temperatureLow,temp_unit

435
-	  tft->printf("%.0f F hi", OWOC.forecast[fo].temperatureHigh);
+	  tft->printf("%.0f %c hi", OWOC.forecast[fo].temperatureHigh,temp_unit);

438
-	  tft->printf("%.0f F lo", OWOC.forecast[fo].temperatureLow);
+	  tft->printf("%.0f %c lo", OWOC.forecast[fo].temperatureLow, temp_unit);

525
-	  tft->printf("%.0f F hi", OWOC.forecast[fo].temperatureHigh);
+	  tft->printf("%.0f %c hi", OWOC.forecast[fo].temperatureHigh, temp_unit);
 
528	
-	  tft->printf("%.0f F lo", OWOC.forecast[fo].temperatureLow);
+	  tft->printf("%.0f %c lo", OWOC.forecast[fo].temperatureLow, temp_unit);

Got my first issue

Hello i have i have tried to follow everything you wrote to the letter. however i get this error.

`In file included from C:\Users\jJcSystems\Documents\Arduino\libraries\AceTime-develop\src/AceTime.h:20:0,
from C:\Users\jJcSystems\Documents\Arduino\libraries\T-watch-2020-master\DudleyWatch\DudleyWatch.ino:26:
C:\Users\jJcSystems\Documents\Arduino\libraries\AceTime-develop\src/ace_time/common/compat.h:78:25: fatal error: AceCommon.h: No such file or directory
compilation terminated.

Multiple libraries were found for "WiFi.h"
Used: C:\Users\jJcSystems\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi
Not used: C:\Users\jJcSystems\Desktop\Bakup\12-24-2020\Desktop\arduino-1.8.3\libraries\WiFi
exit status 1
Error compiling for board TTGO T-Watch.`

Joseph

get_location.cpp doesn't compile

sketch\get_location.cpp: In function 'int get_city_from_lat_long(char*, char*)':
get_location.cpp:168:94: error: 'LOCATIONIQ_KEY' was not declared in this scope
   sprintf(url, "https://us1.locationiq.com/v1/reverse.php?key=%s&format=json&lat=%s&lon=%s", LOCATIONIQ_KEY, latitude, longitude);

...

'LOCATIONIQ_KEY' was not declared in this scope

'MY_LANGUAGE' was not declared in this scope

I got the above error message when I tried to upload the version which I downloaded on 12/23/2020. How can I resolve this?

Error messages log:

Arduino: 1.8.13 (Windows 10), Board: "TTGO T-Watch, Enabled, Default (2 x 6.5 MB app, 3.6 MB SPIFFS), 2000000, None"

In file included from C:\Users\Bill\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:29:0,

             from C:\Users\Bill\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:146,

             from sketch\DudleyWatch.ino.cpp:1:

C:\Users\Bill\Documents\Arduino\DudleyWatch\DudleyWatch.ino: In function 'void setup()':

DudleyWatch:240:44: error: 'MY_LANGUAGE' was not declared in this scope

 strcpy_P(general_config.language, PSTR(MY_LANGUAGE));

                                        ^

C:\Users\Bill\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/pgmspace.h:35:24: note: in definition of macro 'PSTR'

#define PSTR(s) (s)

                    ^

Multiple libraries were found for "WiFi.h"

Used: C:\Users\Bill\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi

Not used: C:\Program Files (x86)\Arduino\libraries\WiFi

Multiple libraries were found for "SD.h"

Used: C:\Users\Bill\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\SD

Not used: C:\Program Files (x86)\Arduino\libraries\SD

exit status 1

'MY_LANGUAGE' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

AceTime compiling error

Hello!

I have a little problem. I am trying to compile the software in Arduino IDE. I have all the neccesary up to date libraries, but the IDE is giving compiling errors. I am using the IDE version 1.8.13 with the latest ESP32 definitions on Win10. I could not solve this issue on my own. Any help or suggestion would be really appreciated. Thank you in advance. Lazlo

AceTime 1.3.0
custom_lib.a(zone_registry.cpp.o):(.rodata._ZN8ace_time6zonedb13kZoneRegistryE+0x42c): undefined reference to `ace_time::zonedb::kZoneWET'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling to TTGO T-Watch .

Or another error with the AceTime-develop library

custom_lib.a(my_tz.cpp.o):(.literal.startup._GLOBAL__sub_I_tz_opts+0x4): undefined reference to `ace_time::zonedb::kZoneRegistry'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling to TTGO T-Watch .

Unable to compile: OpenWeatherOneCall: no langCode.h

D:\Documents\Arduino\libraries\OpenWeatherOneCall\src/OpenWeatherOneCall.h:25:22: fatal error: langCode.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board TTGO T-Watch.

Not strictly an error in your code, but can you compile properly? version of OWOC is 3.0.4

AppWeather: no longer compiles

sketch\appWeather.cpp.o:(.literal._Z10appWeatherv+0x10): undefined reference to `get_loc_city'
sketch\appWeather.cpp.o:(.literal._Z10appWeatherv+0xd0): undefined reference to `get_city_from_lat_long(char*, char*)'
sketch\appWeather.cpp.o: In function `appWeather()':
sketch/appWeather.cpp:234: undefined reference to `get_city_from_lat_long(char*, char*)'

The Bitcoin app works only once, and subsequent attempts result in a DNS resolution error

when using ntptime , everything work fine , and i can launch it multiple time :

best strength = -36, best ssid = Sighq, tz = 506099284
best channel 11, best mac 1a:f6:cf:fd:97:70
铭德美家1-2301 mingde2301 1467951276
NETGEAR Qin32 Gutsmodernraven47 506099284
found SSID we know: Sighq
Connecting to WiFi network: Sighq
password ######## channel 11 mac ##########
Waiting for WIFI connection...
waiting 2 seconds for wifi connection
WiFi connected! IP address: 192.168.43.239
WiFi connected! IP address: 192.168.43.239
Saturday, November 21 2020 12:25:58
printLocalTime(): UTC = 12:25:58 2020/11/21

when using any others app using wifi : i can do it only once ( ex bitcoin app ) :

tzonestr = 506099284
best strength = -35, best ssid = Sighq, tz = 506099284
best channel 11, best mac 1a:f6:cf:fd:97:70
铭德美家1-2301 mingde2301 1467951276
NETGEAR Qin32 Gutsmodernraven47 506099284
found SSID we know: Sighq
Connecting to WiFi network: Sighq
password ######## channel 11 mac #########
Waiting for WIFI connection...
WiFi connected! IP address: 192.168.43.239
WiFi connected! IP address: 192.168.43.239
WiFi connected! IP address: 192.168.43.239

the next time another time :

Waiting for WIFI connection...
[E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for api.coindesk.com
WiFi connected! IP address: 192.168.43.239
WiFi connected! IP address: 192.168.43.239

The only way to be able to start any wifi app without having this dns error is to start the ntptime before , look like it reset something that the others app don't ..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.