Hello everybody, I have a problem.
I'm trying to trigger some events with Arduino using some bluetooth LE sensor by a chinese manufacturer, Kaipule. I buy this sensor on Alibaba and I'm trying to understand how can I interface them in my sketch.
The are magnetic contact sensors and I know that they have just the BLE broadcasting mode (no GATT, profile etc): they send information when the contact is open.
I try to scan them with a BLE scanner and this is the log
kCBAdvDataIsConnectable : 0
Local Name : iSensor
Manufacturer Data : <beca2c02 4602f9f7>
I notice that
the scanner can see the sensor just when I open the contact, so to save battery he broadcast data just when the contact is open
every time you open and close the contact the code change a little. Here is a sequence
<beca2c02 46025856> - > open
<beca2c02 46005955> - > close
<beca2c02 46025a58> - > open
<beca2c02 46005b57> - > close
<beca2c02 46025c5a> - > open
<beca2c02 46005d59> - > close
<beca2c02 46025e5c> - > open
<beca2c02 46005f5b> - > close
etc
I assume that 02 is the status open, 00 is the status close and I see also a pattern for other bytes.
I have the paper the company send to me, but I cannot find any useful reference.
Assuming that I need to use this sensor as a switch for Arduino, have you seen a sample to understand how can I manage a bluetooth LE broadcasting?
every time you open and close the contact the code change a little. Here is a sequence
It looks to me like the 1st value is the sensor number and the second is simply an increasing number. So, you'd have to keep track of the actual state of the sensor, and toggle it each time the sensor sent an event.
did you ever work this out. I have some of these sensors (different brand but documentation looks identical). I am assuming you extract data form the 31 bits in the advertising packet as per the spec