Giter Club home page Giter Club logo

zswatch's Introduction

ZSWatch_gh_banner

License discord

ZSWatch v4 CNC:ed Stainless Steel (left), Clear Resin 3D print (right)


Smartwatch built from scratch, both hardware and software. Built on the Zephyr™ Project RTOS, hence the name ZSWatch - Zephyr Smartwatch.


UI and features

walkthrough_watch.mp4

Watch my presentation at Zephyr Developer Summit 2023

Building or getting one

Some things are still in progress:

I'll also build a few initial kits (assembled) for those who don't want or can build ZSWatch themselves.
In addition to assembled ZSWatch and dock you will get the following compared to if you build it yourself:

  • A magnetic dock connector and cable. I have got custom ordered cables to fit the needs of ZSWatch.
  • Dock with onboard SEGGER J-Link OB debgger, which means you won't need an external debugger for ZSWatch development and flashing.
  • Possibly CNC:ed casing in Stainless steel.

If you are interested in a kit, or want to get notified when the missing parts above are resolved, fill in your mail here (Google form) and I'll send a reminder when it's ready.

Or if you want to get notified for releases and when the missing parts are finished simply press the Watch button (next to Fork and Star) -> Custom -> Releases and you will see in your feed when it's officially released.

Table of content ZSWatch

Hardware features

  • nRF5340 BLE chip (u-blox NORA-B10 module).
    • 128 MHz Dual core.
    • 512 KB RAM.
    • 1 MB Flash.
    • 30 MHz SPI for display.
  • 240x240 round display with touch screen.
  • IMU Bosch BMI270, with this one it's possible to do many fancy things such as navigation using gestures and the typical smartwatch wakeup by moving the arm so the display is viewable.
  • Bosch BME688 Environmental sensor with AI.
  • Bosch BMP581 High performance pressure sensor accuracy in units of ~20cm's.
  • ST LIS2MDLTR Magnetometer.
  • Renesas AT25SL128A 16 MB external flash.
  • Broadcom APDS-9306-065 Light Sensor for automatic brightness control.
  • Option to not mount some sensors to save BOM cost.

Charger/Dock

Option with and without onboard SEGGER J-Link OB debugger.
As the debugger requires a license, this will only be availible as part of a kit.

See more at https://github.com/jakkra/ZSWatch-Dock

Enclosure/Casing

3D printed casing with 3D printed buttons, option CNC:able casing in metal.

Software Features

Features and progress

There are almost endless of posiblities for features that could be implemented, see here for full progress and in GitHub issues.

Watchfaces

watchfaces.mp4

Smartphone communication

Android phone communication

Fortunately there is a great Android app called GadgetBridge which handles everything needed on the phone side, such as notifications management, music control and so much more... The ZSWatch right now pretends to be one of the supported Smart Watches in Gadgetbridge, following the same API as it does. In future there may be a point adding native support, we'll see.

Demo of doing HTTP requests over BLE through Gadgetbridge.

http_demo.mp4

Pairing

  • In the watch go to Settings -> Bluetooth -> Enable pairing
  • Now go reconnect to the watch from Gadgetbridge app.
  • You should now be paired.

iOS device communication

Apple exposes Apple Notification Center Service GATT server which handles notifications management on the phone side, music control is done in the same fashion using Apple Media Service... The ZSWatch communicates straight to the iOS with no extra Apps.

Pairing

  • In the watch go to Settings -> Bluetooth -> Enable pairing
  • Now go to your device settings -> Bluetooth and choose "ZSWatch"
  • You should be prompted to pair and allow share notifications

PCB

A 4 layer board which measures 38mm in diameter designed in KiCad.
More info here: https://github.com/jakkra/ZSWatch-HW

Environment, Compiling and running the code

See GETTING_STARTED.md

Writing apps for the Application Manager

See Wiki page about apps

Other tools

Licence GPL-3.0

Main difference from MIT is now that if anyone want to build something more with this, then they need to also open source their changes back to the project, which I thinks is fair. This is so everyone can benefit from those improvements. If you think this is wrong for some reason feel free to contact me, I'm open to change the LICENCE.

Thanks

SEGGER for supporting with SEGGER-OB licenses which makes the dock a fully functional programmer and debugger for ZSWatch. Thanks to this the project will be much more approchable for persons without a J-Link debugger, letting them have full development and debugging capabilites.

zswatch's People

Contributors

almazshai avatar apewo avatar coderbyheart avatar elmo2k3 avatar hasheddan avatar jakkra avatar kampi avatar ldab avatar msa360 avatar vchavezb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zswatch's Issues

Split hardware and firmware repositories

Prerequisites

Since the ZSWatch hardware and firmware doesn't have anything in common (expect of fact that all of this related to one final product) I purpose to split it to different repositories. By growing project size and difficulties to maintain hw and fw in one repository we'll definitely end up with splitting them. I suggest doing it in early state of project before it's got too painful. By splitting the repository following advantages:

  1. Possibility to setup independent pipelines
  2. Follow some branching model for firmware
  3. Track and handle releases/changelog clearly for firmware and hardware
  4. Configure ZSWatch firmware repo as a manifest file in proper way, which provide possibility to:
    -- clone project and all dependencies via single command line,
    -- checkout certain version of Zephyr and modules
    -- automatically apply patches to Zephyr
    -- extend west command
    -- ect.
  5. Define issues independently -> avoid mess of TODO
  6. Open root directory in VSCode which provide:
    -- possibility to operate with Git extension for VSCode
    -- nRF Connect extension automatically loads application
    -- set up workspace and firmware specific settings

Side effects

  1. Some manual merging required for all forks
  2. Content of current repo will be changes, people will not see that they expect by clicking old link

Proposal

  1. Create two new repositories named "ZSWatchFw" and "ZSWatcHw" and copy related part to there.
  2. Keep current repo as a ZSWatch overview, keep demos, documentation, images.
  3. Configure ZSWatch manifest repo which will include all 3 repositories and have a following tree:
    ZSWatch # zephyr top dir
    ├─ ZSWatch
    ├─ ZSWatchHw
    ├─ ZSWatchFw
    │ └─ west.yml # Main manifest
    ├─ zephyr
    ├─ modules
    ├─ bootloader
    ...

I don't like the idea of having hw sources in zephyr manifest, but it might be useful for someone.

Display init sequence error

I found these errors in the display driver init sequence.
/app/drivers/display/gc9a01.c

  • (line 119-121)
    GC9A01A1_VREG1A, 0x13,
    GC9A01A1_VREG1B, 0x13,
    GC9A01A1_VREG2A, 0x22,

should be

    GC9A01A1_VREG1A,1, 0x13,
    GC9A01A1_VREG1B,1, 0x13,
    GC9A01A1_VREG2A,1, 0x22,

It is missing the numArgs.

  • line 112
    0xB6, 2, 0x00, 0x00, should be 0xB6, 2, 0x00, 0x20,
  • line 143
    GC9A01A_TEON, 1, GC9A01A_INVOFF, should be GC9A01A_TEON, 0,.

In my implementation I have removed some redundant register inits and moved some register inits to a function call,(some registers can be initialized earlier on , like orientation and pixel format). It also has pwm based backlight control implemented.

I hope this solves the problem that you face.
Cheers,
Amrith

CAD

First of all, your work currently looks good, but it seems that the first version of the watch shell can no longer meet the second version, and I am very interested in its shell style

How to build the app?

Hello, I am very interested in this program, but I'm new for zephyr. Now I already install the dev env at of zephyr in ubuntu22.04 according to https://docs.zephyrproject.org/latest/develop/getting_started/index.html. But I can't find the way to build the project, could you add some short description for How to build the app in README?
Thanks again for you awesome project.

Question: Why is battery superviser?

Hello, I am very interested in your project. I am planning to build something similar but with AMOLED display and with internal small coin battery for RTC time. I am just curious why would you use battery supervisor chip? From your photos I can see that the battery has already integrated supervisor, so why you adding additional?

Upload LVGL resources such as images to external flash. Use resources in LVGL code that are in external flash.

With 16MB external flash soon coming to the next hardware version we can now store alot of resources in this memory.

This open many new doors.

We need a way to easily put resources such as icons, fonts etc. in this flash and also point LVGL to read those resources from there.

LVGL already have support for this, but needs to be configured and enabled.

How to easily upload resources to external flash?

CAD

From the picture, it can be seen that you have already made the watch case, haven't you? How beautiful! Can you share the CAD files and take a look? I am very curious about how the button part is resolved. Thank you.

native posix build does not work

I am trying to build native posix project. I get the following error. Am I doing something wrong or the build script is corrupted?

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base (cached)).
-- Application: /home/mohammad/zephyrproject/projects/ZSWatch/app
-- CMake version: 3.27.4
-- Cache files will be written to: /home/mohammad/.cache/zephyr
-- Zephyr version: 3.4.99 (/home/mohammad/zephyrproject/zephyr)
-- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
-- Board: native_posix
-- Found host-tools: zephyr 0.16.1 (/home/mohammad/zephyr-sdk-0.16.1)
-- Found toolchain: host (gcc/ld)
-- Found BOARD.dts: /home/mohammad/zephyrproject/zephyr/boards/posix/native_posix/native_posix.dts
-- Found devicetree overlay: /home/mohammad/zephyrproject/projects/ZSWatch/app/boards/native_posix.overlay
-- Generated zephyr.dts: /home/mohammad/zephyrproject/projects/ZSWatch/app/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/mohammad/zephyrproject/projects/ZSWatch/app/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /home/mohammad/zephyrproject/projects/ZSWatch/app/build/zephyr/dts.cmake

warning: SENSOR (defined at drivers/sensor/Kconfig:6) was assigned the value 'n' but got the value
'y'. See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_SENSOR and/or look up SENSOR in
the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.


warning: MAX30101_SLOT1 (defined at drivers/sensor/max30101/Kconfig:143) was assigned the value '1'
but got the value ''. Check these unsatisfied dependencies: MAX30101_MULTI_LED_MODE (=n), MAX30101
(=n). See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MAX30101_SLOT1 and/or look up
MAX30101_SLOT1 in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: MAX30101_SLOT2 (defined at drivers/sensor/max30101/Kconfig:158) was assigned the value '2'
but got the value ''. Check these unsatisfied dependencies: MAX30101_MULTI_LED_MODE (=n), MAX30101
(=n). See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MAX30101_SLOT2 and/or look up
MAX30101_SLOT2 in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: MAX30101_SLOT3 (defined at drivers/sensor/max30101/Kconfig:173) was assigned the value '3'
but got the value ''. Check these unsatisfied dependencies: MAX30101_MULTI_LED_MODE (=n), MAX30101
(=n). See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MAX30101_SLOT3 and/or look up
MAX30101_SLOT3 in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: MAX30101_SLOT4 (defined at drivers/sensor/max30101/Kconfig:188) was assigned the value '0'
but got the value ''. Check these unsatisfied dependencies: MAX30101_MULTI_LED_MODE (=n), MAX30101
(=n). See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MAX30101_SLOT4 and/or look up
MAX30101_SLOT4 in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: PM (defined at subsys/pm/Kconfig:13) was assigned the value 'y' but got the value 'n'.
Check these unsatisfied dependencies: HAS_PM (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_PM and/or look up PM in the
menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values,
and Kconfig - Tips and Best Practices sections of the manual might be helpful too.


warning: The choice symbol MAX30101_MULTI_LED_MODE (defined at drivers/sensor/max30101/Kconfig:62)
was selected (set =y), but no symbol ended up as the choice selection. See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MAX30101_MULTI_LED_MODE and/or look up
MAX30101_MULTI_LED_MODE in the menuconfig/guiconfig interface. The Application Development Primer,
Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
helpful too.


warning: The choice symbol NEWLIB_LIBC (defined at lib/libc/Kconfig:85) was selected (set =y), but
EXTERNAL_LIBC (defined at lib/libc/Kconfig:101) ended up as the choice selection. See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_NEWLIB_LIBC and/or look up NEWLIB_LIBC in
the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.


/home/mohammad/zephyrproject/projects/ZSWatch/app/prj.conf:36: warning: attempt to assign the value 'n' to the undefined symbol KSCAN_CST816S

/home/mohammad/zephyrproject/projects/ZSWatch/app/prj.conf:183: warning: attempt to assign the value '5' to the undefined symbol ZBUS_RUNTIME_OBSERVERS_POOL_SIZE

error: Aborting due to Kconfig warnings
Parsing /home/mohammad/zephyrproject/projects/ZSWatch/app/Kconfig
Loaded configuration '/home/mohammad/zephyrproject/zephyr/boards/posix/native_posix/native_posix_defconfig'
Merged configuration '/home/mohammad/zephyrproject/projects/ZSWatch/app/prj.conf'
Merged configuration '/home/mohammad/zephyrproject/projects/ZSWatch/app/boards/native_posix.conf'

CMake Error at /home/mohammad/zephyrproject/zephyr/cmake/modules/kconfig.cmake:348 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /home/mohammad/zephyrproject/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
  /home/mohammad/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  /home/mohammad/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
  CMakeLists.txt:15 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=/usr/bin/python3 -B/home/mohammad/zephyrproject/projects/ZSWatch/app/build -GNinja -S/home/mohammad/zephyrproject/projects/ZSWatch/app

Settings subsystem to store configs etc. to flash

Right now we cannot store an settings or anything that persists power loss.
This is quite bad, and we really need persistent storage.

Start with bringing it up, then next step is to organize a good way for apps to store/load settings etc.

Notification enhancements

ToDo

  • #149
  • #118
  • Support more applications
    • Discord
    • YouTube
    • LinkedIn
    • Home Assistant
    • Finanzguru
    • Google Calendar
    • Steam
  • Additional font for special characters
  • Notification app freezes at some number of notifications (more than 14). Figure out why and add a workaround like visualizing only 10 notifications, etc.

Is there a glitch when LDO cut-off by the voltage supervisor?

It is a Great Project :)
I'd like to try, but I have question about the battery supervior.

When the battery goes down to 3.6V -> NCV(supervisor) RESET_OUTPUT to low ->
Disable LDO(CE), Turn off MCU.

For charing battery,
VBUS connected -> charge battery -> if +BATT>3.6 turn LDO on by NCV

what if LCD BL and MCU drain more than charged capacity(might be low current VBUS),
is there no glitch, like turn on and off in a loop?

button

I have been researching the structure of your first version recently, but I cannot understand your structure in the button section. How do you specifically implement the button function? I also noticed that you have a plastic part in the physical part of the button. Is this what you bought? Can you send me a purchase link to take a look? Thank you very much!

Config to allow touch chip to wake up the screen

The touch chip IC cst816s have features to go into low power mode and then allow wakeup by doing gestures or taps on the screen. This would be a nice additional way to wake up the watch.

Implement this. What registers and how to configure this needs some digging as much documentation for the cst816s is in chinese.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.