{ "info": { "author": "Dr. Konstantin Selyunin", "author_email": "selyunin.k.v@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Programming Language :: Python :: 3" ], "description": "# BNO055 USB Stick Python driver\n\n[![PyPI version](https://badge.fury.io/py/bno055-usb-stick-py.svg)](https://badge.fury.io/py/bno055-usb-stick-py)\n\n**TL;DR:** *\"Swiss army knife\"* for using \n[`BNO055 USB Stick`](https://eu.mouser.com/new/bosch/bosch-bno055-usb-stick/) \nunder Linux from `python3`. \n\n`BNO055 USB Stick` comes with \n[`Development Desktop 2.0`](https://www.bosch-sensortec.com/bst/support_tools/downloads/overview_downloads) \nsoftware package, \nwhich is available for Windows only. \n\nIf you have a `BNO055 USB Stick` and want to\nuse it on a Linux platform \n(e.g. Ubuntu, Raspbian, Yocto, Suse, etc.) \nthis repo provides you with a `python 3` driver,\ncapable of reading / writing registers / burst read, \nand stream data read.\n\n## OS Prerequisites\n\n1. When plugged in on a Linux system, \nthe `BNO055 USB Stick` should appear \nas `/dev/ttyACM*` device. \nThis device is a so-called\n[`cdc_acm`](https://www.keil.com/pack/doc/mw/USB/html/group__usbh__cdcacm_functions.html) \n(communication device class), but let us leave \nthese details for now.\n\n2. Your Linux user must be a member of the\n`dialout` group \n(e.g. see this [thread](https://unix.stackexchange.com/questions/14354/read-write-to-a-serial-port-without-root))\nto be able to read/write `ttyACM*` devices \nwithout root privileges.\n\n3. `udev` is installed on the system.\nWe do autodetect the USB stick by relying on information from\nudev.\n\n## Installation\n\n```sh\npip install bno055_usb_stick_py\n```\n\n\n## Supported Python version\n\n**python v3.6+**\n\n## Python dependencies\n\n**TL;DR:** install \n(i) `pyserial`, \n(ii) `pyudev`,\n(iii) `dataclasses` (if using `python3.6`), and\n(iv) optionally: `pyquaternion` \nand `matplotlib`, \nor use \n[`environment.yml`](./environment.yml)\nto create conda environment\nwith dependencies resolved.\n\nFor further details regarding creating `conda` senvironment read [**this**](./CONDA_HOWTO.md) guide.\n\n## Quick start\n\nRead BNO register:\n\n```python\nfrom bno055_usb_stick_py import BnoUsbStick\nbno_usb_stick = BnoUsbStick()\nreg_addr = 0x00\nreg_val = bno_usb_stick.read_register(reg_addr)\nprint(f\"bno chip id addr: 0x{reg_addr:02X}, value: 0x{reg_val:02X}\")\n```\n\nWrite register:\n\n```python\nfrom bno055_usb_stick_py import BnoUsbStick\nbno_usb_stick = BnoUsbStick()\nreg_addr = 0x3F\nreg_value = 0x01\nbno_usb_stick.write_register(reg_addr, reg_value)\nprint(f\"bno self test started!\")\n```\n\nBurst register read:\n\n```python\nfrom bno055_usb_stick_py import BnoUsbStick\nbno_usb_stick = BnoUsbStick()\nreg_start_addr = 0x08\nnum_registers = 0x12\nburst_read_result = bno_usb_stick.burst_read(reg_start_addr, num_registers)\nprint(f\"bno burst read result: {burst_read_result}\")\n```\n\nGet 10 packets in streaming mode (using generator):\n\n```python\nfrom bno055_usb_stick_py import BnoUsbStick\n\nbno_usb_stick = BnoUsbStick()\nbno_usb_stick.activate_streaming()\nfor packet in bno_usb_stick.recv_streaming_generator(num_packets=10):\n print(f\"bno data: {packet}\")\n```\n\nGet 100 packets in streaming mode (by receiving single packets):\n\n```python\nfrom bno055_usb_stick_py import BnoUsbStick\nbno_usb_stick = BnoUsbStick()\nbno_usb_stick.activate_streaming()\nfor _ in range(100):\n packet = bno_usb_stick.recv_streaming_packet()\n print(f\"{packet}\")\n```\n\nReceive infinite number of packets (in case you wait infinite time :wink: ):\n\n```python\nfrom bno055_usb_stick_py import BnoUsbStick\nbno_usb_stick = BnoUsbStick()\nbno_usb_stick.activate_streaming()\nfor packet in bno_usb_stick.recv_streaming_generator():\n print(f\"{packet}\")\n```\n\n## Bno USB Stick Data Packet\n\nWhen receiving data in streaming mode, the result \nis an object of `BNO055` data class (from `bno055.py`) file.\n\n`BNO055` data class has the following fields:\n\n```python\nfrom bno055_usb_stick_py import BNO055\nbno_data = BNO055()\nbno_data.a_raw # raw accelerometer data (a_raw_x, a_raw_y, a_raw_z)\nbno_data.g_raw # raw gyro data (g_raw_x, g_raw_y, g_raw_z)\nbno_data.m_raw # raw magnetometer data (m_raw_x, m_raw_y, m_raw_z)\nbno_data.euler_raw # raw euler angles (heading, roll, pitch)\nbno_data.quaternion_raw # raw quaternion data (q_raw_w, q_raw_x, q_raw_y, q_raw_z)\nbno_data.lin_a_raw # raw linear acceleration data (lin_a_raw_x, lin_a_raw_y, lin_a_raw_z)\nbno_data.gravity_raw # raw gravity vector (gravity_raw_x, gravity_raw_y, gravity_raw_z)\nbno_data.a # accelerometer (a_x, a_y, a_z)\nbno_data.g # gyroscope (g_x, g_y, g_z)\nbno_data.m # magnetometer (m_x, m_y, m_z)\nbno_data.euler # euler angler (heading, roll, pitch)\nbno_data.quaternion # quaternion values (q_w, q_x, q_y, q_z)\nbno_data.lin_a # linear acceleration (lin_a_x, lin_a_y, lin_a_z)\nbno_data.gravity # gravity vector (gravity_x, gravity_y, gravity_z)\nbno_data.temp # temperature register\nbno_data.calib_stat # calibration status (addr 0x35) register\nbno_data.st_result # status result (addr 0x36) register\nbno_data.int_sta # interrupt status (addr 0x37) register\nbno_data.sys_clk_status # system clock status (addr 0x38) register\nbno_data.sys_status # system status (addr 0x39) register\n```\n\n## Prevent modem manager to capture serial device\n\nWhen plugging `bno_usb_stick` on Ubuntu,\nthe device is unavailable for the first 10-15 seconds,\ndue to the fact that `ModemManager` process \ntakes over and tries to use the device.\n\nTo avoid this Ubuntu-specific behavior, \nadd an exception to the `udev` rules,\ns.t. the `ModemManager` ignores the `bno_usb_stick`.\nRun the script:\n\n`python disable_modem_manager_bno_usb_stick.py`\n\nThe script requires root privileges. Essentially it copies \nthe `97-ttyacm.rules` file to `/etc/udev/rules.d` and reloads the \nudev rules.\n\n## Maintainer\n\n[Dr. Konstantin Selyunin](http://selyunin.com/), \nfor suggestions / questions / comments \nplease contact: \nselyunin [dot] k [dot] v [at] gmail [dot] com\n\n\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/selyunin/bno055_usb_stick_py", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "bno055-usb-stick-py", "package_url": "https://pypi.org/project/bno055-usb-stick-py/", "platform": "", "project_url": "https://pypi.org/project/bno055-usb-stick-py/", "project_urls": { "Homepage": "https://github.com/selyunin/bno055_usb_stick_py" }, "release_url": "https://pypi.org/project/bno055-usb-stick-py/0.9.5/", "requires_dist": [ "pyserial", "pyudev", "dataclasses" ], "requires_python": "", "summary": "BNO055 USB Stick Linux Python Driver", "version": "0.9.5" }, "last_serial": 4646308, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "518c8d035d5b9c29a4ca9a2ca746d35e", "sha256": "a84abda8bafeccf573cc3f8dfc876fe1f308b4605379695641b8d0510ea9146b" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "518c8d035d5b9c29a4ca9a2ca746d35e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11624, "upload_time": "2018-12-28T17:04:01", "url": "https://files.pythonhosted.org/packages/be/cd/12cc76f1743176c05cc9c4d88125c2038ae053df140ed4f52eb72c65eca2/bno055_usb_stick_py-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ee6749854fe795ece835796330c64f7c", "sha256": "84f86a8e3daa92ad771d08c061eefd8153eaa9acb33d9ccdef3ccf2c70955f70" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ee6749854fe795ece835796330c64f7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11280, "upload_time": "2018-12-28T17:04:06", "url": "https://files.pythonhosted.org/packages/50/43/58c2c316e374dc0476c39459bad7cd7517320b63d0dd313a40dec120e65f/bno055_usb_stick_py-0.1.0.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "203fe7d45b49e3c878ea4a715c3f5518", "sha256": "3e8386a13e7766a096fe033db6e75e47a32a772082c66cb21b40ebd8afcb59e9" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.9.0-py3-none-any.whl", "has_sig": false, "md5_digest": "203fe7d45b49e3c878ea4a715c3f5518", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11638, "upload_time": "2018-12-28T17:04:04", "url": "https://files.pythonhosted.org/packages/ba/c3/887fe88551941c204c17770441de00f35b4370185cd1d437d2d82be8d50a/bno055_usb_stick_py-0.9.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "71478b67d9ffa6b04307b9e124acee51", "sha256": "4886b004dae26e72242e89e7ab23a368238097f51d98617b06beabd76004f93f" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.9.0.tar.gz", "has_sig": false, "md5_digest": "71478b67d9ffa6b04307b9e124acee51", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11326, "upload_time": "2018-12-28T17:04:07", "url": "https://files.pythonhosted.org/packages/0a/e4/0676cdaecdbefef6d229a2a48e2faf0625345b003e2492fd20fae2c48e18/bno055_usb_stick_py-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "ee65b75b7458cc1675e94ceaf4b92aa3", "sha256": "9d2a88d9ef5b77c8f04a6aedc3f3c06dba2a33378b883915103ccb173a2cfbfd" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.9.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ee65b75b7458cc1675e94ceaf4b92aa3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11692, "upload_time": "2018-12-29T05:48:55", "url": "https://files.pythonhosted.org/packages/50/2b/b3e5d9eb5d958059496471abdb1b1f404a1dcf16aa21b3bf8d7e800112bd/bno055_usb_stick_py-0.9.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d6225bc2023c3cedddf2e368876cb7e5", "sha256": "cfa3f693d0c36690cff237314ff0e8fc2e79461e31d334138939314440e00eed" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.9.1.tar.gz", "has_sig": false, "md5_digest": "d6225bc2023c3cedddf2e368876cb7e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11426, "upload_time": "2018-12-29T05:48:57", "url": "https://files.pythonhosted.org/packages/48/e8/4056bd64a721b47451a27f7daa6c20512b2943524a4144f3c93bb3ee670a/bno055_usb_stick_py-0.9.1.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "162428a7f8f540225da884e16c042904", "sha256": "ce65756065076da48124b7b59844005b0f80f9d8aea8732faf82a9dbbdfe52b1" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.9.3-py3-none-any.whl", "has_sig": false, "md5_digest": "162428a7f8f540225da884e16c042904", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12484, "upload_time": "2018-12-29T16:54:04", "url": "https://files.pythonhosted.org/packages/7a/04/7d1665b0c6acd42cdab238302b1addfd985163bbb6e429693e29d7bff250/bno055_usb_stick_py-0.9.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "70159e6e5ba8878add6a9699dcdf2cff", "sha256": "1dc1a7ba91ea15e824223ad5da57c9f1e099f08719da786b31f7ce6c7b01487a" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.9.3.tar.gz", "has_sig": false, "md5_digest": "70159e6e5ba8878add6a9699dcdf2cff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11968, "upload_time": "2018-12-29T16:54:07", "url": "https://files.pythonhosted.org/packages/11/3b/8bfcf853f02665449ec18dbc57adf42990d30f4881467485edbeb6002e8c/bno055_usb_stick_py-0.9.3.tar.gz" } ], "0.9.5": [ { "comment_text": "", "digests": { "md5": "3e1fd5e658fe7bfe950fc187a59a7a53", "sha256": "c45211022bd65a34591477df96ed6966804a17444ad804ce3bb94f4d1afc1497" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.9.5-py3-none-any.whl", "has_sig": false, "md5_digest": "3e1fd5e658fe7bfe950fc187a59a7a53", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13015, "upload_time": "2018-12-30T14:25:56", "url": "https://files.pythonhosted.org/packages/74/3f/7446a988be7587bd99bbc25ba685fb259b8281ece9ec2f0d574ca85f0e66/bno055_usb_stick_py-0.9.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f09ce455b0978e676c5854845677ba86", "sha256": "c4e2322b47398c8016bb861676c3634c7ead939d440c89a83df91935c93a4769" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.9.5.tar.gz", "has_sig": false, "md5_digest": "f09ce455b0978e676c5854845677ba86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12980, "upload_time": "2018-12-30T14:25:59", "url": "https://files.pythonhosted.org/packages/2e/20/f96a49e6b224df3d95a5a5633b38f368712d4e29b8499b90a75f04c189cb/bno055_usb_stick_py-0.9.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3e1fd5e658fe7bfe950fc187a59a7a53", "sha256": "c45211022bd65a34591477df96ed6966804a17444ad804ce3bb94f4d1afc1497" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.9.5-py3-none-any.whl", "has_sig": false, "md5_digest": "3e1fd5e658fe7bfe950fc187a59a7a53", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13015, "upload_time": "2018-12-30T14:25:56", "url": "https://files.pythonhosted.org/packages/74/3f/7446a988be7587bd99bbc25ba685fb259b8281ece9ec2f0d574ca85f0e66/bno055_usb_stick_py-0.9.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f09ce455b0978e676c5854845677ba86", "sha256": "c4e2322b47398c8016bb861676c3634c7ead939d440c89a83df91935c93a4769" }, "downloads": -1, "filename": "bno055_usb_stick_py-0.9.5.tar.gz", "has_sig": false, "md5_digest": "f09ce455b0978e676c5854845677ba86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12980, "upload_time": "2018-12-30T14:25:59", "url": "https://files.pythonhosted.org/packages/2e/20/f96a49e6b224df3d95a5a5633b38f368712d4e29b8499b90a75f04c189cb/bno055_usb_stick_py-0.9.5.tar.gz" } ] }