Hi all,
Totally new here. For a hobby project, I was planning to use ESP32-S3 on a custom PCB board. Board contains an accelerometer and I want to transmit that data over WiFi to a laptop/PC. I am looking for the lowest latency solution to transmit data from ESP32-S3 to the PC.
One way is to get ESP-32-S3 to connect to my Wifi Router and push to a server and pull that info from the server onto my laptop. But I would believe it would be too slow. Is there any way for me to directly push the data from the ESP to the laptop?I can set up a local hotspot on the laptop to connect to ESP32. If so, can I still maintain an active WiFi internet connection in the 2.4GHz band so that laptop can continue its internet access?
What are my options here? Is there any architecture scheme to transmit the esp32 data to the laptop faster via WiFi? Not looking at BLE as an option because the connection interval is at 7.5ms.
Can someone kindly help with this architecture?
ESP32-S3 WiFi connectivity with a laptop
-
- Posts: 4
- Joined: Fri Aug 18, 2023 4:23 am
Re: ESP32-S3 WiFi connectivity with a laptop
Hi,
Just a bump. Can anyone please help with this architecture?
Just a bump. Can anyone please help with this architecture?
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-S3 WiFi connectivity with a laptop
Can I ask what 'too slow' is here? Fwiw, if I ping my router from my laptop (which goes via a bunch of switches as well), I get about 3ms of latency. Would that be too much? Generally, we'd like it if you explained your use case a bit better; there may be other solutions that solve the issue.
On the question of if you could set up a hot spot on your laptop and still retain an Internet connection - that very much depends on your hardware and software, we can't really answer that.
If you want to keep the router out of the loop and don't want to mess around with hot spots, a third option would be to use two ESP32-S3 chips and use ESP-Now to communicate between them. You could then use e.g. USB to go from there to the laptop. (Although do note that I think USB would add half a ms to the average latency for that solution.)
On the question of if you could set up a hot spot on your laptop and still retain an Internet connection - that very much depends on your hardware and software, we can't really answer that.
If you want to keep the router out of the loop and don't want to mess around with hot spots, a third option would be to use two ESP32-S3 chips and use ESP-Now to communicate between them. You could then use e.g. USB to go from there to the laptop. (Although do note that I think USB would add half a ms to the average latency for that solution.)
-
- Posts: 4
- Joined: Fri Aug 18, 2023 4:23 am
Re: ESP32-S3 WiFi connectivity with a laptop
Thanks for the response. Appreciate it.
I don't have a latency delay number in mind as it's still in the architecture design phase. I am looking for the absolute fastest option fundamentally. I did consider the two ESP32-S3 options with one being connected as a USB dongle on a PC with communication between being WiFi though and not ESP-Now(it's a nice idea, it may be better), I was thinking it will be slower fundamentally via the USB approach than connecting directly to the laptop(acting as an Access point or ESP being an access point and laptop connecting to it) via a local network. But that introduces the concern of laptop/PC still being able to keep its internet connectivity. Is there any way to ensure that this can be done with any laptop/desktop or will it be hardware specific? I don't want to build a solution only catering to my setup only. I would like to avoid the 2 ESP32 approach if it's avoidable with second hardware but can pursue it if it's the fastest option.
I am assuming there are the following architectures
Can you please help with the above?
I don't have a latency delay number in mind as it's still in the architecture design phase. I am looking for the absolute fastest option fundamentally. I did consider the two ESP32-S3 options with one being connected as a USB dongle on a PC with communication between being WiFi though and not ESP-Now(it's a nice idea, it may be better), I was thinking it will be slower fundamentally via the USB approach than connecting directly to the laptop(acting as an Access point or ESP being an access point and laptop connecting to it) via a local network. But that introduces the concern of laptop/PC still being able to keep its internet connectivity. Is there any way to ensure that this can be done with any laptop/desktop or will it be hardware specific? I don't want to build a solution only catering to my setup only. I would like to avoid the 2 ESP32 approach if it's avoidable with second hardware but can pursue it if it's the fastest option.
I am assuming there are the following architectures
- ESP32-S3 sensor--> Laptop(Fastest I assume, ESP acting as an AP, Laptop connecting to it. The Con being, can laptop be connected to the internet?- Not sure of that, also range will be limited laptop's/desktop's WiFi range )
- ESP32-S3 sensor --> WiFi Router --> Laptop(via a local network approach, Not sure if this is possible or how to do this though)
- ESP32-S3 sensor--> WiFi Router(Push to server) --> Remote Server --> WiFi Router(Pull from Server) --> Laptop (I assume this will be slowest)
- ESP32-S3 sensor(Station Mode) ---[WiFi]---> ESP32-S3 USB dongle(AP mode) --> USB --> Laptop
- ESP32-S3 sensor---[ESP-Now]---> ESP32-S3 USB dongle --> USB --> Laptop
Can you please help with the above?
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-S3 WiFi connectivity with a laptop
Honestly, first I'd figure out what latency is acceptable, e.g. by reasoning it through or building a (wired) prototype. 'As fast as possible' is a bad requirement, as it's not a satisfiable requirement; there's always a way to compromise everything else and go even faster. You also want to specify 'latency' a bit better: what if for one or two samples the latency spikes to tens of mS, for instance?
As for latencies, seems that ESP-NOW is on average 2'ish mS, as I said WiFi via a router probably is 3 mS or something. I imagine anything that doesn't go via the Internet at large being similar.
As for latencies, seems that ESP-NOW is on average 2'ish mS, as I said WiFi via a router probably is 3 mS or something. I imagine anything that doesn't go via the Internet at large being similar.
-
- Posts: 4
- Joined: Fri Aug 18, 2023 4:23 am
Re: ESP32-S3 WiFi connectivity with a laptop
Thanks again for the inputs. If I have to put a number to a number to it, I would specify transmission latency to be in the 5ms range(I guess it's overspec-ed). The application is for a wireless controller for a PC similar to a gaming controller.
The point of "as fast as possible" was to avoid potential hop points as much as possible so that just because I architected in that way it's causing the delay.
The list in terms of delay(low to high) would be Option 1,2,5,4,3. If I have to choose between 1 and 2, 1 is only a possibility if internet connectivity can be maintained when a laptop can connect to ESP32 is Station mode.
Can you just let me know if there is a way to test out Options 1 and 2? Option 1 I believe can be tested with an ESP32 in AP mode and streaming data and connecting the laptop to it. Is there any dedicated project which I can refer to for receiving the data on the laptop? I can probably try it out. For option 2, I don't have an idea on how to configure that local network via the router.
The point of "as fast as possible" was to avoid potential hop points as much as possible so that just because I architected in that way it's causing the delay.
The list in terms of delay(low to high) would be Option 1,2,5,4,3. If I have to choose between 1 and 2, 1 is only a possibility if internet connectivity can be maintained when a laptop can connect to ESP32 is Station mode.
Can you just let me know if there is a way to test out Options 1 and 2? Option 1 I believe can be tested with an ESP32 in AP mode and streaming data and connecting the laptop to it. Is there any dedicated project which I can refer to for receiving the data on the laptop? I can probably try it out. For option 2, I don't have an idea on how to configure that local network via the router.
Who is online
Users browsing this forum: Majestic-12 [Bot] and 128 guests