Python Micro:bit Bitio Error – microbit.repl.repl.REPLException: Timeout trying to receive

Question:

I have a micro:bit (v1.3 B) and am trying to use the Python bitio library on a MacBook (macOS Monterey). I’ve been following the getting started section and have gotten to the ‘making a connection’ section.

I’ve already ‘flashed’ the bitio.hex file to the micro:bit by uploading the file, and it successfully shows the bitio logo, like shown here.

When I run python3 counter.py it gives me the following error:

microbit.repl.repl.REPLException: Timeout trying to receive [
raw EPL; CTRL-B to exit
>]

The full traceback:

Traceback (most recent call last):
  File "/Users/User/Downloads/bitio-master/src/counter.py", line 3, in <module>
    import microbit
  File "/Users/User/Downloads/bitio-master/src/microbit/__init__.py", line 130, in <module>
    repl.to_raw()
  File "/Users/User/Downloads/bitio-master/src/microbit/repl/repl.py", line 109, in to_raw
    self.wait_repl_response()
  File "/Users/User/Downloads/bitio-master/src/microbit/repl/repl.py", line 143, in wait_repl_response
    self.receive("rnraw REPL; CTRL-B to exitrn>", timeout=2)
  File "/Users/User/Downloads/bitio-master/src/microbit/repl/repl.py", line 82, in receive
    raise REPLException("Timeout trying to receive [%s]" % buffer)
microbit.repl.repl.REPLException: Timeout trying to receive [
raw EPL; CTRL-B to exit
>]

The full output:

User@Users-Macbook-Pro src % python3 counter.py
No micro:bit has previously been detected
Scanning for serial ports
remove device, then press ENTER
scanning...
found 137 device(s)
plug in device, then press ENTER
scanning...
found 138 device(s)
found 1 new device
selected:/dev/tty.usbmodem14202
Do you want this device to be remembered? (Y/N)Y
connecting...
Traceback (most recent call last):
  File "/Users/User/Downloads/bitio-master/src/counter.py", line 3, in <module>
    import microbit
  File "/Users/User/Downloads/bitio-master/src/microbit/__init__.py", line 130, in <module>
    repl.to_raw()
  File "/Users/User/Downloads/bitio-master/src/microbit/repl/repl.py", line 109, in to_raw
    self.wait_repl_response()
  File "/Users/User/Downloads/bitio-master/src/microbit/repl/repl.py", line 143, in wait_repl_response
    self.receive("rnraw REPL; CTRL-B to exitrn>", timeout=2)
  File "/Users/User/Downloads/bitio-master/src/microbit/repl/repl.py", line 82, in receive
    raise REPLException("Timeout trying to receive [%s]" % buffer)
microbit.repl.repl.REPLException: Timeout trying to receive [
raw EPL; CTRL-B to exit
>]
Asked By: realhuman

||

Answers:

Fixed the issue, turns out I had to give the terminal (or whatever editor/IDE used) full disk access in settings

Answered By: realhuman
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.