spacemanspiff2007 / sml2mqtt

Sml to MQTT Bridge
GNU General Public License v3.0
25 stars 8 forks source link

sml2mqtt can't start with current smllib-version #5

Closed der-peer closed 2 years ago

der-peer commented 2 years ago

Hey, great package 👍. So I can get rid of my own SML-parser (idiot-style bash script).

But installing from scratch with current package versions ends up in error:

(venv) me@pvanlage:/opt/sml2mqtt$ sml2mqtt --config /opt/sml2mqtt
Traceback (most recent call last):
  File "/opt/sml2mqtt/venv/bin/sml2mqtt", line 5, in <module>
    from sml2mqtt.main import main
  File "/opt/sml2mqtt/venv/lib/python3.9/site-packages/sml2mqtt/main.py", line 13, in <module>
    from sml2mqtt.sml_device import Device
  File "/opt/sml2mqtt/venv/lib/python3.9/site-packages/sml2mqtt/sml_device.py", line 8, in <module>
    from smllib import CrcError, SmlStreamReader
ImportError: cannot import name 'CrcError' from 'smllib' (/opt/sml2mqtt/venv/lib/python3.9/site-packages/smllib/__init__.py)

There seems to have been some code refactoring on smllib side. Version 0.7 is the highest working version. Installing with pip install smllib==0.7 fixes it for now. I'm working with Python 3.9.

spacemanspiff2007 commented 2 years ago

How do you install sml2mqtt? If you install it with pip the version is properly pinned

der-peer commented 2 years ago

🤔 maybe I messed it up somehow... first was on Debian 10 (so Python 3.7) trying to install it by following your guide. Gave an error like in #1. Then updated to Debian 11, to try it again with Python 3.9... but on that second attempt, it didn't install with dependencies. Cleaned up the "venv", retried. Same... had to install dependencies by hand.

Will give it a new try with another machine.

spacemanspiff2007 commented 2 years ago

Updated to latest version