Hex Device Python Library
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:
- [✅] ChassisMaver
- [✅] ChassisMark2
- [✅] ChassisTriggerA3
- [✅] ArmArcher
- [✅] ArmSaber
- [✅] ArmFirefly
- [✅] HandsHtGp100
- [✅] HandGp80G1
- [✅] LiftLotaP1
- [✅] RtZetaVc2
- [✅] Hello
Prerequisites
- Python 3.9 or higher
- Anaconda Distribution (recommended for beginners) - includes Python, NumPy, and commonly used scientific computing packages
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
Quickstart
If you have already installed the library from PyPI using pip, please refer to Usage
Install protoc
-
Install protoc from package manager (Recommended only for Debian13/Ubuntu24.04)
sudo apt install protobuf-compiler
-
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
Compile Protocol Buffer messages:
mkdir ./hex_device/generated
protoc --proto_path=proto-public-api --python_out=hex_device/generated proto-public-api/*.proto && cp ./proto-public-api/version.py ./hex_device/generated/version.py
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:
-
Install dependencies:
python3 -m pip install -r requirements.txt
-
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
Examples
- Simple demo for all devices: tests/main.py
- Robotic arm trajectory tracking: tests/archer_traj_test.py or tests/saber7dof_traj_test.py
Basic Usage
IPv4 connection:
python3 tests/main.py --url ws://0.0.0.0:8439
IPv6 connection:
python3 tests/main.py --url ws://[fe80::500d:96ff:fee1:d60b%3]:8439
Q&A
How do I connect using IPv6?
You can connect to our devices using IPv6, which enables direct connection without a router (e.g., using a single cable to connect the robot and PC).
Note: We assume you have basic knowledge about IPv6. If you don't, please use IPv4 instead. We will not explain IPv6 in detail.
Key points:
- Without DHCP6, devices can still have a link-local address
- To use link-local addresses, you must specify the zone ID of the interface using the
%symbol - You can find the zone ID of the interface by running
ip a
Example:
# Find the interface and zone ID
ip a
# Use the zone ID in the connection URL
ws://[fe80::500d:96ff:fee1:d60b%3]:8439
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. Additionally, we recommend that you use a fixed software version after successful deployment to avoid code failures due to incompatible updates.
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
Metadata
Release files for hex-device 1.4.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hex_device-1.4.11.tar.gz | 97.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hex_device-1.4.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 190.0 kB
Release files / hex_device-1.4.11.tar.gz
| Download URL | hex_device-1.4.11.tar.gz |
|---|---|
| Size | 97.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cecb79c1ef8a8d8d95626e4a60e019f0b14d8f4f35d37c0854784b796a977193
|
|
BLAKE2b-256 checksum How to use checksums |
cec0d39a5aaa034ab136f93c10739708831c3595797b9700d0726ec0754e06a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.18
|
Release files / hex_device-1.4.11-py3-none-any.whl
| Download URL | hex_device-1.4.11-py3-none-any.whl |
|---|---|
| Size | 92.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
beaec2f9ac1fa1c9770056b9f23342ec57048619e93507262884d96b35025da2
|
|
BLAKE2b-256 checksum How to use checksums |
dd14fcf4f1143da7bdbf8ffccca358e4b103f28aa7e90465a1a9a4f54a197f3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.18
|