sircuri / GoodWeUSBLogger

Python based logger for GoodWe inverters using USB.
GNU General Public License v3.0
10 stars 7 forks source link

ImportError: No module named daemonpy.daemon #3

Closed kkplein closed 7 years ago

kkplein commented 7 years ago

Cloned this github repo, made the .py files executable, installed the required modules according to the docs (needed "pip install enum34" instead of just enum) but everything worked, and then:

~/goodwe/GoodWeUSBLogger $ sudo ./GoodWe.py start Traceback (most recent call last): File "./GoodWe.py", line 2, in from daemonpy.daemon import Daemon ImportError: No module named daemonpy.daemon

As we are not familiar with python (yes, we should be, i know that...) we are not sure what to do.

We cloned only this GoodWeUSBLogger repo, but do we perhaps also need the GoodWeLogger?

Feedback would be appreciated :-)

sircuri commented 7 years ago

daemonpy.daemon is a GIT submodule. You need to "fetch" that one as well.

try this after you cloned the repo locally:

$ git submodule init Submodule 'daemonpy.daemon' (...) registered for path '...' $ git submodule update

kkplein commented 7 years ago

Hi Arjen, thanks for the quick reply. :-)

Your suggestion helped, yes! But the next issue is:

$ sudo -H python3 -m pip install configparser Requirement already satisfied: configparser in /usr/local/lib/python3.5/dist-packages $ sudo ./GoodWe.py start Traceback (most recent call last): File "./GoodWe.py", line 4, in import configparser ImportError: No module named configparser

Also a suggestion for this one?

sircuri commented 7 years ago

Check the first line of "GoodWe.py". What python version is used? Looks like you might have python version conflicts. Does the configparser module exists at all in the python lib path?

I'm also not a python developer.... so these are hard questions for me as well.

kkplein commented 7 years ago

Yes, I had python 2 and 3 installed, you were right. Installed modules in python 2, and now it seems to start, but it logs only an error and exits: Traceback (most recent call last): File "./GoodWe.py", line 90, in daemon.start() File "/home/heupink/goodwe/GoodWeUSBLogger/daemonpy/daemon.py", line 85, in start self.run() File "./GoodWe.py", line 28, in run interval = config.getint("inverter", "pollinterval") File "/usr/local/lib/python2.7/dist-packages/backports/configparser/init.py", line 834, in getint return self._get_conv(section, option, int, kwargs) File "/usr/local/lib/python2.7/dist-packages/backports/configparser/init.py", line 822, in _get_conv return self._get(section, conv, option, kwargs) File "/usr/local/lib/python2.7/dist-packages/backports/configparser/init.py", line 814, in _get return conv(self.get(section, option, **kwargs)) ValueError: invalid literal for int() with base 10: '5000 # Every 5 seconds the information of the inverter gets pushed to MQTT'

Sorry for all the questions, but any idea what that means?

Or let me rephrase: what distro are you running on, then I could do the same. A pi? Running what distro..?

I am testing now without having attached the inverter, since I am not onsite now. Perhaps this error is caused, because the pc is not attached to the inverter..? Next week I can try with the usb cable attached.

sircuri commented 7 years ago

I'm running raspbian on a Pi Zero W.

Don't worry about you ask these questions. Looking at the error, i think the goodwe.conf file in /etc/goodwe does not support adding comments to it. You should remove the '# <comment>' from the config file.

kkplein commented 7 years ago

yess. Running now. :-) Thanks a lot. So, next is to setup an mqtt server to 'push' the stats to. Our ultimate goal: being abe to display generated electricity etc from our PV panels. If I may... could you give some hints on what other components you use? Which mqtt server (or broker, as I should call it) works for you, and also how to extract interesting numbers, or even generate some graphs etc from the data..?

sircuri commented 7 years ago

I use "mosquitto" as the MQTT broker. Easy to setup and easy to use. My current setup looks like this:

Ubuntu server running MySQL Raspberry Pi2 running Mosquitto, Apache/PHP (to show graphs) and Node-RED for wiring all the information together. 2 Raspberry Pi Zero W(ireless) for each PV inverter that talks to the Mosquitto broker.

My website and DB layout is not yet ready for "display" to others. If i have the time i can write down the basic parts on a page here on Github.

kkplein commented 7 years ago

This is all very interesting and new stuff for us. Next week I'll wire my test laptop to the inverter, install mqtt, and have a look at the kind of data (what values, what kinds of stats) it generates. Perhaps if we just like to show-off real-time data, like those displayed on the inverter display, things could be simple. To be continued next week Thanks again..!