Message value

I got the data of the gateway using mssagePack.

But there are some questions.

  1. What is the battery value?
  2. Is the rssi value signed 8-bit binary? is the range from -128 to 127?
    (I want a decimal value.)
    (ex 0xaa => -86 , 0xE8 => -24)

The data below is the actual value I received. Would you tell the rssi value and the battery value in that value??

key:v
value:1.2.5.17
key:mid
value:22
key:time
value:213
key:ip
value:192.168.0.28
key:mac
value:246F28A76F70
key:devices
value BinaryHeader:1
bytes hexString:00E6DC8783A116E80201061AFF4C000215B5B182C7EAB14988AA99B5C1517008D9000116A1C5

yes. it’s int8 value. the range is -128 to 127.

The advertising data you pasted is iBeacon profile data. It doesn’t contain battery value.

I use Gateway(AB BLE Gateway V4) and use ble(April Beacon N02)

I use iBeacon.

In this case, can’t I receive the data including the battery value??

Please check your another question.

Our beacon usually advertises eddystone TLM data per 30+ seconds.

I am trying to see raw data, but it looks broken.

Changing the encoding also breaks. Please can you send it(not broken) to me??
(I try to change setting Windows, Linux, Korean, Chinese, encoding)

https://github.com/AprilBrother/ab-ble-gateway-sdk-php/blob/master/examples/sample_gateway4_data.txt

Gateway V4 post data in MessagePack format. MessagePack is an efficient binary serialization format.

You should decode the data first and check the final data. It’s just like the content of your first topic.

Try to decode the data with messagePack again.

I received the data as a sample(paese.class).

So the data I see now is in iBeacon format.

How do I get eddystone TLM data format from MessageUnpacker?

Sample source or can you tell me how to change it?

Please see the data format for key devices.

From byte 9, the data is raw advertising data. It can be iBeacon data or Eddystone data or other customize advertising data.

  • BLE gateway uploads iBeacon data if it scan iBeacon data
  • BLE gateway uploads Eddystone data if it scan Eddystone data
  • BLE gateway uploads customize data if it scan customize data

It depends on the advertising data format of your beacon.

Thanks for the answer.

This is my beacon. ( April Beacon N02)

Is this only sending data in iBeacon format?

It is said that both iBeacon and Eddystone formats are supported when checking the specification. In this case, only iBeacon format is supported.
(https://wiki.aprbrother.com/en/AprilBeacon.html => Features)

I kept receiving data for 10 minutes, but the beacon only sends iBeacon format data.
(Advertising Filter => Allow All Advertising Data)

**please tell me **
Is this beacon only sending iBeacon format?
Or do I need to change something?

Let me make it clear. Our beacon usually advertises eddystone TLM data per 30+ seconds for all mode. You don’t need change anything.

Thanks for the reply.

Finally I received the tlm data.
00 (adv type)
E6DC8783A116 (mac)
DB (rssi)
0201060303AAFE1116AAFE20000D141A80020F1D050E77A5B0 (adv data => tlm format)

I checked it according to the format, but I want to know the battery status.
(battery voltage is not battery state)

The battery state means the percentage of battery remaining.
(100% when fully charged range 100%~0%)

  1. Question
    Which bit is the value to know the battery status?
    Can you tell me the format of the beacon?

  2. Question
    When I receive the tlm format, it comes once every 70 seconds.
    Can you adjust the cycle? Or is it fixed??

see the function for convert battery voltage to percent. We copied the codes from nordic’s SDK

/** @brief Function for converting the input voltage (in milli volts) into percentage of 3.0 Volts.
 *                            
 *  @details The calculation is based on a linearized version of the battery's discharge
 *           curve. 3.0V returns 100% battery level. The limit for power failure is 2.1V and
 *           is considered to be the lower boundary.
 *              
 *           The discharge curve for CR2032 is non-linear. In this model it is split into
 *           4 linear sections:                               
 *           - Section 1: 3.0V - 2.9V = 100% - 42% (58% drop on 100 mV)                      
 *           - Section 2: 2.9V - 2.74V = 42% - 18% (24% drop on 160 mV)                      
 *           - Section 3: 2.74V - 2.44V = 18% - 6% (12% drop on 300 mV)                      
 *           - Section 4: 2.44V - 2.1V = 6% - 0% (6% drop on 340 mV)                         
 *                                                                                           
 *           These numbers are by no means accurate. Temperature and
 *           load in the actual application is not accounted for!
 *
 *  @param[in] mvolts The voltage in mV                                         
 *                                            
 *  @return    Battery level in percent.   
*/                         
static __INLINE uint8_t battery_level_in_percent(const uint16_t mvolts)
{                                  
    uint8_t battery_level;       
                                                                                                
    if (mvolts >= 3000)
    {                                                                             
        battery_level = 100;                                               
    }                                                                       
    else if (mvolts > 2900)                         
    {                 
        battery_level = 100 - ((3000 - mvolts) * 58) / 100;
    }                                                                   
    else if (mvolts > 2740)                    
    {                                                                               
        battery_level = 42 - ((2900 - mvolts) * 24) / 160;
    }                                               
    else if (mvolts > 2440)                          
    {                                 
        battery_level = 18 - ((2740 - mvolts) * 12) / 300;            
    }                                                    
    else if (mvolts > 2100)                               
    {           
        battery_level = 6 - ((2440 - mvolts) * 6) / 340;
    }                        
    else                                                                           
    {                                                            
        battery_level = 0;                  
    }                                     
               
    return battery_level;
}

Thanks for your quick answer!

All questions were resolved.

Lastly, please answer.

Our server will receive data from multiple gateways.
So the gateway has to filter the data and reduce the data amount.

We only need eddystone tlm data,
Can I only receive the eddystone tlm advertising??
(config tool => There is no tlm data in the filter)

Not support yet. You can filter TLM data at your app side.

Thank you for reply

Then, can I filter only April Beacon(April Beacon N02)?

We only want to manage this beacons,

Can I filter the beacon??

using config tool or Does the packet have an id(To know the beacon, means manufactoring id, etc)?

or impossible??

Please update the firmware for the gateway first. We added a feature that filter by mac address of beacon. You can update firmware to v1.2.5.2x

The label on the card is the mac address of the beacon.

Thank you for your reply

First, I upgraded F/W. (v 1.2.5.22)
{“firmwareVer”:“1.2.5.22”,“hardwareVer”:“4.0”,“mac”:“24:6F:28:A7:6F:70”,“sn”:10973040,“validate”:1}

iBeacon
00E6DC8783A116DE0201061AFF4C000215B5B182C7EAB14988AA99B5C1517008D9000116A1C5
eddystone tlm
00E6DC8783A116E00201060303AAFE1116AAFE20000D0E1A000210A0D10E8250DB

There is no feature filter added in the config tool.

I’m curious

1. Is it possible to send data by filtering only April Beacon N02 at the gateway?

2. If the filter does not have at the gateway,
Is there a value other than the mac value to know that it is a April Beacon N02? (not using mac value)

I want to manage only April Beacon data.

please answer 2 question me

Please try the latest config tool here. Some features may not work in the tool. But it support mac address filter.