Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Low rate of UDP package #74

@filipeaguiar22

Description

@filipeaguiar22

Hi everyone,

I am trying to short the latency to the minimum using WiFi.
Using a very simple code, I found that the max rate of UDP packages I can send in one per 25ms. If I lower the delay, the I get the error OSError:ENOMEM (out of memory).
What do you think can be done to increase the frequency?

Filipe

`
.
import network
import time

nic = network.WLAN(network.STA_IF)
nic.active(True)
nic = network.WLAN(network.STA_IF) # create station interface
nic.connect('MOTOROLA-46320', 'test') # connect to an AP
time.sleep(5)

#send udp:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
address = ('192.168.10.8', 57029)
#address = ('192.168.10.8', 57855)
#s.setblocking(False)
s.connect(address)

print(s)
print("Bombarding started")
k=0
while (True):
data = b'hello udp'
k=k+1
data = str.encode("i: {}".format(k))
s.sendall(data)
time.sleep(0.025)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions