Search found 8 matches

by JohnN
Fri Feb 21, 2020 10:10 pm
Forum: ESP32 boards
Topic: Reading GATT Data from Xiaomi Flower Care
Replies: 18
Views: 19172

Re: Reading GATT Data from Xiaomi Flower Care

Should I write some kind of ticket?
by JohnN
Mon Feb 17, 2020 7:26 am
Forum: ESP32 boards
Topic: Reading GATT Data from Xiaomi Flower Care
Replies: 18
Views: 19172

Re: Reading GATT Data from Xiaomi Flower Care

Hi Jimmo, I was using IDF 4.X. To make sure it was no spi problem I flashed https://micropython.org/resources/firmware/esp32-idf4-20191220-v1.12.bin to the board today and ran the same code mentioned above again with "import nexter" (the code is stored in nexter.py) and I get this error message: /py...
by JohnN
Sun Feb 16, 2020 9:56 pm
Forum: ESP32 boards
Topic: Reading GATT Data from Xiaomi Flower Care
Replies: 18
Views: 19172

Re: Reading GATT Data from Xiaomi Flower Care

Hi Jimmo, thanks for your reply, I did some further reading and it seems that I can use the service class ID . I tried to follow through checking the characteristics with this code: import time import bluetooth import binascii from micropython import const _IRQ_CENTRAL_CONNECT = const(1 << 0) _IRQ_C...
by JohnN
Sat Feb 15, 2020 2:26 pm
Forum: ESP32 boards
Topic: Reading GATT Data from Xiaomi Flower Care
Replies: 18
Views: 19172

Re: Reading GATT Data from Xiaomi Flower Care

Hi, it took me some time, but I looked into my two xiamo flower care and this is what I got back: 0 | c47c8d66d6d8 | b'\xc4|\x8df\xd6\xd8' | True | -34 | 020106030295fe151695fe7120980006d8d6668d7cc40d071003000000 0 | c47c8d66ddf0 | b'\xc4|\x8df\xdd\xf0' | True | -50 | 020106030295fe131695fe712098006...
by JohnN
Mon Jan 27, 2020 5:44 pm
Forum: ESP32 boards
Topic: Reading GATT Data from Xiaomi Flower Care
Replies: 18
Views: 19172

Re: Reading GATT Data from Xiaomi Flower Care

Hi Jimmo, thanks for your reply, I tried the ble.irq(handler=bt_irq) and now it seems to work! :-D import bluetooth import binascii from micropython import const _IRQ_SCAN_RESULT = const(1 << 4) _IRQ_SCAN_COMPLETE = const(1 << 5) def bt_irq(event, data): if event == _IRQ_SCAN_RESULT: addr_type, addr...
by JohnN
Sun Jan 26, 2020 9:39 am
Forum: ESP32 boards
Topic: Reading GATT Data from Xiaomi Flower Care
Replies: 18
Views: 19172

Re: Reading GATT Data from Xiaomi Flower Care

I assume once the script is done, everything is reset back to where it was. I have no prove but changing main.py to this: import network import time sta_if = network.WLAN(network.STA_IF) sta_if.active(True) sta_if.connect("SSID", "Password") time.sleep(10) with open("test.txt", "a") as myfile: myfil...
by JohnN
Sat Jan 25, 2020 11:25 am
Forum: ESP32 boards
Topic: Reading GATT Data from Xiaomi Flower Care
Replies: 18
Views: 19172

Reading GATT Data from Xiaomi Flower Care

Hi everonye, I wrote a little python script for my PC that reads the GATT information from a Xiaomi Flower Care with the bluez API on Linux. But it is very unreliable and not well written. I would usually just start the script and get the results printed to the shell. I bought two different esp32 to...