This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

BLE profiles
#6
Im working on a BLE profile for the xiaome Mi Flora Flower care sensor, this is as far as i have got, i can read the data but not sure how to extract the data i want from the bytes, 
there is available,  light level, soil moisture level and temperature, the location of the data is as per the link below. 
https://www.open-homeautomation.com/2016...nt-sensor/


require('ble')
ble.up()
sock = ble.sock()
ble.settimeout(sock, 30)
res = ble.connect(sock, "80:EA:CA:88:E5:63")
log(res)

if res then

  cmd = 0xA0, 0x1F
  --0x03 -- name
  re, er =  ble.sockwritecmd(sock, 0x33, cmd) -- send the magic to allow us to read the data
  log(re, er)
 
  os.sleep(0.1)
 
  x = ble.sockreadhnd(sock,0x35) or '' 
a = x:byte(1)
b = x:byte(2)
c = x:byte(3)
d = x:byte(4)
e = x:byte(5)
f = x:byte(6)
g = x:byte(7)
h = x:byte(8)
 
log(x,a,b,c,d,e,f,g,h)
  
end
Reply


Messages In This Thread
BLE profiles - by morak - 29.01.2018, 11:37
RE: BLE profiles - by 1114752670@qq.com - 13.03.2019, 07:53
RE: BLE profiles - by Daniel - 13.03.2019, 08:48
RE: BLE profiles - by gjniewenhuijse - 13.03.2019, 11:06
RE: BLE profiles - by admin - 13.03.2019, 11:19
RE: BLE profiles - by benanderson_475 - 13.01.2020, 21:17
RE: BLE profiles - by admin - 14.01.2020, 07:44
RE: BLE profiles - by benanderson_475 - 21.04.2020, 01:00
RE: BLE profiles - by admin - 21.04.2020, 06:23
RE: BLE profiles - by benanderson_475 - 22.04.2020, 00:38
RE: BLE profiles - by admin - 22.04.2020, 10:53
RE: BLE profiles - by benanderson_475 - 12.03.2022, 10:12

Forum Jump: