Skip to main content

A Python library for controlling HexDevice robots and devices

Project description

Hex Device Python Library

中文 | English

Overview

This library provides a simple interface for communicating with and controlling Hex devices. It uses Protocol Buffers for message serialization and WebSocket for real-time communication. The supported hardware list is as follows:

Installation

Install from PyPI (Recommended)

pip install hex_device

Clone the Repository (Development)

git clone --recurse-submodules https://github.com/hexfellow/hex_device_python.git

Prerequisites

  • Python 3.9 or higher
  • Anaconda Distribution (recommended for beginners) - includes Python, NumPy, and commonly used scientific computing packages

Quickstart

Install protoc

  1. Install protoc from package manager (Recommended only for Debian13/Ubuntu24.04)

    sudo apt install protobuf-compiler
    
  2. Install protoc from Github Releases (Recommended Ubuntu22.04 and below)

    Just choose a suitable version and install it. Here below is an example of installing protoc-27.1.

    # For Linux x86_64
    wget https://github.com/protocolbuffers/protobuf/releases/download/v27.1/protoc-27.1-linux-x86_64.zip
    sudo unzip protoc-27.1-linux-x86_64.zip -d /usr/local
    rm protoc-27.1-linux-x86_64.zip
    
    # For Linux arm64
    wget https://github.com/protocolbuffers/protobuf/releases/download/v27.1/protoc-27.1-linux-aarch_64.zip
    sudo unzip protoc-27.1-linux-aarch_64.zip -d /usr/local
    rm protoc-27.1-linux-aarch_64.zip
    
    # Verify installation
    protoc --version # Should be or more than 3.21.12
    

Install hex_device

Option 1: Package Installation

To install the library in your Python environment:

python3 -m pip install .

Option 2: Direct Usage (No Installation)

If you prefer to run the library without installing it in your Python environment:

  1. Compile Protocol Buffer messages:

    mkdir ./hex_device/generated
    protoc --proto_path=proto-public-api --python_out=hex_device/generated proto-public-api/*.proto
    
  2. Install dependencies:

    python3 -m pip install -r requirements.txt
    
  3. Add the library path to your script:

    import sys
    sys.path.insert(1, '<your project path>/hex_device_python')
    sys.path.insert(1, '<your project path>/hex_device_python/hex_device/generated')
    

Usage

The complete function interfaces can be found in our wiki.

Q&A

Why did a previously working software package stop working after a redeployment?

  • Please check the Change log to see if you are using cross-version software packages

If I want to use newer software packages, how do I perform hardware upgrades?

  • Please contact our after-sales service, and we will provide hardware upgrade instructions based on the equipment you purchased

Copyright © 2025-present Hexfellow Org

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

hex_device-1.3.4b0.tar.gz (72.1 kB view details)

Uploaded Source

Built Distribution

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

hex_device-1.3.4b0-py3-none-any.whl (67.3 kB view details)

Uploaded Python 3

File details

Details for the file hex_device-1.3.4b0.tar.gz.

File metadata

  • Download URL: hex_device-1.3.4b0.tar.gz
  • Upload date:
  • Size: 72.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for hex_device-1.3.4b0.tar.gz
Algorithm Hash digest
SHA256 c8b815bca3b8e5f7127b899492221c66c0e7c8e29e13964854a6fc79cad3c00b
MD5 3ea07687e8122cea4720b6db564efaf1
BLAKE2b-256 8ec0a478a2c52c4f0b239258af1c9f060c0ad2f6287dccfb2c6a61283928efb1

See more details on using hashes here.

File details

Details for the file hex_device-1.3.4b0-py3-none-any.whl.

File metadata

  • Download URL: hex_device-1.3.4b0-py3-none-any.whl
  • Upload date:
  • Size: 67.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for hex_device-1.3.4b0-py3-none-any.whl
Algorithm Hash digest
SHA256 40314319767e32c8ec2622bd7e7ecea55d69962edf659087058d5cc05a89d3e7
MD5 4143dec8171fed8efee80a34fc7f0e0c
BLAKE2b-256 4729143cdc6ae09bdd638688e0ed454104bb01d17327eb846431c726ddf8e539

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