prusa3d / Prusa-Firmware-Buddy

Firmware for the Original Prusa MINI, Original Prusa MK4 and the Original Prusa XL 3D printers by Prusa Research.
Other
1.09k stars 214 forks source link

[BFW-5393] [BUG] 6.0.0 - Wifi doesn't work in WPA3/WPA2 Transition mode #3864

Open Gyrxiur opened 3 months ago

Gyrxiur commented 3 months ago

Printer type - [MK4]

Printer firmware version - [6.0.0-RC1]

Original or Custom firmware - [Original]

Optional upgrades - [none]

Describe the bug After updating to 6.0.0-RC1 Wifi have worked, but only till restart, then it says No AP. Only way to make it work is factory reset, but it again works only till restart. Also, in czech language, you have typo, instead of Pokus o připojení you have Pokus o piřpojení ;c)

How to reproduce Update firmware to 6.0.0-RC1 and restart.

Expected behavior Working wifi every time, as it was before updating.

G-code N/A

Crash dump file N/A

Do not share the file publicly, as the crash dump contains a raw snapshot of the printer's memory and may include unencrypted sensitive information.

Video N/A

Gyrxiur commented 3 months ago

So I've reverted to old firmware and it works, so it is bug in new firmware for sure.

bkerler commented 3 months ago

Do you have a prusa-printer-settings.ini file on your stick ? Sounds like a ini parsing issue maybe, trying to sort that out.

Gyrxiur commented 3 months ago

Do you have a prusa-printer-settings.ini file on your stick ? Sounds like a ini parsing issue maybe, trying to sort that out.

Yes, and when I load settings, it asks to delete file, so I confirm it. And even when I try to make new file and load it again, it won't connect. Older firmware connects ok with same file, so no mistakes in that file for sure.

H0Z0 commented 3 months ago

Interesting. I tried to reproduce the error, but after setting up the network, my MK4 connected to the Wi-Fi network every time. It also works after switching off or disconnecting the power cable or pressing the reset button. I also deleted the .ini file from the usb drive, so it can't even read from there. Both PrusaLink and Prusa Connect can connect to the printer.

salmander commented 3 months ago

I confirm that I also experienced this. However, I have flashed the RC1 firmware and restarted the printer a couple of times and now it seems to be working. Another issue I experienced is when I am using binary code (bgcode), it can't seem to download the file from Prusa Connect. I tried this a few times. However, changing the legacy gcode in PrusaSlicer worked the first time.

Gyrxiur commented 3 months ago

So, I have upgraded to 6.0 again, and made some observations. Wifi works, if I have machine turned off for at least 5 minutes, when I reboot it, it stops working, and even if I turn it off for a minute, to really power off wifi module, that doesn't help. It has to be off for at least 5 minutes, so it looks like there is something wrong with combination with my Huawei WiFi AX3 router it seems. But strange is, with older firmware it works, downgrading fixes it. I've even tried to turn on backup wifi 5 network in router and connect to it, but that doesn't help.

Gyrxiur commented 2 months ago

Updated to final 6.0, problem persists. Also that typo not fixed. Downgrading still fixes issue, so old ESP firmware was ok, why don't you use old working ESP firmware with new printer firmware?

Gyrxiur commented 2 months ago

OK, so, I had router in WPA3/WPA2 mode, when I switch it to WPA2 only, it works. So new firmware has problem with WPA3, while older one works with it enabled.

danopernis commented 2 months ago

@Gyrxiur Thanks for figuring out it is an issue with WPA3. Which version were you upgrading from? AFAIK the WiFi is entirely driven by ESP8266 so it must be caused by one of the commits in https://github.com/prusa3d/Prusa-ESP-Nic-FW/commits/master/

Gyrxiur commented 2 months ago

5.1.3 was working well, all 6.x have this issue. In router settings it won't connect until router lists it as currently connected. After few minutes without activity, when router finally realizes that it is offline, printer is able to connect. Strangely, if I leave printer turned on, even if it says No AP in printer, it won't disappear in router, so it is actually connected, just saying No AP. It has to be actually turned off to disappear and then be able to connect.

danopernis commented 2 months ago

Unfortunately there is no 5.2.x release for MK4 so we can't easily confirm if it is caused by https://github.com/prusa3d/Prusa-ESP-Nic-FW/issues/15 or the earlier changes. If there are any MK3.5 users who could help, that would be great.

I will try to reproduce this on some other router.

Gyrxiur commented 2 months ago

Wouldn't it be possible to compile Prusa signed MK4 6.0 firmware with various versions of ESP firmware, so I could test them, to find out, when it became broken? I am willing to test it, but I don't want to brake asterisk on motherboard and ruin my warranty.

jaromirk commented 2 months ago

I can confirm the same issue. My AP is Mikrotik that allows both wpa2 and wpa3. Firmware 6.0.0 final

danopernis commented 2 months ago

@Gyrxiur thank you for generous testing offer, but I think that now we have enough leads to reproduce this. Internal ticket for reference: BFW-5393

For anybody experiencing the issue, you can work around this by disabling "WPA3/WPA2 Transition mode" until the proper fix is made.

dzuelke commented 2 months ago

Fairly sure this is PMF related.

https://github.com/prusa3d/Prusa-Firmware-Buddy/commit/e8ac2cf49d05751efa09e2cb0abd3bd04dc70228 added support for PMF, but maybe required now somehow defaults to true?

Or it kicks into WPA3 mode this way, but there's a bug there? https://docs.espressif.com/projects/esp-idf/en/v5.0.6/esp32/api-guides/wifi-security.html#setting-up-wpa3-personal-with-esp32

Note that https://docs.espressif.com/projects/esp-idf/en/v5.0.6/esp32/api-reference/network/esp_wifi.html#_CPPv417wifi_pmf_config_t indicates capable no longer has any effect on recent versions, this is confirmed by https://docs.espressif.com/projects/esp-idf/en/v5.0.6/esp32/api-guides/wifi-security.html

WPA3 is specced to require PMF, while for WPA2, it is optional. https://docs.espressif.com/projects/esp-idf/en/v5.0.6/esp32/api-guides/wifi-security.html has some details.

In general, this is a common cause for trouble with IoT devices - WPA3 is often not supported, and WPA3/WPA2 transitional mode with optional PMF for WPA2 then has people reporting "my printer/vaccum/sensor/camera/… isn't connecting anymore".

Places like the UniFi community forums are full of these reports. Router/AP vendors often try to fix problems for one type of product, and in the process, break support for another, because these simple WiFi chipsets are often fairly glitchy.

The usual recommendation is to run a separate IoT WiFi that uses only the 2.4 GHz band and WPA2 Personal for maximum compatibility.

danopernis commented 2 months ago

Update:

I tried to reproduce this on the network with enabled WPA2/WPA3 Transitional mode and the printer connects just fine. This seems to be related to the particular router you are using. Maybe there is some ESP8266 configuration I could tweak, but I have no way of verifying if that tweak solves the issue for your particular router.

As pointed out by @dzuelke this is likely to be caused by https://github.com/prusa3d/Prusa-Firmware-Buddy/commit/e8ac2cf49d05751efa09e2cb0abd3bd04dc70228 (or more specifically, https://github.com/prusa3d/Prusa-ESP-Nic-FW/commit/ed2613339dcfdc007672ca1eea72ada36751f684 and https://github.com/prusa3d/Prusa-ESP-Nic-FW/issues/15). We do not want to revert this because it enables WPA3 which is desired. For future reference, I am also including link to discussion at reddit where they talk about WPA3 finally working.

For now, the best workaround is either use WPA2 or WPA3 on your router.

If there is anybody who experiences this issue and is skilled enough to build https://github.com/prusa3d/Prusa-ESP-Nic-FW from sources and flash their ESP-01S, I would really appreciate if you could try tweaking the configuration. Right now the printer does not flash ESP firmware as long as the protocol version matches, so experimenting should be easy.

MarcusPocus66 commented 2 months ago

Problem reproduced and confirmed with Prusa technicians. The bug is there with 6.0.0 but not with 5.1.3.

Prusa-Support commented 2 months ago

Thanks for reporting.

As our developer mentioned, we are already working on this. For now, a potential workaround may be setting the router fixed on WPA2 (or WPA3 in a few cases), without automatic transitioning. Please let us know your further findings.

However, we struggle to reproduce the issue which may seem to be modem-dependent. In case of problems like these, we would appreciate you sharing more details about the router model/specifics and settings (if you customized any). Thanks.

Michele Moramarco Prusa Research

pilotak commented 2 months ago

it's happening on Mikrotik HAP AX3

chinskiy commented 2 months ago

Also faced this issue with Mikrotik hAP ax3 Can confirm that disabling automatic transitioning mode WPA2/WPA3 solves an issue like @Prusa-Support suggested

MarcusPocus66 commented 2 months ago

Faced the issue with HP / Aruba AP12 semi-commercial access points. The only option I have is “WPA2+WPA3 personal”.

De : Dmytro Vdovychynskyi @.> Envoyé : 7 mai 2024 13:15 À : prusa3d/Prusa-Firmware-Buddy @.> Cc : MarcusPocus66 @.>; Comment @.> Objet : Re: [prusa3d/Prusa-Firmware-Buddy] [BFW-5393] [BUG] 6.0.0 - Wifi doesn't work in WPA3/WPA2 Transition mode (Issue #3864)

Also faced this issue with Mikrotik hAP ax3 Can confirm that disabling automatic transitioning mode WPA2/WPA3 solves an issue like @Prusa-Supporthttps://github.com/Prusa-Support suggested

— Reply to this email directly, view it on GitHubhttps://github.com/prusa3d/Prusa-Firmware-Buddy/issues/3864#issuecomment-2098933100, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BIBFHC4X5MFKK3PO64ZTRGLZBEDY7AVCNFSM6AAAAABFOOKS7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYHEZTGMJQGA. You are receiving this because you commented.Message ID: @.**@.>>

onovy commented 2 months ago

Can confirm on Mikrotik cAP ac with "new" wifi drivers (wifi-qcom-ac). Relevant part of configuration:

/interface wifi security
add authentication-types=wpa2-psk,wpa3-psk disable-pmkid=yes disabled=no encryption=ccmp ft=yes ft-over-ds=yes group-encryption=ccmp name=Name wps=disable
tjdomsalla commented 2 months ago

Same issue here. Using a Fritz!Box 7590. After changing the WPA method from "WPA2 (CCMP)" to "WPA + WPA2" is seems to work now.

mitchellj commented 1 month ago

Same issue using a Mikrotik hAP ax3

pikdum commented 1 month ago

Running into this issue with a TP-Link AC1200 v2 running OpenWrt 23.05.3.

cbricart commented 1 month ago

I also face this issue since upgrading the MK4 to 6.0.0 funnily enough - for exactly such reasons - my WiFi sticks to a WPA2 rather than WPA2+3-Transition configuration. However, this TP-Link-Omada also advertises PMF as "capable" by default - even in WPA2-only mode - so that matter might hint at PMF again.

Gyrxiur commented 1 month ago

For anyone asking themselves, still not fixed in 6.0.2, don't bother switching your router settings back to WPA3 transitioning mode.

mitchellj commented 3 weeks ago

Having to work around this problem by having a wifi extender plugged into the power strip under the prusa and running a RJ45 cable from the wifi extender to the printer. @Prusa-Support any update since May 7th?

CZDanol commented 3 weeks ago

@pikdum "TP-Link AC1200" is not an exact model name. Can I ask you to provide the exact model name of your router?

pikdum commented 2 weeks ago

My bad, I meant TP-Link TL-WA1201 v2.

CZDanol commented 2 weeks ago

@pikdum okay, thanks. We'll get the router and try debugging it in our office :)

jaromirk commented 2 weeks ago

@CZDanol I can send you my mikrotik config if needed. Mikrotiks will be likely easier to get.

onovy commented 2 weeks ago

I already did: https://github.com/prusa3d/Prusa-Firmware-Buddy/issues/3864#issuecomment-2098963005

kwinsch commented 1 week ago

Also tried it with 6.0.3 on a MK4. Still not working and had to downgrade to version 5 firmware.