Help on the online indoor app example

Hi,
I followed the online example enter link description here and hoped to fetch x,y coordinates captured by beacons. It showed built succeeded with one warning. However, there were errors in the output area.

indoor[2860:1820291] can’t fetch location: Error Domain=ESTRequestBaseErrorDomain Code=0 “NSURLConnection failed.” UserInfo={NSLocalizedRecoverySuggestion=Verify provided URL and params., NSLocalizedFailureReason=unsupported URL, NSLocalizedDescription=NSURLConnection failed.}

The warning is:

image

Could anyone help on solving this problem?

The code in the ViewController.m:

@interface ViewController () <EILIndoorLocationManagerDelegate>

@property (nonatomic) EILIndoorLocationManager *locationManager;
@property (nonatomic) EILLocation *location;

@end


@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.locationManager = [EILIndoorLocationManager new];
    
    self.locationManager.delegate = self;
    
    [ESTConfig setupAppID:@"XXX" andAppToken:@"XXXX"];
    
    
    EILRequestFetchLocation *fetchLocationRequest = [[EILRequestFetchLocation alloc] initWithLocationIdentifier: @"XXX"];
    [fetchLocationRequest sendRequestWithCompletion:^(EILLocation *location, NSError *error) {
        if (location != nil) {
            self.location = location;
            [self.locationManager startPositionUpdatesForLocation:self.location];
            } else {
            NSLog(@"can't fetch location: %@", error);
        }
    }];

    }

-    (void)indoorLocationManager:(EILIndoorLocationManager *)manager
didFailToUpdatePositionWithError:(NSError *)error {
    NSLog(@"failed to update position: %@", error);
}

- (void)indoorLocationManager:(EILIndoorLocationManager *)manager
            didUpdatePosition:(EILOrientedPoint *)position
                 withAccuracy:(EILPositionAccuracy)positionAccuracy
                   inLocation:(EILLocation *)location {
    NSString *accuracy;
    switch (positionAccuracy) {
        case EILPositionAccuracyVeryHigh:accuracy = @"+/- 1.00m"; break;
        case EILPositionAccuracyHigh:    accuracy = @"+/- 1.62m"; break;
        case EILPositionAccuracyMedium:  accuracy = @"+/- 2.62m"; break;
        case EILPositionAccuracyLow:     accuracy = @"+/- 4.24m"; break;
        case EILPositionAccuracyVeryLow:accuracy = @"+/- ? :-("; break;
    }
    NSLog(@"x: %5.2f, y: %5.2f, orientation: %3.0f, accuracy: %@",
          position.x, position.y, position.orientation, accuracy);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    

}

@end

I used the Cocoapods but could not remove errors without a long list of imports…

Can you try again? We had a temporary disruption of Estimote Cloud’s operation around the time when you posted about your problems. Which could explain the “connection failed” error. It’s all back to normal now.

Hi thanks for your reply. The connection seems working now. However, there is a new error message shown as follows:

2016-03-04 12:40:16.615 indoor[58949:2305275] failed to update position: Error Domain=com.estimote Code=5 “The platform does not support Bluetooth Low Energy.” UserInfo={NSLocalizedDescription=The platform does not support Bluetooth Low Energy.}
2016-03-04 12:40:19.615 indoor[58949:2305275] failed to update position: Error Domain=com.estimote Code=2 “Magnetometer not able to initialize.” UserInfo={NSLocalizedDescription=Magnetometer not able to initialise.}

It seems like beacons can’t detect users’ phones?

What device are you testing on? It looks like it doesn’t support Bluetooth Low Energy, which is a hard requirement for Indoor Location to work. (It looks like your device doesn’t have a magnetometer either, but that you could work around by switching to Indoor Light.)

We tried both Moto g and the newest iPhone 6s. Both trials returned the same error outputs. Bluetooth on both devices were turned on. I thought most smartphones were equipped with magnetometers?

Hmm, Moto G … ? Our Indoor SDK is currently only available on iOS.

iPhone 6s has both BLE and magnetometer, not sure yet why you’re getting this error then.

ohh, I thought estimote beacons can communicate with any mobile devices with bluetooth on.
I tried the example code in the mac and got so frustrated when no coordinates was shown on the console. New to the beacon&xcode world and there is a lot to learn. Thank you for always answering me promptly!

I have got the same error as the one wjlingling has got with similar code. Do you know what is going wrong

Also, keep in mind iOS Simulator doesn’t support Bluetooth & sensors either.

I am testing using an iPad air and an iphone 5s. I am sure that they have a magnetometer and satisfy all the requirements.

2016-07-23 16:53:08.676 IndoorMap[280:19013] Unknown class _TtC9IndoorMap21EILIndoorLocationView in Interface Builder file.
can’t fetch location: Optional(Error Domain=ESTRequestBaseErrorDomain Code=-1 “NSURLConnection failed.” UserInfo={NSLocalizedRecoverySuggestion=Check reason field to verify what kind of error happened., NSLocalizedFailureReason=unsupported URL, NSLocalizedDescription=NSURLConnection failed.})

This is the error I am getting…

This is what is written in the ESTRequestBaseErrorDomain.h
ESTRequestBaseErrorConnectionFail = -1,
/**
* No data was returned as a response or it couldn’t be parsed as JSON.
*/

I think there might be something wrong with your location’s identifier, can you double check if there are no extra spaces, or non-ASCII characters in it?