Giter VIP home page Giter VIP logo

Comments (10)

JorgePe avatar JorgePe commented on July 26, 2024

I am goind to write some python examples in athe next 2 days but I'm no programmer so I'm not the best person to write an API.
But it's quite easy to create a python package.
As I wrote, I use pybluez and gatttlib. There are other libraries but these were the first that I could use in ev3dev and are already included with it. I wrote a short tutorial on how to use ev3dev to talk with WeDo 2.0, if you want to understand the basics:
http://www.ev3dev.org/docs/tutorials/controlling-wedo2-motor/

Please understand that I'm reverse engineering the BOOST and writing short examples at the same time. A small background on BT BLE is needed if you want to use my information on your own right now. For example, I tend to use handles in my code, it's easier. But handles can change whenever the firmware changes so a good practice is to scan your device, read all uuids and get the handle for the uuid you want to use.
Also we can not assume that because today everything is at the same handle it will also be like that in the future - it can be split by several handles (like the WeDo 2.0). A good API will have to take that in consideration to prevent a total failure whenever LEGO updates the firmware.

from boostreveng.

JorgePe avatar JorgePe commented on July 26, 2024

I already started a python package.
Still polishing some things (byte manipulation) but hope in a few to days to have something for controlling motors and RGB LED.
Sensors will follow later but I'm facing crashes when receiving notifications, I might need to upgrade my BlueZ stack or open an issue and hope for a pygattlib patch.

from boostreveng.

undera avatar undera commented on July 26, 2024

I took existing python examples and managed to make them work. That's positive experience.
I am python dev, and I think I'd make python part of it in slightly different way. Maybe I'll experiment on making my own python lib.
The thing I really miss is good explanation of wire protocol. Not always clear how to form commands, from the existing docs. Maybe I'll ask some questions later, hope somebody will help me.

Anyway this is awesome project and I wanted to say words of appreciation to its authors!

from boostreveng.

JorgePe avatar JorgePe commented on July 26, 2024

Thanks! Great that you could manage to use the examples.

As I stated, I'm not really a programmer. Other people have joined the project and they do have a much better programming background/skills/whatever than my self and even started their own projects, that was one of the main ideas when this project started and I'm very happy that several people have made good use of it.

You're right , the protocol lacks a good explanation. Things have gone quite fast lately and last two weeks it has been impossible for me to keep up with all the information updates. Will try soon. But please note that until LEGO releases an official SDK there will be some dark parts - some commands were found by pure luck, like the WeDo 2.0 motor.

Even with a SDK, I feel that we will still be missing something. The WeDo 2.0 SDK doesn't properly document this new Power Functions 2.0 devices (WeDo 2.0 and BOOST... and probably something more still to be released).

if by any chance you start your own python library please give us a link so we can add to the README file (if you don't mind, of course). People will surely benefit if they have a better option than my library (which, by the way, is being target for my MINDSTORMS EV3 and Raspberry Pi's).

from boostreveng.

undera avatar undera commented on July 26, 2024

Here's my repo: https://github.com/undera/pylegoboost

from boostreveng.

JorgePe avatar JorgePe commented on July 26, 2024

Added.
Be careful with the name... LEGO has some tough policies related to it's name and trademarks. Might not matter for a small open source project but if you ever make success and try to go to market they will come after you :)

Another BLE library based on BlueZ... have you used it before? I wonder if t works well on low power armel like the EV3.

from boostreveng.

undera avatar undera commented on July 26, 2024

No, this is my first attempt to do anything with Bluetooth.

Well, I can rename repo into pylgbst - will it help?

from boostreveng.

JorgePe avatar JorgePe commented on July 26, 2024

For me the name is fine. It's your project, you do what you want :)

from boostreveng.

undera avatar undera commented on July 26, 2024

Sure I understand I'm free. But your advice is highly appreciated.

from boostreveng.

undera avatar undera commented on July 26, 2024

I have renamed it, just in case: https://github.com/undera/pylgbst

from boostreveng.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.