Git Product home page Git Product logo

Comments (17)

nplan avatar nplan commented on July 19, 2024 3

I released v2.0.5 with this fix and also added support for setting static IP, which should further reduced the reaction time.

from homebuttons.

nplan avatar nplan commented on July 19, 2024 1

@hilsonp Sure, I'll add static IP in the future.

from homebuttons.

nplan avatar nplan commented on July 19, 2024

I guess it's taking that long to obtain the IP from you router... What router setup do you have? EAP610 is just an access point if I'm correct?

Would be really helpful if you could provide logs. There's a debug "connector" next to reset button. You can connect a USB to UART adapter to the TX and RX pins and then use a serial monitor. The baud is 115200. But please flash (with OTA) the attached debug build first so the log will be more verbose.

homebuttons_fw_v2.0.4_debug.bin.zip
(extract the zip first)

from homebuttons.

PaulRitzkat avatar PaulRitzkat commented on July 19, 2024

The EAP610 is just an AP, thats correct. The fritzbox is the DHCP server and is set to always give the same IP to the homebutton esp. Can I set a static IP? With WPA+WPA2 the connection time is under 2 seconds, I would says ~1,5

I flashed the debug firmware, but I don't get any output on serial (with screen /dev/ttyUSB0 115200, even tried switching RX/TX pins). I checked with an ESP8266 and that one worked with my FTD1232.
IMG_0494

from homebuttons.

nplan avatar nplan commented on July 19, 2024

Sorry, gave you wrong instructions.... You should connect TX pin of Home Buttons to RX pin of UART adapter and GND to GND.

I think you should also move the jumper on you adapter. It should be set to 3.3v.

Please try again.

from homebuttons.

PaulRitzkat avatar PaulRitzkat commented on July 19, 2024

GND and TX/RX worked flawlessly :) I attached each a reset and button press from my fritzbox IOT WiFi with WPA+WPA2 and one from my EAP Skynet WiFi with WPA2+WPA3 (two button presses for good measure)
homebutton_iot.log
homebutton_skynet.log

from homebuttons.

NicoDreamzZ avatar NicoDreamzZ commented on July 19, 2024

Would it be an advantage if we provided a static IP configuration?

from homebuttons.

nplan avatar nplan commented on July 19, 2024

@PaulRitzkat Thanks for the logs. It seems to me that your access point has a certain timeout before a device can connect again if it has tried to connect recently. The timeout seems to be around 20 seconds. Could you check in the configuration if there's a setting like that?

Home Buttons is trying to connect twice shortly one after another.

  1. The first try is only using ssid and password - this is successful and takes the expected time
  2. Then it saves the bssid and channel info and tries to connect again to confirm the settings - this fails due to 4way handshake timeout
  3. Then it is retrying in a loop and finally succedes after around 20s

Try this please:

  1. Press a button
  2. Wait until it connects (20 seconds), sends mqtt message and goes to sleep
  3. Wait 60s
  4. Press the button again and observe what happens

And paste here the log.

@NicoDreamzZ Based on logs this seems to be an authorization issue, not a DHCP issue so I don't think it would make any difference.

from homebuttons.

PaulRitzkat avatar PaulRitzkat commented on July 19, 2024

Thank you for your time! I don't have any "security" settings regarding reconnect times or similar, but I've got logs in the omada controller regarding the ESP connects:

Mar 15, 2023 23:21:59 esp32s2-A44230 is disconnected from SSID "Skynet" on AP Flur (1m connected, 2.70KB).
Mar 15, 2023 23:15:58 [Failed]esp32s2-A44230 failed to connected to AP Flur with SSID "Skynet" on channel 11 because WPA Authentication times out/failed.(1 time in a minute)
Mar 15, 2023 23:15:08 esp32s2-A44230 is connected to AP Flur with SSID "Skynet" on channel 11.

Logfile with a couple button presses with >60s wait (second/third time didn't take 20s, more ~8s): homebutton.log

Logfile with failure, auto wakup from sleep to send data: homebutton_sleep.log

from homebuttons.

nplan avatar nplan commented on July 19, 2024

The first log looks fine. At first press it does the normal slow connect because it was reset prior to that. On the next two presses it uses quick connect (with bssid and channel) which succeed normally. It does take a bit longer than it should because of two reasons: 1. this is debug build which boots slower, 2. due to WPA3 (I'm looking into if this could be improved)

In the second log the quick connect fails due to AUTH_EXPIRE which I'm not sure what it means. But then it connects using normal slow mode as expected.

Did you try rebooting your router and access point?

Also I randomly found this: https://community.home-assistant.io/t/esphome-wifi-auth-expired/443790/28
The poster has basically the same situation: using channel 11 and is getting both AUTH_EXPIRE and 4WAY_HANDSHAKE_TIMEOUT exactly like in your case.

Please try changing the channel to see what happens.

from homebuttons.

hilsonp avatar hilsonp commented on July 19, 2024

from homebuttons.

PaulRitzkat avatar PaulRitzkat commented on July 19, 2024

Interesting with CH11, I rebootet the AP and switched to CH6 (20MHz width), but sadly no luck with quicker logins.

all slow connects: homebutton.log: reset; button press; ~60s wait; button press (~20s); ~80s wait; button press (~30s); 20s wait; button press (~34s); wake up from sleep
and one log from a quick connect: homebutton_quick.log

Same errors in the AP logs: [Failed]esp32s2-A44230 failed to connected to AP Flur with SSID "Skynet" on channel 6 because WPA Authentication times out/failed.(4 times in a minute)

Most of the time its slow (>10s) and sometimes its quicker and immediately after its another slow connect. Channel utilization is between 30% and 40% and the area here has lots of other 2.4GHz networks. If I move the homebutton directly under the AP the chance of quicker connect gets better.

Can I solder an antenna somewhere to see if that helps? I can run a separate IOT WiFi directly from my fritzbox and can use it, but fast WPA3 connects would be nice :)

from homebuttons.

nplan avatar nplan commented on July 19, 2024

Are those two different networks in the last two logs or did you edit the ssid and bssid in one of them to hide it?

There's nowhere to connect an external antenna unfortunately.

If you can use another network that's the best option right now. I'm looking into it but I don't have a solution yet.

from homebuttons.

PaulRitzkat avatar PaulRitzkat commented on July 19, 2024

Oh, yeah those are the same networks, I forgot to hide it :D

No worries, I'll use a dedicated IOT network in the meantime. If you need someone to test something, just ping me :)

from homebuttons.

nplan avatar nplan commented on July 19, 2024

Please try this build. I'm not sure if it will solve your issue, but it reduces the connection time by about 40% for both WPA2 and WPA3.

In testing I get the average connection times:

  • WPA2: 980 ms
  • WPA3-SAE: 2665 ms

homebuttons_fw_v2.0.5-beta.bin.zip
(extract the zip first)

from homebuttons.

Zixim avatar Zixim commented on July 19, 2024

I also just tried it, and there's indeed a serious difference in the connection speed. Great job !!
Next thing that will make a real difference is setting a fixed IP in the device. (which is a feat. that was already req'd in another post)

from homebuttons.

PaulRitzkat avatar PaulRitzkat commented on July 19, 2024

Thats better :) I still sometimes get longer delays, but that might be the wall the box is mounted to (or other 2.4GHz networks interfering).

from homebuttons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.