Skip to content

SpaceNav WebSocket Bridge for using a 3dConnexion spacemouse with onshape

License

Notifications You must be signed in to change notification settings

RmStorm/spacenav-ws

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Websockets exposer for the spacenav driver (spacenav‑ws)

PyPI version Build Status License

Table of Contents

About

spacenav‑ws is a tiny Python CLI that exposes your 3Dconnexion SpaceMouse over a secure WebSocket, so Onshape on Linux can finally consume it. Under the hood it reverse‑engineers the same traffic Onshape’s Windows client uses and proxies it into your browser.

This lets you use FreeSpacenav/spacenavd on Linux with Onshape.

Prerequisites

  • uv/uvx or another Python env manager.
  • A running instance of spacenavd
  • A modern browser (Chrome/Firefox) with a userscript manager (Tampermonkey/Greasemonkey)

Usage

  1. Validate spacenavd
uvx spacenav-ws@latest read-mouse
# → should print spacemouse events
  1. Run the server and trust the cert
uvx spacenav-ws@latest serve

Now open: https://127.51.68.120:8181. When prompted, add a browser exception for the self‑signed cert.

  1. Install Tampermonkey and add the userscript

Install Tampermonkey. After installing, click this link for one‑click install of the script.

  1. Open an Onshape document and test your mouse!

Developing

git clone https://github.com/you/spacenav-ws.git
cd spacenav-ws
uv run spacenav-ws serve --hot-reload

This starts the server with Uvicorn's code watching / hot reload feature enabled. When making changes the server restarts and any websocket state is nuked, however, Onshape should immediately reconnect automatically! This makes for a very smooth and fast iteration workflow.

About

SpaceNav WebSocket Bridge for using a 3dConnexion spacemouse with onshape

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.1%
  • JavaScript 2.9%