dchristl / esp32_nat_router_extended

a simple ESP32 NAT Router with some additional features
308 stars 60 forks source link

Question about auth mode #110

Closed gitfvb closed 8 months ago

gitfvb commented 8 months ago

Hi @dchristl,

This project is really cool. Got it working so far and in a speedtest I get up to 15Mbit/s, which is very impressing, but when trying to connect my TV, it only supports WPA2PSK(AES), WPA2/WPA Mixed PSK and WPA3-Personal. Without encryption it works, but that was more for debug purposes.

I have found to right place to change the .authmode but I haven't found the possible options I can enter before compiling. And maybe .pairwise_cipher needs a change, too. Do you have any idea what to enter to get it working?

dchristl commented 8 months ago

Hello @gitfvb ,

the current auth-mode already supports maximum compatibility. Normally, WPA2 PSK should also be possible. I wouldn't know what else I could do. If you want to compile and try it yourself, you can find possible values here, starting at line 60. The cipher-possibilities start at line 178.

Please let me know, what options work.

Kind Regards, Danny

gitfvb commented 8 months ago

Nice @dchristl , thanks for that list. That was exactly what I was searching for. I suspected it to be the cipher, but CCMP was fine. Instead the TV needed the authmode WIFI_AUTH_WPA2_PSK instead of WIFI_AUTH_WPA2_WPA3_PSK

Now it works like a charm to stream Disney+, thanks :-)

dchristl commented 8 months ago

Great that it's working now, although I find it a bit strange. According to the documentation, WIFI_AUTH_WPA2_WPA3_PSK includes WIFI_AUTH_WPA2_PSK and automatically negotiates the possible encryption with the device. It seems like that's not working in your case. I'll look into whether I can expand on that or find out more.

gitfvb commented 8 months ago

This setting definitely made the difference. I have also changed the esp_nat_router.c to this so it scans for all networks first and then connects to the one with the best rssi. In our house network we have multiple mesh devices and it can happen, that the device connects to the wrong repeater. I don't know if that change makes a difference yet.

    /* ESP WIFI CONFIG */
    wifi_config_t wifi_config = {
        .sta = {
            .scan_method = WIFI_ALL_CHANNEL_SCAN,
            .sort_method = WIFI_CONNECT_AP_BY_SIGNAL}};