Page 11 of 17
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 04 April 2017 0:15
by Coldman
devros wrote:i have problems with Mi Flora, sensor works only when is really near with script (1-2m) and event then reading is often with timeout,
but when is about 5 meters and one window
but with hcitool lescan is visible
Code: Select all
LE Scan ...
C4:7C:8D:61:B4:DA (unknown)
C4:7C:8D:61:B4:DA Flower mate
any idea what wrong, is really BE really so poor with signal?
tried to check singal, but dunno what numbers to check
Code: Select all
> HCI Event: LE Meta Event (0x3e) plen 35 [hci0] 115.727966
LE Advertising Report (0x02)
Num reports: 1
Event type: Connectable undirected - ADV_IND (0x00)
Address type: Public (0x00)
Address: C4:7C:8D:61:B4:DA (OUI C4-7C-8D)
Data length: 23
Flags: 0x06
C4:7C:8D:61:B4:DA Flower mate
LE General Discoverable Mode
BR/EDR Not Supported
16-bit Service UUIDs (partial): 1 entry
Xiaomi Inc. (0xfe95)
Service Data (UUID 0xfe95): 3102980006dab4618d7cc40d
RSSI: -77 dBm (0xb3)
Code: Select all
[bluetooth]# scan on
Discovery started
[CHG] Controller 34:C3:D2:E4:13:E3 Discovering: yes
[CHG] Device C4:7C:8D:61:F7:83 RSSI: -78
[CHG] Device C4:7C:8D:60:F5:2A RSSI: -82
[CHG] Device C4:7C:8D:61:B2:D2 RSSI: -86
[CHG] Device C4:7C:8D:60:96:75 RSSI: -76
[CHG] Device C4:7C:8D:60:84:99 RSSI: -84
[CHG] Device C4:7C:8D:61:5F:4D RSSI: -86
[CHG] Device C4:7C:8D:60:84:8F RSSI: -74
[CHG] Device C4:7C:8D:61:B6:52 RSSI: -74
[CHG] Device C4:7C:8D:61:B6:62 RSSI: -70
[CHG] Device C4:7C:8D:61:9A:01 RSSI: -92
3-5 meters, connect is ok
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 04 April 2017 0:31
by devros
found that BE Mi Flora works only when i restart machine on first try....., on second try i have
connect: No route to host (113)
so its some BE problem machine
EDIT: ok it was problem with old Bluetooth daemon, upgraded to 5.44 version and it works now
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 04 April 2017 6:37
by tontze
RSSI is the one to check, lower rssi = better signal, sort of. It still doesnt tell quality of the connection. Connection might be poor, even when signal is strong.
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 04 April 2017 6:38
by tontze
devros wrote:found that BE Mi Flora works only when i restart machine on first try....., on second try i have
connect: No route to host (113)
so its some BE problem machine
EDIT: ok it was problem with old Bluetooth daemon, upgraded to 5.44 version and it works now
works wit longer distance too ?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 04 April 2017 11:58
by devros
tontze wrote:devros wrote:found that BE Mi Flora works only when i restart machine on first try....., on second try i have
connect: No route to host (113)
so its some BE problem machine
EDIT: ok it was problem with old Bluetooth daemon, upgraded to 5.44 version and it works now
works wit longer distance too ?
Yup miflora is still on same place and sensor now works....
Code: Select all
connect: Device or resource busy (16)
Mi Flora: C4:7C:8D:61:B4:DA
Firmware: 2.6.2
connect: Device or resource busy (16)
edit: noticed that its not 100% ok sometimes its not working (weird is thas when i run hcitool lescan before script it works almost everytime)
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 04 April 2017 12:36
by Coldman
devros wrote:tontze wrote:devros wrote:found that BE Mi Flora works only when i restart machine on first try....., on second try i have
connect: No route to host (113)
so its some BE problem machine
EDIT: ok it was problem with old Bluetooth daemon, upgraded to 5.44 version and it works now
works wit longer distance too ?
Yup miflora is still on same place and sensor now works....
Code: Select all
connect: Device or resource busy (16)
Mi Flora: C4:7C:8D:61:B4:DA
Firmware: 2.6.2
connect: Device or resource busy (16)
edit: noticed that its not 100% ok sometimes its not working (weird is thas when i run hcitool lescan before script it works almost everytime)
if you use App Flower Care on your phone, you should close it!
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 04 April 2017 13:49
by devros
Coldman wrote:devros wrote:tontze wrote:
works wit longer distance too ?
Yup miflora is still on same place and sensor now works....
Code: Select all
connect: Device or resource busy (16)
Mi Flora: C4:7C:8D:61:B4:DA
Firmware: 2.6.2
connect: Device or resource busy (16)
edit: noticed that its not 100% ok sometimes its not working (weird is thas when i run hcitool lescan before script it works almost everytime)
if you use App Flower Care on your phone, you should close it!
i only closed app and disabled bluetooth, or i have to unpair device somehow ?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 04 April 2017 18:56
by Coldman
devros wrote:Coldman wrote:devros wrote:
Yup miflora is still on same place and sensor now works....
Code: Select all
connect: Device or resource busy (16)
Mi Flora: C4:7C:8D:61:B4:DA
Firmware: 2.6.2
connect: Device or resource busy (16)
edit: noticed that its not 100% ok sometimes its not working (weird is thas when i run hcitool lescan before script it works almost everytime)
if you use App Flower Care on your phone, you should close it!
i only closed app and disabled bluetooth, or i have to unpair device somehow ?
With the last and the penultimate firmware you do not need to pair Bluetooth, there is working perfectly without pairing
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Thursday 06 April 2017 23:25
by dakipro
how does one upgrade to 5.44 after having installed 5.43?
Is it just running
cd /home/pi
wget
http://www.kernel.org/pub/linux/bluetooth/bluez-5.44.tar.gz
tar -xvf bluez-5.4
4.tar.gz
cd bluez-5.4
4
sudo ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-tools --disable-test --disable-systemd
sudo make all
and then
export PATH=$PATH:~/bluez-5.44/attrib/
?
As last time I tried to copy gatttool from 5.44 i got cp: cannot stat 'attrib/gatttool': No such file or directory
Problem is that everything worked fine when I installed the script, and some time after that, but then it sort of stopped. Now if I run script manually I do get some values first time (but I do not see light signal on the flora as I did when I first tested).
But second time I try to manually pull values, I get
osmc@kodi:~/bluez-5.44$ /usr/bin/python3 /home/osmc/miflora/domoticz.py
21: ()
Mi Flora: C4:7C:8D:62:00:EC
connect error: Function not implemented (38)
connect error: Transport endpoint is not connected (107)
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Thursday 06 April 2017 23:29
by dakipro
And now I tested few more times, and it seems to work... Strange...
Distance between the flora and pi is 4m without obstacles (i tried from 20cm distance, but received also sometimes confused responses)
(bluetooth on phone is turned off, app connects fine each time and gets historical data fine)
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Thursday 06 April 2017 23:32
by Coldman
dakipro wrote:And now I tested few more times, and it seems to work... Strange...
Distance between the flora and pi is 4m without obstacles (i tried from 20cm distance, but received also sometimes confused responses)
(bluetooth on phone is turned off, app connects fine each time and gets historical data fine)
RPi2+USB BT dongle?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Thursday 06 April 2017 23:41
by Szwuntex
dakipro wrote:how does one upgrade to 5.44 after having installed 5.43?
As last time I tried to copy gatttool from 5.44 i got cp: cannot stat 'attrib/gatttool': No such file or directory
Is Gatttool included in 5.44? I had to go for 5.43 to get Gatttool.
Why do you want to upgrade to 5.44?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Friday 07 April 2017 18:34
by madrian
Update: after the new update Mi Home on iOs the flower monitor is now successfully connecting. Yeah!
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Saturday 08 April 2017 20:50
by dakipro
Well I was having problems with connecting to the Flora (connect error: Transport endpoint is not connected (107) - see previous post for details), so I was under impression that 5.44 fixed this and wanted to update.
But now I see that everything works fine on my raspberry Pi 3 (onboard bluetooth, wifi not active on the board if that matters)
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Tuesday 11 April 2017 14:36
by woodtrix
I've been looking into the region ban,
It seems there camera are also effected, but blocking a couple of dns hosts works to bypass it, maybe it also works for the miflora app.
https://github.com/fritz-smh/yi-hack/is ... -219249830
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 12 April 2017 20:18
by Jumper3126
Found a way to connect the "mainland china" sensors to your iphone. You need a jailbreak for it though.
I used "cover my ass" VPN to get an IP address in beijing (free first week). then used Cydia app "protect my privacy" to fake that I'm actually in China.
So, the plant sensor only checks your location at the moment of registering the sensor for the first time in the app. I think it does this based on IP address and phone location. Afterwards it doesnt check anymore. For I understand, this is different to the location block in the camera's, as they continuously check where they are.
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Wednesday 12 April 2017 23:08
by madrian
I am started to use domoticz.py, it is working fine, but where I can see battery level? Do I need to create a dummy battery device?
In the source I see that we are sending battery level at each device:
Code: Select all
val_bat = "{}".format(poller.parameter_value(MI_BATTERY))
# Update temp
val_temp = "{}".format(poller.parameter_value("temperature"))
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_temp + "&nvalue=0&svalue=" + val_temp + "&battery=" + val_bat)
...but where I can check this battery level?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Thursday 13 April 2017 7:19
by pvm
In there device list
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Thursday 13 April 2017 8:35
by madrian
Thanks, I found it.
I am thinking of replacing the battery with lir2032 rechergeable battery (+solar charger), but it's voltage is higher than regular cr2032. What do you think about higher voltage?
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Posted: Thursday 13 April 2017 11:31
by LouiS22
hpapagaj wrote:Thanks, I found it.
I am thinking of replacing the battery with lir2032 rechergeable battery (+solar charger), but it's voltage is higher than regular cr2032. What do you think about higher voltage?
Time will tell. Some devices are tolerate a bit higher juice, but generally it's not a good idea to overfeed any device. Worst case in your case: you kill your sensor.