ParadoxAlarmInterface / hassio-repository

HASS.IO repository
Eclipse Public License 2.0
12 stars 17 forks source link

Serial port not detected #6

Closed nardusleroux closed 4 years ago

nardusleroux commented 4 years ago

Hi, Thanks for great work to add PAI to hass.io!

Issue solved, but thought that I will add instructions on how to overcome this. Not sure whether this will make sense to add in future release since highly dependent on setup.

I am using the Paradox 306USB converter which exposes itself as ttyUSB0 on host and addon complained about port not being available. I added the following line to config.json "devices": ["/dev/ttyUSB0:/dev/ttyUSB0:rwm"],

Also had to add udev rule on host to allow non root user access to serial device. I used instructions as per https://stackoverflow.com/questions/24225647/docker-a-way-to-give-access-to-a-host-usb-or-serial-device

yozik04 commented 4 years ago

Probably for hass.io OS you would need to use privileged mode, because you do not have access to udev rules.

yozik04 commented 4 years ago

It is not possible to add devices to the config.json as it would require the device to exist on the host to start the container. Anyway linked to this issue from the wiki.

nardusleroux commented 4 years ago

Thanks, should have added, I am running Hasbian with docker and hassio on top of that, not hassos.

cybertza commented 4 years ago

Hey, so this is how i went about a similar install: https://github.com/ParadoxAlarmInterface/pai/wiki/Connection-methods#serial-over-ip-esp32

but i guess you could make a different TCP: serial on the host with socat or alike and then address it as a IP_CONNECTION_BARE = True

cybertza commented 4 years ago

https://www.losant.com/blog/how-to-access-serial-devices-in-docker let me know if this works?

cybertza commented 4 years ago

i see the IDE addon has this setting available, image

so i guess it may be possible to add for direct serial access?

cybertza commented 4 years ago

Ok so, here seems to be the solution, albeit i think you may have try this and let us know: https://developers.home-assistant.io/docs/en/hassio_addon_config.html

devices | list | no | Device list to map into the add-on. Format is: <path_on_host>:<path_in_container>:<cgroup_permissions>. i.e. /dev/ttyAMA0:/dev/ttyAMA0:rwm
-- | -- | -- | --

image

yozik04 commented 4 years ago

See my post https://github.com/ParadoxAlarmInterface/hassio-repository/issues/6#issuecomment-573293583

yozik04 commented 4 years ago

I fixed it proper way.

yozik04 commented 4 years ago

Released in 2.0.0