Skip to content

Pico W: Issues with ussl / usocket with encrypted MQTT #9259

Discussion options

You must be logged in to vote

@IanW6374 could you add this to verify that sock.write(msg) is sending the whole message?

...
print(len(msg))
print(sock.write(msg))
...

From MicroPython docs about socket.write

Write the buffer of bytes to the socket. This function will try to write all data to a socket (no “short writes”). This may be not possible with a non-blocking socket though, and returned value will be less than the length of buf.

So both values should be the same, if not then there is the problem.
In case they are the same, I would try to use Wireshark and see if I can spot any differences between Python and MicroPython. 🤔

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@IanW6374
Comment options

@Carglglz
Comment options

@IanW6374
Comment options

@fishjoe
Comment options

@IanW6374
Comment options

Answer selected by IanW6374
Comment options

You must be logged in to vote
3 replies
@IanW6374
Comment options

@fishjoe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment