Skip to content

Commit 6ae25ad

Browse files
authored
Merge pull request #17 from jaswch/main
V0.3.2
2 parents 17f8424 + db0176d commit 6ae25ad

File tree

5 files changed

+92
-12
lines changed

5 files changed

+92
-12
lines changed

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ All of the required code is in the ```src``` directory, just rename the file ```
5555

5656
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.
5757

58+
## Configurator Tool
59+
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
60+
61+
```python otwConfigurator.py```
62+
63+
or
64+
65+
```python3 otwConfigurator.py```
66+
67+
in your terminal.
68+
5869
# Features
5970
1. Home screen with custom background
6071
2. Activity view shows steps walked, calories burned and weather (It is just a dummy and not functionally implemented yet)
@@ -76,11 +87,12 @@ Note:- also refer to the README.md at [TQT pro](https://github.com/Xinyuan-LilyG
7687
4. While playing pong scroll button moves the paddle up and the menu button moves the paddle down
7788

7889
# Release Notes
79-
1. **V0.3.1** - otwUI bug fix, updated configuration for TQT pro N8 in ```platformio.ini``` file and better documentation.
80-
2. **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.
81-
3. **V0.2.1** - Added refinements to the OS navigation, added a manual in the ```README.md``` and changed the tone of the speaker.
82-
4. **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.
83-
5. **V0.1** - The initial release it just had a home screen and an about screen.
90+
1. **V0.3.2** - New OpenTimeWatch Configurator tool.
91+
2. **V0.3.1** - otwUI bug fix, updated configuration for TQT pro N8 in ```platformio.ini``` file and better documentation.
92+
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.
93+
4. **V0.2.1** - Added refinements to the OS navigation, added a manual in the ```README.md``` and changed the tone of the speaker.
94+
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.
95+
6. **V0.1** - The initial release it just had a home screen and an about screen.
8496

8597
# What to expect in V0.4?
8698
1. Support for our new watch hardware:- OpenTimeWatch 1
@@ -95,9 +107,6 @@ Note:- also refer to the README.md at [TQT pro](https://github.com/Xinyuan-LilyG
95107
10. Flappy bird clone
96108
11. UART console support
97109

98-
# When could you expect SDKs for apps, custom home screens and widgets
99-
By V0.7 or V0.8 we could start making SDKs for developers to make apps and games, we will also extend support for other microcontrollers and screen resolutions as the OS currently runs at 128 * 128 px.
100-
101110
# Can I contribute ?
102111
Yes, you can contribute to the project by the following ways :
103112
1. Help us add features to the project by making a PR.

otwConfigurator.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# OpenTimeWatch Configurator tool
2+
3+
print("Welcome to OpenTimeWatchOS configuration script")
4+
file_path = "/home/jaswanth/Developer/Arduino/OpenTimeWatch-OS/src/osVariables/osVariables.cpp"
5+
6+
def configureWifiNetwork(userSSID):
7+
try:
8+
with open(file_path, 'r') as file:
9+
lines = file.readlines()
10+
11+
with open(file_path, 'w') as file:
12+
for line in lines:
13+
if 'const char* ssid = ' in line:
14+
line = f'const char* ssid = "{userSSID}";\n'
15+
file.write(line)
16+
except Exception as e:
17+
print(f"An error occurred: {e}")
18+
19+
def configureWifiPassword(userPassword):
20+
try:
21+
with open(file_path, 'r') as file:
22+
lines = file.readlines()
23+
24+
with open(file_path, 'w') as file:
25+
for line in lines:
26+
if 'const char* password = ' in line:
27+
line = f'const char* password = "{userPassword}";\n'
28+
file.write(line)
29+
except Exception as e:
30+
print(f"An error occurred: {e}")
31+
32+
def configureGMTOffset(userGMT):
33+
try:
34+
with open(file_path, 'r') as file:
35+
lines = file.readlines()
36+
37+
with open(file_path, 'w') as file:
38+
for line in lines:
39+
if 'const long gmtOffset_sec = ' in line:
40+
line = f'const long gmtOffset_sec = {userGMT};\n'
41+
file.write(line)
42+
except Exception as e:
43+
print(f"An error occurred: {e}")
44+
45+
def configureDayLightOffset(userDayLight):
46+
try:
47+
with open(file_path, 'r') as file:
48+
lines = file.readlines()
49+
50+
with open(file_path, 'w') as file:
51+
for line in lines:
52+
if 'const int daylightOffset_sec = ' in line:
53+
line = f'const int daylightOffset_sec = {userDayLight};\n'
54+
file.write(line)
55+
except Exception as e:
56+
print(f"An error occurred: {e}")
57+
58+
if __name__ == "__main__":
59+
60+
userSSID = input("Enter your WiFi network name: ")
61+
configureWifiNetwork(userSSID)
62+
userPassword = input("Enter your WiFi network password: ")
63+
configureWifiPassword(userPassword)
64+
userGMT = input("Enter your area's GMT offset(in seconds): ")
65+
configureGMTOffset(userGMT)
66+
userDayLight = input("Enter your area's day light offset(in seconds): ")
67+
configureDayLightOffset(userDayLight)
68+
69+
print("Configuration complete. Please compile and upload the firmware.")

src/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* OpenTime Watch OS
3-
* V0.3.1
3+
* V0.3.2
44
* An open source OS for watches.
55
*
66
* created on 15 November 2024
@@ -19,6 +19,8 @@
1919
* Stable release of V0.3
2020
* 15 February 2025 - V 0.3.1 -
2121
* Minor update, otwUI bug fix and better documentation.
22+
* 19 April 2025 - V 0.3.1 -
23+
* A new configurator tool.
2224
*/
2325

2426
// include all the necessary libraries for the OS

src/osVariables/osVariables.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ const char* password = "yourPassword";
4343
// URL of the ntp server
4444
const char* ntpServer = "pool.ntp.org";
4545
// GMT offset (in seconds)
46-
const long gmtOffset_sec = 0;
46+
const long gmtOffset_sec = 0;
4747
// Day light offset (in seconds)
48-
const int daylightOffset_sec = 0;
48+
const int daylightOffset_sec = 0;
4949
// A variable to store the first 3 letters of the current weekday name
5050
char dayName[4];
5151
// A variable to store the first 3 letters of the current month name

src/settingsMenu/settingsMenu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void infoScreen(){
4848
tft.fillScreen(TFT_BLACK);
4949
tft.setTextColor(TFT_WHITE);
5050
tft.drawString("OpenTime Watch OS",0,0,2);
51-
tft.drawString("Version : V 0.3.1",0,20,2);
51+
tft.drawString("Version : V 0.3.2",0,20,2);
5252
tft.drawString("CPU : ESP32-S3",0,40,2);
5353
tft.drawString("PSRAM : 2MB",0,60,2);
5454
tft.drawString("Flash : 4MB",0,80,2);

0 commit comments

Comments
 (0)