WebSocket Protocol¶
The default protocol for ARVOS - works everywhere, bidirectional, and easy to use.
Overview¶
WebSocket is the default protocol for ARVOS. It provides: - ✅ Bidirectional communication - ✅ Works on all networks - ✅ Good performance - ✅ Easy to debug
Default Port¶
9090
Quick Start¶
Python Server¶
import asyncio
from arvos import ArvosServer
async def main():
server = ArvosServer(port=9090)
server.print_qr_code()
server.on_imu = lambda data: print(f"IMU: {data}")
await server.start()
asyncio.run(main())
iOS App¶
- Open ARVOS app
- Select WebSocket protocol (default)
- Enter server IP and port 9090
- Connect!
Features¶
Bidirectional Communication¶
- iPhone sends sensor data
- Server can send control commands
- Real-time feedback
Automatic Reconnection¶
- Handles network interruptions
- Automatic reconnection logic
- Message queuing during disconnects
Message Format¶
JSON Messages (IMU, GPS, Pose):
{
"type": "imu",
"timestampNs": 1700000000000,
"angularVelocity": [0.01, -0.02, 0.005],
"linearAcceleration": [0.1, 0.0, -0.01]
}
Binary Messages (Camera, Depth):
Use Cases¶
- General purpose streaming
- First-time users
- Most research applications
- Development and testing
Advantages¶
- ✅ Works everywhere
- ✅ No special setup
- ✅ Good performance
- ✅ Easy debugging
Limitations¶
- ⚠️ Not the fastest (use gRPC for maximum performance)
- ⚠️ Single connection per client
Example¶
Next Steps¶
- Protocol Comparison
- gRPC Protocol - Higher performance alternative