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

Add support for iGrill mini #81

Open
jesperldk opened this issue Feb 5, 2019 · 4 comments
Open

Add support for iGrill mini #81

jesperldk opened this issue Feb 5, 2019 · 4 comments

Comments

@jesperldk
Copy link

This device needs authentication, but it seems to have been hacked already: https://github.com/bjoernhoefer/igrill

I am ready to give it a try to make a GATT specification, but I am clueless on how to make the authentication.

@vkolotov
Copy link
Contributor

vkolotov commented Feb 5, 2019

Right, I had a quick look at the way how authentication works for that device.

Effectively that python scripts sends a bytes sequence to a specific characteristic, then receives response then encrypts the response and sends it back to the device. This obviously is not supported at the moment.

The binding can do basic authentication so called "pin code" authentication, this is the very first part of the process above. Obviously two next parts are missing (receiving response, encrypting and sending back to device).

This class is responsible for pin code authentication strategy: https://github.com/sputnikdev/bluetooth-manager/blob/master/src/main/java/org/sputnikdev/bluetooth/manager/auth/PinCodeAuthenticationProvider.java

It would not be very difficult to add another one for your device, however this will require some changes not only in the BT manager, but also in Gatt parser (to somehow specify characteristics that are responsible for receiving encrypted response) and the binding itself.

@jesperldk
Copy link
Author

Let me know how I can help. I can use a little time on it, and I do know Java. I do however unfortunately not have the time to spend days getting my way around all parts of you great binding, so if I should do anything it needs to be very directed - sorry about that.

By the way, have you seen this: https://medium.com/machine-learning-world/how-i-hacked-xiaomi-miband-2-to-control-it-from-linux-a5bd2f36d3ad
That guy apparently hacked the authentication for a Xiaomi Miband and got it running on linux. If you are adding support for more types of devices it might be an idea to review this. And it might work for other Xiaomi devices as well?? (I have some on order ;-)

@vkolotov
Copy link
Contributor

vkolotov commented Feb 5, 2019

Unfortunately I don't have much time too. Giving that this device is quite rare and have a little demand, I'd say this will take some time to make it working.

Thanks for pointing out to that article, looks interesting.

Normally xiaomi devices use some proprietary authentication protocol that requires some native libraries. Also they normally advertise data, so as a workaround for the xiaomi auth we just listen to their advertisements which is more than enough. Have a read here: https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding/blob/master/xiaomi.md#important-note-for-all-xiaomi-devices

@jesperldk
Copy link
Author

Thank you for your comments! I will return if I get the time later ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants