ラズパイでMHZ19Bが動作しない時のエラーパラーン(切り分け用)

UARTが有効になっていない。

pi@raspberrypi:~ $ sudo cat /boot/config.txt |grep uart
enable_uart=0
pi@raspberrypi:~ $ sudo python3 -m mh_z19
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/serial/serialposix.py", line 265, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/ttyAMA0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/mh_z19/__init__.py", line 62, in mh_z19
    ser = connect_serial()
  File "/usr/local/lib/python3.7/dist-packages/mh_z19/__init__.py", line 58, in connect_serial
    timeout=1.0)
  File "/usr/local/lib/python3.7/dist-packages/serial/serialutil.py", line 240, in __init__
    self.open()
  File "/usr/local/lib/python3.7/dist-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyAMA0: [Errno 2] No such file or directory: '/dev/ttyAMA0'
A dependency job for serial-getty@ttyAMA0.service failed. See 'journalctl -xe' for details.
null

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です