DWC loses connection when switching tabs



  • Hi!

    For some weeks DWC always loses connection when I am switching to another tab in my browser. If I only switch for about 10 seconds the connection will remain but if it's longer, DWC asks me to enter the password again. On top of that, if I type in the password, DWC won't reconnect - it is loading and loading..
    I have to reload the DWC page and then it works again - until I switch to another tab..

    I think I had this issue somewhere around the 2.0 DWC release - I am not really sure.

    I use the latest software:
    DWC 2.0.4
    Duet2Firmware 2.04
    WiFiServer 1.23
    Safari Browser and latest MacOS



  • looks like this is not the case with chrome



  • Safari puts background tabs to sleep. To keep them awake, change the setting: Disable Hidden Page Timer Throttling, located under Debug → Miscellaneous Flags

    If you haven’t enabled the Safari Debug menu yet, triple-click the following line and paste it into a Terminal session:

    defaults write com.apple.Safari IncludeInternalDebugMenu 1



  • @Danal
    I thought there might be a problem with sleeping background tabs.

    I copied the line into Terminal but a debug-menu didn't appear.
    Tried it several times and restarted Safari but there is nothing.

    To be sure, the debug-thing should appear in Safaris menu bar?

    The Develop menu is already in the menu bar.



  • Correct, the debug should appear. The command-line to enable it may have changed across releases, see if you can google it.



  • @Danal
    Got it!
    In macOS Mojave this doesn't work anymore like it should. You have to check something in the system preferences so Terminal has full access to the disk volume. This is new in macOs Mojave.

    The command is still the same.

    Thanks!



  • Now I checked "Disable hidden page timer throttling" but the problem is still there!
    DWC asks me for the password again after I switch to other tabs and won't let me in until I reload the page.
    Nothing has changed.



  • Hmmm... I will give this a try on Safari. Later this evening (US time)


  • administrators

    I've got a test setup with the latest OS X and Safari versions here. So far I can say that Safari suspends the connection at some point and I've got to re-enter the password (which shouldn't be the case so I'll fix that) but once I do that, DWC2 reconnects as expected.

    Edit: It looks like Safari never generates timeout errors but tries to resend pending HTTP request when a tab is resumed. That conflicts with the current error handler so I'll develop a work-around.


Log in to reply