Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assigned MAC addresses get cleared when closing and reopening the app #52

Closed
DigiH opened this issue Nov 16, 2022 · 6 comments
Closed
Labels
bug Something isn't working iOS iOS only specific macOS macOS only specific

Comments

@DigiH
Copy link
Member

DigiH commented Nov 16, 2022

Assigned MAC addresses get cleared when closing the app and opening it again, verified on macOS and iOS 1.2

This requires any MAC addresses to be entered again for all devices to be able to get functioning published MQTT messages again.

The assigned MAC addresses need to be persistent across app restarts.

@DigiH DigiH added iOS iOS only specific macOS macOS only specific labels Nov 16, 2022
@DigiH DigiH changed the title MAC addresses get cleared when closing and reopening the app Assigned MAC addresses get cleared when closing and reopening the app Nov 16, 2022
@1technophile 1technophile added the bug Something isn't working label Feb 7, 2023
@DigiH
Copy link
Member Author

DigiH commented Feb 7, 2023

Likely related to
#58
as the MAC addresses are also in the database, but not being repopulated (either in the UI, nor for MQTT publishing) when App is reopened.

@DigiH
Copy link
Member Author

DigiH commented Feb 8, 2023

Closing as verified with the latest build as fixed.

Opening the app immediately populates the locations, and also the previously saved MAC addresses are there for all devices. 👍

@DigiH DigiH closed this as completed Feb 8, 2023
@emericg
Copy link
Collaborator

emericg commented Feb 9, 2023

By the way, it might be a nice addition to the decoder to have it parse and expose the sensor's MAC addresses, if available in the advertisement data.
That way, there wouldn't be any need to fill that MAC field manually. I already do that for sensors that have an existing WatchFlower implementation, but it might be useful to generalize that.

Kind of theengs/decoder#89, but the other way around.

@DigiH
Copy link
Member Author

DigiH commented Feb 9, 2023

I'm not quite sure what you mean by

parse and expose the sensor's MAC addresses

Decoder does get the MAC address from the project, Theengs App, OpenMQTTGateway, Theengs Gateway etc. and doesn't need to send it back because of that - each project already having the "id" key and property.

How would you want it to be additionally exposed?

@emericg
Copy link
Collaborator

emericg commented Feb 9, 2023

With the macOS and iOS Bluetooth stack, you don't have access to the MAC addresses, so the ID field of the decoder is filled only with "equivalent" UUIDs.

For instance with the FlowerCare sensors, you do need the actual MAC to interact with the devices for longer than a second, it's part of its handshake process. So they put the MACs in the advertising data (https://github.com/emericg/WatchFlower/blob/master/docs/mibeacon-ble-api.md#protocol-version-0x70), so their iOS app can have the same features than their Android app.
So for these devices, you could add a mac field/property in the decoder.

@DigiH
Copy link
Member Author

DigiH commented Jun 11, 2023

MAC property added in branch
https://github.com/theengs/decoder/tree/mac_property

Needing more device decoder updates for devices known to have their MAC address in broadcast data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iOS iOS only specific macOS macOS only specific
Projects
None yet
Development

No branches or pull requests

3 participants