datenschuft / SMA-EM

SMA Energymeter measurement
GNU General Public License v2.0
93 stars 38 forks source link

can't get daemon to run #9

Closed broke23 closed 6 years ago

broke23 commented 6 years ago
/home/SMA-EM $ sudo python3 sma-daemon.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/configparser.py", line 1136, in _unify_values
    sectiondict = self._sections[section]
KeyError: 'SMA-EM'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "sma-daemon.py", line 30, in <module>
    smaemserials=parser.get('SMA-EM', 'serials')
  File "/usr/local/lib/python3.5/configparser.py", line 779, in get
    d = self._unify_values(section, vars)
  File "/usr/local/lib/python3.5/configparser.py", line 1139, in _unify_values
    raise NoSectionError(section)
configparser.NoSectionError: No section: 'SMA-EM'

Can someone help out here?

the live viewer works fine

datenschuft commented 6 years ago

configparser missing ? apt install python3 cl-py-configparser

typing error in /etc/smaemd/config ? just run sudo <path/to/sma-daemon.py> start

There are known problems with Systemd because the multicast address is not yet available at system startup.

broke23 commented 6 years ago

Reading package lists... Done Building dependency tree Reading state information... Done cl-py-configparser is already the newest version. python3 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 38 not upgraded.

configparser is installed ...

config:

[SMA-EM]

[DAEMON] pidfile=/run/smaemd.pid

so no clue what I'm missing here to write the data (i edited the # icon only in here, cause it wrote in huge letters)

broke23 commented 6 years ago

what i do see is that i do not have any file for :

[DAEMON] pidfile=/run/smaemd.pid

I checked that location, I don't have that .pid file

datenschuft commented 6 years ago

the daemon should generate the pid file on startup, after reading the configs. but you have a problem when reading the configs.

no idea... Did you create the configuration file with utf8 charset?

broke23 commented 6 years ago

I did a copy-paste from the example you put here in the github, so I guess yes ?

I just launched the following to be sure:

iconv -f UTF-8 config -o /dev/null

sudo python3 sma-daemon.py usage: sma-daemon.py start|stop|restart /run/smaemd.pid

sudo python3 sma-daemon.py start

and now it works!

datenschuft commented 6 years ago

great - i hope you can enjoi the the software