-
-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Introduction
This issue gathers some ideas for Bluetooth and USB to help us keep track of the big picture while we work on low-level details.
Note that most of this won't be done any time soon (if ever). This is mainly intended to avoid implementation choices now which might come back to hurt us later. If you want us to prioritize this, please consider becoming a sponsor π .
Nomenclature
- The
code
in boxes is pseudocode for commands in user scripts. - Arrows: wireless or wired communication.
- Each color is a different service/characteristic which may or may not share a common connection.
1. Single-hub coding scenario
This is what we are working on today. We are working on a Pybricks BLE service to handle things like starting and stopping programs in a clean way. Standard I/O (print
/input
) may be a separate service or characteristic on the same connection.
Until now, both were handled on one and the same characteristic, which made it easy to mess up the connection by sending the wrong characters.
Cleaning this up and documenting it also paves the way for other editors or extensions to support Pybricks.
This is the only use case we will target for the upcoming v3.0 release. That is likely also the last release for Move Hub; it won't have enough space for the other features listed below.
2. Multi-hub coding scenario
This might work as above, but there are many elements still missing such as:
- Distinguishing hubs (e.g. by name or color)
- Multiple Pybricks Code instances (e.g. tabs or windows)
3a. Multi-hub communication scenario
This is still to be explored. At the basic level, there might be serial i/o streams between hubs that could be used with standard MicroPython tools. Higher level abstractions such as mailboxes could be added on top of these later.
3b. Other BLE UART devices
This is really the same as above, but worth showing in a separate diagram because this really opens up interesting possibilities.
4. BLE HID Peripherals
We may support connecting to generic HID devices over BLE (and possibly classic). Users could build on this to add specific mappings for certain devices like popular gaming consoles.
5. Bluetooth classic scenario
This is only available on Prime Hub and Inventor Hub. Therefore, we will not use Bluetooth classic for any system purposes. So, you won't be able to download and run programs with it.
Rather, it might be used within end-user scripts. For example, you might set up a generic RFCOMM connection with a server or client. This could be another Prime Hub, an EV3 Brick, a laptop, and so on.
6. LEGO Powered Up Remote
See #186.
7. USB scenario
This is only available on Prime Hub and Inventor Hub. Therefore, we will probably not use USB for system purposes. So, you probably won't be able to download and run programs with it. USB will be used primarily for charging the hub. We may re-enable REPL over USB if users want this. Since REPL is treated as a regular program, we'd have to define a way to start and stop it. Perhaps USB can also be used for fast(er) file transfer.