全能電路設計實戰

2018年6月24日 星期日

使用pyserial讀取Serial資料










Trouble Shooting


 pip3 install pyserial

Traceback (most recent call last):
  File "serial.py", line 1, in <module>
    import serial
  File "/home/pi/serial.py", line 3, in <module>
    port = serial.Serial("/dev/ttyUSB0", baudrate=9600, timeout=3.0)
AttributeError: module 'serial' has no attribute 'Serial'

解法:  pip3 uninstall serial

>>> import serial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: bad magic number in 'serial': b'\x03\xf3\r\n'

解法:  find . -name \*.pyc -delete




https://goo.gl/EcCcj7

1 則留言 :

  1. Read the information you share, it is very helpful for me. Hope I will learn more interesting information on your blog.
    Đến với Proship khách hàng sẽ được sử dụng những dịch vụ tốt nhất, chất lượng nhất, thời gian nhanh nhất và đặc biệt giá cả cạnh tranh nhất.
    Dịch vụ vận chuyển ô tô
    Dịch vụ cho thuê xe tải
    Vận chuyển xe máy bằng tàu hỏa
    Dịch vụ chuyển hàng bằng container,...

    回覆刪除