Skip to main content

ADI study watch python SDK

Project description

Study Watch Python SDK

The adi-study-watch provides an object-oriented interface for interacting with ADI's VSM study watch platform.


pip install adi-study-watch


A user application can use the SDK to receive complete packets of bytes over a physical interface (USB or BLE) and decode it. The functionality is organized into applications, some of which own sensors, some own system-level functionality (i.e. file system), and while others own algorithms. The hierarchy of objects within the SDK mirrors the applications present on the device. Each application has its own object within the SDK hierarchy, which is used to interact with that application. A brief guide on using the SDK and few examples have been added below.

Firmware Setup

Getting started with SDK

Import the adi-study-watch module into your application code

from adi_study_watch import SDK

Instantiate the SDK object by passing the com port number

sdk = SDK('COM28')

The application objects can be instantiated from the sdk object. In order to instantiate an application object, we'll have to pass a call-back function as an input argument which can be used to retrieve the data from the application object. Define a callback function as displayed below.

def adxl_cb(data):

Once the call-back function is defined, you can instantiate the application object as shown below.

adxl_app = sdk.get_adxl_application()

Each application object has various methods that can be called by referring to the application. An example of retrieving the sensor status is shown below. Almost all method in an application returns result in a dict.

packet = adxl_app.get_sensor_status() # returns dict

Basic Example:

import time
from datetime import datetime
from adi_study_watch import SDK

# callback function to receive adxl data
def callback_data(data):
    sequence_number = data["payload"]["sequence_number"]
    for stream_data in data["payload"]["stream_data"]:
        dt_object = datetime.fromtimestamp(stream_data['timestamp'] / 1000)  # convert timestamp from ms to sec.
        print(f"seq :{sequence_number} timestamp: {dt_object} x,y,z :: ({stream_data['x']}, "
              f"{stream_data['y']}, {stream_data['z']})")

if __name__ == "__main__":
    sdk = SDK("COM4")
    application = sdk.get_adxl_application()

    # quickstart adxl stream
    application.enable_csv_logging("adxl.csv") # logging adxl data to csv file

Permission Issue in Ubuntu

1 - You can run your script with admin (sudo).

2 - If you don't want to run scripts as admin follows the steps below:

  • add user to tty and dialout group
sudo usermod -aG tty <user>
sudo usermod -aG dialout <user>
  • create a file at /etc/udev/rules.d/ with name 10-adi-usb.rules:
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0456", ATTRS{idProduct}=="2cfe", MODE="0666", GROUP="dialout"
  • reboot

All streams packet structure :

Documentation :

Examples :

License :


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

adi_study_watch-5.19.0.tar.gz (115.2 kB view hashes)

Uploaded source

Built Distribution

adi_study_watch-5.19.0-py3-none-any.whl (204.1 kB view hashes)

Uploaded py3

Supported by

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