gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Experience and issues on Apple macOS (10.15.7)

Open DigiH opened this issue 3 years ago • 10 comments

Hi @1technophile and @h2zero

I've installed the Theengs Gateway on my Mac running macOS 10.15.7, admittedly not the latest OS, by using the simple

pip3 install TheengsGateway

as I've seen the

• Apple Mac (not tested yet)

in the Hardware section.

Things are somehow working as expected, with starting the broker connection, the config file being created etc.

But here are the issues I find which don't quite work as expected.

All devices, which I also register with my separate ESP32 OMG, do get nicely recognised, but the published id is always a long uuid which has nothing to do with the devices' MAC addresses, additionally for my iBeacons the name is never registered, nor the mac_type.

For example here is a comparison of the same iBeacon from the TheengsGateway on macOS

{"id":"A7BCF6BE-1FC3-4579-BD82-2385A496BF20","rssi":-73,"brand":"GENERIC","model":"IBEACON","model_id":"IBEACON","mfid":"4c00","uuid":"fbc50733a4e24ec1afcfc4db07663825","major":1,"minor":1,"volt":2.3}

vs. the ESP OMG

{"id":"AA:BB:CC:DD:EE:FF","mac_type":1,"name":"BEACON01","rssi":-73,"brand":"GENERIC","model":"IBEACON","model_id":"IBEACON","mfid":"4c00","uuid":"fbc50733a4e24ec1afcfc4db07663825","major":1,"minor":1,"volt":2.3}

Similarly for the Mi Band 4, where the name is being published, but also before the uuid id

{"name":"Mi Smart Band 4","id":"6C5A59D3-0350-426E-9A9D-7F730735B4AC","rssi":-52,"brand":"Xiaomi","model":"Miband","model_id":"MiBand","steps":846}

vs.

{"id":"AA:BB:CC:DD:EE:FF","mac_type":0,"name":"Mi Smart Band 4","rssi":-86,"servicedata":"4e030000","servicedatauuid":"0xfee0","brand":"Xiaomi","model":"Miband","model_id":"MiBand","steps":846}

and with the same uuids being in the reported topics

home/TheengsGateway/A7BCF6BE-1FC3-4579-BD82-2385A496BF20
home/TheengsGateway/6C5A59D3-0350-426E-9A9D-7F730735B4AC

it's not really what I'd expect and would be compatible with the ESP OMG reports.

Let me know how I can be of help getting Theengs Gateways running properly on macOS.

Thanks

DigiH avatar Mar 05 '22 14:03 DigiH

This is because of Bleak's macOS backend, which is a bit special.

koenvervloesem avatar Mar 05 '22 15:03 koenvervloesem

Thanks for the explanation @koenvervloesem :) unfortunately this currently makes the interchangeability with the topics and ids not really compatible with existing OMG or other platform Gateway setups :( but working nicely as a stand alone macOS solution with the unique uuids.

Why the names of my iBeacons are never recognised however seems to be another issue.

DigiH avatar Mar 05 '22 15:03 DigiH

Thanks for testing with MAC @DigiH is the MAC ADDRESS of your devices part of this "id":"6C5A59D3-0350-426E-9A9D-7F730735B4AC" or this "id":"A7BCF6BE-1FC3-4579-BD82-2385A496BF20"

1technophile avatar Mar 06 '22 19:03 1technophile

is the MAC ADDRESS of your devices part of this "id":"6C5A59D3-0350-426E-9A9D-7F730735B4AC" or this "id":"A7BCF6BE-1FC3-4579-BD82-2385A496BF20"

@1technophile I already thought they might be, but unfortunately not, they are completely arbitrary uuids from what I can gather so far. Otherwise I would have put the AA…BB:CC… from the MAC addresses into the appropriate uuid indexes ;)

DigiH avatar Mar 06 '22 19:03 DigiH

@1technophile And even worse! I just confirmed, with a restart of the Mac and starting TheengsGateway again the uuids have changed completely for the same devices - so not really useful for subscribing to ever changing topics :(

DigiH avatar Mar 06 '22 19:03 DigiH

Seems that having unique ID on Apple device will be complex

1technophile avatar Mar 06 '22 19:03 1technophile

In @koenvervloesem link above it briefly states that the uuids might be cached, but obviously only on that one specific machine, and it seems that the cache is being cleared with a restart. Just stopping and restarting TheengsGateway seems to keep the uuids the same so far.

DigiH avatar Mar 06 '22 19:03 DigiH

Some sensors advertize their mac address into the manufacturer data of service data, we could identify those into the decoder and replace the MAC with it, this would enable to have the compatibility with Apple devices. Nevertheless I'm asking myself if it is worth doing it, do you think there is enough interest/traction?

1technophile avatar Mar 12 '22 15:03 1technophile

With non of my BT devices advertising their MAC addresses in the manufacturer data, with Apple Mac machines being power hungry PCs compared to ESP32s or even Raspberry Pis I don't rally think it's worth trying to get a topic compatibility on macOS.

Only being compatible with few devices (which contain their MAC in the published data) would probably only confuse people to open issues about why such and such a device doesn't work properly on the macOS side.

I think it's better to keep full gateway compatibility on devices which allow it. And even if someone is running a macOS server continuously and would want to use the Theengs Gateway it would only be something like € 5 investment for an ESP32 ;)

DigiH avatar Mar 12 '22 15:03 DigiH

Got it, let's put this aside

1technophile avatar Mar 12 '22 16:03 1technophile