Skip to main content

bhaptics-http

HTTP REST bridge for bHaptics haptic hardware.

Wraps the bhaptics-python SDK in a lightweight aiohttp server, exposing a language-agnostic REST API so that any language or environment can drive bHaptics vests, arm bands, gloves, and other devices over plain HTTP.

Why?

bHaptics hardware is controlled through bHaptics Player (a Windows desktop app). The official SDK options are:

SDK Works in Raw dot patterns?
tact-js Browser only (WASM) No (needs Studio)
bhaptics-python Windows Python Yes — but no HTTP
bHaptics REST API Via Player No raw dot control

bhaptics-http fills the gap: run it once on Windows alongside bHaptics Player, then call it from Node.js, WSL2, Docker, another machine — or any curl command.

The key feature is /haptic/dot: raw per-motor intensity control with no bHaptics Studio pre-registration required.


Install

pip install bhaptics-http

Windows only — must run on the same machine as bHaptics Player.


Quick start

# Start bHaptics Player, then:
python -m bhaptics_http
bhaptics-http starting on 0.0.0.0:15883  (appId=BHapticsHTTP)
Endpoints:
  GET  http://0.0.0.0:15883/health
  POST http://0.0.0.0:15883/haptic
  POST http://0.0.0.0:15883/haptic/dot
  POST http://0.0.0.0:15883/haptic/stop

Test it:

curl http://localhost:15883/health
# {"ok": true, "backend": "bhaptics-python", "player": true}

curl -X POST http://localhost:15883/haptic/dot \
  -H 'Content-Type: application/json' \
  -d '{"deviceType":0,"duration":300,"motors":[{"index":0,"intensity":100},{"index":1,"intensity":100}]}'
# {"ok": true}

REST API

GET /health

Check connection to bHaptics Player.

{"ok": true, "backend": "bhaptics-python", "player": true}

POST /haptic

Play a named pattern registered in bHaptics Studio.

{ "event": "HeartBeat", "deviceIndex": 0 }

POST /haptic/dot

Play raw per-motor intensities — no Studio required.

{
  "deviceType": 0,
  "duration":   300,
  "motors": [
    {"index": 0, "intensity": 100},
    {"index": 4, "intensity":  60}
  ]
}

Device type reference:

deviceType Device
0 TactSuit X16 / X40 (chest vest)
1 Tactosy2 left arm
2 Tactosy2 right arm
3 TactVisor head
6 Tactosy feet left
7 Tactosy feet right
8 TactGlove left
9 TactGlove right

intensity range: 0–100


POST /haptic/stop

Stop all currently playing haptic patterns.

{"ok": true}

Configuration

Environment variable Default Description
BHAPTICS_HTTP_PORT 15883 Port to listen on
BHAPTICS_APP_ID BHapticsHTTP App ID for bHaptics Player auth
BHAPTICS_API_KEY "" API key (usually empty for local Player)

Or place a tact-config.json next to the server:

{ "appId": "MyApp", "apiKey": "" }

WSL2 / cross-machine setup

Run the server on Windows, then call it from WSL2 or another machine.

# Find your Windows host IP from WSL2:
cat /etc/resolv.conf | grep nameserver
# nameserver 172.22.112.1

# Then call:
curl http://172.22.112.1:15883/health

Windows Firewall: you may need to allow inbound TCP on port 15883:

# PowerShell (as Administrator):
New-NetFirewallRule -DisplayName "bhaptics-http" -Direction Inbound `
  -Protocol TCP -LocalPort 15883 -Action Allow

Or simply run the server and the client on the same Windows machine.


Node.js example

const BASE = "http://localhost:15883";

// Raw dot pattern — vest upper row
await fetch(`${BASE}/haptic/dot`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    deviceType: 0,
    duration: 300,
    motors: [
      { index: 0, intensity: 100 },
      { index: 1, intensity: 100 },
      { index: 2, intensity: 100 },
      { index: 3, intensity: 100 },
    ],
  }),
});

See examples/client.js for a full demo.


Python library usage

from aiohttp import web
from bhaptics_http.server import make_app, load_config

app_id, api_key = load_config()          # reads env / tact-config.json
app = make_app(app_id, api_key)
web.run_app(app, port=15883)

CLI options

python -m bhaptics_http --help

options:
  --port PORT       Port (default: 15883, env: BHAPTICS_HTTP_PORT)
  --host HOST       Bind interface (default: 0.0.0.0)
  --config PATH     Path to tact-config.json
  --app-id ID       bHaptics appId
  --api-key KEY     bHaptics apiKey

Citation

If you use this in academic work, please cite via Zenodo:

Vollmer, S.C. (2026). bhaptics-http: HTTP REST bridge for bHaptics haptic hardware [Software]. Zenodo. https://doi.org/XXXX/zenodo.XXXXXXX

(DOI will be updated after Zenodo deposit.)


Related


License

MIT © MissCrispenCakes

Metadata

Release files for bhaptics-http 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bhaptics-http 0.1.0
File Size Uploaded Provenance
bhaptics_http-0.1.0.tar.gz 9.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bhaptics-http 0.1.0
File Interpreter ABI Platform
bhaptics_http-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.4 kB

Release files / bhaptics_http-0.1.0.tar.gz

Download URL bhaptics_http-0.1.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
63166ef9696c3d954061e892213c02ded46c1478fef6867e5553094ec0757c2a
BLAKE2b-256 checksum
How to use checksums
351329ad6e339643056fcb3353feb5de4248fcd0abf28bd60d7dfc568c8c314d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release files / bhaptics_http-0.1.0-py3-none-any.whl

Download URL bhaptics_http-0.1.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
babe9e1ff105f0c569633b819a67f33068f49704254642036ef4f570aaa58f67
BLAKE2b-256 checksum
How to use checksums
7d37edd4cc555d1b45a2feaacebabbca3b536c1dbe43e44d1e4098e834334667
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Security for bhaptics-http 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bhaptics_http-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page