micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

IndexError: bytes index out of range

Open MikeZhou-UofT opened this issue 2 months ago • 1 comments

When I run the code simple.py on a Pi Pico.

I was getting "IndexError: bytes index out of range" after the internet was connected, but the MQTT broker connection failed.

From line 112 of simple.py: assert resp[0] == 0x20 and resp[1] == 0x02

It was saying "in connect" but afterward, it is giving me IndexError: bytes index out of range. Has anyone had this issue before?

What I have to do is unplug the USB and plug it back in multiple times to make it work.

MikeZhou-UofT avatar Nov 10 '25 02:11 MikeZhou-UofT