Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communicating between a computer and the hub via bluetooth #164

Closed
giadefa opened this issue Nov 10, 2020 · 7 comments
Closed

Communicating between a computer and the hub via bluetooth #164

giadefa opened this issue Nov 10, 2020 · 7 comments
Labels
platform: Powered Up Issues related to LEGO Powered Up support Request for technical support for a problem that is not a bug or feature request topic: bluetooth Issues involving bluetooth topic: communication Issues related to hub-to-hub/phone/computer communcation

Comments

@giadefa
Copy link

giadefa commented Nov 10, 2020

Is it possible to establish a communication between my computer and the HUB via bluetooth to send commands? At the moment bluetooth seems to be used only to transfer the python program into the hub and remotely start it. It does seem in theory possible to speak to the hub after the program has started but how? I have a spike hub and Control+ hub.

@laurensvalk laurensvalk transferred this issue from pybricks/pybricks-api Nov 10, 2020
@laurensvalk
Copy link
Member

With some effort, yes, this is already possible. It depends on what you are after. Can you elaborate on your use case?

establish a communication between my computer and the HUB via bluetooth to send commands

If I interpret this literally, #154 may be what you are after.

We also have a python library to interact with the hub. See also #156 for some hints. Is this closer to what you might need?

@laurensvalk laurensvalk added the support Request for technical support for a problem that is not a bug or feature request label Nov 10, 2020
@dlech dlech added platform: Powered Up Issues related to LEGO Powered Up topic: bluetooth Issues involving bluetooth labels Nov 10, 2020
@giadefa
Copy link
Author

giadefa commented Nov 10, 2020

I would like to send commands from a normal python3 environmnet under linux and receive back data from the hub, like motor encoder readings.

@giadefa
Copy link
Author

giadefa commented Nov 10, 2020

#156 seems to be ok to send commands but not to receive data if I read it correctly.

@laurensvalk
Copy link
Member

Everything that the hub prints is available to read using the hub.output property, so you could send data back that way.

The pybricksdev library is mainly something we’ve been using internally for development, so that’s why it’s not as well documented as the main Pybricks API. It sounds like more people are interested in this too though, so maybe we should document it.

@giadefa
Copy link
Author

giadefa commented Nov 10, 2020

Thanks and by the way pybrick is very nice. I was really happy to see it when it appeared.

@laurensvalk
Copy link
Member

Thanks! Looking forward to see what you’ll make.

Support for SPIKE Prime is around the corner as well.

@giadefa giadefa changed the title Communicating between a computer the hub via bluetooth Communicating between a computer and the hub via bluetooth Nov 10, 2020
@dlech dlech added the topic: communication Issues related to hub-to-hub/phone/computer communcation label Jan 19, 2021
@laurensvalk
Copy link
Member

This use case would be covered by scenario 1 in #262, which is in progress, so we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Powered Up Issues related to LEGO Powered Up support Request for technical support for a problem that is not a bug or feature request topic: bluetooth Issues involving bluetooth topic: communication Issues related to hub-to-hub/phone/computer communcation
Projects
None yet
Development

No branches or pull requests

3 participants