Connect to a MI FlowerCare sensor #2140
Replies: 11 comments
-
Posted at 2017-04-19 by furuskog I'm going to try the new firmware 1,92 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-19 by @gfwilliams Puck.js should have no timeout itself - the 1v92 firmware might well help though, so give that a try first. Perhaps you could also try using the nRF Connect app and making sure that those services and characteristics are correct and that you can read the values. It might be that the characteristic isn't readable but only handles notifications |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-19 by furuskog The nRF connect closes the connection after 2-3 seconds that why I suspect the miflora tries to save energy, it seems that you have to write to a characteristic first, then you could get the real values, otherwise it only return zeroes. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-19 by @gfwilliams That document mentions handles. Ideally you'd have the actual characteristic UUIDs to use - perhaps you could write some code for Puck.js that uses Worst case, you could actually create a new http://www.espruino.com/Reference#BluetoothRemoteGATTCharacteristic class with the internal handle variables set to the handles mentioned in that document, and then set them up as it says? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-19 by furuskog @gfwilliams thanks. I will go through it step and try the things you mentioned. It sounds like it will work. Looks like I have something to tinker with this weekend to :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-20 by furuskog Finally some success
Output
Next is to format the values but I save that for this weekend :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-21 by @gfwilliams Great! Thanks for posting up your working code as well! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-22 by furuskog
Format C Type Python type Standard size How can I do this with the ArrayBuffer in JavaScript?
I wonder if there is an easy solution to this? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-22 by Wilberforce Gordon has recently added the Dataview class which allows you to pack and read from a byte array have a look in the reference... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-22 by Wilberforce http://www.espruino.com/Reference#l_DataView_DataView
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-23 by furuskog @wilberforce thank you very much for the help. With a little googling and some other tutorials about the sensor in python I finally had success. This is the code I used to get the correct values.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-19 by furuskog
Im trying to connect to a MI FlowerCare sensor. Im having a issue thoe.
I get error disconnected it seems that the flower sensor gets disconnected (I get error disconnected) :) in order to save battery there is a automatic disconnect after like 2 secs. Is there something I can do? Is my code correct ? I got the values using the gatttool on a raspberry Pi. I also found some clues here: https://github.com/open-homeautomation/miflora/blob/master/miflora/miflora_poller.py, Any sudgestions?
Beta Was this translation helpful? Give feedback.
All reactions