Skip to content

fbiego/chronos-esp32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chronos-esp32

A wrapper library for ESP32 to facilitate easy setup of a smartwatch like project. Supports syncing of notifications from the phone. Setup your ESP32 as a smartwatch and connect to Chronos app over BLE.

arduino-library-badge PlatformIO Registry

Features

  • Time
  • Notifications
  • Weather
  • Controls (Music, Find Phone, Camera)
  • Phone Battery (Level, Charging state) (Chronos app v3.5.1+)
  • Alarms

Companion App

Download Chronos

Chronos

Functions

ChronosESP32();
ChronosESP32(String name); // set the BLE name
ChronosESP32(String name, ChronosScreen screen); // set the BLE name and screen configuration
void begin(); // initializes BLE
void loop(); // handles routine functions

// watch
bool isConnected();
void set24Hour(bool mode);
bool is24Hour();
String getAddress();
void setBattery(uint8_t level, bool charging = false);
bool isCameraReady();

// notifications
int getNotificationCount();
Notification getNotificationAt(int index); // index [0-9]
void clearNotifications();

// weather
int getWeatherCount();
String getWeatherCity();
String getWeatherTime();
Weather getWeatherAt(int index); // index[0-6]
HourlyForecast getForecastHour(int hour); // hour [0-23]

// alarms
Alarm getAlarm(int index);
void setAlarm(int index, Alarm alarm);

// control
void sendCommand(uint8_t *command, size_t length);
void musicControl(uint16_t command);
void setVolume(uint8_t level);
bool capturePhoto();
void findPhone(bool state);

// phone battery
void setNotifyBattery(bool state);
bool isPhoneCharging();
uint8_t getPhoneBattery();

// app info
int getAppCode();
String getAppVersion();

RemoteTouch getTouch(); // RemoteTouch(bool state, uint32_t x, uint32_t y)
String getQrAt(int index); // index [0-8]

// helper functions for ESP32Time
int getHourC(); // return hour based on hour 24 variable
String getHourZ(); // return zero padded hour string based on hour 24 variable
String getAmPmC(bool caps = true); // return (no caps)am/pm or (caps)AM/PM for 12 hour mode or none for 24 hour mode

// callbacks
void setConnectionCallback(void (*callback)(bool));
void setNotificationCallback(void (*callback)(Notification));
void setConfigurationCallback(void (*callback)(Config, uint32_t, uint32_t));
void setDataCallback(void (*callback)(uint8_t *, int));
void setRawDataCallback(void (*callback)(uint8_t *, int));

PlatformIO

Open the project folder in VS Code with PlatformIO installed to directly run the example sketches. This makes it easier to develop and test features

Dependencies