howto disable wifi 30 minute timeout - anyone figured this out yet?

Discussion in 'iOS Development' started by morgman, May 15, 2009.

  1. morgman

    morgman New Member

    Feb 23, 2009
    Likes Received:
    iPhone 3GS (Black)
    Hey all, I've been beating my head against this particular problem for awhile now, my toolchain based daemon needs persistent wifi, I can accept the battery penalty.

    of course once the device goes to sleep and is off a power supply, the wifi shuts off after 30 minutes...
    I've prevented this in other cases with a foreground application running, backlight turned off and not allowing the device to go to sleep.

    But when going to sleep, everything I've tried so far fails to prevent the 30 minute wifi timeout/shutdown.

    I've tried (in basically the order I tried it):

    UIRequiresPersistentWifi YES or boolean set to true - no joy

    [[ UIApplication sharedApplication ] setIdleTimerDisabled: YES ]; - no joy

    IONotificationPortRef notificationPort;
    root_port = IORegisterForSystemPower(self, &notificationPort, powerCallback, &notifier);
    // add the notification port to the application runloop
    					   kCFRunLoopCommonModes );
    the above intercepts the kIOMessageCanSystemSleep msgs and cancels them, but the wifi still shuts off after 30 minutes... (I've seen maybe one post that suggests that these are two different problems.)

    more recently I replace the above with:
    IOPMAssertionID assertionID;
    IOReturn success = IOPMAssertionCreate(kIOPMAssertionTypeNoIdleSleep, 
    again this is power management and seems to be separate from the wifi problem.

    Recently I noticed the following in console messages on my device:
    "Thu May 14 17:40:43 unknown configd[15] <Notice>: WiFi: Disassociation timer disabled because we are connected to a power source

    this lead me down the path of investigating configd.

    I've written code to dump all the key/value pairs in configd and see nothing that correlates (at least to me) to the 30 minute or 1800 second timeout.

    I found lots of references to a 1800 and disconnecting on sleep in the /System/Library/Frameworks/SystemConfiguration.framework/NetworkConfiguration.plist like:

    but changes made to this file don't seem to affect anything... (after power cycle) same 30 minute timeout...

    sooo I'm beginning to run out of ideas...
    I was going to start searching for the string "Disassociation" in binaries to see if I can trace the configd message to something else...
    There is also a POWERSAVE key in one of the dictionaries in configd that has to do with the network:

    key is State:/Network/Interface/en0/AirPort
     is a Dictionary
        STATE : 3
        POWER : (
        BSSID : <XXXX XXXXX>
        TXPOWER : 1496
        [COLOR="Red"]POWERSAVE : 1[/COLOR]
        RSSI : {
        "RSSI_CTL_AGR" = 10;
        "RSSI_UNIT" = 89;
        AUTH_TYPE : {
        "AUTH_LOWER" = 1;
        SSID : <XXX XXX>
        CHANNEL : {
        CHANNEL = 1;
        "CHANNEL_FLAGS" = 10;
        RATE : 54
    But I haven't modified my configd code to change that yet...

    I've been scouring the forums to no avail...
    Perhaps someone out there in the know will see this and shed some light on the issue...

    Thanks for any thoughts on this...
  2. jek

    jek New Member

    Mar 9, 2009
    Likes Received:
    iPhone 3G (Black)
    I'm not an expert (or even close), but is there a way you could emulate a touch (on the screen).

Share This Page