All Projects → EnotYoyo → pysphero

EnotYoyo / pysphero

Licence: MIT license
Unofficial Sphero V2 api for bluetooth low energy toys

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pysphero

spherov2.js
Unofficial Sphero V2 api for new toys like Sphero Mini, Lighting McQueen
Stars: ✭ 81 (+161.29%)
Mutual labels:  sphero, mini
spherov2.py
Unofficial Python API for all Sphero toys
Stars: ✭ 36 (+16.13%)
Mutual labels:  ble, sphero
homekit
HomeKit Accessory Protocol implementation for embedded Rust
Stars: ✭ 23 (-25.81%)
Mutual labels:  ble
sblendid
A JavaScript Bluetooth Low Energy (BLE) Library
Stars: ✭ 60 (+93.55%)
Mutual labels:  ble
path planning GAN
Path Planning using Generative Adversarial Network (GAN)
Stars: ✭ 36 (+16.13%)
Mutual labels:  ble
deneyapkart-arduino-core
Arduino Core for Deneyap DevKits
Stars: ✭ 39 (+25.81%)
Mutual labels:  ble
freebird
No description or website provided.
Stars: ✭ 21 (-32.26%)
Mutual labels:  ble
BleDemo
Android 蓝牙BLE
Stars: ✭ 12 (-61.29%)
Mutual labels:  ble
Tasmota-specials
Tasmota unofficial firmware builds. Install via Tasmota WebInstaller
Stars: ✭ 54 (+74.19%)
Mutual labels:  ble
decoder
Efficient, portable and lightweight library for Internet of Things payload decoding.
Stars: ✭ 59 (+90.32%)
Mutual labels:  ble
Gormsson
Harald "Bluetooth" Gormsson was a king of Denmark and Norway.
Stars: ✭ 25 (-19.35%)
Mutual labels:  ble
Gesture-Detecting-Macro-Keyboard
Glorified Bluetooth macro keyboard with machine learning (TensorFlow Lite for Microcontrollers) running on an ESP32.
Stars: ✭ 68 (+119.35%)
Mutual labels:  ble
EUC-Dash-ESP32
Bluetooth Dashboard for electric unicycles (EUCs) for ESP32(ttgo t-watch). requires PlatformIO to build
Stars: ✭ 24 (-22.58%)
Mutual labels:  ble
BLE SDK6 examples
Examples for the Dialog Smartbond Bluetooth low energy families based on the SDK6
Stars: ✭ 38 (+22.58%)
Mutual labels:  ble
OGMNeo
[No Maintenance] Neo4j nodeJS OGM(object-graph mapping) abstraction layer
Stars: ✭ 54 (+74.19%)
Mutual labels:  bolt
daydream-node
Quick Node.js module to connect to the Daydream controller and receive all the data
Stars: ✭ 17 (-45.16%)
Mutual labels:  ble
USBNinja-android
USBNinja Android Remote Control Application
Stars: ✭ 22 (-29.03%)
Mutual labels:  ble
ble2mqtt
Bluetooth to MQTT bridge, add your bluetooth-capable (including controllable) devices to your smart home
Stars: ✭ 46 (+48.39%)
Mutual labels:  ble
IOS-Nordic-Thingy
iOS Library and example application for Thingy:52™
Stars: ✭ 60 (+93.55%)
Mutual labels:  ble
balena-locating
Never lose something important to you again by using Bluetooth Low Energy (BLE) beacons and Raspberry Pi sensors to track your stuff.
Stars: ✭ 47 (+51.61%)
Mutual labels:  ble

PySphero

PyPI - Python Version Build Status

This is an unofficial Sphero library for BLE toys.
The Sphero protocol is reverse-engineered using the official Sphero Edu application for Android and this library.

This code is tested only on Sphero Bolt. Probably it will work on the other BLE toys too.

Install the dependencies

For using this library need bluepy and libgtk2.0-dev.

# apt-get install libgtk2.0-dev
# pip install bluepy

# To use gatt BT stack, install it manually
# pip install gatt

# To use bled112 dongle, pygatt for BGAPI is supported
# To use pygatt BT stack, install it manually
# pip install pygatt

Install

To install pysphero use pip:

# pip install pysphero

Example

from time import sleep

from pysphero.utils import toy_scanner


def main():
    with toy_scanner() as sphero:
        sphero.power.wake()
        sleep(2)
        sphero.power.enter_soft_sleep()


if __name__ == '__main__':
    main()

Tips

While using gatt, if you are facing connection issues

# Connection failed: Device does not exist, check adapter name and MAC address.

You must check if your BLE device is known on your system list (thanks to bluez-tools).

# bt-device -l

If not, used bluetoothctl to do so.

sudo bluetoothctl
Agent registered
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# scan on
[CHG] Controller AB:CD:EF:12:34:56 Discovering: yes
[NEW] Device 12:34:56:78:90:AB (your Sphero toy)
[bluetooth]# exit

BLE device list must have been populated

Unknown

Packet contains sourceID and targetID. Their meaning is unknown.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].