Error on updating beacon power

Hello,

I have a problem when changing the beacons power.I successfully connect to the beacon and in the delegate method “beaconConnectionDidSucceeded” I modify the advertising interval and power with “writeAdvInterval” and “writePower” methods. The advertising interval is successfully updated but the power cannot be changed because I get an error “Power value update failed due to server issue”. I’ve tried that 10-20 times during the day at different hours, but the error kept showing up, but I have to specify that 2-3 times it worked, especially when I changed ESTBeaconPowerLevel8 to ESTBeaconPowerLevel7, then when I tried again, I received the error again.Can you please help me?Thank you very much.

Can you let us know the MAC address of the beacon? Gonna look through our logs for some clue of what could be going wrong.

Hello,

The mac addresses of one of the beacons is D5:9E:BA:65:FB:0E.

Can you post the code snippet which you use to change the settings? One thing that comes to my mind—you need to wait for writeAdvInterval to finish before you can writePower.

1 Like

I think you’ve got a point, I didn’t think about this but this may be the problem.Here is the code:

- (void)configBeacon:(ESTBeacon *)beacon {
    
    [beacon writeAdvInterval:200 completion:^(unsigned short value, NSError *error) {
        
        if (error)
        {
            NSLog(@"Error Advertising Interval write: %@", error.localizedDescription);
        }
    }];
    
    [beacon writePower:4 completion:^(ESTBeaconPower value, NSError *error) {
        
        if (error)
        {
            NSLog(@"Error Power write: %@", error.localizedDescription);
        }
    }];
}

I solved the problem. Indeed the problem was the writeAdvInterval was not finishing and that caused the problem.I’ve refactored the code and now works great. Thank you very much.

Glad it works now (:

We should probably detect this situation and throw a more descriptive error message.