diff --git a/README.md b/README.md index a0b15a2..475338f 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,19 @@ A smartwatch based on ESP32 from LlyGo. Currently under development. # Install Clone this repository and open it with platformIO. Build and upload. On a terminal in vscode you can do it with + ```bash pio run -t upload ``` -# how to make a screenshot +or simple press "build and upload" in platformIO. +# how to use + +On startup you see the main screen (time tile). It show the time and the current weather (if correct configure). Now you can swipe with you fingers up, down, left and right between the four main screens. The four screens are organized in time, apps, note and setup tile. +For the weather app you need an openweather.com api-id. http://https://openweathermap.org/appid is a good starting point. + +# how to make a screenshot The firmware has an integrated webserver. Over this a screenshot can be triggered. The image has the format RGB565 and can be read with gimp. From bash it look like this ```bash wget x.x.x.x/shot ; wget x.x.x.x/screen.565 diff --git a/src/app/weather/weather.cpp b/src/app/weather/weather.cpp index a1c3163..e5c0ed5 100644 --- a/src/app/weather/weather.cpp +++ b/src/app/weather/weather.cpp @@ -22,6 +22,7 @@ #include "config.h" #include #include +#include "esp_task_wdt.h" #include "weather.h" #include "weather_fetch.h" @@ -115,7 +116,7 @@ void weather_app_setup( void ) { xTaskCreate( weather_widget_sync_Task, /* Function to implement the task */ - "weather sync Task", /* Name of the task */ + "weather widget sync Task", /* Name of the task */ 5000, /* Stack size in words */ NULL, /* Task input parameter */ 1, /* Priority of the task */ @@ -155,6 +156,7 @@ weather_config_t *weather_get_config( void ) { void weather_widget_sync_Task( void * pvParameters ) { while( true ) { vTaskDelay( 500 ); + esp_task_wdt_delete( _weather_widget_sync_Task ); if ( xEventGroupGetBits( weather_widget_event_handle ) & WEATHER_WIDGET_SYNC_REQUEST ) { if ( weather_config.autosync ) { uint32_t retval = weather_fetch_today( &weather_config, &weather_today ); @@ -193,7 +195,7 @@ void weather_save_config( void ) { fs::File file = SPIFFS.open( WEATHER_CONFIG_FILE, FILE_WRITE ); if ( !file ) { - Serial.printf( __FILE__ "Can't save file: %s\r\n", WEATHER_CONFIG_FILE ); + log_e( "Can't save file: %s\r\n", WEATHER_CONFIG_FILE ); } else { file.write( (uint8_t *)&weather_config, sizeof( weather_config ) ); @@ -209,7 +211,7 @@ void weather_load_config( void ) { fs::File file = SPIFFS.open( WEATHER_CONFIG_FILE, FILE_READ ); if (!file) { - Serial.printf( __FILE__ "Can't open file: %s\r\n", WEATHER_CONFIG_FILE ); + log_e( "Can't open file: %s\r\n", WEATHER_CONFIG_FILE ); } else { size_t filesize = file.size(); diff --git a/src/app/weather/weather_forecast.cpp b/src/app/weather/weather_forecast.cpp index e8ab7da..2f58511 100644 --- a/src/app/weather/weather_forecast.cpp +++ b/src/app/weather/weather_forecast.cpp @@ -21,6 +21,7 @@ */ #include #include +#include "esp_task_wdt.h" #include "weather.h" #include "weather_fetch.h" @@ -142,7 +143,7 @@ void weather_forecast_tile_setup( uint32_t tile_num ) { xTaskCreate( weather_forecast_sync_Task, /* Function to implement the task */ - "weather sync Task", /* Name of the task */ + "weather forecast sync Task", /* Name of the task */ 5000, /* Stack size in words */ NULL, /* Task input parameter */ 1, /* Priority of the task */ @@ -191,6 +192,7 @@ void weather_forecast_sync_Task( void * pvParameters ) { while( true ) { vTaskDelay( 500 ); + esp_task_wdt_delete( _weather_forecast_sync_Task ); if ( xEventGroupGetBits( weather_forecast_event_handle ) & WEATHER_FORECAST_SYNC_REQUEST ) { if ( weather_config->autosync ) { retval = weather_fetch_forecast( weather_get_config() , &weather_forecast[ 0 ] ); diff --git a/src/config.h b/src/config.h index 98a5d60..b7f4d51 100644 --- a/src/config.h +++ b/src/config.h @@ -31,6 +31,6 @@ /* * firmeware version string */ - #define __FIRMWARE__ "2020072907" + #define __FIRMWARE__ "2020073003" #endif // _CONFIG_H diff --git a/src/gui/mainbar/app_tile/app_tile.cpp b/src/gui/mainbar/app_tile/app_tile.cpp index 953f082..36c5c09 100644 --- a/src/gui/mainbar/app_tile/app_tile.cpp +++ b/src/gui/mainbar/app_tile/app_tile.cpp @@ -27,6 +27,7 @@ lv_app_entry_t app_entry[ MAX_APPS_ICON ]; static lv_obj_t *app_cont = NULL; +static lv_obj_t *app_label = NULL; static lv_style_t *style; static lv_style_t appstyle; @@ -39,8 +40,15 @@ void app_tile_setup( void ) { style = mainbar_get_style(); lv_style_copy( &appstyle, style); + lv_style_set_text_opa( &appstyle, LV_OBJ_PART_MAIN, LV_OPA_30); lv_style_set_text_font( &appstyle, LV_STATE_DEFAULT, &Ubuntu_72px); + app_label = lv_label_create( app_cont, NULL); + lv_label_set_text( app_label, "apps"); + lv_obj_reset_style_list( app_label, LV_OBJ_PART_MAIN ); + lv_obj_add_style( app_label, LV_OBJ_PART_MAIN, &appstyle ); + lv_obj_align( app_label, NULL, LV_ALIGN_CENTER, 0, 0); + for ( int app = 0 ; app < MAX_APPS_ICON ; app++ ) { // set x, y and mark it as inactive app_entry[ app ].x = APP_FIRST_X_POS + ( ( app % MAX_APPS_ICON_HORZ ) * ( APP_ICON_X_SIZE + APP_ICON_X_CLEARENCE ) ); diff --git a/src/gui/mainbar/note_tile/note_tile.cpp b/src/gui/mainbar/note_tile/note_tile.cpp index 1fe95ce..b3b5511 100644 --- a/src/gui/mainbar/note_tile/note_tile.cpp +++ b/src/gui/mainbar/note_tile/note_tile.cpp @@ -39,6 +39,7 @@ void note_tile_setup( void ) { style = mainbar_get_style(); lv_style_copy( ¬estyle, style); + lv_style_set_text_opa( ¬estyle, LV_OBJ_PART_MAIN, LV_OPA_30); lv_style_set_text_font( ¬estyle, LV_STATE_DEFAULT, &Ubuntu_72px); notelabel = lv_label_create( note_cont, NULL); diff --git a/src/gui/mainbar/setup_tile/update/update_check_version.cpp b/src/gui/mainbar/setup_tile/update/update_check_version.cpp index 4a506a6..e9257de 100644 --- a/src/gui/mainbar/setup_tile/update/update_check_version.cpp +++ b/src/gui/mainbar/setup_tile/update/update_check_version.cpp @@ -42,7 +42,7 @@ uint64_t update_check_new_version( void ) { "Connection: close\r\n" "Pragma: no-cache\r\n" "Cache-Control: no-cache\r\n" - "User-Agent: ESP32\r\n" + "User-Agent: ESP32-" __FIRMWARE__ "\r\n" "Accept: text/html,application/json\r\n\r\n", FIRMWARE_HOST ); uint64_t startMillis = millis(); diff --git a/src/my-ttgo-watch.ino b/src/my-ttgo-watch.ino index 12cce77..3588320 100644 --- a/src/my-ttgo-watch.ino +++ b/src/my-ttgo-watch.ino @@ -41,7 +41,7 @@ void setup() { motor_setup(); Serial.begin(115200); - Serial.printf("starting t-watch V1\r\n"); + Serial.printf("starting t-watch V1, version: " __FIRMWARE__ "\r\n"); ttgo->begin(); ttgo->lvgl_begin(); diff --git a/ttgo-t-watch2020_v1.ino.bin b/ttgo-t-watch2020_v1.ino.bin index 45d6644..9b68aa6 100644 Binary files a/ttgo-t-watch2020_v1.ino.bin and b/ttgo-t-watch2020_v1.ino.bin differ diff --git a/ttgo-t-watch2020_v1.version.json b/ttgo-t-watch2020_v1.version.json index 914248b..da866dd 100644 --- a/ttgo-t-watch2020_v1.version.json +++ b/ttgo-t-watch2020_v1.version.json @@ -1 +1 @@ -{"version":"2020072907","url":"http://www.neo-guerillaz.de/ttgo-t-watch2020_v1.ino.bin"} +{"version":"2020073003","url":"http://www.neo-guerillaz.de/ttgo-t-watch2020_v1.ino.bin"}