Wifi 2 SPI Timeout



  • Hi Duet people! I'm trying to get started with my first Duet Wifi 2 and struggling to get my wifi working. The SPI error is concerning to me - I was unable to get the Duet to via the original firmware, so I tried updating.
    Here's a log I captured after updating the both the Duet2CombinedFirmware.bin at 2.04RC1 and DuetWiFiServer.bin at 2.03:

    RepRapFirmware for Duet 2 WiFi/Ethernet Version 2.04RC1 dated 2019-07-14b1
    
    Executing config.g...Error: M587: Failed to add SSID to remembered list
    HTTP is enabled on port 80
    FTP is enabled on port 21
    TELNET is disabled
    Warning: Macro file config-override.g not found.
    
    Done!
    RepRapFirmware for Duet 2 WiFi/Ethernet is up and running.
    WiFi module started
    Error: Temperature reading fault on heater 1: sensor open circuit
    WiFi reported error: no known networks found
    WiFi module is idle
    === Diagnostics ===
    RepRapFirmware for Duet 2 WiFi/Ethernet version 2.04RC1 running on Duet WiFi 1.02 or later + DueX2
    Board ID: 08DGM-917DA-G4MSJ-6JKFJ-3SJ6N-TBRB9
    Used output buffers: 1 of 24 (9 max)
    === RTOS ===
    Static ram: 25680
    Dynamic ram: 94104 of which 460 recycled
    Exception stack ram used: 288
    Never used ram: 10540
    Tasks: NETWORK(ready,1244) HEAT(blocked,916) DUEX(suspended,156) MAIN(running,3844) IDLE(ready,160)
    Owned mutexes:
    === Platform ===
    Last reset 00:09:33 ago, cause: power up
    Last software reset details not available
    Error status: 0
    Free file entries: 10
    SD card 0 detected, interface speed: 20.0MBytes/sec
    SD card longest block write time: 0.0ms, max retries 0
    MCU temperature: min 29.0, current 31.3, max 31.5
    Supply voltage: min 1.6, current 1.7, max 1.8, under voltage events: 0, over voltage events: 0, power good: no
    Driver 0: ok, SG min/max not available
    Driver 1: ok, SG min/max not available
    Driver 2: ok, SG min/max not available
    Driver 3: ok, SG min/max not available
    Driver 4: ok, SG min/max not available
    Driver 5: ok, SG min/max not available
    Driver 6: ok, SG min/max not available
    Date/time: 1970-01-01 00:00:00
    Cache data hit count 1140769362
    Slowest loop: 0.28ms; fastest: 0.07ms
    I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0
    === Move ===
    Hiccups: 0, FreeDm: 169, MinFreeDm: 169, MaxWait: 0ms
    Bed compensation in use: none, comp offset 0.000
    === DDARing ===
    Scheduled moves: 0, completed moves: 0, StepErrors: 0, LaErrors: 0, Underruns: 0, 0
    === Heat ===
    Bed heaters = 0 -1 -1 -1, chamberHeaters = -1 -1
    Heater 1 is on, I-accum = 0.0
    === GCodes ===
    Segments left: 0
    Stack records: 1 allocated, 0 in use
    Movement lock held by null
    http is idle in state(s) 0
    telnet is idle in state(s) 0
    file is idle in state(s) 0
    serial is ready with "M122" in state(s) 0
    aux is idle in state(s) 0
    daemon is idle in state(s) 0
    queue is idle in state(s) 0
    autopause is idle in state(s) 0
    Code queue is empty.
    === Network ===
    Slowest loop: 0.24ms; fastest: 0.00ms
    Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0) Telnet(0)
    HTTP sessions: 0 of 8
    - WiFi -
    Network state is changing mode
    WiFi module is idle
    Failed messages: pending 0, notready 0, noresp 1
    WiFi firmware version 1.23
    WiFi reported error: no known networks found
    WiFi module is idle
    WiFi MAC address ec:fa:bc:25:34:8f
    WiFi Vcc 3.43, reset reason Turned on by main processor
    WiFi flash size 4194304, free heap 26088
    Socket states: 0 0 0 0 0 0 0 0
    ok
    Error retrieving WiFi status message: SPI timeout
    
    WiFi reported error: no known networks found
    WiFi module is idle
    
    M587: Failed to retrieve network list
    ok
    Error retrieving WiFi status message: bad reply format version
    

    Edit:
    I found M111 S1 P14 lists wifi networks around the printer, however M587 S"mywifinetwork" P"my wifi password" gives: Executing config.g...Error: M587: Failed to add SSID to remembered list
    and a bare M587 claims

    M587: Failed to retrieve network list
    ok
    Error retrieving WiFi status message: bad reply format version
    

    then returns to the every couple seconds spewing

    WiFi reported error: no known networks found
    WiFi module is idle
    


  • Tagging @dc42 @T3P3Tony - does this board need exchanging?



  • This morning I downgraded the main firmware to 2.03 just to rule out any weirdness with a mismatched function from the 2.03 wifi firmware. Same sad state unfortunately. What information can I provide to help?



  • https://duet3d.dozuki.com/Wiki/Gcode#Section_M588_Forget_WiFi_host_network

    I just went through all the network library again and saw this little footnote. So I read the gcode that came out of the configurator and noticed that it does not use a M552 S0. So I added

    ; Network
    M552 S0                                  ; Put wifi in idle mode.  If you don't do this apparently it does not start up.
    

    and it does connect now. I don't know why the module does not seem to turn on with the configurator-provided M552 S1 but hey it turns on now and I can reach the web interface.



  • Curious was this all done through config.g and not the serial port?

    Important! Do not use M587 within config.g. As well as being a security hazard, writing the access point parameters to WiFi chip every time you start the Duet may eventually wear out the flash memory. Also, the wifi module does not get enabled until the end of running config.g. It is better to use a macro to send M587 (source: https://forum.duet3d.com/post/42798)



  • The firmware configuration tool spat out m587 into config.g yes. Through trial and much error I took it out and ran that via serial. The m587 seems to have been somehow poisoning the startup of the wifi chip.



  • Thats unfortunate. Wonder how that could be adressed to avoid others experiencing the same thing.

    At least you got it working in the end though! 👍


  • administrators

    @krohelm said in Wifi 2 SPI Timeout:

    The firmware configuration tool spat out m587 into config.g yes. Through trial and much error I took it out and ran that via serial. The m587 seems to have been somehow poisoning the startup of the wifi chip.

    The firmware config tool should not put M587 commands in config,g. We're looking into it.



  • Could introduce wifi.g to be executed after config.g if no networks are stored in the wifi module maybe? Would simplify the setup being able to put it all on the sd card, and it could even reconnect if you for some reason replace the wifi module.


  • administrators

    @bearer said in Wifi 2 SPI Timeout:

    Could introduce wifi.g to be executed after config.g if no networks are stored in the wifi module maybe? Would simplify the setup being able to put it all on the sd card, and it could even reconnect if you for some reason replace the wifi module.

    Leaving your network password on the SD card is a security risk. Don't do it.



  • @dc42 said in Wifi 2 SPI Timeout:

    Leaving your network password on the SD card is a security risk. Don't do it.

    In fact this is the only reason it occurred to me to remove from config.g. If that data were not somewhat sensitive I would have left it and never found the solution.

    A oneshot.g or something could work though - read once and deleted by the firmware. Or just decline to provide the m587 at all and let users find the command. 🤷 I'm sure you're more than capable of doing the right thing for rrf on this minor issue. Thanks for looking into it!


 

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