korylprince / hassio-apcupsd

An apcupsd Hass.io add-on
MIT License
52 stars 20 forks source link

Proxmox LXC #16

Closed tamet83 closed 4 years ago

tamet83 commented 4 years ago

Hi,

I've setup a new instance of Hassio with Whiskerz scritp.

I have both a ConBee stick and and APC UPS USB.

When i try to run the addon I receive this error:

ERROR (SyncWorker_1) [hassio.docker] Can't start addon_a722577e_apcupsd: 500 Server Error: Internal Server Error ("error gathering device information while adding custom device "/dev/usb/": no such file or directory")

Do you have any advice how to solve this problem?

This hare the devices listed in my Hass.io instance:

serial:
/dev/ttyS0
/dev/ttyS16
/dev/ttyS8
/dev/ttyS2
/dev/ttyS7
/dev/ttyS14
/dev/ttyS5
/dev/ttyS20
/dev/ttyS18
/dev/ttyS15
/dev/ttyS19
/dev/ttyS26
/dev/ttyS28
/dev/ttyS3
/dev/ttyS25
/dev/ttyS11
/dev/ttyS29
/dev/serial/by-id/usb-FTDI_FT230X_Basic_UART_DO01MI89-if00-port0
/dev/ttyS22
/dev/ttyS6
/dev/ttyS31
/dev/ttyUSB0
/dev/ttyS4
/dev/ttyS17
/dev/ttyS27
/dev/ttyS23
/dev/ttyS9
/dev/ttyS12
/dev/ttyS1
/dev/ttyS21
/dev/ttyS30
/dev/ttyS10
/dev/ttyS13
/dev/ttyS24
input:
HDA Intel PCH HDMI/DP,pcm=8
HDA Intel PCH Mic
Sleep Button
PC Speaker
HDA Intel PCH Front Headphone
Power Button
HDA Intel PCH HDMI/DP,pcm=7
HDA Intel PCH HDMI/DP,pcm=3
HDA Intel PCH HDMI/DP,pcm=10
HDA Intel PCH HDMI/DP,pcm=9
Video Bus
disk:
gpio:
gpiochip200
gpiochip196
audio:
0:
name: HDA-Intel - HDA Intel PCH
type: PCH
devices:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]

``

korylprince commented 4 years ago

You'll need to use udev rules to make your APC UPS USB device show up as /dev/usb/hiddevX so that Hass.io can see it. I don't know the details of doing that on Proxmox/LXC, but I'd start with making the /dev/usb/hiddevX device show up on your physical host, then work on getting it passed into the LXC container.

There's some udev rule info on this page that may be helpful.

tamet83 commented 4 years ago

Because of my lack of knowledge whit Linux in general, I think I won’t be able to do it alone. I wrote to whiskerz007 and see if he can make some changes to his script. Anyway, thanks for your help, really appreciate it.

gomez85 commented 4 years ago

Hi @korylprince , I've the same tamet83 problem and I'd tried to use udev rules as your suggestion but when I try to start the addon i retrieve this error:

[hassio.docker] Can't start addon_a722577e_apcupsd: 500 Server Error: Internal Server Error ("error gathering device information while adding custom device "/dev/usb/": not a device node")

If helping, my device is located in /dev/bus/usb/003/002

Can you help me?

korylprince commented 4 years ago

The problem is the same: you've got to get the /dev/usb/* devices to show up to hass.io so that it can put them into the apcupsd container. I'm not very familiar with LXC, and you're much more likely to get a solution from the issue on the proxmox_hassio_lxc project.

Giancky79 commented 4 years ago

maybe the problem is debian10 and apcupsd?

gomez85 commented 4 years ago

@korylprince thanks for the reply.. isn't possible by the addon configuration set manually the path? Because the problem isn't LXC but maybe how debian10 manage the usb devices

korylprince commented 4 years ago

This add-on is limited by this issue, unfortunately; I can only hard-set device paths for the add-on.

I'm going to go ahead and close this issue, as it's not fixable by this project. If you're not going to use the standard Hass.io installations (which puts the devices in the proper places), it will be up to you to use udev rules or some other mechanism to populate the /dev/usb/* devices.

gomez85 commented 4 years ago

@korylprince , I answer even if you have closed the issue, to tell you that the problem was in the management of resources in my system with Proxmox, LXC and VM. So I confirm that with the latest revision of the whiskerz script everything works as you can see in the my comment in his script issue.

Thank you

korylprince commented 4 years ago

Awesome! Glad you were able to get it working. Thanks for posting back here with a solution.