Coder Social home page Coder Social logo

home-assistant-addons's Introduction

Hi there 👋

home-assistant-addons's People

Contributors

markussiebert avatar tobiaskuntzsch avatar

Stargazers

 avatar

Watchers

 avatar  avatar

home-assistant-addons's Issues

vzLogger add-on has no permission to access /dev/ttyUSB0 in haos_rpi3-64-8.5

When I try to read my smartmeter with the vzLogger addon, then there seems to be a permission problem to access the ttyUSB0.
When I open the vzLogger log, I see this error:
open(/dev/ttyUSB0): Operation not permitted

I have an IR to USB reader (USB IR Lesekopf EHZ Lese-Schreib-Kopf Volkszähler Hichi Smartmeter) with CP2102_USB_to_UART_Bridge to read my smartmeter.
I'm using a fresh haos_rpi3-64-8.5 installation with my Raspberry 3:
https://github.com/home-assistant/operating-system/releases/download/8.5/haos_rpi3-64-8.5.img.xz

When I use the command line to communicate with the smartmeter, everything works fine. I get response from the smartmeter with these commands:
stty -F /dev/ttyUSB0 300 -parodd cs7 -cstopb parenb -ixoff -crtscts -hupcl -ixon -opost -onlcr -isig -icanon -iexten -echo -echoe -echoctl -echoke
cat ./Anforderungssequenz_xxxxx.txt > /dev/ttyUSB0
cat /dev/ttyUSB0

In
https://github.com/markussiebert/homeassistant-addon-vzlogger/blob/main/vzlogger/Dockerfile
I found these lines:
# without running a user context, no exec is possible and without the dialout group no access to usb ir reader possible
# RUN useradd -G dialout vz && mkdir -p /home/vz && chown vz:vz /home/vz
RUN chmod a+x /etc/services.d/vzlogger/listdevices.sh && \
usermod -a -G dialout root

So I think, the docker container expects that /dev/ttyUSB0 must be accessable for the group dialout.

But when I check this in my terminal, then I see that /dev/ttyUSB0 is only accessable for the group audio:
ls -l /dev/ttyUSB0
crw-rw---- 1 root audio 188, 0 Mar 11 08:33 /dev/ttyUSB0

I tried to change the group for ttyUSB0, but that didn't work:
chgrp dialout /dev/ttyUSB0
chgrp: /dev/ttyUSB0: Read-only file system

Here is the complete log of the vzLogger add-on:
`[20:19:00] INFO: ==============================================================================
[20:19:00] INFO: Starting vzlogger
[Sep 01 20:19:00][main] vzlogger v0.8.0 based on heads/master-0-gccb6d8ee49 from Fri, 5 Nov 2021 03:13:34 +0100 started.
[Sep 01 20:19:00][main] log level is 15
[Sep 01 20:19:00][d0] open(/dev/ttyUSB0): Operation not permitted
[Sep 01 20:19:00][mtr0] Cannot open meter
[Sep 01 20:19:00][] Startup failed: Meter open failed.
[Sep 01 20:19:00][mtr0] Creating new meter with protocol d0.
[Sep 01 20:19:00][d0] pullseq len:11 found
[Sep 01 20:19:00][d0] using autoack
[Sep 01 20:19:00][mtr0] Meter configured, enabled.
[Sep 01 20:19:00] New meter initialized (protocol=d0)
[Sep 01 20:19:00] Have 1 meters.
[Sep 01 20:19:00][main] local=0
[Sep 01 20:19:00] Process not daemonized...
[Sep 01 20:19:00] Opened logfile /var/log/vzlogger.log
[Sep 01 20:19:00][push] No pushDataServer defined.
[Sep 01 20:19:00][] ===> Start meters
[20:19:01] INFO: ==============================================================================
/dev/ttyUSB0 - Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0037
[20:19:01] INFO: ==============================================================================
[20:19:01] INFO: {
"retry": 0,
"verbosity": 15,
"log": "/var/log/vzlogger.log",
"local": {
"enabled": false,
"port": 8081,
"index": true,
"timeout": 0,
"buffer": 0
},
"meters": [
{
"enabled": true,
"allowskip": false,
"interval": -1,
"aggtime": -1,
"aggfixedinterval": false,
"channels": [
],
"protocol": "d0",
"device": "/dev/ttyUSB0",
"dump_file": "",
"pullseq": "2F3F31xxxxxxxxxx210D0A",
"ackseq": "auto",
"baudrate": 300,
"baudrate_read": 9600,
"baudrate_change_delay": 500,
"parity": "7e1",
"read_timeout": 100
}
]

}`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.