danielwelch / hassio-zigbee2mqtt

Hass.io add-on for zigbee2mqtt
Apache License 2.0
565 stars 190 forks source link

Socat unable to create Serial Device in /dev #535

Closed HarrisonPace closed 3 years ago

HarrisonPace commented 3 years ago

zigbee2mqtt add-on version (if edge, please report commit hash):

1.17.1

Operating environment (HassOS, Virtual Machine, Device/platform running Home Assistant):

HassOS

Description of problem:

As of 1.17, Socat is unable to create serial devices in /dev i.e. /dev/ttyZ2M:

Extract from the log: /share/zigbee2mqtt/socat.log

2021/02/10 22:06:54 socat[257] N PTY is /dev/pts/0
2021/02/10 22:06:54 socat[257] E unlink("/dev/ttyZ2M"): Read-only file system
2021/02/10 22:06:54 socat[257] N exit(1)

Creating the device in /tmp works. But the default configuration uses /dev.

Your entire configuration from the frontend (with sensitive fields redacted):

data_path: /share/zigbee2mqtt
external_converters: []
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server:  [REDACTED]
  user:  [REDACTED]
  password:  [REDACTED]
serial:
  port: /dev/ttyZ2M
advanced:
  log_level: info
  pan_id: [REDACTED]
  channel: 11
  network_key:
     [REDACTED]
  availability_blocklist: []
  availability_passlist: []
  rtscts: false
device_options: {}
blocklist: []
passlist: []
queue: {}
frontend:
  port: 8099
experimental:
  new_api: true
socat:
  enabled: true
  master: 'pty,raw,echo=0,link=/dev/ttyZ2M,mode=777'
  slave: 'tcp4:[REDACTED]:8485,ignoreeof'
  restartdelay: 1
  initialdelay: 1
  options: '-d -d'
  log: true

Your logs from Home Assistant

N/A

(Note: I tested the zigbee2mqtt/hassio-zigbee2mqtt addon, the issue is present in both addons. )

ciotlosm commented 3 years ago

Can you try https://github.com/zigbee2mqtt/hassio-zigbee2mqtt and see how it behaves?

HarrisonPace commented 3 years ago

Can you try https://github.com/zigbee2mqtt/hassio-zigbee2mqtt and see how it behaves?

It behaves the same as this addon i.e. /dev is read-only and socat fails to create a serial tty device in /dev.

ciotlosm commented 3 years ago

@thehaxxa You can try the solution suggested here: https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/issues/24 until we patch the defaults to change the location for the mapping.

ciotlosm commented 3 years ago

Closing this as it's covered under zigbee2mqtt/hassio-zigbee2mqtt#24