Search code examples
javaandroidibeaconaltbeacon

How to receive temperature and battery charge of Beacons using Altbeacons


I have to monitor temperature and battery status of beacons in android using Altbeacon (without using Eddystone or other libs). Is it possible?


Solution

  • The AltBeacon format defines a one byte data byte that may be used for any manufacturer-specific purpose such as a temperature reading. This, however, is dependent on a beacon manufacturer supporting this use of the data field. In theory, with a beacon that takes the output of a hardware temperature sensor and puts it into the data field of the AltBeacon transmission, you could get the temperature like this:

    long temperature = beacon.getDataFields().get(0);
    

    That said, I am unaware of any manufacturer that sends a temperature reading in the AltBeacon transmission. It is more common to use the data field byte for a battery level (Radius Networks' beacons do this). That said, you could always make your own custom beacon that does this.

    Full disclosure: I work for Radius Networks.