Wifi module keeps disconnecting
-
Tried adding an IP address…
M552 S0
M587 S"Littlefish" P"xxx" I192.168.0.15M552 S1
M552 gives:
WiFi: connected with Littlefish, channel 1
Wifi module is connected to access point Littlefish, IP address 192.168.0.15
WiFi: ip:192.168.0.15,mask:0.0.0.0,gw:0.0.0.0
WiFi: pm open,type:2 0
WiFi module is connected to access point Littlefish, IP address 192.168.0.15
ok
WiFi module is connected to access point Littlefish, IP address 192.168.0.15
okBut there are no devices connected with that IP address. It's just as bad as the spurious 192.168.0.100
I'm totally lost now. Please help! -
And more info:
I have tried setting the P parameter on M587 in several ways, as it generally reports the wrong password. e.g. assuming the first is correct, but fails to connect:
M587 S"Littlefish" P"TestPass"
M587 S"Littlefish" P"T'e's'tP'a's's"
M587 S"Littlefish" P"T'E'S'TP'A'S'S"
M587 S"Littlefish" P"t'e's'tp'a's's"
When I try the bottom variant, I get the (false) connected message, with the non-existent IP address.
Anyone got any ideas?
-
Tried adding an IP address…
M552 S0
M587 S"Littlefish" P"xxx" I192.168.0.15M552 S1
M552 gives:
WiFi: connected with Littlefish, channel 1
Wifi module is connected to access point Littlefish, IP address 192.168.0.15
WiFi: ip:192.168.0.15,mask:0.0.0.0,gw:0.0.0.0
WiFi: pm open,type:2 0
WiFi module is connected to access point Littlefish, IP address 192.168.0.15
ok
WiFi module is connected to access point Littlefish, IP address 192.168.0.15
okBut there are no devices connected with that IP address. It's just as bad as the spurious 192.168.0.100
I'm totally lost now. Please help!It appears that there is a compatibility problem between the WiFi module and your router. I am fairly certain that your router is accepting the low-level connection from the wifi module, and allocating it an IP address if you don't assign it a static IP address, but it is then refusing the connection at some other level. What router are you using?
-
And more info:
I have tried setting the P parameter on M587 in several ways, as it generally reports the wrong password. e.g. assuming the first is correct, but fails to connect:
M587 S"Littlefish" P"TestPass"
M587 S"Littlefish" P"T'e's'tP'a's's"
M587 S"Littlefish" P"T'E'S'TP'A'S'S"
M587 S"Littlefish" P"t'e's'tp'a's's"
When I try the bottom variant, I get the (false) connected message, with the non-existent IP address.
Anyone got any ideas?
How are you sending those M587 commands?
-
If you send them from a terminal emulator or similar that doesn't force all characters to upper case, then the first 3 are equivalent. The last one is different because the password will be testpass instead of TestPass
-
If you send them from a program that does force the characters to uppercase, then in all cases the SSID will be LITTLEFISH not Littlefish. In the first case the password will be TESTPASS and in the other 3 it will be TestPass.
So did you set testpass or TestPass as the password on your router?
-
-
The router is a new Virgin Media Hub 3.0 All our other devices work fine and connect fine.
I'm sending the M587 commands via the Chrome extension UARTool. I don't know if it converts to uppercase - I don't think so as the SSID name is always correct. I'm just trying everything I can.
The virgin router forces you to use at least one uppercase letter.
Prior to this I didn't have any, and didn't have any problems.What is bizarre, at least to me, is that I somehow got connected yesterday, after many, many attempts. I immediately changed the config using the DWC to the correct password thinking it would be solved. But today, when I switched it on it failed to connect using those values. And since then I have been unable to connect any other way.
I've lost the whole day, just trying to get the printer to connect.
-
I can confirm that the final variant always results in the false connected message. I repeated it lots of times, it always claims it's connected and it never is.
-
I really don't think the connected message is false, because the wifi module doesn't lie about whether the access point has allocated it an IP address and accepted the connection. If you turn off wifi on your router and run M552 a little while later, I think you will find that the Duet reports it has lost the connection.
You could try upgrading firmware and wifi module to 1.21RC3, or just upgrade DuetWiFiServer to 1.21RC1 and keep the main firmware at 1.20, because 1.21RC1 and later use new WiFi firmware form the manufacturers of the wifi chip.
-
You could try upgrading firmware and wifi module to 1.21RC3, or just upgrade DuetWiFiServer to 1.21RC1 and keep the main firmware at 1.20, because 1.21RC1 and later use new WiFi firmware form the manufacturers of the wifi chip.
How? I have no way of doing that if I can't connect it to the WiFi, do I?
-
See Fallback procedire #1 at https://duet3d.dozuki.com/Wiki/Installing_and_Updating_Firmware.
-
Ok thanks, I'll try that tomorrow.
My wife also suggested an interesting solution, which is to use my phone as a WiFi hotspot, which would test the WiFi module without the pernicious influence of our new router.
-
Yes, that's a good idea.
-
OK, tried with my phone as a hotspot and the Duet connected first time to my phone, I could view the DWC via the same hotspot on my laptop.
So there's seems to be a problem with the router.
Next I tried to upgrade just the DuetWiFiServer to 1.21RC1. It did this, then disconnected. I now I can't connect at all to the wifi module. It's throwing up all kinds of errors that weren't there before. the M587 command keeps failing with
Turn off the current WiFi mode before selecting a new one
and M587: Failed to add SSID to remembered list.
God I'm growing weary of this.
-
I feel your pain - been there (not with the Duet, yet, TG!). Have you tried turning off all other WIFI devices? I was having similar fits with an IoT device and it turned out to be a different device (Arduino Yun) not playing nice . When I unplugged that all my problems went away.
-
OK, tried with my phone as a hotspot and the Duet connected first time to my phone, I could view the DWC via the same hotspot on my laptop.
So there's seems to be a problem with the router.
Next I tried to upgrade just the DuetWiFiServer to 1.21RC1. It did this, then disconnected. I now I can't connect at all to the wifi module. It's throwing up all kinds of errors that weren't there before. the M587 command keeps failing with
Turn off the current WiFi mode before selecting a new one
and M587: Failed to add SSID to remembered list.
God I'm growing weary of this.
There seems to be a bug in 1.21RC3 whereby you may need to send M552 S0 twice to get out of the current WiFi mode, or maybe you just need to wait longer after sending it. It's on my list to investigate. I wasn't aware of the same issue with 1.21RC1, but perhaps it's in that version too.
-
Might just be my weakish WiFi signal but after updating from 1.20 to 1.21RC3 I seem to be getting more random disconnections than I did prior to the upgrade.
Hitting connect usually gets me straight back in though there have been a couple of occasions where I struggled a bit.
Relevant bit of M122 diags in case there's anything in there that's of any use (as you can see the signal strength is weak but not that bad):
- WiFi -
Network state is running
WiFi module is connected to access point
Failed messages: pending 0, notready 0, noresp 0
WiFi firmware version 1.21RC3(28b1)
WiFi MAC address ec:fa:bc:0b:f7:33
WiFi Vcc 3.47, reset reason Turned on by main processor
WiFi flash size 4194304, free heap 14952
WiFi IP address 192.168.0.25
WiFi signal strength -71dBm, reconnections 0, sleep mode modem
Socket states: 2 0 0 0 0 0 0 0
- WiFi -
-
Thanks. Your reported signal strength of -71dBm is rather low and likely to be a contributory factor.
1.21RC1 and later use a different wifi SDK version than 1.20 and earlier did, and there appear to have been major changes between the two versions. So it is quite likely that one will work better than the other in a particular environment. We had to make the change to get the fix for the KRACK vulnerability.
-
Nope, tried sending M552 S0 twice, with a pause. There's something wrong with that version, it doesn't write the SSID when you send M587, even though it replies "ok". When you ask it to list the SSIDs, it fails to retrieve them.
Looks like the SD card is my next option.
But I'd like to know how the printer connected to my phone's wifi hotspot with a glitch, but still fails to connect to my router's wifi. Every other device in our house works perfectly with the router. I put capital letters in my phone's hotspot password just to test it - worked fine. The Duet just cannot connect the main router for some reason. We have laptop, chromebook, chromecast, Nintendo Switch, TV, etc all connect fine. The only one that won't is the Duet. And this is with the correct network name and password in the config file.
-
OK, I have restored my Duet to the stable 1.20 firmware / wifi.
So, what I know is that the Duet connects to my phone as a wifi hotspot. I can send the config via a terminal emulator and it connects fine. It returns an IP address and I can view DWC.
If I repeat the exact same process with our router SSID and password - I get wrong password error. The password is correct obviously - I can cut and paste the same password when I connect to the router's web interface into the M587 command and it will fail.
However, if I cut and paste the same password into my phone's hotspot wifi config, repeat the terminal M587 with the new password for the phone, it connects. So the problem isn't the password.
There is something else preventing the Duet connecting to the home router.
Both Chromebook and phone, and every other device in the whole house connects fine to router wifi. Only the Duet is unable.
What is going on / going wrong, can someone please put my out of my misery?!!
-
I have heard rumours before that the wifi module we use may be incompatible with some routers (depending to some extent on the SDK firmware version). This thread https://github.com/esp8266/Arduino/issues/2795 appears to confirm it. One post near the bottom from a user says he got it to work by changing the encryption settings on his router, to WPA-personal and AES. The "wrong password" error does suggest that the issue may be with incompatible encryption settings on your router.
HTH David
-
Hi David
Well, it does seem to be something like that. I disabled the security on the router, and the Duet connected fine. So it's something to do with the encryption modules. Unfortunately there is no WPA-Personal authentication setting.
This is proving to be a nightmare. I've wasted so much time - and I can't change the router. We've just got it and everything else works fine. In terms of the rest of the family, the 3D printer is right at the bottom of the list of priorities!
I really don't know what to do now. The printer is useless without a means to control it.