Yet Another Wifi Connection Problem

  • I have 2 Duets in 2 printers, and for as long as I can remember (since 1.17) the Duets will randomly disconnect (while printing or idle). If I then probe through Pronterface an M522 says the wifi is idle. The only way I can reconnect is to reset them or hook up the USB interface and send a [c]M552 S1[/c].

    Since it's happening on 2 Duets, through a year of firmware updates, and I don't see other people that are having this problem, I'm sure there is something abnormal about my system/network. That said, the dozens of other wifi connections the family uses around the house don't have this problem - they either stay connected or they reconnect after connection is lost. So it's probably some interaction between my environment and the Duet system. I'm hoping to get some help, so here's the checklist:

    Make sure you are running the latest stable versions of the main firmware

    I'm using the latest 1.21RC5 for firmware and wifiserver. Web interface is 1.21-RC4.

    If an AJAX Error is reported

    No Ajax error is reported. I get a popup that says [c]The last HTTP request has timed out. Please make sure the connection between your device and the board is not interrupted.[/c] After that, when I try to reconnect I get [c]Could not establish a connection to the Duet firmware! Please check your settings and try again.[/c] When I try to ping the address of the Duet there's no response.

    Run M122 from either the web interface (if you can reconnect) or from USB. In the Network diagnostics, check the WiFi signal strength, also called RSSI. Values in the range -30 to -50 are good, -50 to -60 is OK, -60 to -70 is marginal. Anything below -70 is weak and likely be unreliable. See below for how to improve RSSI.
    Also in the M122 Network diagnostics check the WiFi Module Reset Reason. It should be "turned on by main processor". If it is anything else (e.g. "exception"), report the problem on the forum.

    I don't get a signal strength when I run M122. Probably because it reports [c]WiFi module is idle.[/c] Here's the full network section:

    === Network ===
    Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0) Telnet(0)
    HTTP sessions: 1 of 8
    - WiFi -
    Network state is running
    WiFi module is idle
    Failed messages: pending 0, notready 0, noresp 0
    WiFi firmware version 1.21RC5(16b1)
    WiFi MAC address 60:01:94:0c:55:75
    WiFi Vcc 3.36, reset reason Turned on by main processor
    WiFi flash size 4194304, free heap 18440
    Socket states: 0 0 0 0 0 0 0 0

    In Duet Web Control, on the Settings/General tab check that "Maximum number of AJAX retries" is at least 3.

    It is set to 3. Is this the problem? If it doesn't reconnect after 3 tries the wifi goes into an idle, unconnectable state?

    Are the disconnections related to another device that uses the 2.4GHz band? Typical devices that may cause problems include cordless telephones, baby monitors, and leaky microwave ovens.

    I don't think so. I dedicated a TP-Link router for the Duets, because I'm in my garage, far from the house's main hotspot. The router is about 1.5 meters from the Duet. Signal strength is -48dBm when the wifi is working.

    Try changing the channel on your WiFi router. Most routers default to Auto, but can be set to use a fixed channel instead. The channels overlap, so it is common to use channel 1, 6 or 11. This may also help if another device is causing interference. We have some feedback that channel 6 gives better results than channel 1.

    It's currently set to 6. Just changed it to 1 and still can't (re)connect.

    Is the connection stable when the printer is idle, but unreliable when printing? If so then there may be too few CPU cycles to service the network interface, because of an excessive step pulse rate. Check the M122 report after a disconnection during a print, or after completing the print, and look at the MaxReps figure in the Move diagnostics. This value should be kept below about 50. If it is higher, reduce either microstepping (M350) or maximum speed (M203). Please note, MaxReps is reset when you run M122 so only the value the first time you run M122 after a disconnection or completion of a print is significant.

    Max reps was 4. It's currently printing a long job at 50mm/s on a Cartesian printer so the CPU shouldn't be heavily taxed.

    Also if the connection is stable when the printer is idle but not when printing: could it be temperature-related? Does the disconnection occur when the CPU temperature displayed in DWC reaches a certain value? If so, try cooling the Duet with a fan, if you are not doing so already.

    Connection can be lost when idle or printing. Sometimes it will print for 12+ hours without disconnecting. In this case it disconnected a few hours into the print. Duet is cooled, and MCU temperature is min 21.4, current 22.6, max 30.3.

    Any ideas what could be causing the wifi to just turn itself off?

  • This is the first time I've had USB hooked up when it failed. For some reason I can't restart it with M552 S1. Here's what I tried:

    WiFi reported error: Lost connection, auto reconnecting
    WiFi reported error: Timed out while trying to connect to Garage AP
    >>>  M552 S1
    SENDING:M552 S1
    >>>  M552
    WiFi module is changing mode
    >>>  M552
    WiFi module is changing mode
    >>>  M552 S0
    SENDING:M552 S0
    >>>  M552 S1
    SENDING:M552 S1
    >>>  M552
    WiFi module is changing mode
    >>>  M552
    WiFi module is changing mode

  • administrators

    Next time try sending M552 S-1 first. That resets the WiFi module.

    The forthcoming 1.21 release includes a fix for a known issue that can cause reconnection to fail.

  • That did it, thanks.

  • Ok so my wifi module light on my board has gone dark in the middle of an overnite print … it will be printing now for another few hrs. on fw released last week 1.21 - no PanelDue.

    What to do to reconnect whilst mid print ?

  • administrators

    You can probably reconnect by sending M552 S1 from USB. As you have a print running, to minimise the chance of disruption I suggest you use a laptop running off its battery to connect via USB if possible, to avoid getting a USB ground loop.


Looks like your connection to Duet3D was lost, please wait while we try to reconnect.