The great Docker problem*

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Lizard
Posts: 7
Joined: Wednesday 04 October 2017 0:44
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: The great Docker problem*

Post by Lizard »

You need to uncomment devices:

and fix the indentation of that and of the usb stick
njlammerts
Posts: 139
Joined: Wednesday 12 August 2020 17:13
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Fryslan
Contact:

Re: The great Docker problem*

Post by njlammerts »

it already goes wrong at line 4, even with the device uncommented
Show me the right way instead of saying that something is wrong..
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: The great Docker problem*

Post by waltervl »

njlammerts wrote: Monday 29 April 2024 22:09 Show me the right way instead of saying that something is wrong..
I don't think this is the appropriate way to ask for help....

You should remove the # and a space to get the right indentation.
See the dashes after devices and ports are in the same column now (as an example, use your own usb by-id device)

Code: Select all

    container_name: domoticz
    restart: unless-stopped
    # Pass devices to container
    devices:
      - "/dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyACM0"
    ports:
      - "8080:8080"
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: The great Docker problem*

Post by Kedi »

Don't put a screenprint of that file but post that exact file here and I will run that compose file and see what happens at my test system.
Logic will get you from A to B. Imagination will take you everywhere.
njlammerts
Posts: 139
Joined: Wednesday 12 August 2020 17:13
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Fryslan
Contact:

Re: The great Docker problem*

Post by njlammerts »

I put the prnt scrn to show how my docker-compose.yml file is made, because one says I have to check the exact indentation of the yml file and another says to uncomment devices. And it still goes wrong at line 4. when running "docker-compose up -d" If there is a fault, please tell me what is wrong and what I am doing wrong in stead of saying something is not right. This makes me frustrated and I apologize for that. SORRY!. I want to learn from my mistakes, but you have to point them out

But as I am trying to make clear is that I follow the link Kedi replied on April 01,
and when I use the domoticz docker compose file as shown on that page, I create a docker-compose.yml file in the /opt/domoticz dir with nano and put in the text as shown below

Code: Select all

version: '3.3'

services:
  domoticz:
    image: domoticz/domoticz:stable
    container_name: domoticz
    restart: unless-stopped
    # Pass devices to container
    # devices:
    #   - "/dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyACM0"
    ports:
      - "8080:8080"
    volumes:
      - ./config:/opt/domoticz/userdata
    environment:
      - TZ=Europe/Amsterdam
      #- LOG_PATH=/opt/domoticz/userdata/domoticz.log
and when running "docker-compose up -d" I get yaml: line 4: did not find expected key
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: The great Docker problem*

Post by Kedi »

Your docker-compose.yml file runs fine.
Probably you forgot to make the config dir in your local environment.
If you are in the directory where your docker-compose.yml is located do:

Code: Select all

sudo mkdir config
Logic will get you from A to B. Imagination will take you everywhere.
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: The great Docker problem*

Post by Kedi »

You better read this, then you might understand the error better.
https://borderpolar.com/how-to-fix-the- ... key-error/
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
Thuis
Posts: 251
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: The great Docker problem*

Post by Thuis »

Problem? This docker mater starts to feel a lot like homea$$istant.
docker docker compose docker-compose docker engine docker cli docker dashboard docker install docker docker
then finally docker running, docker compose then docker container domoticz. then mosquitto container, nodered container homebridge container and so forth then all the containers need to communicate with each other. I see thru the trees no forest anymore. Change something, in the yml file. AAAAAAAAAA yaml. then search the internet how to docker compose down and up -d to take the changes. Try to backup a container need to read pages of options to commit then make a backup container. Where is the simple life. copy a to b.

Im getting there but it is a lot of reading and trying out. And i see the benefit of it all, but man i get the feeling they make it so hard on purpose with all these different flavours of the docker saga. Probably it is just me, but i had to get rid of it.
I Love Domoticz ! And the community around it :-)
BartSr
Posts: 347
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.3
Location: Netherlands
Contact:

Re: The great Docker problem*

Post by BartSr »

What's your point? Steep learning curve? Have a look at domoticz wiki about e.g. zwave to mqtt. Follow exactly whats mentioned and you'r there. But build your system step by step and it's not that difficult. My 70 years brains can do so why should your's not do? And once you get stuck on a step ask in fora. Many people willing to help you.
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 espeasy
MQTT
lost
Posts: 616
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: The great Docker problem*

Post by lost »

Always think why being compelled to such labyrinthin setup?
Nowadays, containers are mostly used out of its target of isolaing untrusted or old stuff with dependancy issues.
That's used as a solution to make badly designed accidentally working sw usable. Look at zwavejs: bad language choice, heavy dependancies, mqtt even for localhost.
A pure product of so called modern sw dev methods we would have called "quick&dirty" 20 years ago.
This comes from web design where maintenance over many years is not an issue and ttm the only thing that matter...
User avatar
Thuis
Posts: 251
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: The great Docker problem*

Post by Thuis »

BartSr wrote: Tuesday 01 October 2024 17:09 What's your point? Steep learning curve? Have a look at domoticz wiki about e.g. zwave to mqtt. Follow exactly whats mentioned and you'r there. But build your system step by step and it's not that difficult. My 70 years brains can do so why should your's not do? And once you get stuck on a step ask in fora. Many people willing to help you.
No point, i just needed to write it down and get rid of my irritation that i had on that moment after hours. It says so in the last 5 words of my previous post.
I Love Domoticz ! And the community around it :-)
solarboy
Posts: 300
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: The great Docker problem*

Post by solarboy »

Yeah, I'm 6 hours now trying to migrate to docker. The main issue is USB mapping.

I modified the provided docker-compose.yml https://github.com/domoticz/domoticz-docker to map by 2 USB serial devices.

Code: Select all


services:
  domoticz:
    image: domoticz/domoticz:stable
    container_name: domoticz
    restart: unless-stopped
    # Pass devices to container
    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"
    ports:
      - "8080:8080"
    volumes:
      - ./config:/opt/domoticz/userdata
      #- ./config/www/templates:/opt/domoticz/www/templates
    environment:
      - TZ=Europe/Amsterdam
      - LOG_PATH=/opt/domoticz/userdata/domoticz.log

After a suggestion here somewhere

Inside the container the devices appear in "/dev/serial/by-id"

Code: Select all

root@b4f0e5d41500:/dev/serial/by-id# ls
usb-0658_0200-if00 
usb-1a86_USB2.0-Ser_-if00-port0
However in the add hardware page of Domoticz , for the RFX plugin and the Dombus plugin the port setting is blank.

So after some digging (not here) I change the mapping

Code: Select all

 - "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
      - "/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0:/dev/ttyUSB0"
Now the USB devices do appear in the hardware pop-up but when selected for RFX the hardware doesn't start and Dombus just crashes (that's a whole other issue).

Also, mosquitto (also in a docker) is not available unless I add "network_mode: host" to the official docker-compose.yml. This seems like a major omission.

I would love to move to docker but this all gets so tedious after a while. I have been running zwave, zigbee, homebridge, dashticz for years on dockers and they've never been as painful as this. Constantly learning things I don't want to know about rather than enjoying creating dzvents scripts and actually have some fun.
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
solarboy
Posts: 300
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: The great Docker problem*

Post by solarboy »

Oh, and the domoticz docker doesn't use the plugins folder mapped in ./userdata/plugins but creates a new one in ./plugins and uses that, although this didn't occur on earlier times I brought up the container. Back to bare metal for me.
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
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: The great Docker problem*

Post by Kedi »

solarboy wrote: Sunday 01 December 2024 13:38 Oh, and the domoticz docker doesn't use the plugins folder mapped in ./userdata/plugins but creates a new one in ./plugins and uses that, although this didn't occur on earlier times I brought up the container. Back to bare metal for me.
I always use full path in docker yaml files, it is more clear what the path is instead of the ./config, because the dot means current path
And you not always know what current is.
Logic will get you from A to B. Imagination will take you everywhere.
solarboy
Posts: 300
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: The great Docker problem*

Post by solarboy »

Agreed, I just posted that for brevity, my actual entries are

Code: Select all

volumes: - /home/pi/domoticzDocker/config:/opt/domoticz/userdata
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
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests