Replies: 3 comments 2 replies
-
I have no idea why the Ideas to increase performance:
|
Beta Was this translation helpful? Give feedback.
-
ESPNow does not use sockets. |
Beta Was this translation helpful? Give feedback.
-
Came through on my Gmail account ... I guess it will show-up here later. Yes. Have a read through this: https://randomnerdtutorials.com/esp-now-esp32-arduino-ide/
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm new to the uasyncio tcp communication, I will try to make it as short as possible.
I have 3 ESP32, one acts as WiFi router/access point. Two are connected to the router or acts as station.
so I have a server in one of the ESP32. [for example, 192.168.0.3 is server]
whenever I sent data from the other device to the server, I create a asyncio.open_connection connection and send data.
it seems it takes about 1 seconds to make the connection, Is it normal? Since I need to communicate very often to multiple server, making it connect every-time seems quite time consuming which is not feasible in my case.
Is there any workaround or any other idea to do it? I'm trying to communicate between multiple ESP32, some acts as server and client at the same time too. and communication is quite frequent, communication more like star topology.
for simple test, i did the following:
server:
async def send_server(msg, gateway, port):
print("before conn",utime.ticks_ms()/1000)
reader, writer = await asyncio.open_connection(str(gateway), port)
print("after conn",utime.ticks_ms()/1000)
l = "{:0>4}".format(str(len(str(msg))))
writer.write("{0}{1}".format(l, msg))
await writer.drain()
print("sending",utime.ticks_ms()/1000)
writer.close()
await writer.wait_closed()
print("closed", utime.ticks_ms())
client:
async def server_callback(reader, writer):
data = await reader.read(4)
data = await reader.read(int(data.decode()))
parsed = ujson.loads(data.decode())
print("data is ", data.decode())
writer.close()
await writer.wait_closed()
and the output in from the server is [for example]:
before conn 69.283
after conn 70.364
sending 71.157
closed 71161
Beta Was this translation helpful? Give feedback.
All reactions