Jump to content
THIS IS THE TEST SITE OF EUROBRICKS!
THIS IS THE TEST SITE OF EUROBRICKS!

Featured Replies

Posted

Hello everyone! I'm new to the forum. After some research (fruitless I might add) I decided to post my question here. I am in the process of building an AI controlled crawler. My goal is to build a "Mars Rover" type of vehicle controlled by an AI that would be capable of moving by itself over terrain and also go up and down the stairs of our house or chase my daughter (or birds) around the back yard. 

Before you all call me crazy the AI part is the easy part for me given that I work in deep learning AIs (both genetic and trained) for work and image recognition is stupid easy if you know how to do it :) I've been doing this stuff for decades so that's not the question.

The question is: I have 3 Buwizz batteries that so far I controlled through the App. All good and great but now I want to be able to have the AI running on the Raspberry PI (cluster ... there's more than one running different processes in parallel) to communicate directly to the batteries. 

I got as far as getting everything set up, connect to the BuWizz bluetooth system, I can get the characteristics and handles and descriptors listed out. I can read all the readable characteristics and I've identified what looks like 2 potential writable characteristics in the API but when I write to them nothing happens. I followed a post from someone from 2017 where he suggested that handle 0x0012 is the handle for the engine controls and that posting data in the form of 5 bytes structured like this: 

 

+--------+--------+--------+--------+--------+
|1aaaaaaa|0bbbbbbb|0ccccccc|0ddddddd|0pp00000|
+--------+--------+--------+--------+--------+


Where a, b, c and d are 7-bit signed integers for the port output level, and p is the overall power level.

char-write-req 0x0012 80003f0040

so sending those codes either through python or the gatttool doesn't do anything and I'm at a dead end right now.

So I'm thinking that perhaps in the last 3 years the protocol has changed ... 

Has anyone being able to successfully send instructions directly to the battery? is anyone aware of a way to do that? even if it implies perhaps using their app? I can't find an avilable SDK to code against unfortunately and every documented experiment or example is quite old. 

does anyone have any more recent examples of attempts to communicate through the BuWizz BLE API?

Thanks!

I can't help with that, but I'm curious about it. Did you try to contact the guys who made the Buwizz?

  • Author

I did. For someone as smart as I think I am I'm pretty dumb actually. And clearly I didn't find everything in my research ... doh.

BuWizz support responded immediately (THANK YOU BuWizz!!) and redirected me to this: 

BuWizz Android Demo

and if you look into the commands classes you'll see how to properly build the codes. 

So transmitting: 

107f7f7f7f00

on characteristic 000092d1-0000-1000-8000-00805f9b34fb of service 4e050000-74fb-4481-88b3-9919b1676e93

and then immediately followed by another hex code:

1140

will get that little sucker spinning like it's running for its life.

Scared the living poop out of me too because I didn't expect it to jump that hard ... it's been quiet for days and now I don't know how to make it stop! lol

I'm cleaning up my python code and then I'll post it here in full once it's in a presentable state. but yes, I got it to work!!!

This is AWESOME!

  • Author
3 minutes ago, imurvai said:

Hi, I reverse engineered the BLE protocol for BuWizz and put it here: https://github.com/imurvai/brickcontroller2/blob/master/BuWizz_protocol.md

AAAHHH!!!! I found the documentation and tried the interface for BuWizz V1 and didn't work.

I guess I have V2 since I bought them very recently ... V2 is the one that worked for me.

Thanks for sharing! That's really good stuff!!!

  • 3 months later...

Your project looks fantastic!! I am interested in using a RPi 3 as you did to control a BuWizz V2 but I have no idea where to start. I control a "Brixo" lego smartbrick using bluetooth and python but it is very easy since there is a python library that I can directly use and an example program. I do not see anything similar for BuWizz. Could you share part of your program so I can imagine how to try it? 

I did the same thing but not with A.I., just merging GPIO/i2C sensors a web-service + lego technic engines in a vehicles using buwizz and BLE.

I had a raspberry pi 3A (so no ML on that hardware ^^, maybe tensorflow lite ) in the lego technic vehicle with a lipo battery for the pi. The pi was connected to my 2 buwizz, using the protocol @imurvai reverse engineered. 

At the time I wanted to train and poc around Node.js so did the vehicle using it, it was more powerful than I thought, Google V8 engine is amazing, but the JS BLE library was not good. I could try and find the code if you need, you have all the characteristics etc, but the github link post here has absolutely everything you need normally !

Will upgrade the vehicle once Buwizz 3.0 is out, with Python3 and maybe some AI this time :). 

According to @Zerobricks they plan to release the BLE protocol/characteristics for Buwizz 3.0, so hopefully no reverse-engineering will be needed, especially since this time there are way more functionalities.
 

Edited by sephiroth117

  • 3 years later...

Has any tried these protocols with the clones. I have a couple of them and want to use them for running trains. I got one Buwizz I am waiting on shipping. I was hoping to get them all working together and using pybricks for the coding. I would be surprised if the clones where just a direct knock off including protocols. I feel like the knock are lazy copies so I don't think they put much effort in writing new firmware BLE protocols. 

  • 3 months later...

Hi, I am currently working on a project. In this project I am trying to recreate a harbor where I have several buwizz 3.0 blocks. I want to control this via a Raspberry Pi 4. I want to use C# for this, ultimately I want to build a web interface in .NET to control this. Can anyone help me with this because I can't find much about it myself.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.
Sponsored Links