# BLE Gateway, MQTT Broker corrupted messages

**URL:** <https://community.homey.app/t/ble-gateway-mqtt-broker-corrupted-messages/25207>\
**Category:** Questions & Help\
**Created:** [January 30, 2020, 12:07pm UTC](https://community.homey.app/t/ble-gateway-mqtt-broker-corrupted-messages/25207 "2020-01-30T12:07:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lidvar\_Husoy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/lidvar_husoy/32/19637_2.png) [@Lidvar\_Husoy](https://community.homey.app/u/Lidvar_Husoy)\
**Post date:** [January 30, 2020, 12:07pm UTC](https://community.homey.app/t/ble-gateway-mqtt-broker-corrupted-messages/25207/1 "2020-01-30T12:07:56Z")

</div>

Hi,

First post here, so be gentle 🙂

I have two cars, and in each car i have a bluetooth beacon to show presance of each car, wich is then opening/closing my garagedoor when coming home or leaving.

This is sort of working with the beacon app in homey directly, but coverage is a problem.

So i bought a AB BLE Gateway V4 and are now trying to connect this to my Homey Pro. I use MQTT Broker and MQTT Client apps in appstore.  
I manage to get connection and i see the beacons in the message, but the message seems corrupted.

So here you can see an example of message i get in MQTT Client :  
20200130-12:50:28 arrTriggerTopic[0] = Test  
20200130-12:50:30 OnMessage called  
20200130-12:50:30 received '��v�1.2.5.15�mid��time��ip�192.168.10.153�mac�246F282EB448�devices�6�JK�u�w� �L(��T�’N����� W�.������yc��lL���H���Ĩb|�e�L ���� K��� �L� ��i@�pV�����L ��� ��’N����� W�.������yc��lL���H��’N����� W�.������yc��lL���H��JK�u�w� �L(��T�pV�����L ��� ��&� 0’��L�����O�����adx%‘Qe���� 0’���e � 0’da i3\_bmw� K��� �L� ��i@��Ĩb|�e�L ����’N����� W�.������yc��lL���H��pV�����L ��� ��JK�u�w� �L(��T�’N����� W�.������yc��lL���H��pV�����L ��� ��’N����� W�.������yc��lL���H�� K��� �L� ��i@��Ĩb|�e�L ����pV�����L ��� ��"� 0!����� ��a57�0�� 0!���e � 0!da x5\_bmw�’N����� W�.������yc��lL���H��’N����� W�.������yc��lL���H�� K��� �L� ��i@��Ĩb|�e�L ����pV�����L ��� ��’N����� W�.������yc��lL���H��’N����� W�.������yc��lL���H��pV�����L ��� ��’N����� W�.������yc��lL���H��JK�u�w� �L(��T� K��� �L� ��i@��Ĩb|�e�L ����pV�����L ��� ��’N����� W�.������yc��lL���H�� K��� �L� ��i@��Ĩb|�e�L ����pV�����L ��� ��’N����� W�.������yc��lL���H��JK�u�w� �L(��T�"� 0’����� ��W�d�� 0’���e � 0’da i3\_bmw��Ĩb|�e�L ���� K��� �L� ��i@�’N����� W�.������yc��lL���H��pV�����L ��� ��’N����� W�.������yc��lL���H��JK�u�w� �L(��T� K��� �L� ��i@�’N����� W�.������yc��lL���H��pV�����L ��� �’ on ‘Test’

As you can see here both the i3\_bmw and x5\_bmw beacon is recognised. But i can not manage to get a trigger from this.  
Do anyone have a clue on how to make a trigger of this?

Best Regards  
Lidvar Husøy

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 30, 2020, 1:30pm UTC](https://community.homey.app/t/ble-gateway-mqtt-broker-corrupted-messages/25207/2 "2020-01-30T13:30:46Z")

</div>

> [@Lidvar\_Husoy](#):
>
> AB BLE Gateway V4

According to the FAQ, [_“Gateway V4 post data in MessagePack format”_](https://wiki.aprbrother.com/en/FAQ_For_AB_BLE_Gateway_V4.html#q-why-the-data-fom-ble-gateway-is-messed-up).

Which means you somehow have to have a MessagePack parser between the BLE gateway and Homey if you want Homey to make any sense of it.

---

<div class="post-metadata">

**Author:** ![Lidvar\_Husoy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/lidvar_husoy/32/19637_2.png) [@Lidvar\_Husoy](https://community.homey.app/u/Lidvar_Husoy)\
**Post date:** [January 30, 2020, 6:58pm UTC](https://community.homey.app/t/ble-gateway-mqtt-broker-corrupted-messages/25207/3 "2020-01-30T18:58:01Z")

</div>

Thanx for the reply 🙂  
I was afraid that this was an issue. Do you know of any parser`s i can use?  
Maybe i can use my RPi3 for this?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 31, 2020, 6:00am UTC](https://community.homey.app/t/ble-gateway-mqtt-broker-corrupted-messages/25207/4 "2020-01-31T06:00:16Z")

</div>

You can probably use your RPi3 for that, but I don’t think there’s an out-of-the-box solution. Instead, you need to write a script that will monitor the MQTT topic(s) from the gateway, decode any MessagePack-encoded messages, and re-publish them (on another topic).

---

<div class="post-metadata">

**Author:** ![Lidvar\_Husoy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/lidvar_husoy/32/19637_2.png) [@Lidvar\_Husoy](https://community.homey.app/u/Lidvar_Husoy)\
**Post date:** [January 31, 2020, 7:00pm UTC](https://community.homey.app/t/ble-gateway-mqtt-broker-corrupted-messages/25207/5 "2020-01-31T19:00:12Z")

</div>

Ok, thank you for the answer.  
This is a bit over my level , so i think i just lay this issue dead 😉  
Scripting is something i know nothing about.
