mirror of https://github.com/sqfmi/Watchy.git
Compare commits
18 Commits
aaa3d91113
...
e5556cb700
Author | SHA1 | Date |
---|---|---|
sqfmi | e5556cb700 | |
SQFMI | 83aada6452 | |
Sukhpal Singh | 3a7eff4a8e | |
Sukhpal Singh | 9ac9aeded9 | |
SQFMI | ef0534e92b | |
SQFMI | 2cdfeaa0d1 | |
SQFMI | 9a64af8b3d | |
SQFMI | 5921655691 | |
SQFMI | 472eee733d | |
SQFMI | 6e41b9c982 | |
Olivier Mehani | dd3797f2d5 | |
SQFMI | c5344d9d42 | |
Olivier Mehani | cbb4820d85 | |
Olivier Mehani | c750754e8a | |
Olivier Mehani | 5f07f2ec63 | |
Olivier Mehani | b0e405e187 | |
Olivier Mehani | 2bd89ef250 | |
SQFMI | eb43be0634 |
|
@ -15,8 +15,9 @@ Visit [**https://watchy.sqfmi.com**](https://watchy.sqfmi.com) for documentation
|
|||
2. Install this library (search for **Watchy** in the library manager), and any other dependencies when prompted
|
||||
3. Check out the examples under ```Examples``` -> ```Watchy```
|
||||
4. Compile & Upload with these board settings:
|
||||
* Board: "ESP32 Dev Module"
|
||||
* Board: "Watchy"
|
||||
* Partition Scheme: "Huge App"
|
||||
* Board Revision: Choose your Watchy version
|
||||
* All Other Settings: leave to default
|
||||
|
||||
You may also have to install the [CP2104 USB to Serial drivers](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) if the port is not automatically detected.
|
||||
|
@ -24,3 +25,8 @@ You may also have to install the [CP2104 USB to Serial drivers](https://www.sila
|
|||
### Have Fun! :)
|
||||
|
||||
|
||||
### Got Questions?
|
||||
|
||||
Join our [Discord](https://discord.gg/ZXDegGV8E7)
|
||||
|
||||
|
||||
|
|
|
@ -10,17 +10,18 @@
|
|||
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
|
||||
//NTP Settings
|
||||
#define NTP_SERVER "pool.ntp.org"
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
|
||||
|
||||
watchySettings settings{
|
||||
CITY_ID,
|
||||
OPENWEATHERMAP_APIKEY,
|
||||
OPENWEATHERMAP_URL,
|
||||
TEMP_UNIT,
|
||||
TEMP_LANG,
|
||||
WEATHER_UPDATE_INTERVAL,
|
||||
NTP_SERVER,
|
||||
GMT_OFFSET_SEC
|
||||
.cityID = CITY_ID,
|
||||
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||
.weatherURL = OPENWEATHERMAP_URL,
|
||||
.weatherUnit = TEMP_UNIT,
|
||||
.weatherLang = TEMP_LANG,
|
||||
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||
.ntpServer = NTP_SERVER,
|
||||
.gmtOffset = GMT_OFFSET_SEC,
|
||||
.vibrateOClock = true,
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
|
||||
//NTP Settings
|
||||
#define NTP_SERVER "pool.ntp.org"
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
|
||||
|
||||
watchySettings settings{
|
||||
CITY_ID,
|
||||
OPENWEATHERMAP_APIKEY,
|
||||
OPENWEATHERMAP_URL,
|
||||
TEMP_UNIT,
|
||||
TEMP_LANG,
|
||||
WEATHER_UPDATE_INTERVAL,
|
||||
NTP_SERVER,
|
||||
GMT_OFFSET_SEC
|
||||
.cityID = CITY_ID,
|
||||
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||
.weatherURL = OPENWEATHERMAP_URL,
|
||||
.weatherUnit = TEMP_UNIT,
|
||||
.weatherLang = TEMP_LANG,
|
||||
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||
.ntpServer = NTP_SERVER,
|
||||
.gmtOffset = GMT_OFFSET_SEC,
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
|
||||
//NTP Settings
|
||||
#define NTP_SERVER "pool.ntp.org"
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
|
||||
|
||||
watchySettings settings{
|
||||
CITY_ID,
|
||||
OPENWEATHERMAP_APIKEY,
|
||||
OPENWEATHERMAP_URL,
|
||||
TEMP_UNIT,
|
||||
TEMP_LANG,
|
||||
WEATHER_UPDATE_INTERVAL,
|
||||
NTP_SERVER,
|
||||
GMT_OFFSET_SEC
|
||||
.cityID = CITY_ID,
|
||||
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||
.weatherURL = OPENWEATHERMAP_URL,
|
||||
.weatherUnit = TEMP_UNIT,
|
||||
.weatherLang = TEMP_LANG,
|
||||
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||
.ntpServer = NTP_SERVER,
|
||||
.gmtOffset = GMT_OFFSET_SEC,
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
|
||||
//NTP Settings
|
||||
#define NTP_SERVER "pool.ntp.org"
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
|
||||
|
||||
watchySettings settings{
|
||||
CITY_ID,
|
||||
OPENWEATHERMAP_APIKEY,
|
||||
OPENWEATHERMAP_URL,
|
||||
TEMP_UNIT,
|
||||
TEMP_LANG,
|
||||
WEATHER_UPDATE_INTERVAL,
|
||||
NTP_SERVER,
|
||||
GMT_OFFSET_SEC
|
||||
.cityID = CITY_ID,
|
||||
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||
.weatherURL = OPENWEATHERMAP_URL,
|
||||
.weatherUnit = TEMP_UNIT,
|
||||
.weatherLang = TEMP_LANG,
|
||||
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||
.ntpServer = NTP_SERVER,
|
||||
.gmtOffset = GMT_OFFSET_SEC,
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
|
||||
//NTP Settings
|
||||
#define NTP_SERVER "pool.ntp.org"
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
|
||||
|
||||
watchySettings settings{
|
||||
CITY_ID,
|
||||
OPENWEATHERMAP_APIKEY,
|
||||
OPENWEATHERMAP_URL,
|
||||
TEMP_UNIT,
|
||||
TEMP_LANG,
|
||||
WEATHER_UPDATE_INTERVAL,
|
||||
NTP_SERVER,
|
||||
GMT_OFFSET_SEC
|
||||
.cityID = CITY_ID,
|
||||
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||
.weatherURL = OPENWEATHERMAP_URL,
|
||||
.weatherUnit = TEMP_UNIT,
|
||||
.weatherLang = TEMP_LANG,
|
||||
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||
.ntpServer = NTP_SERVER,
|
||||
.gmtOffset = GMT_OFFSET_SEC,
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
|
||||
//NTP Settings
|
||||
#define NTP_SERVER "pool.ntp.org"
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
|
||||
|
||||
watchySettings settings{
|
||||
CITY_ID,
|
||||
OPENWEATHERMAP_APIKEY,
|
||||
OPENWEATHERMAP_URL,
|
||||
TEMP_UNIT,
|
||||
TEMP_LANG,
|
||||
WEATHER_UPDATE_INTERVAL,
|
||||
NTP_SERVER,
|
||||
GMT_OFFSET_SEC
|
||||
.cityID = CITY_ID,
|
||||
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||
.weatherURL = OPENWEATHERMAP_URL,
|
||||
.weatherUnit = TEMP_UNIT,
|
||||
.weatherLang = TEMP_LANG,
|
||||
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||
.ntpServer = NTP_SERVER,
|
||||
.gmtOffset = GMT_OFFSET_SEC,
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -10,17 +10,17 @@
|
|||
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
|
||||
//NTP Settings
|
||||
#define NTP_SERVER "pool.ntp.org"
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT
|
||||
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5 EST, -4 EDT, will be overwritten by weather data
|
||||
|
||||
watchySettings settings{
|
||||
CITY_ID,
|
||||
OPENWEATHERMAP_APIKEY,
|
||||
OPENWEATHERMAP_URL,
|
||||
TEMP_UNIT,
|
||||
TEMP_LANG,
|
||||
WEATHER_UPDATE_INTERVAL,
|
||||
NTP_SERVER,
|
||||
GMT_OFFSET_SEC
|
||||
.cityID = CITY_ID,
|
||||
.weatherAPIKey = OPENWEATHERMAP_APIKEY,
|
||||
.weatherURL = OPENWEATHERMAP_URL,
|
||||
.weatherUnit = TEMP_UNIT,
|
||||
.weatherLang = TEMP_LANG,
|
||||
.weatherUpdateInterval = WEATHER_UPDATE_INTERVAL,
|
||||
.ntpServer = NTP_SERVER,
|
||||
.gmtOffset = GMT_OFFSET_SEC,
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Watchy",
|
||||
"version": "1.4.3",
|
||||
"version": "1.4.5",
|
||||
"description": "Watchy - An Open Source E-Paper Watch by SQFMI",
|
||||
"authors": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name=Watchy
|
||||
version=1.4.3
|
||||
version=1.4.5
|
||||
author=SQFMI
|
||||
maintainer=SQFMI
|
||||
sentence=Watchy - An Open Source E-Paper Watch by SQFMI
|
||||
|
|
|
@ -12,6 +12,8 @@ RTC_DATA_ATTR bool BLE_CONFIGURED;
|
|||
RTC_DATA_ATTR weatherData currentWeather;
|
||||
RTC_DATA_ATTR int weatherIntervalCounter = -1;
|
||||
RTC_DATA_ATTR bool displayFullInit = true;
|
||||
RTC_DATA_ATTR long gmtOffset = 0;
|
||||
RTC_DATA_ATTR bool alreadyInMenu = true;
|
||||
|
||||
void Watchy::init(String datetime) {
|
||||
esp_sleep_wakeup_cause_t wakeup_reason;
|
||||
|
@ -27,9 +29,26 @@ void Watchy::init(String datetime) {
|
|||
|
||||
switch (wakeup_reason) {
|
||||
case ESP_SLEEP_WAKEUP_EXT0: // RTC Alarm
|
||||
if (guiState == WATCHFACE_STATE) {
|
||||
RTC.read(currentTime);
|
||||
RTC.read(currentTime);
|
||||
switch (guiState) {
|
||||
case WATCHFACE_STATE:
|
||||
showWatchFace(true); // partial updates on tick
|
||||
if (settings.vibrateOClock) {
|
||||
if (currentTime.Minute == 0) {
|
||||
// The RTC wakes us up once per minute
|
||||
vibMotor(75, 4);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MAIN_MENU_STATE:
|
||||
// Return to watchface if in menu for more than one tick
|
||||
if (alreadyInMenu) {
|
||||
guiState = WATCHFACE_STATE;
|
||||
showWatchFace(false);
|
||||
} else {
|
||||
alreadyInMenu = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ESP_SLEEP_WAKEUP_EXT1: // button Press
|
||||
|
@ -38,8 +57,10 @@ void Watchy::init(String datetime) {
|
|||
default: // reset
|
||||
RTC.config(datetime);
|
||||
_bmaConfig();
|
||||
gmtOffset = settings.gmtOffset;
|
||||
RTC.read(currentTime);
|
||||
showWatchFace(false); // full update on reset
|
||||
vibMotor(75, 4);
|
||||
break;
|
||||
}
|
||||
deepSleep();
|
||||
|
@ -257,6 +278,7 @@ void Watchy::showMenu(byte menuIndex, bool partialRefresh) {
|
|||
display.display(partialRefresh);
|
||||
|
||||
guiState = MAIN_MENU_STATE;
|
||||
alreadyInMenu = false;
|
||||
}
|
||||
|
||||
void Watchy::showFastMenu(byte menuIndex) {
|
||||
|
@ -620,7 +642,8 @@ weatherData Watchy::getWeatherData(String cityID, String units, String lang,
|
|||
JSONVar::stringify(responseObject["weather"][0]["main"]);
|
||||
currentWeather.external = true;
|
||||
// sync NTP during weather API call and use timezone of city
|
||||
syncNTP(long(responseObject["timezone"]));
|
||||
gmtOffset = int(responseObject["timezone"]);
|
||||
syncNTP(gmtOffset);
|
||||
} else {
|
||||
// http error
|
||||
}
|
||||
|
@ -786,6 +809,8 @@ void Watchy::setupWifi() {
|
|||
} else {
|
||||
display.println("Connected to");
|
||||
display.println(WiFi.SSID());
|
||||
display.println("Local IP:");
|
||||
display.println(WiFi.localIP());
|
||||
}
|
||||
display.display(false); // full refresh
|
||||
// turn off radios
|
||||
|
@ -807,6 +832,8 @@ void Watchy::_configModeCallback(WiFiManager *myWiFiManager) {
|
|||
display.println(WIFI_AP_SSID);
|
||||
display.print("IP: ");
|
||||
display.println(WiFi.softAPIP());
|
||||
display.println("MAC address:");
|
||||
display.println(WiFi.softAPmacAddress().c_str());
|
||||
display.display(false); // full refresh
|
||||
}
|
||||
|
||||
|
@ -942,6 +969,8 @@ void Watchy::showSyncNTP() {
|
|||
display.setTextColor(GxEPD_WHITE);
|
||||
display.setCursor(0, 30);
|
||||
display.println("Syncing NTP... ");
|
||||
display.print("GMT offset: ");
|
||||
display.println(gmtOffset);
|
||||
display.display(false); // full refresh
|
||||
if (connectWiFi()) {
|
||||
if (syncNTP()) {
|
||||
|
@ -979,7 +1008,7 @@ void Watchy::showSyncNTP() {
|
|||
|
||||
bool Watchy::syncNTP() { // NTP sync - call after connecting to WiFi and
|
||||
// remember to turn it back off
|
||||
return syncNTP(settings.gmtOffset,
|
||||
return syncNTP(gmtOffset,
|
||||
settings.ntpServer.c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ typedef struct watchySettings {
|
|||
String ntpServer;
|
||||
int gmtOffset;
|
||||
int dstOffset;
|
||||
//
|
||||
bool vibrateOClock;
|
||||
} watchySettings;
|
||||
|
||||
class Watchy {
|
||||
|
|
Loading…
Reference in New Issue