Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't get daemon to run #9

Closed
broke23 opened this issue Nov 23, 2017 · 6 comments
Closed

can't get daemon to run #9

broke23 opened this issue Nov 23, 2017 · 6 comments

Comments

@broke23
Copy link

broke23 commented Nov 23, 2017

/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
Copy link
Owner

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
Copy link
Author

broke23 commented Nov 24, 2017

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]

  • serials of sma-ems the daemon should take notice
  • seperated by space
    serials=1900254537
  • measurement values
    values=pregard psurplus qsurplus ssurplus

[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
Copy link
Author

broke23 commented Nov 29, 2017

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
Copy link
Owner

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
Copy link
Author

broke23 commented Dec 1, 2017

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
Copy link
Owner

great - i hope you can enjoi the the software

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants