Domoticz on Proxmox

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

Moderator: leecollings

Post Reply
mrwjca
Posts: 15
Joined: Saturday 27 October 2018 17:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Domoticz on Proxmox

Post by mrwjca »

Hello all,
it has been a while since I have been playing the last time with Domoticz, many private problems and now getting back on track.
still a Newbie

any way
I am now busy trying to get back to Domoticz and was looking to it at a new angle.

Because I am also busy with playing with a HP Proliant DL380 G7, purly for playing and learning no big plans yet.
So via VM it has currently a working Minecraft server (private local network)
there is also a Windows Server 2019 running on it.
It is all for new me but having fun.

Now I had the following idea to put also domoticz on it, been searching the internet had bad luck finding real good info and got stuck.
Sofar I managed to put debian-10.4.0-i386 on it.
Now I tried after this to put Domoticz on it and then it went all the wrong way.
I was trying to partly follow https://sancla.com/domoticz/domoticz-on ... e-vsphere/
first i was fighting with the SU access, managed to get that done correctly but then when I basically got to the last step to install Domoticz it went wrong.

I did "curl -sSL install.domoticz.com | sudo bash"

and the result was:
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.domoticz.com/download.php?c ... chine=i686 [following]
--2020-07-28 09:42:00-- https://www.domoticz.com/download.php?c ... chine=i686
Connecting to www.domoticz.com (www.domoticz.com)|104.31.78.142|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://releases.domoticz.com/releases/ ... x_i686.tgz [following]
--2020-07-28 09:42:00-- https://releases.domoticz.com/releases/ ... x_i686.tgz
Resolving releases.domoticz.com (releases.domoticz.com)... 146.185.159.228, 2a03:b0c0:0:1010::480:1001
Connecting to releases.domoticz.com (releases.domoticz.com)|146.185.159.228|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-07-28 09:42:00 ERROR 404: Not Found.


And I got stuck and fully lost :cry:

where am I going wrong
is there someone that wants to help this newbie back on the right track?
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Domoticz on Proxmox

Post by Bikey »

Hi,

In order not to have all this installation hustle, I would advice you to look at using Docker.

You can install Docker inside a LXC and get all the benefits of managing the machine with ProxMox, but without having to actually install Domoticz or other "Docker-ised" apps. So the only thing you have to install is Docker itself (and it is also handy to install Docker-Compose and Portainer).

See an instruction on how to install Docker, Docker-Compose and Portainer on Proxmox in this video and to see what that looks like.

Then you can use e.g. this Domoticz Docker image to start up and running without any further installation!

About the error: it looks like you are being redirected to a .tgz file, which is not present. Strange, as I would not expect this redirection.

You can try to see if you can just get the install script without executing it, by just using: curl -sSL install.domoticz.com
User avatar
sancla
Posts: 105
Joined: Wednesday 01 January 2020 23:01
Target OS: -
Domoticz version:
Contact:

Re: Domoticz on Proxmox

Post by sancla »

mrwjca wrote:Hello all,
it has been a while since I have been playing the last time with Domoticz, many private problems and now getting back on track.
still a Newbie

any way
I am now busy trying to get back to Domoticz and was looking to it at a new angle.

Because I am also busy with playing with a HP Proliant DL380 G7, purly for playing and learning no big plans yet.
So via VM it has currently a working Minecraft server (private local network)
there is also a Windows Server 2019 running on it.
It is all for new me but having fun.

Now I had the following idea to put also domoticz on it, been searching the internet had bad luck finding real good info and got stuck.
Sofar I managed to put debian-10.4.0-i386 on it.
Now I tried after this to put Domoticz on it and then it went all the wrong way.
I was trying to partly follow https://sancla.com/domoticz/domoticz-on ... e-vsphere/
first i was fighting with the SU access, managed to get that done correctly but then when I basically got to the last step to install Domoticz it went wrong.

I did "curl -sSL install.domoticz.com | sudo bash"

and the result was:
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.domoticz.com/download.php?c ... chine=i686 [following]
--2020-07-28 09:42:00-- https://www.domoticz.com/download.php?c ... chine=i686
Connecting to www.domoticz.com (www.domoticz.com)|104.31.78.142|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://releases.domoticz.com/releases/ ... x_i686.tgz [following]
--2020-07-28 09:42:00-- https://releases.domoticz.com/releases/ ... x_i686.tgz
Resolving releases.domoticz.com (releases.domoticz.com)... 146.185.159.228, 2a03:b0c0:0:1010::480:1001
Connecting to releases.domoticz.com (releases.domoticz.com)|146.185.159.228|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-07-28 09:42:00 ERROR 404: Not Found.


And I got stuck and fully lost :cry:

where am I going wrong
is there someone that wants to help this newbie back on the right track?
I think I need to update this guide then :-)
Check these howto's: https://sancla.com
mrwjca
Posts: 15
Joined: Saturday 27 October 2018 17:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz on Proxmox

Post by mrwjca »

Bikey wrote: Tuesday 28 July 2020 11:41 Hi,

In order not to have all this installation hustle, I would advice you to look at using Docker.

You can install Docker inside a LXC and get all the benefits of managing the machine with ProxMox, but without having to actually install Domoticz or other "Docker-ised" apps. So the only thing you have to install is Docker itself (and it is also handy to install Docker-Compose and Portainer).

See an instruction on how to install Docker, Docker-Compose and Portainer on Proxmox in this video and to see what that looks like.

Then you can use e.g. this Domoticz Docker image to start up and running without any further installation!

About the error: it looks like you are being redirected to a .tgz file, which is not present. Strange, as I would not expect this redirection.

You can try to see if you can just get the install script without executing it, by just using: curl -sSL install.domoticz.com
Thx for the tip, ;) going to have a closer look at this video, and the other video's because this looks very interesting, luckily my German is not bad.

sancla wrote: Tuesday 28 July 2020 13:11 I think I need to update this guide then :-)
Well where are you waiting for :lol:
Just kidding the guide was already helping me a bit, only got stuck at the end.
mrwjca
Posts: 15
Joined: Saturday 27 October 2018 17:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz on Proxmox

Post by mrwjca »

Well after watching a few movies from ApfelCast as suggested by Bikey I managed to install Docker, Docker-Compose and Portainer on the server.
So many challenges but learning so much. :geek:

Current Setup is:
HP Proliant DL380 G7 Server
With:
- Minecraft Server (private use)
- Windows Server 2019 (it is there still need to play with it)
- Docker -> Docker-Compose -> Portainer -> Domoticz

The process getting Domoticz on it was a different story, doing it via the raspberry pi was easier, but hey lets do crazy.
Learning a lot in regard to Linux and so, facing many challenges finding my answers (to much used to windows desktop)

Well as said Domoticz is on it, hopefully correct, the challenge is now in the USB devices to be connected or found, currently a bit stuck with this but not giving up yet. some reason this morning Domoticz stopped which i don't understand, looking into it.
Indeed finding correct way to find the USB Devices is difficult, I have plugged in a RFXCOM and a Aeotec Z-Stick, I managed to find the devices with lsusb and usb-devices, but then I get stuck. Especially in finding the path or address for --device=<device_id>

Maybe somebody can kick me in the correct direction, bare in mind that I am a a serious dummy :lol:
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Domoticz on Proxmox

Post by Bikey »

hi, i recognise your struggling, so here is a small guide:

On the ProxMox host:

I first used the Domoticz guide create "Persistent USB Devices". It is optional, but it makes sure that the ID of your USB does not change after a restart or when plugging in other USB-devices as well.

After that you can see your device with the chosen name (in my case /dev/ttyUSB-ZStick-5G) or /dev/ttyUSB0 on the ProxMox host.

Then I used this Guide to make sure that the LX Container that is running Docker and Domoticz can also see AND read/write to this device.

With this Guide you should be able to find the Major and (optionally, I use a wildcard) the Minor numbers that are needed to allow access to the port. In my case the Major ID of the device was 188

Following this guide I ended up adding this in my Container config (found on /etc/pve/lxc/<container_id>.conf ):

lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: c 188:* rwm
lxc.mount.entry: /dev/ttyUSB-ZStick-5G dev/ttyUSB-ZStick-5G none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file

After that I think I had to restart both the ProxMox host as the LXC Container with Docker.

If everything is right you can then SSH into the LXC Container and see that e.g. /dev/USB0 is also available there.

Finally: you also need to allow the Docker Container to have acces to this port as this is also running in a virtualised container, so you need to do a device mapping there as well.

I use Docker-Compose for easy deployment of the Docker containers. Here is my docker-compose.yml which does this mapping, but also with some other directories you may want to add to have persistent data (and not have to discover all your Z-Wave Devices every time) for custom plugins and templates across container upgrades.

Make sure you have these directories and files in the location relative to the docker-compose.yml file, or comment that out.

Also note that I am not running the Domoticz container as root, so make sure to use the proper User ID and Group ID (PUID and PGID) for the the user that you want Domoticz to run, which have access to these directories.

Code: Select all

version: "3.5"
services:
  domoticz:
    image: demydiuk/domoticz:latest
    container_name: domoticz
    command: -www 8080 -sslwww 444 -loglevel status,error
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - ./domoticz_data:/config
      - ./domoticz_data/ozwcache_0x-the-id-of-your-ozw-cache-file.xml:/opt/domoticz/Config/ozwcache_0x-the-id-of-your-ozw-cache-file.xml 
      - ./domoticz_data/plugins:/opt/domoticz/plugins
      - ./domoticz_data/styles/machinon:/opt/domoticz/www/styles/machinon
 #     - /sys:/sys <- access to all GPIO-ports
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
    ports:
      - 8080:8080
      - 444:444
      - 6144:6144
    devices:
      - /dev/ttyUSB-ZStick-5G:/dev/ttyUSB-ZStick-5G
    restart: unless-stopped
P.s. are you running Minecraft as a Docker container? If not that is easy too!
mrwjca
Posts: 15
Joined: Saturday 27 October 2018 17:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz on Proxmox

Post by mrwjca »

Bikey wrote: Friday 31 July 2020 12:14 hi, i recognise your struggling, so here is a small guide:

On the ProxMox host:

I first used the Domoticz guide create "Persistent USB Devices". It is optional, but it makes sure that the ID of your USB does not change after a restart or when plugging in other USB-devices as well.

After that you can see your device with the chosen name (in my case /dev/ttyUSB-ZStick-5G) or /dev/ttyUSB0 on the ProxMox host.

Then I used this Guide to make sure that the LX Container that is running Docker and Domoticz can also see AND read/write to this device.

With this Guide you should be able to find the Major and (optionally, I use a wildcard) the Minor numbers that are needed to allow access to the port. In my case the Major ID of the device was 188

Following this guide I ended up adding this in my Container config (found on /etc/pve/lxc/<container_id>.conf ):

lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: c 188:* rwm
lxc.mount.entry: /dev/ttyUSB-ZStick-5G dev/ttyUSB-ZStick-5G none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file

After that I think I had to restart both the ProxMox host as the LXC Container with Docker.

If everything is right you can then SSH into the LXC Container and see that e.g. /dev/USB0 is also available there.

Finally: you also need to allow the Docker Container to have acces to this port as this is also running in a virtualised container, so you need to do a device mapping there as well.

I use Docker-Compose for easy deployment of the Docker containers. Here is my docker-compose.yml which does this mapping, but also with some other directories you may want to add to have persistent data (and not have to discover all your Z-Wave Devices every time) for custom plugins and templates across container upgrades.

Make sure you have these directories and files in the location relative to the docker-compose.yml file, or comment that out.

Also note that I am not running the Domoticz container as root, so make sure to use the proper User ID and Group ID (PUID and PGID) for the the user that you want Domoticz to run, which have access to these directories.



P.s. are you running Minecraft as a Docker container? If not that is easy too!
Hi Bikey,
Thank you for the info, going to dive into it as soon as possible, still need to do some working from home.

In regard to your question about the Minecraft a little bit background info.
The Minecraft server was in the idea of making a minecraft server for my kid, he has to deal with autism and reading issues. his wish was having a minecraft server so he could play with someone else , unfortunately not many friends and letting him in to the wide world of internet is a bit tricky , so I am playing with him on a regular base, he is a real architect if it comes to it.
Well I could have made a simple server but luck was with me because I found this HP server for a very friendly price of 60 euro's, working and all.
I thought by myself why not , lets go crazy and also do some playing and learning for me, I like computers and so, time is a different issue but we are managing.

any ways let me finish work and some small tasks at home, wife complains, and then back to the server.
mrwjca
Posts: 15
Joined: Saturday 27 October 2018 17:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz on Proxmox

Post by mrwjca »

Bikey wrote: Friday 31 July 2020 12:14 hi, i recognise your struggling, so here is a small guide:

P.s. are you running Minecraft as a Docker container? If not that is easy too!
EDIT: pics are not doing what I hoped for so you need to click on them.

Right, let me show this print screen first:
Image2020-08-01 14_41_32-Window by MrWJCA, on Flickr[/img]
portainer if I am correct is installed under container 105 (Docker)

I did the following in the Proxmox shell (pve):
I looked up the info regarding my devices with $ lsusb
Image2020-07-31 14_34_06-Window by MrWJCA, on Flickr[/img]

I followed this manual: https://www.domoticz.com/wiki/PersistentUSBDevices

I did sudo nano /etc/udev/rules.d/99-usb-serial.rules
Image2020-07-31 14_53_49-Window by MrWJCA, on Flickr</script>[/img]

I rebooted

I checked https://medium.com/@konpat/usb-passthro ... 482674f11d

I did in :
Image2020-07-31 14_36_00-Window by MrWJCA, on Flickr[/img]
and
Image2020-07-31 14_36_25-Window by MrWJCA, on Flickr[/img]

then I did in 104 (LXCUbuntu)
sudo nano /etc/pve/lxc/<container_id>.conf
where the id is 105
so i became sudo nano /etc/pve/lxc/105.conf

In this file I had already some info I added at the bottom 3 lines:
Image2020-08-01 14_44_28-Window by MrWJCA, on Flickr[/img]

I first had copied your instructions with the extra line lxc.apparmor.profile: unconfined but the result was that I could not access my portainer anymore after reboot , when i removed the line and rebooted portainer was working again.

Now I am a bit stuck, if I understand correctly I need to to
sudo nano docker-compose.yml
I did this under my container 104 (LXCUbuntu)

I rebooted the docker and container and it looks like everything works, but when I try to start domoticz the result is:
http://<IP>:8080/#/Offline

did I do correct and where did I go wrong?


something else in regard to the minecraft story.
I installed the minecraft server as a VM in proxmox with MineOS, maybe later I will lok at running it as a docker, if you have the info for me I can always look at it ;) but this has no priority right now.
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Domoticz on Proxmox

Post by Bikey »

Hi,

I can't see anything strange, look Ok from here.

You can check why you can't see a running Domoticz, by checking the Domoticz-log.

You can check the log by going into the Portainer web interface (default at http://docker-host:9000/#/containers) and then in the "Containers" menu, select the Domoticz container and then in the overview select the blue "Logs" icon.

You probably see that it keeps restarting or did crash immediately because it can not find the devices for the mapping.

To see why the mapping/port is not available, the best thing to find out is by stepwise checking everything:

First check in on the ProxMox-host if you can see the devices:

ls -lh /dev/ttyUSB-ZStick-5G
ls -lh /dev/ttyUSB-RFX433

It that is Ok, do the same in the LXCUbuntu container and the container with id 105.

If these devices are also visible there, you succeeded in the most difficult part ;-)

If not, I think you have to step-by step see if you can build everything up. Perhaps first without using the logical names of de persistent devices, but using the physical ports.

If everything is well, the Domoticz log should in Portainer should give you more clue's about what is wrong.
mrwjca
Posts: 15
Joined: Saturday 27 October 2018 17:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz on Proxmox

Post by mrwjca »

Hi Bikey,
Bikey wrote: Saturday 01 August 2020 15:34 Hi,

First check in on the ProxMox-host if you can see the devices:

ls -lh /dev/ttyUSB-ZStick-5G
ls -lh /dev/ttyUSB-RFX433

It that is Ok, do the same in the LXCUbuntu container and the container with id 105.
First let me say thank you very much for your help it really helps me.

First regarding the domoticz page not being found, I used the wrong IP address. :oops:

Doing the ls -lh /dev/ttyUSB-ZStick-5G
ls: cannot access '/dev/ttyUSB-ZStick-5G': No such file or directory

So back to: https://www.domoticz.com/wiki/PersistentUSBDevices

So I was looking a bit further and noticed that when I would
root@pve:~# sudo mknod /dev/ttyUSB0 c 188 0
the result would be nothing, just:
root@pve:~#
so I dove a bit deeper and noticed that if I would go to:
root@pve:/dev#
and then did the
sudo mknod /dev/ttyUSB0 c 188 0
it created a file.

But after reboot the file would not be there anymore
what am I overlooking.

EDIT:
I still have a rule in my system made with
sudo nano /etc/udev/rules.d/99-usb-serial.rules
containing 2 rules:
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", ATTRS{serial}=="DO2XP49U", SYMLINK+="ttyUSB-RFX433"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="ttyUSB-ZStick-5G"
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Domoticz on Proxmox

Post by Bikey »

mrwjca wrote: Sunday 02 August 2020 14:50
Doing the ls -lh /dev/ttyUSB-ZStick-5G
ls: cannot access '/dev/ttyUSB-ZStick-5G': No such file or directory
SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="ttyUSB-ZStick-5G"
Hi, you should not have to use mknod: if the device is recognised its there if not it does not appear by creating a file.

If ls -lh /dev/ttyUSB-ZStick-5G fails, then obviously something went wrong with the persistent device mapping.

Are you absolutely sure you are doing the on the ProxMox host? So the machine that runs PVE and that is the one that interacts with the hardware.

Do you see your USB-devices if you do: ls -lh /dev/ttyUSB*

Are the user rights Ok?

If that shows your Zwave stick but you can not reach it with the logical name (ttyUSB-ZStick-5G), you really should check if you have the correct values in the /etc/udev/rules.d/99-usb-serial.rules although I have to say that I'm having exactly the same for the Z-Wave stick.

Btw: you also don't have to use "sudo" if your are root already.
mrwjca
Posts: 15
Joined: Saturday 27 October 2018 17:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz on Proxmox

Post by mrwjca »

Hi Bikey,

sofar I know I am on the proxmox host. always been.

the main problem I see now is that when I do the sudo mknod /dev/ttyUSB-ZStick-5G c 188 0 (with ot without the sudo) it creates a file with the correct name.
and when I do ls -lh /dev/ttyUSB-ZStick-5G it also confirms it to me.
But when I reboot the machine the file is gone it is not there anymore :cry:
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Domoticz on Proxmox

Post by Bikey »

My point was that there shouldn’t be a need to use mknod. If you plug in a USB stick a device is created, there is noneed to do that manually. If you can’t list the device, not even by it’s /dev/tty* then something else is wrong.
mrwjca
Posts: 15
Joined: Saturday 27 October 2018 17:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz on Proxmox

Post by mrwjca »

Bikey wrote: Sunday 02 August 2020 18:18 My point was that there shouldn’t be a need to use mknod. If you plug in a USB stick a device is created, there is noneed to do that manually. If you can’t list the device, not even by it’s /dev/tty* then something else is wrong.
Hi Bikey,

back to the drawing table.
As we have seen I can find the USB devices, however I am unable to identify them in a correct way.
With this I mean /dev/tty*
I see many tty files in the /dev folder. about 65 of them from tty, tty0 to 63
also see 32 ttyS files and 1 ttyprintk.

As said I followed https://www.domoticz.com/wiki/PersistentUSBDevices
I created the rules file.
rebooted and when I do
ls -lh /dev/ttyUSB-ZStick-5G
I find nothing, getting error.

Based on the info in https://www.domoticz.com/wiki/PersistentUSBDevices
I understand the file ttyUSB-ZStick-5G should be in the folder /dev
as said in the explanation "When you see no device" on https://www.domoticz.com/wiki/PersistentUSBDevices
I did the mknod action.
indeed the file is created but when I reboot the file disappears.

when I use filezilla to have a look in those folders, what I notice is that the (so far I can see) the entire folder /dev everything is being written over, date stamp is after reboot the date of today, is here something going wrong?
Bikey
Posts: 331
Joined: Sunday 22 February 2015 12:19
Target OS: Linux
Domoticz version: 2020.x
Location: Netherlands
Contact:

Re: Domoticz on Proxmox

Post by Bikey »

Can you see the device as /dev/ttyUSB0 or /dev/ttyACM0?

I'm definitely no Unix expert, but I think that most of these devices are placeholders.
In my case the "real" devices are different from the other devices because all devices are belonging tot the "tty" group, but the actual devices are assigned to the "dial out" group.

E.g. result from ls -lh /dev/ttyACM*
crw-rw---- 1 root dialout 166, 1 Jun 1 13:13 /dev/ttyACM1

and the logical name is just a symbolic link to that device.

lrwxrwxrwx 1 root root 7 Jun 1 13:13 /dev/ttyUSB-ZStick-5G -> ttyACM1

Do you see activities for the USB* or ACM* devices with dimeg if the USB-stick is removed and inserted?
What do you get with:
dmesg | grep tty

If not I’m lost why the system does not recognize your devices, and also would do a lot of Googling, but it then makes no use to go on trying to make a logical name to it.

If it does exist then first try to get it working without the persistent device names but using the port names like /dev/ttyUSB0
mrwjca
Posts: 15
Joined: Saturday 27 October 2018 17:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz on Proxmox

Post by mrwjca »

Well, after spending many hours in not finding the answer why the USB devices don't work I gave up :?
Maybe in the future I will give it a new try.

But I didn't give up on domoticz I went back to the Raspberry Pi.

thx for all the help sofar.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest