ESP32 Networking Question #9934
-
I have a The following code is intended to receive the sinewave on port 55000 at the PC or the The code works in Does anyone have an idea of what I can try to debug the path from try:
import usocket as socket
import esp_network
esp_network.do_connect()
uc_server_addr = ("192.168.1.11", 55000)
except:
import socket as socket
uc_server_addr = ("192.168.1.22", 55000)
pc_server_addr = ("192.168.1.22", 56000) # This is IP of the server (gnuradio udp source)
# Socket to exchange data with GR
c = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(uc_server_addr)
BUFFER = 8192
while True:
samples, address = s.recvfrom(BUFFER)
print(samples)
c.sendto(samples, pc_server_addr) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I simplified the code to focus only on the try:
import socket as socket
import esp_network
esp_network.do_connect()
uc_server_addr = ("192.168.1.11", 55000)
except:
import socket as socket
uc_server_addr = ("192.168.1.22", 55000)
# Socket to exchange data with GR
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
binding = s.bind(uc_server_addr)
print(f'binding = {binding}')
BUFFER = 4
samples, address = s.recvfrom(BUFFER)
print(f'number of bytes received = {len(samples)}') In
I did not expect the binding to have the value When running at the
Note that the |
Beta Was this translation helpful? Give feedback.
-
I wrote a client in python, and it is able to communicate with the |
Beta Was this translation helpful? Give feedback.
I wrote a client in python, and it is able to communicate with the
esp32
. So the issue must be in mygnuradio
workflow. Since it doesn't appear to have anything to do withmicropython
, I'll mark the topic as answered.