我有一个微:位(V1.3B),并且正在尝试在一个bitio图书馆 (macOS蒙特雷)上使用Python。我一直在跟踪入门部分,已经进入了“建立连接”部分。
我已经通过上传文件将bitio.hex文件“闪烁”到微:位,它成功地显示了bitio徽标,就像显示的这里一样。
当我运行python3 counter.py时,它会给出以下错误:
microbit.repl.repl.REPLException: Timeout trying to receive [
raw EPL; CTRL-B to exit
>]完整的回溯:
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("\r\nraw REPL; CTRL-B to exit\r\n>", 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
>]全部产出:
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("\r\nraw REPL; CTRL-B to exit\r\n>", 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
>]发布于 2022-11-06 14:44:56
修复了这个问题,结果我不得不在设置中给予终端(或任何编辑器/IDE)完整的磁盘访问权限。
https://stackoverflow.com/questions/74335503
复制相似问题