neXenio / BLE-Indoor-Positioning

Multilateration using bluetooth beacons
Apache License 2.0
430 stars 129 forks source link

Views in sample app not showing any beacons #144

Closed Manigandan21 closed 5 years ago

Manigandan21 commented 5 years ago

Does this application need any major change to test in India? I can see a blank page for Map, Radar, and Chart.

My Current location is as per log: Last known location set to Latitude: 13.092544 Longitude: 80.1626726

I am using IBeacon Minor value of 3 beacons. Minor values set to 100, 200 and 300.

Sample part:

case 100: { beaconLocation.setLatitude(13.092441779956898); beaconLocation.setLongitude(80.16278815262923); beaconLocation.setAltitude(20); break; } Now I can see that application is not loading Map image .

Also when I check the log for the following I can see infinity value. fromLocation.getLatitude(), fromLocation.getLongitude(), fromLocation.getAltitude(),toLocation.getLatitude(), toLocation.getLongitude(), toLocation.getAltitude()

Infinity::-Infinity,0.0,-Infinity,Infinity,0.0

Can you please help.

Steppschuh commented 5 years ago

The chart view shows all beacons that match the current UUID filter. You can either adjust that filter to accept your beacons, or configure your beacons to advertise frames that match the current filter implementation (IBeacon frames with UUID 03253fdd-55cb-44c2-a1eb-80c8355f8291).

The map and radar views will only show something meaningful if you have a LocationProvider assigned to each of your beacons. The dummy app currently does that in the BluetoothClient.

To get a background image in the map view, adjust the BeaconMapFragment and replace the image drawable with a floor plan of your location. Calculating the reference locations is quite complex, though. You can read about that in the wiki.

Manigandan21 commented 5 years ago

Just need another update, please.

In BecaonMapFragment file I can see using logger the execution of method createDeviceLocationListener the executing happening inside else if part. So I can't see the user location in the Map view. Only Beacon is visible.

@Override
    protected LocationListener createDeviceLocationListener() {
        return new LocationListener() {
            @Override
            public void onLocationUpdated(LocationProvider locationProvider, Location location) {
                if (locationProvider instanceof IndoorPositioning) {
                    Log.d(TAG, locationProvider.toString());
                    beaconMap.setDeviceLocation(location);
                    beaconMap.setPredictedDeviceLocation(IndoorPositioning.getLocationPredictor().getLocation());
                    beaconMap.fitToCurrentLocations();
                } else if (locationProvider instanceof AndroidLocationProvider) {
                    Log.d(TAG, "This line not executed");
                    // TODO: remove artificial noise
                    //location.setLatitude(location.getLatitude() + Math.random() * 0.0002);
                    //location.setLongitude(location.getLongitude() + Math.random() * 0.0002);
                }
            }
        };
    }
Steppschuh commented 5 years ago

First of all, please read about basic writing and formatting syntax on GitHub.

Unfortunately I can't really follow you, please try rephrasing your question.

Manigandan21 commented 5 years ago

Sorry I failed to add the code in insert code. Please check now. I have edited and formatted the same above comment section.

As per the LOG the execution jumps to else if part. So I can't see the user location in the Map view.

Steppschuh commented 5 years ago

And how is that related beacons not showing up in the view?

The IndoorPositioning singleton uses beacons that have a LocationProvider to calculate the geolocation of the device that received the beacon advertising frames.

The fact that the code always jumps to the else if part means that you're not receiving location updates from IndoorPositioning, most likely because you didn't configure location providers for your beacons (or the provided locations are so wrong that the multilateration is impossible).

amoasasasa commented 2 years ago

what should be major value on beacon? plzz help