Skip to content

VNSconnect – SDK for SmartVNS

This documentation provides API information, functionality description and usage examples for communication with SmartVNS devices over Bluetooth and USB.

For the Python library, Bleak was used as cross-platform BLE library.


Sample Client

import asyncio
from vnsconnect import VNSconnect


async def client():
    vns = VNSconnect("")

    config = vns.create_sysconfig(
        imu_odr=10, mag_odr=10, to_ble_imu=True, to_ble_log=True, to_ble_mag=True, to_ble_quat=True)

    await vns.connect_to_tracker()

    address = vns.get_address()
    print(f"{address}")

    await vns.write_config("sys", config)
    await vns.read_config("sys")
    await vns.start_notification()      # No timeout

    try:
        while True:
            await asyncio.sleep(1)
    except KeyboardInterrupt:
        pass

    await vns.stop_notification()

    await vns.disconnect()


if __name__ == "__main__":
    print("Starting VNSconnect client... press CTRL+C to terminate")
    asyncio.run(client())