1.19beta7 and WiFi connect
-
OK, I found the bug, it's purely a reporting issue. If you have no remembered networks but you have specified an access point name, then when you list remembered networks it prints the access point name. After you have added a remembered network, you can still retrieve the own access point name by sending M589. The fix will be in the next beta.
I still haven't worked out why it's trying to connect to an empty SSID. I'll look at that later today.
-
@dc42: as per definition the passphrase within the AP mode hast to be at least 8 chars long, i think it would be reasonable to check for valid M589 input (i think ssid min 0 max 32 chars and passphrase min 8-64 chars).
try:[[language]] M552 S0 ok WiFi module started M589 S"test" P"test" I192.168.1.1 ok M552 S2 ok WiFi module started WiFi reported error: Failed to start access point Wifi module is idle M589 S"test" P"testtest" I192.168.1.1 ok M552 S2 ok Wifi module is providing access point test, IP address 192.168.1.1
-
Thanks for the suggestion, I'll implement it in the next beta.
I can't reproduce the problem with failing to connect and not displaying the SSID name, but I've built a new DuetWiFiServer.bin with some changes that may help and put it at https://dl.dropboxusercontent.com/u/19369680/DuetWiFiServer.bin. Please try it.
-
will give it a try. will give feedback tomorrow.
is there the possibility to erase the ESP (incl. flash) completly from SAM/RRF? or only via ISP? -
@dc: i think i found the reason, why an empty config was read…
SocketServer.cpp - row 64
[[language]] for (size_t i = 1; i <= MaxRememberedNetworks; ++i)
shouldn't it be```
[[language]]
for (size_t i = 0; i <= MaxRememberedNetworks; ++i)same in row 83 or better (i think) not to waste one slot at the beginning (row 64, 83, 112, 521,…)
[[language]]
for (size_t i = 0; i < MaxRememberedNetworks; i++) -
The first entry is the configuration for the WiFi module as an access point. So the count starts from 1 when it is searching for a remembered SSID.
-
hmmm… once again:
[[language]] for (int8_t i = 0; i < num_ssids; ++i) { if ((strongestNetwork < 0 || WiFi.RSSI(i) > WiFi.RSSI(strongestNetwork)) && RetrieveSsidData(WiFi.SSID(i).c_str(), ssidData)) { strongestNetwork = i; } }
WiFi.RSSI's and WiFi.SSID's parameters are a zero based index from prior discovered SSIDs by blocking WiFi.scanNetworks(false, true)
At this point we are looking at the wrong index. aren't we? ++i -> i++ -
@dc: 1.19beta8+1 doesn't change the WiFi behaviour. but can you plz. confirm/check the above post?
-
Using ++i or i++ does exactly the same thing if the operand has primitive type and you don't use the value within the same expression, as in this case.
-
I just got a Duet Wifi and I'm having a hell of a time with the WIFI setup. I have tried flashing 1.18 stable as well as 1.19 beta 8. I first attempted upgrades via M997 but eventually tried the erase/reset/reload via samba. I have gotten it to connect once or twice but it seems whenever I edit config.g to uncomment M552 S1 it fails to connect again after reboot. I have fiddled with it quite a bit since then and haven't been able to get it to talk to my router again.
I've noticed a couple things
- when using 1.18 M552 will say that the board is in AP mode but I can't see it in my list of WIFI networks.
- when it does this it also says hostname is some bunch of gibberish ascii characters
- when using 1.19 Beta 8 M587 returns the two remembered networks I have configured in my SetNetwork macro however when I do a M552 S1 I get
M587
SENDING:M587
Remembered networks:
seawest
seawest 5G
M552 S1
SENDING:M552 S1
WiFi reported error: no known networks found
Wifi module is idleI'm starting to think the board is faulty. Is there anything else I can try? It's almost as if the WIFI module is retaining some kind of garbage. Is there a way to purge everything so I'm starting fresh? SD Card, memory, everything?
-
The "no known networks found" message means that it did a network scan and didn't find either of the SSIDs you configured. How strong is the signal from your router where the Duet is? Is the Duet surrounded by metalwork that would attenuate the signal?
The Duet WiFi does 2.4GHz only, and I presume seawest 5G is a 5GHz access point.
I think access point names are case sensitive. Is 'seawest' exactly how your access point name appears when you connect to it from a smartphone, tablet etc. ?
-
wow thanks for the quick reply. seawest is the name of my 2.4 Ghz network and my seawest 5G is my 5 Ghz network. Both are off of the same ASUS router that sits about 10 feet away. The names are case sensitive and exactly as they're seen from my iphone. My password is alphanumeric and only contains letters and a number.
The thing that makes me suspicious that the board is bad is the fact that I don't see "Duet WIFI" when the board thinks it's in AP mode when using 1.18. Are there any debug commands I can use to test the functionality of the WIFI module itself? I was able to get the board to connect a handful of times and it seemed tied to loading a new WIFI firmware. However, I have tried reloading firmware several times since then and I haven't been able to re-establish a connection.
I WAS able to connect to the "Duet WIFI" SSID but only once. When that occurred I could see my neighbor's APs as well as my own. I was also able to get into the web interface but as soon as I uncommented "M552 S1" and rebooted I had the same problems all over again and could not reconnect.
-
When you are using firmware 1.18 and the Duet reports that it is in AP mode, you should be able to find it in the network listing on your smartphone assuming your smartphone isn't only looking for 5GHz networks. If you can't, ask for the Duet to be replaced.
-
@DC42: regaring the SSID/PSK topic:
within the StartClient() you are calling RetrieveSsidData() which overwrites ssidData each time it is called with data from EEPROM.
But at the end of StartClient() you are calling ConnectToAccessPoint() with the last update of ssidData as parameter (which could store wrong data at this point caused by prior RetrieveSsidData() calls).i think RetrieveSsidData() should be called again with WiFi.SSID(strongestNetwork) as paramter right after the strongestNetwork was found to update ssidData with the correct parameters again. adopted version: https://www.dropbox.com/s/60djqiyv9f380xe/DuetWiFiServer.bin?dl=0
-
Thanks for spotting that. I'll update it when I am back in the office.
-
Ps. Can also confirm that '@' within passphrase isn't a problem at all!
-
Thanks for the confirmation!