Not "pickle", even "json" over "sockets" #10471
Replies: 5 comments 13 replies
-
I suggest you also print |
Beta Was this translation helpful? Give feedback.
-
I assume your
Are you sure you are connecting and sending anything ? |
Beta Was this translation helpful? Give feedback.
-
@nastiliano |
Beta Was this translation helpful? Give feedback.
-
Thank you very much guys, but I'm still a little bit desperate :) I tried all adding Sleep: And I tried: Data1 always is empty. I think my problem is on client code. I think nothind is sended with this syntax: |
Beta Was this translation helpful? Give feedback.
-
Your server code: listening_socket = socket.socket(socket.AF_INET , socket.SOCK_STREAM)
listening_socket.setsockopt(socket.SOL_SOCKET , socket.SO_REUSEADDR , 1)
listening_socket.listen(1)
client_socket , addr_port = listening_socket.accept()
deserialised_connection_data = client_socket.recv(...).... obviously nowhere tells your listening socket on which port the server should run. Perhaps the May I suggest you read (and try to understand) at least a little about TCP/IP ? |
Beta Was this translation helpful? Give feedback.
-
Hi, everyone.
With Micropython 4.19.1 in my ESP32 I'm not able to implement "pickle", even "json".
I just want to send a string list over Wifi. PC (Tx) to ESP32(Rx).
In my ESP32 importing "pickle" the console output simply is: the module not exist
And using "json" the follows doesn't work:
PC code:
...
list = ["hello" , "world"]
...
socket.sendall(json.dumps(list))
ESP32 code:
...
client_socket , addre_port = listening_socket.accept()
data1 = client_socket.recv(1024)
data2 = json.loads(data1)
print(data2)
ESP32 console output:
...
ValueError: syntax error in JSON
Could someone help me?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions