Problem with WiFi AP Mode and tablet

Rocker
Posts: 24
Joined: Fri Apr 21, 2017 10:30 pm

Problem with WiFi AP Mode and tablet

Postby Rocker » Sun Jun 03, 2018 4:20 pm

I'm using the 2.1 version of the IDF using the ESP32 WROOM module on a custom board. I have things set up to operate in AP mode or STA mode (AP mode when another router is not available). When in AP mode, I can connect and talk to my laptop just fine. I'm sending a number of small data packets (around 350/sec) with a total throughput of around 7.5 kBytes/sec - which isn't really a lot of traffic. When I connect with a couple of different Windows 10 tablets (Azpen, NuVision), packets are dropped in large numbers. On the ESP code, I log when I try to send a message, but it would block - this happens repeatedly with hundreds of messages dropped in a row.

On the other hand, if I connect to my home WiFi router and operate in STA mode, the same tablet gets very reliable data transfer. There are occasional strings of messages that are dropped, but this is infrequent and the situation quickly gets resolved instead of continuing in that states for multiple seconds.

Has this been addressed in the move to 3.0? Going to 3.0 is a serious problem for me because the SPI driver has some significant changes since 2.1 which will break other parts of my system.

Thanks,
Rob

Rocker
Posts: 24
Joined: Fri Apr 21, 2017 10:30 pm

Re: Problem with WiFi AP Mode and tablet

Postby Rocker » Sun Jun 03, 2018 6:34 pm

I did test v3.0 of the IDF and had the same results in AP mode.

Rocker
Posts: 24
Joined: Fri Apr 21, 2017 10:30 pm

Re: Problem with WiFi AP Mode and tablet

Postby Rocker » Tue Jun 05, 2018 2:21 pm

I had a friend recommend looking at whether the tablet and laptop connected to the ESP in different modes. In fact, the tablet connects in 802.11g, while the laptop connects in 802.11n. Is there a way to force the ESP to only use 802.11n? I'm not sure that this even makes a difference, but it would be nice to test.

Rocker
Posts: 24
Joined: Fri Apr 21, 2017 10:30 pm

Re: Problem with WiFi AP Mode and tablet

Postby Rocker » Thu Jun 07, 2018 11:56 pm

I'm getting a lot of message drops (TCP/IP) going from the ESP to a tablet. I'm speculating that ties up all the ESP32 buffers waiting for ACKs to come back, resulting in send() blocking. Regardless, the destination does not receive the data unless the packet rate is very low. This doesn't only happen in AP mode and doesn't only happen with 802.11g (as I thought earlier).

Does anyone else see poor WiFi send performance?

genedyne
Posts: 18
Joined: Wed Jun 06, 2018 12:47 pm

Re: Problem with WiFi AP Mode and tablet

Postby genedyne » Fri Jun 08, 2018 6:34 pm

If I understand your setup correctly:
- when you connect the laptop/tablet to the ESP32 (running in AP mode, no intervening router), you get a large number of dropped packets & long delays.
- when you connect the laptop/tablet to the ESP32 (running in STA mode, WITH a router providing connectivity to both laptop & ESP32), you get good throughput & no dropped connections.

If the above is correct, I'd suggest you try the second arrangment (with the router), but REMOVE the uplink from the router. I suspect the laptop/tablet is looking for a connection to 'the internet'. When it doesn't find one (in your first scenario), it classifies the WIFI link as 'poor', and starts scanning for 'a better link'. While it's off looking for something better, your ESP32 is sitting there stacking up packets, waiting for ACKs, and going through its retransmission algorithm.

Rocker
Posts: 24
Joined: Fri Apr 21, 2017 10:30 pm

Re: Problem with WiFi AP Mode and tablet

Postby Rocker » Sun Jun 10, 2018 7:24 pm

Thanks. That's not quite it, but you could be on to something. I have a Dell laptop that does great using the ESP32 as an AP. But most tablets don't. However, I did a wireshark capture and saw many attempts by the tablet to use the ESP32 as a gateway for messages to internet destinations. I didn't see that on the laptop, only some rejected ICMP packets. I'll look at how the networks are configured on the laptop vs tablet to see if there is any difference that would make one try to get to the internet and the other not to try.

Who is online

Users browsing this forum: VinayDand and 447 guests