kvantetore / igrill

Hacking the iGrill mini
MIT License
28 stars 74 forks source link

Igrill2 with Raspberry Pi #3

Closed brettroyer closed 7 years ago

brettroyer commented 8 years ago

Maybe someone can give me a hand here. I've got an igrill2 I'm trying to use with this library using an raspberry pi. Following the instructions above, I did decompile the idevices's app apk file I found in the web and did find the .plist files under the assets/device/igrill_bundle directory. Although I can sorta follow along were you found the UUID's for firmware, etc. I still can't figure out how you determined the encryption key. Please point me in the right direction.

Note: using the Pi, I am able to see the igrill to and obtain its MAC address. I did plug that into the library.

kvantetore commented 7 years ago

I don't remember exactly where I found the keys. It was a const somewhere in the decompiled java sources.

bjoernhoefer commented 7 years ago

Hi, I ran into the same problem - with the same hardware....

At least I could find out where the keys reside: small/com/igrill/weber/igrill/igrill/iGrillMini.smali - starting in line 128 ".method public getEncryptionKey()" there's an array, which exactly matches your keys... sadly - so I don't know why my igrill2 is still not working :-(

According to my dmesg I've got a http://www.csr.com/products/bluecore-csr8510-a10-wlcsp attached to my raspberry pi

Do you have any ideas what could be wrong?

When I'm starting python main.py I only get Creating Scanner Connecting to InfluxDB server Scanning... Persisting... Scanning... Persisting... Scanning...

and that keeps running till infinity... the settings in main.py are changed accordingly...

hcitool lescan reports my iGrillv2 (and awful lot Samsung TVs...) D4:81:CA:23:67:A1 iGrill_V2

and hcitool dev Devices: hci0 00:1A:7D:DA:71:13

so my main.py device section looks like this: device_settings = { "D4:81:CA:23:67:A1": { "device": "iGrill_V2", "addr": "D4:81:CA:23:67:A1", "type": "kitchen" }, "00:1A:7D:DA:71:13": { "device": "raspi", "addr": "00:1A:7D:DA:71:13", "type": "ambient" } } which should be fine but nothing happens...

The "Hardware" seems also pretty fine as the onboard LED of the USB-Adapter is starting, as soon as I fire up the script...

The igrill2 also works properly if I connect it to my smartphone, it works like it should reporting me the temperatures...

Any idea how this could be solved? Any hints how I could troubleshoot more?

I'm already trying to dig into the code - but as I'm not the best programmer, maybe you could support me a bit with this problem...

Looking through the code, I think the problem relies in the tokencube.py, as you measure things like pressure, orienatation and stuff like this (??) - i'm a bit confused...

Sorry for bugging you and thanks in advance for any kind of help

bjoern

brianjmurrell commented 6 years ago

Why did this get closed? I don't see how or where @brettroyer's problem was actually solved.

I have an iGrill2 also and I can't seem to get past the Creating Scanner Connecting to InfluxDB server Scanning... Persisting... Scanning... Persisting... Scanning... loop either.

brettroyer commented 6 years ago

Check out this fork: https://github.com/onlywade/igrill

  1. Copy the IGrillV2Peripheral class from iGrill.py
  2. Per the notes in the iGrill.py

    if no bonding exists, so please use bluetoothctl to create a bond first

Use bluetoothctl trust command on iGrill device.

I believe that’s all I did to get it to working. I’m interested in any code you come up with so please share :).

bjoernhoefer commented 6 years ago

Nice clue - I'll give it a try hopefully this weekend... or later... at least somebody with a working iGrillV2 is here....

If I can bypass the app-workaround I would be veeeeery happy...

To start the app you just fire up monitor_igrill_v2.py ?

Cheers

PS: If I get it working I will add some mqtt support :-)

bjoernhoefer commented 6 years ago

Your fork works like a charm...

Maybe the next days I'll provide you my MQTT addons...

brettroyer commented 6 years ago

On a fresh Raspberry Pi Install, I performed the following to get this code to work - Minus the database portion.

Install bluez using these instructions. Install version 5.29 instead of the version listed. https://learn.adafruit.com/install-bluez-on-the-raspberry-pi/installation a. Download - wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.29.tar.xz b. Extract - tar xvf bluez-5.29.tar.xz c. Browse - cd bluez-5.29 d. sudo apt-get update e. sudo apt-get install -y libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev f. ./configure g. make h. sudo make install i. bluetoothctl -v

After bluez is installed, source installed bluepy0.9.11.

a. Download - wget https://github.com/IanHarvey/bluepy/tarball/v/0.9.11.tar.xz b. Extract - tar xvf 0.9.11 c. Browse - cd 0.9.11 d. sudo python setup.py build e. sudo python setup.py install

Note: If you try to install bluepy0.9.11 before installing bluez, the install will error out.