Skip to main content

Pythgon API for GShock Watches using BLE

Project description

GShockTimeServer

Overview

GShockTimeServer allows you to set the correct time on your Casio G-Shock watches, including:

Additionally, this repository provides an API for developing applications for these watches. While still a work in progress, you can refer to the api_tests.py file for usage examples.

Usage

This app can run on any device with Python and Bluetooth capabilities—from a desktop to a Raspberry Pi Zero. It has been tested on Linux but should also work on Windows.

Pi Zero Running the Server

Setting the Time

  1. Ensure the app is running on your device.

  2. Short-press the lower-right button on your G-Shock watch to connect.

  3. Once connected, the app will automatically set the correct time on your watch.

  4. If AUTO TIME ADJUSTMENT is enabled, the watch will sync up to four times daily.

Dependencies

This project requires the following Python packages: ` pytz bleak `

So you can install them using the following command: ` pip3 install -r requirements.txt `

Virtual Environment Setup

To run the server in a virtual environment:

  1. Create a virtual environment:

# Create a virtual environment
python3 -m venv myenv

# Activate it (Mac/Linux)
source myenv/bin/activate

# Install dependencies
pip3 install -e .
  1. Run the tests:

python3 src/examples/api_tests.py [--multi-watch]
  1. Run the server:

python3 src/examples/gshock_server.py [--multi-watch]

The optional `–multi-watch` parameter allows you to connect if you have multiple watches.

Installing the library for your project:

` pip3 install gshock-api `

Troubleshooting:

If your watch cannot connect, and the `–multi-watch` parameter is not used, remove the `config.ini` file and try again.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gshock_api-2.0.2.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gshock_api-2.0.2-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

Details for the file gshock_api-2.0.2.tar.gz.

File metadata

  • Download URL: gshock_api-2.0.2.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for gshock_api-2.0.2.tar.gz
Algorithm Hash digest
SHA256 bae06ae513a80e672f9d208bb1fed584b3013452b23fb143bf9e08d613e4a263
MD5 136d19f56e1ba2e42726cc28723c0f3c
BLAKE2b-256 a5aaff6aa09ef83f8b870f4ac45d3b8bbde42b7306d9e05c3e7ff397a1df1578

See more details on using hashes here.

File details

Details for the file gshock_api-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: gshock_api-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 32.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for gshock_api-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6b44c1074573ea59e58ff72602eaa08e849aaf5162eec6f951a221f3c4cb89ff
MD5 fbbe8066a2668584c89d51863debbca7
BLAKE2b-256 fe09cec3a96ff62d3a1007421705f3a17aa45880bb545ada3f2523da91d0b8bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page