Comments (10)
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.
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.
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.
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.
Here's my repo: https://github.com/undera/pylegoboost
from boostreveng.
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.
No, this is my first attempt to do anything with Bluetooth.
Well, I can rename repo into pylgbst - will it help?
from boostreveng.
For me the name is fine. It's your project, you do what you want :)
from boostreveng.
Sure I understand I'm free. But your advice is highly appreciated.
from boostreveng.
I have renamed it, just in case: https://github.com/undera/pylgbst
from boostreveng.
Related Issues (19)
- Create a Slack for coordination HOT 5
- 6-axis tilt sensor HOT 2
- another way to program it directly with iPad or iPhone HOT 1
- Capture packets to figure out how to move a interactive motor to a precise angle HOT 6
- D = 02 HOT 3
- identify LEGO App blocks HOT 3
- Unable to make the app inventor example work HOT 4
- Slack invite link in readme.md not valid anymore HOT 5
- Command crib sheet with names
- Train motor AutoID/resistor? HOT 4
- BOOST Color and Distance Sensor info HOT 61
- BLE Advertising Data HOT 5
- Any possibility for LEGO App-Controlled Batmobile 76112? HOT 2
- BLE protocol changed
- gattlib not working HOT 3
- First byte in commands HOT 2
- Nodejs API HOT 2
- ColorSensors: Byte 2/3/4. HOT 93
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boostreveng.