Skip to main content

No project description provided

Project description

Crownstone UART

Official Python lib for Crownstone: "Crownstone Unified System Bridge", or Crownstone USB implementation.

This works on all platforms and requires a Crownstone USB to work.

Install guide

This module is written in Python 3 and needs Python 3.7 or higher. The reason for this is that most of the asynchronous processes use the embedded asyncio core library.

If you want to use python virtual environments, take a look at the README_VENV

You can install the package by pip:

pip3 install crownstone-uart

If you prefer the cutting edge (which may not always work!) or want to work on the library itself, use the setuptools: python3 setup.py install

Requirements for the Crownstone USB

OS X

OS X requires installation of the SiliconLabs driver: https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers

Ubuntu

In order to use serial without root access, you should be in the dialout group.

You can check if you're in the group:

$ groups

To add yourself:

$ sudo adduser $USER dialout

You may need to logout and login again.

Raspbian

Similar to Ubuntu.

Arch Linux

To use serial in Arch Linux, add yourself to the uucp group.

To add yourself to the group:

$ sudo gpasswd -a $USER uucp

Make sure to logout and login again to register the group change.

Example

An example is provided in the root of this repository.

Prerequisites

  • First use the phone app to setup your Crownstones and the Crownstone USB.
  • Make sure you update the Crownstones' firmware to at least 5.4.0.
  • Find out what port to use (e.g. COM1, /dev/ttyUSB0, or /dev/tty.SLAB_USBtoUART), use this to initialize the library.
  • Have this library installed.

Find the IDs of your Crownstones

Firstly run the example script that simply lists the IDs of the Crownstones.:

$ python3 ./examples/discovery_example.py

Once some IDs are printed, use one of them for the next example. This can take a while because Crownstones, if not switched, only broadcast their state every 60 seconds.

Switch a Crownstone, and show power usage.

Edit the file switch_example.py:

  • Set targetCrownstoneId to a Crownstone ID that was found in the previous example.

Run the file:

$ python3 ./examples/switch_example.py

API documentation

The API documentation can be found here.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crownstone-uart-2.4.1.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crownstone_uart-2.4.1-py3-none-any.whl (42.4 kB view details)

Uploaded Python 3

File details

Details for the file crownstone-uart-2.4.1.tar.gz.

File metadata

  • Download URL: crownstone-uart-2.4.1.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.9

File hashes

Hashes for crownstone-uart-2.4.1.tar.gz
Algorithm Hash digest
SHA256 b88f36e8bde460bf77e803263dc8c102224249591f83dbb9580784a00f297026
MD5 efec99960dc96d4dfd5c7b8a69f2332d
BLAKE2b-256 7ae17228dad02ce28c2dcd5cc144a3f409bd79a4f5e9389fa9ab6728d1351757

See more details on using hashes here.

File details

Details for the file crownstone_uart-2.4.1-py3-none-any.whl.

File metadata

  • Download URL: crownstone_uart-2.4.1-py3-none-any.whl
  • Upload date:
  • Size: 42.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.9

File hashes

Hashes for crownstone_uart-2.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1649921dde3e954b4eb011a8ace796460638227f1fbe9df8142a81c9a21cc073
MD5 8506d43211c0eaf5057020f65a502a1f
BLAKE2b-256 d9db1a0dabc6879fb9aed2e4589b81e9ebc7f41a5fd62b554d09d798c96a257f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page