Comments (6)
Hi,
Are you sure that you've installed PySerial and not Serial?
pip show pyserial
Should return something like this:
Name: pyserial Version: 3.4
from kamstrup-402-mqtt.
Yes I am very sure.
Allready checked it before, also did a uninstall and install again.
Here is what pip show pyserial
returns:
Name: pyserial Version: 3.5 Summary: Python Serial Port Extension Home-page: https://github.com/pyserial/pyserial Author: Chris Liechti Author-email: [email protected] License: BSD Location: /usr/local/lib/python3.9/dist-packages Requires: Required-by:
from kamstrup-402-mqtt.
Does pip show serial
return anything?
I would expect a stacktrace in the debug.log file if there are any problems with declaring the serial port object. Can you paste those contents?
tail -f debug.log -n 50
from kamstrup-402-mqtt.
Pip show serial
gives package not found
What perhaps could be the issue is that something with USB passtrough is not going right. I have installed this on a container in Proxmox. I will dive into this as well.
Here is my tail -f debug.log -n 50
output:
`root@warmtemeting:~/kamstrup-402-mqtt# tail -f debug.log -n 50
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/kamstrup-402-mqtt/kamstrup_meter.py", line 92, in init
self.serial = serial.Serial(
File "/usr/local/lib/python3.9/dist-packages/serial/serialutil.py", line 244, in init
self.open()
File "/usr/local/lib/python3.9/dist-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
[2022-03-02 20:54:39 daemon.py init: 41 - INFO - initializing daemon]
[2022-03-02 20:54:39 mqtt_handler.py connect: 43 - INFO - Connected to MQTT at: 192.168.1.254:1883]
[2022-03-02 20:54:39 mqtt_handler.py connect: 45 - INFO - with username ***, QoS level = 0 and retain = False]
[2022-03-02 20:54:39 kamstrup_meter.py init: 100 - ERROR - [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0']
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/kamstrup-402-mqtt/kamstrup_meter.py", line 92, in init
self.serial = serial.Serial(
File "/usr/local/lib/python3.9/dist-packages/serial/serialutil.py", line 244, in init
self.open()
File "/usr/local/lib/python3.9/dist-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
[2022-03-02 21:02:01 daemon.py init: 41 - INFO - initializing daemon]
[2022-03-02 21:02:01 mqtt_handler.py connect: 43 - INFO - Connected to MQTT at: 192.168.1.254:1883]
[2022-03-02 21:02:01 mqtt_handler.py connect: 45 - INFO - with username ***, QoS level = 0 and retain = False]
[2022-03-02 21:02:01 kamstrup_meter.py init: 100 - ERROR - Could not configure port: (25, 'Inappropriate ioctl for device')]
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/serial/serialposix.py", line 398, in _reconfigure_port
orig_attr = termios.tcgetattr(self.fd)
termios.error: (25, 'Inappropriate ioctl for device')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/kamstrup-402-mqtt/kamstrup_meter.py", line 92, in init
self.serial = serial.Serial(
File "/usr/local/lib/python3.9/dist-packages/serial/serialutil.py", line 244, in init
self.open()
File "/usr/local/lib/python3.9/dist-packages/serial/serialposix.py", line 332, in open
self._reconfigure_port(force_update=True)
File "/usr/local/lib/python3.9/dist-packages/serial/serialposix.py", line 401, in _reconfigure_port
raise SerialException("Could not configure port: {}".format(msg))
serial.serialutil.SerialException: Could not configure port: (25, 'Inappropriate ioctl for device')`
from kamstrup-402-mqtt.
hi @matthijsvisser , i reinstalled everything in a VM (instead of container). And now it's working! So problem was USB passthrough to Debian container, even when USB is listed.....
Thanks for your help, i can now enjoy your work!
from kamstrup-402-mqtt.
Awesome, nice job. Don't forget to star the project for updates!
from kamstrup-402-mqtt.
Related Issues (14)
- Adding compatibility with kamstrup 403 HOT 2
- kamstrup 402/3 on ESPhome HOT 2
- I can't start the systemd service on my RasperryPI HOT 4
- Docker error while installing HOT 5
- RuntimeError: Message publish failed: The client is not currently connected HOT 3
- Multical 403 HOT 1
- CRC error? HOT 7
- Questions about hardware HOT 8
- Multical 403 - No response from meter / Message is invalid HOT 5
- Article covering your repository HOT 2
- Errors running deamon.py HOT 5
- Cannot extract meter value - Kamstrup Multical 401 HOT 15
- Docker install HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kamstrup-402-mqtt.