Skip to main content

Python API for working with Wonder Workshop robots

Project description

WonderPy

Build status

This is an alpha-status project to bring realtime control of the WonderWorkshop robots to Python.
To get the most out of this, you should already have a beginner-level comfort with python and the command-line.

Project Status

At an "Alpha" release. It's ready to be tried out by folks who are willing to live with a few more rough-edges than one would want, and ideally who can provide constructive criticism.

Please see the "Issues" in github for an up-to-date list of known bugs and to-do items.

Setup

Prerequisites

  1. MacOS
  2. Familiarity with python and command-line tools

Create a new python virtual environment

  1. virtualenv --python=/usr/bin/python2.7 --no-site-packages venv
  2. source venv/bin/activate

Install dependencies

Unfortunately the AdaFruit BTLE package is not hosted on PyPi, which makes it difficult to automatically install when this package is installed via pip. Additionally, this project requires a fork of that project by WonderWorkshop, which as of this writing has not been merged back into the main project.

  1. pip install git+git://github.com/playi/Adafruit_Python_BluefruitLE@928669a#egg=Adafruit_BluefruitLE

Install WonderPy

pip install WonderPy

Documentation

Documentation is still also in Alpha stage.

Getting Started

The steps above install the core library.
There are many examples of using it separately in the github repository playi/WonderPyExamples.
It is highly recommended to look at those examples.

To test basic functionality, run these at the command-line, inside your fresh virtualenv:

download the "01_hello_world.py" tutorial example:
curl -o 01_hello_world.py https://raw.githubusercontent.com/playi/WonderPyExamples/master/tutorial/01_hello_world.py

run it:
python 01_hello_world.py

It should connect to any nearby robot and say hello !

Robot Connection Options

Upon launching any of the examples, the app will scan for robots for at least 5 and at most 20 seconds. After scanning, whichever robot had the highest signal strength (RSSI) will be connected to. This is a reasonable approximation of connecting to the closest robot.

Connection Options:

[--connect-type cue | dot | dash]
  filter for robots of the specified type/s

[--connect-name MY_ROBOT | MY_OTHER_ROBOT | ...]
  filter for robots with the specified name/s

[--connect-eager]
  connect as soon as a qualified robot is discovered.  
  do not wait the full scanning period.
  if there are more than one robot with matching criteria,
  the one with the best signal is still selected

[--connect-ask]  
  show a list of available robots, and interactively ask for input.
  indicates which has the highest signal strength.

Connection Examples:

  • Spend 5 seconds looking for all Cue and Dash robots which are named either "sammy" or "sally", and connect to the one with the best signal strength:
    python demos/roboFun.py --connect-type cue dash --connect-name sammy blippy sally

  • Connect ASAP to any robot named 'orions robot', no matter what type of robot it is.
    python demos/roboFun.py --connect-eager --connect-name "orions robot"

Known Issues and To-Do's

Please see the "Issues" in github for an up-to-date list of known bugs and to-do items.
As of this writing, the open issues are:

  • Only works with a single robot.
  • Only works with Python2.7.
    The limiting factor here is getting the AdaFruit BTLE package to run under Python3. There's evidence this is possible.
  • Once under Python3, update the concurrency model.
  • Flesh-out inline documentation.
  • Make the pip installation more standard. Currently this requires a manual install of a github-based fork of the AdaFruit package.
  • Port to Windows, Linux

Contribute

Please check the list of issues and todo's at the WonderPy repository on github.
Pull-Requests are welcome.
Feature requests for the API should also be sent as a new Issue in github.

Get Help

Report Bugs

If there's a specific bug or problem with the API, please check the outstanding issues in github and if it's not already covered, create a new one.

Ask for Advice

If you have a more general question such as "how would I approach doing .." or you have a tip you'd like to share, please visit stackoverflow and be sure to tag your post with wonderworkshop.

Sharing your work ?

Got a great picture or video ?
If you're sharing your Dash, Dot or Cue work on Twitter or Instagram, remember to tag @WonderWorkshop !

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

WonderPy-0.0.13.tar.gz (483.1 kB view details)

Uploaded Source

Built Distribution

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

WonderPy-0.0.13-py2-none-any.whl (497.4 kB view details)

Uploaded Python 2

File details

Details for the file WonderPy-0.0.13.tar.gz.

File metadata

  • Download URL: WonderPy-0.0.13.tar.gz
  • Upload date:
  • Size: 483.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.10

File hashes

Hashes for WonderPy-0.0.13.tar.gz
Algorithm Hash digest
SHA256 7d53a909b32f338b8d03edebf2ba4a37f2590294aaa4ce89f20cbd8c8a6c8468
MD5 57dfc228abd401db6904d510274e3176
BLAKE2b-256 e23202621bde3329cd4a2022ac4759f438a676bfabd3ec8439bb8bb6126adbcc

See more details on using hashes here.

File details

Details for the file WonderPy-0.0.13-py2-none-any.whl.

File metadata

  • Download URL: WonderPy-0.0.13-py2-none-any.whl
  • Upload date:
  • Size: 497.4 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.10

File hashes

Hashes for WonderPy-0.0.13-py2-none-any.whl
Algorithm Hash digest
SHA256 1ec80a7855ea7567ab71d0f62bb1ec4b140f7dfe7eb8f1b974630b4796015575
MD5 52dc55bc1f40b5a2c08b75c9a88170f9
BLAKE2b-256 3e2551b79d1fea72d09c5d78eb36420a5c2150a0d46a73e7d2dd8347bafb69fd

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