DTUFeedme / feedme-mobile

feedme-mobile is the frontend of the feedme system which is a platform designed for optimising the indoor climate in larger work spaces such as office building or schools. With the app, users can give feedback on the indoor climate with their location being automatically estimated. With the feedback the feedme system will regulate the indoor climate to reach the optimal personal comfort of the users while maintaining minimal economical costs.
Apache License 2.0
0 stars 0 forks source link

Adding multiple beacons fail because of UUID #2

Closed SebastianKotewitz closed 4 years ago

SebastianKotewitz commented 4 years ago

Adding multiple beacons to one building fails, as the beacons require a unique UUID by the server. The UUID of the 4 beacons I have are the same, or, at least the field where the UUID is taken is. It is currently taken from the advertisementData.serviceData.keys.first, which seems to be the only field matching the structure required by the database.

sasp1 commented 4 years ago

The uuids should be unique. Also the ones you have so I think it is not the correct field. The UUID is part of the iBeacon package that is sent out, which we (in the old app) were able to get through a iBeacon library to iOS and android. This way you can avoid having to call /beacons to match the beacon name with an id and instead just send the uuid directly. But now that I look at it, it doesn't seem like you can see the iBeacon package with the Flutter Blue library. Maybe we need to investigate this further or just have the beacon names (the short 4 letter name) be unique and make the server match the name with the beacon.

SebastianKotewitz commented 4 years ago

If we decide to have the beacon names be unique, it would cause an issue if one beacon is used in 2 or more buildings (Very specific case where two neighbouring buildings are close together), as one beacon can only have one building. This is why we used _id as the primary key. The algorithm determining the building is also already setup to choose the building via bluetooth based on all scanned beacons and what building is referenced the most by these. This takes duplicate beacons with the same name but different _id and thus different buildings into account.