Skip to main content

OctoStudio

This Python library pass messages between Python and OctoStudio.

Specifically, it works with two blocks of OctoStudio:

  • beam to phones
  • wait for beam (work-in-progress)

Install

# Python >= 3.10
pip install octostudio

Usage

from octostudio import OctoStudio

def on_message(shape):
    print(shape)

octo = OctoStudio()
octo.on_message = on_message
octo.start()

For MicroBlocks users

This library was originally used to bridge OctoStudio's Bluetooth radio with MicroBlocks' wifi radio.

To do this you need to install this package, then run the command: octostudio-microblocks-bridge

Take a look at the inner workings.

For Scrarch users

Install dependencies:

pip install paho-mqtt octostudio

run the command: octostudio-scratch-bridge. Take a look at the inner workings.

Open the demo project

OctoStudio & Scratch demo video

Customize

octostudio-scratch-bridge uses the default MQTT broker and account. Other users may also be using it. If you want to use your own broker and account, you can run the following code instead of the default octostudio-scratch-bridge:

# custom octostudio-scratch-bridge
import paho.mqtt.client as mqtt
from octostudio import OctoStudio

mqtt_client = mqtt.Client()
# You can use other MQTT broker. If you want to use it with Scratch, make sure the MQTT broker supports wss protocol
mqtt_client.username_pw_set('guest', 'test')
mqtt_client.connect("mqtt.aimaker.space", 1883, 60)

def on_message(shape):
    mqtt_client.publish("octo_message", shape)
octo = OctoStudio()
octo.on_message = on_message
octo.start()

For Snap! users

Install dependencies:

pip install paho-mqtt octostudio

run the command: octostudio-snap-bridge. Take a look at the inner workings.

Open the demo project

FAQ

How to send a message to OctoStudio?

send a message to OctoStudio

I implemented this part directly in MicroBlocks instead of the bridge. I will update the relevant principles to this article soon.

Messages being delayed

Reference here: Maximum rate that advertisements can be scanned/read.

No solution found yet.

Related source code, looking forward to you improving it.

Metadata

Release files for octostudio 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for octostudio 0.4.2
File Size Uploaded Provenance Actions
octostudio-0.4.2.tar.gz 3.2 kB Without provenance Details for octostudio-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for octostudio 0.4.2
File Interpreter ABI Platform Actions
octostudio-0.4.2-py3-none-any.whl Python 3 none any Details for octostudio-0.4.2-py3-none-any.whl

Total release size: 7.9 kB

Release files / octostudio-0.4.2.tar.gz

Download URL octostudio-0.4.2.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c91eb5331c8d39a652be050c7fe6ebb7f375b0969db6456fc4385539323fb5b8
BLAKE2b-256 checksum
How to use checksums
f1ce30ace11b130ff57ddf199c86878e5ed25c6106d92b998ca8854d3d2dad11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.5 Darwin/22.5.0

Release files / octostudio-0.4.2-py3-none-any.whl

Download URL octostudio-0.4.2-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55e0eb44e24752dd217689bb2472b259e1c03e8e49b8ee5d8417ec36ba7311fe
BLAKE2b-256 checksum
How to use checksums
6c6e3799c91fe154349df3e7606d602d04087663d44baa37c4fed72cd92ac953
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.5 Darwin/22.5.0

Security for octostudio 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page