[FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
User avatar
Pepsi92
Posts: 6
Joined: Friday 03 February 2017 10:18
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

[FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Post by Pepsi92 »

Hello everyone,

I'm using Domoticz for 7 years and I'm taking the opportunity of the migration to zwave-js-ui to reinstall everything from scratch with a completely new architecture (docker, mqtt, zwave-j-ui,...). As I'm also discovering Docker and MQTT it is not as easy as I thought to have everything working :lol:

As a matter of principle, I try to have all the components running as non-root users. It works ok with mosquitto and zwave-js-ui but I'm stuck with Domoticz. It seems to work correctly, except that I cannot see the serial devices when trying to add new hardware (Teleinfo EDF and RFXtrx433 USB devices).

The devices are correctly mapped in the container but Domoticz does not detect them and does not propose them in the dropdown list in the hardware tab (list is empty) :cry:

Domoticz hardware form
Domoticz hardware form
Capture 2023-11-04 à 17.30.15.png (218.43 KiB) Viewed 3581 times

... whereas the devices exist in the container (/dev/linky and /dev/RFXtrx433)

Existing devices in the container
Existing devices in the container
Capture 2023-11-04 à 17.34.05.png (176.32 KiB) Viewed 3581 times

I use the following docker compose file to create the container (part of a Portainer stack) :

Code: Select all

version: "3.8"
services:
  domoticz:
    image: domoticz/domoticz:beta
    container_name: domoticz
    restart: unless-stopped
    user: 5000:20
    environment:
      - WWW_PORT=8080
      - SSL_PORT=8443
      - TZ=Europe/Paris  
    ports:
      - 8080:8080
      - 8443:8443
    networks:
      - domo-net
    volumes:
      - /home/domoticz/data:/opt/domoticz/userdata
    devices:
      - '/dev/serial/by-id/usb-Cartelectronic_Interface_USB_1_TIC_DA1U76CP-if00-port0:/dev/linky'
      - '/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A13UIUO-if00-port0:/dev/RFXtrx433'

<...>

networks:
  domo-net:
UID 5000 (domoticz) is the UID of the domoticz user on the raspberry and GID 20 (dialout) id the GID allowing access to the /dev/USB* devices.

Any idea why these devices are not showing in Domoticz?

Thanks a lot for your help

Edit: same issue when Domoticz is running as root :(
Last edited by Pepsi92 on Sunday 05 November 2023 12:33, edited 1 time in total.
Domoticz Beta 2023.2-15636
Raspberry Pi 4 - RaspiOS Lite 64 bits Bullseye 2023-10-10
RFXCOM RFXtrx433E - Ext/1011
AEON LABS Z-Wave Plus Z-Stick GEN5
USBTIC Teleinfo module
User avatar
Pepsi92
Posts: 6
Joined: Friday 03 February 2017 10:18
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Post by Pepsi92 »

FIXED !

Domoticz seems to only support /dev/ttyUSB* or /dev/ttyACM* serial port names.

Replacing /dev/linky by /dev/ttyUSB0 and /dev/RFXtrx433 by /dev/ttyUSB1 fixed the problem.
Domoticz Beta 2023.2-15636
Raspberry Pi 4 - RaspiOS Lite 64 bits Bullseye 2023-10-10
RFXCOM RFXtrx433E - Ext/1011
AEON LABS Z-Wave Plus Z-Stick GEN5
USBTIC Teleinfo module
D3ni3d
Posts: 3
Joined: Thursday 13 September 2018 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France
Contact:

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Post by D3ni3d »

What the hell !!!!!
2 weeks I'm looking to find "why my fu****g ttyAMA0 is not available in Domoticz ?"

And you save my life !!!
I've the same config, same starting point : reinstall everything from scratch with a completely new architecture (docker, mqtt, zigbee2mqtt). I'm also discovering Docker ... :D

But the real question : why does serial ports are filtered in domoticz's IHM ?

Bref, maintenant, tout est retombé en marche grâce à toi : merci !!!
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Post by gizmocuz »

Well yes it does make sense... If you type

ls /dev

you will see many devices... How would one know which one is a serial port?

Domoticz lists all devices starting with /dev/ttyUSB*, and /dev/serial/by-id

You could also mount to the same mount point like:

- '/dev/serial/by-id/usb-Cartelectronic_Interface_USB_1_TIC_DA1U76CP-if00-port0:/dev/serial/by-id/usb-Cartelectronic_Interface_USB_1_TIC_DA1U76CP-if00-port0
Quality outlives Quantity!
solarboy
Posts: 320
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Post by solarboy »

gizmocuz wrote: Saturday 06 January 2024 8:06

You could also mount to the same mount point like:

- '/dev/serial/by-id/usb-Cartelectronic_Interface_USB_1_TIC_DA1U76CP-if00-port0:/dev/serial/by-id/usb-Cartelectronic_Interface_USB_1_TIC_DA1U76CP-if00-port0
I just tried that with
devices:
- "/dev/serial/by-id/usb-0658_0200-if00:/dev/serial/by-id/usb-0658_0200-if00"
- "/dev/serial/by-id//usb-1a86_USB2.0-Ser_-if00-port0:/dev/serial/by-id//usb-1a86_USB2.0-Ser_-if00-port0"
and still got the blank form.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Post by gizmocuz »

How about you try

- "/dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyUSB0"

And for sure you need to replace 'usb-0658_0200-if00-port0' with your real serial device that you should be able to find with

ls /dev/serial-by-id
Quality outlives Quantity!
tulips
Posts: 10
Joined: Wednesday 22 July 2020 23:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Post by tulips »

I can't mange to get it work. Only by usb0 and usb1 and so. No solution to link it to Id?

Use unraid
User avatar
waltervl
Posts: 5374
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: [FIXED] Domoticz on Docker (non-root user): Serial devices not showing in "hardware" form

Post by waltervl »

tulips wrote: Monday 13 January 2025 9:17 I can't mange to get it work. Only by usb0 and usb1 and so. No solution to link it to Id?

Use unraid
What are you not getting to work? Connect a USB device to the docker environnment?
Give your Docker-compose.xml file please.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest