some small updates

This commit is contained in:
sharandac
2020-07-30 08:30:59 +02:00
parent 8e088ba4e6
commit 77a014bb74
10 changed files with 29 additions and 9 deletions

View File

@@ -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

View File

@@ -22,6 +22,7 @@
#include "config.h"
#include <TTGO.h>
#include <WiFi.h>
#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();

View File

@@ -21,6 +21,7 @@
*/
#include <config.h>
#include <WiFi.h>
#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 ] );

View File

@@ -31,6 +31,6 @@
/*
* firmeware version string
*/
#define __FIRMWARE__ "2020072907"
#define __FIRMWARE__ "2020073003"
#endif // _CONFIG_H

View File

@@ -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 ) );

View File

@@ -39,6 +39,7 @@ void note_tile_setup( void ) {
style = mainbar_get_style();
lv_style_copy( &notestyle, style);
lv_style_set_text_opa( &notestyle, LV_OBJ_PART_MAIN, LV_OPA_30);
lv_style_set_text_font( &notestyle, LV_STATE_DEFAULT, &Ubuntu_72px);
notelabel = lv_label_create( note_cont, NULL);

View File

@@ -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();

View File

@@ -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();

Binary file not shown.

View File

@@ -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"}