From 9841e0f3d03fc9ce629f59299b8f62e4c0e16521 Mon Sep 17 00:00:00 2001 From: Jaswanth Ch Date: Thu, 24 Apr 2025 11:37:30 +0000 Subject: [PATCH] Revert "V0.3.2" --- README.md | 84 ++++++-------------------------- otwConfigurator.py | 118 +++++++++------------------------------------ src/main.cpp | 2 - 3 files changed, 38 insertions(+), 166 deletions(-) diff --git a/README.md b/README.md index 4319886..0a3551b 100644 --- a/README.md +++ b/README.md @@ -31,69 +31,19 @@ which is closer to your location in line 44 ```const char* ntpServer = "pool.ntp Below are a few common NTP server URLs:-
-Area | HostName --------:|:------------------------- -Asia | asia.pool.ntp.org -Europe | europe.pool.ntp.org -North America | north-america.pool.ntp.org -Oceania | oceania.pool.ntp.org -South America | south-america.pool.ntp.org +![Alt text](images/ntp.png) ## For Platformio users ### TQT pro N4R2 (Flash: 4MB, PSRAM: 2MB) Just upload the code without any changes to the ```platformio.ini``` file. It should look like this:
-``` -; PlatformIO Project Configuration File - - -[platformio] -boards_dir = ./board -;default_envs = T-QT-Pro-N8 -default_envs = T-QT-Pro-N4R2 -description = Open source watch OS for ESP32 based watches - -;[env:T-QT-Pro-N8] -[env:T-QT-Pro-N4R2] -platform = espressif32@6.6.0 -board = esp32-s3-t-qt-pro -framework = arduino -build_flags = - -DBOARD_HAS_PSRAM -lib_deps = - lennarthennigs/Button2@^2.3.3 - adafruit/Adafruit GFX Library@^1.11.11 - adafruit/Adafruit MPU6050 @ ^2.0.3 - adafruit/Adafruit Unified Sensor @ ^1.1.4 -``` +![Alt text](images/TQT-psram-conf.png) Note:- Platformio is currently assuming we have total 1MB of flash and not detecting the PSRAM. ### TQT pro N8 (Flash: 8MB, PSRAM: none) You will need to do some changes in the ```platformio.ini``` file before uploading the code. It should look like this:
-``` -; PlatformIO Project Configuration File - - -[platformio] -boards_dir = ./board -default_envs = T-QT-Pro-N8 -;default_envs = T-QT-Pro-N4R2 -description = Open source watch OS for ESP32 based watches - -[env:T-QT-Pro-N8] -;[env:T-QT-Pro-N4R2] -platform = espressif32@6.6.0 -board = esp32-s3-t-qt-pro -framework = arduino -build_flags = -; -DBOARD_HAS_PSRAM -lib_deps = - lennarthennigs/Button2@^2.3.3 - adafruit/Adafruit GFX Library@^1.11.11 - adafruit/Adafruit MPU6050 @ ^2.0.3 - adafruit/Adafruit Unified Sensor @ ^1.1.4 -``` +![Alt text](images/TQT-non-psram-conf.png) ## For Arduino IDE users All of the required code is in the ```src``` directory, just rename the file ```main.cpp``` to ```main.ino``` and install the below libraries and upload the code @@ -106,7 +56,7 @@ All of the required code is in the ```src``` directory, just rename the file ``` Note:- also refer to the README.md at [TQT pro](https://github.com/Xinyuan-LilyGO/T-QT/tree/main?tab=readme-ov-file#quick-start) for setting up the board in arduino ide. ## Configurator Tool -The OpenTimeWatch Configurator tool is a python script which allows users to configure the Board, WiFi network and time settings before compiling and uploading the firmware to the watch. This tool does not compile and upload the code. To run the tool type +The OpenTimeWatch Configurator tool is a python script which allows users to configure the WiFi network and time settings before compiling and uploading the firmware to the watch. This tool does not configure your board type nor does it compile and upload the code. To run the tool type ```python otwConfigurator.py``` @@ -116,8 +66,6 @@ or in your terminal. -Note:- This tool only configures the board for the usage in PlatformIO IDE - # Features 1. Home screen with custom background 2. Activity view shows steps walked, calories burned and weather (It is just a dummy and not functionally implemented yet) @@ -139,13 +87,12 @@ Note:- This tool only configures the board for the usage in PlatformIO IDE 4. While playing pong scroll button moves the paddle up and the menu button moves the paddle down # Release Notes -1. **V0.3.3** - OpenTimeWatch Configurator tool can now configure board settings. -2. **V0.3.2** - New OpenTimeWatch Configurator tool. -3. **V0.3.1** - otwUI bug fix, updated configuration for TQT pro N8 in ```platformio.ini``` file and better documentation. -4. **V0.3** - New UI (created using [lopaka.app](https://lopaka.app/sandbox)), multiple watch faces, Wifi support, time synchronisation, back option in menus, accelerometer support and apps and sub menus separated from the ```main.cpp``` file. -5. **V0.2.1** - Added refinements to the OS navigation, added a manual in the ```README.md``` and changed the tone of the speaker. -6. **V0.2** - A significant update compared to V0.1, as it introduced menus, pong, interaction with peripherals (torch and speaker), OS being open sourced, matrix effect, settings menu. -7. **V0.1** - The initial release it just had a home screen and an about screen. +1. **V0.3.2** - New OpenTimeWatch Configurator tool. +2. **V0.3.1** - otwUI bug fix, updated configuration for TQT pro N8 in ```platformio.ini``` file and better documentation. +3. **V0.3** - New UI (created using [lopaka.app](https://lopaka.app/sandbox)), multiple watch faces, Wifi support, time synchronisation, back option in menus, accelerometer support and apps and sub menus separated from the ```main.cpp``` file. +4. **V0.2.1** - Added refinements to the OS navigation, added a manual in the ```README.md``` and changed the tone of the speaker. +5. **V0.2** - A significant update compared to V0.1, as it introduced menus, pong, interaction with peripherals (torch and speaker), OS being open sourced, matrix effect, settings menu. +6. **V0.1** - The initial release it just had a home screen and an about screen. # What to expect in V0.4? 1. Support for our new watch hardware:- OpenTimeWatch 1 @@ -153,11 +100,12 @@ Note:- This tool only configures the board for the usage in PlatformIO IDE 3. Accent colours 4. IR transmitter support 5. Support for 3 navigation buttons -6. Screen brightness adjustment -7. Screen on-time adjustment -8. Watch endurance -9. Flappy bird clone -10. UART console support +6. Pulse sensor support +7. Screen brightness adjustment +8. Screen on-time adjustment +9. Watch endurance +10. Flappy bird clone +11. UART console support # Can I contribute ? Yes, you can contribute to the project by the following ways : diff --git a/otwConfigurator.py b/otwConfigurator.py index 4597dfb..2c46519 100644 --- a/otwConfigurator.py +++ b/otwConfigurator.py @@ -1,62 +1,14 @@ -# OpenTimeWatchOS Configurator Tool - -print("Welcome to OpenTimeWatchOS configuration script") -OSVarPath = "src/osVariables/osVariables.cpp" -OSConfPath = "platformio.ini" - -def configureBoard(userBoard): - if userBoard == 1: - try: - with open(OSConfPath, 'r') as file: - lines = file.readlines() - for i, line in enumerate(lines): - if i == 6: # Uncomment line 7 - lines[i] = line.lstrip(";") - elif i == 5: # Comment line 6 - if not line.startswith(";"): - lines[i] = ";" + line - elif i == 10: # Uncomment line 11 - lines[i] = line.lstrip(";") - elif i == 9: # Comment line 10 - if not line.startswith(";"): - lines[i] = ";" + line - elif i == 15: # Uncomment line 16 - lines[i] = line.lstrip(";") - with open(OSConfPath, 'w') as file: - file.writelines(lines) - except Exception as e: - print(f"An error occurred: {e}") - - else: - try: - with open(OSConfPath, 'r') as file: - lines = file.readlines() - for i, line in enumerate(lines): - if i == 5: # Uncomment line 6 - lines[i] = line.lstrip(";") - elif i == 6: # Comment line 7 - if not line.startswith(";"): - lines[i] = ";" + line - elif i == 9: # Uncomment line 10 - lines[i] = line.lstrip(";") - elif i == 10: # Comment line 11 - if not line.startswith(";"): - lines[i] = ";" + line - elif i == 15: # Comment line 16 - if not line.startswith(";"): - lines[i] = ";" + line - with open(OSConfPath, 'w') as file: - file.writelines(lines) - except Exception as e: - print(f"An error occurred: {e}") +# OpenTimeWatch Configurator tool +print("Welcome to OpenTimeWatchOS configurator tool") +file_path = "/home/jaswanth/Developer/Arduino/OpenTimeWatch-OS/src/osVariables/osVariables.cpp" def configureWifiNetwork(userSSID): try: - with open(OSVarPath, 'r') as file: + with open(file_path, 'r') as file: lines = file.readlines() - with open(OSVarPath, 'w') as file: + with open(file_path, 'w') as file: for line in lines: if 'const char* ssid = ' in line: line = f'const char* ssid = "{userSSID}";\n' @@ -66,10 +18,10 @@ def configureWifiNetwork(userSSID): def configureWifiPassword(userPassword): try: - with open(OSVarPath, 'r') as file: + with open(file_path, 'r') as file: lines = file.readlines() - with open(OSVarPath, 'w') as file: + with open(file_path, 'w') as file: for line in lines: if 'const char* password = ' in line: line = f'const char* password = "{userPassword}";\n' @@ -79,10 +31,10 @@ def configureWifiPassword(userPassword): def configureGMTOffset(userGMT): try: - with open(OSVarPath, 'r') as file: + with open(file_path, 'r') as file: lines = file.readlines() - with open(OSVarPath, 'w') as file: + with open(file_path, 'w') as file: for line in lines: if 'const long gmtOffset_sec = ' in line: line = f'const long gmtOffset_sec = {userGMT};\n' @@ -92,10 +44,10 @@ def configureGMTOffset(userGMT): def configureDayLightOffset(userDayLight): try: - with open(OSVarPath, 'r') as file: + with open(file_path, 'r') as file: lines = file.readlines() - with open(OSVarPath, 'w') as file: + with open(file_path, 'w') as file: for line in lines: if 'const int daylightOffset_sec = ' in line: line = f'const int daylightOffset_sec = {userDayLight};\n' @@ -104,40 +56,14 @@ def configureDayLightOffset(userDayLight): print(f"An error occurred: {e}") if __name__ == "__main__": - print("1. Configure") - print("2. About") - print("3. Exit") - userOption = input("Select an option: ") - - if userOption == "1": - print("Watch Hardware: ") - print("1. T-QT-Pro-N4R2") - print("2. T-QT-Pro-N8") - userBoard = int(input("Select your board: ")) - configureBoard(userBoard) - if userBoard == 1: - print("You have selected T-QT-Pro-N8") - else: - print("You have selected T-QT-Pro-N4R2") - userSSID = input("Enter your WiFi network name: ") - configureWifiNetwork(userSSID) - userPassword = input("Enter your WiFi network password: ") - configureWifiPassword(userPassword) - userGMT = input("Enter your area's GMT offset(in seconds): ") - configureGMTOffset(userGMT) - userDayLight = input("Enter your area's day light offset(in seconds): ") - configureDayLightOffset(userDayLight) - print("Configuration complete. Please upload the code.") - elif userOption == "2": - print("OpenTimeWatchOS Configuration Script V1.1") - print("This is a configuration script for OpenTimeWatchOS for your watch hardware") - print("It allows you to configure the Board, WiFi SSID, password, GMT offset, and daylight offset") - print("For more information, visit the OpenTimeWatchOS GitHub repository.") - print("https://github.com/OpenTimeWatch-Project/OpenTimeWatch-OS") - elif userOption == "3": - print("Exiting the script. Goodbye!") - exit(0) - else: - print("Invalid option. Please try again.") - exit(1) - + + userSSID = input("Enter your WiFi network name: ") + configureWifiNetwork(userSSID) + userPassword = input("Enter your WiFi network password: ") + configureWifiPassword(userPassword) + userGMT = input("Enter your area's GMT offset(in seconds): ") + configureGMTOffset(userGMT) + userDayLight = input("Enter your area's day light offset(in seconds): ") + configureDayLightOffset(userDayLight) + +print("Configuration complete. Please compile and upload the firmware.") diff --git a/src/main.cpp b/src/main.cpp index 9d1141b..40cec45 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,8 +21,6 @@ * Minor update, otwUI bug fix and better documentation. * 19 April 2025 - V 0.3.1 - * A new configurator tool. - * 24 April 2025 - V 0.3.2 - - * OpenTimeWatch Configurator tool update. */ // include all the necessary libraries for the OS