embyt / enocean-mqtt

Receives messages from an enOcean serial interface (USB) and provides selected messages to an MQTT broker.
GNU General Public License v3.0
42 stars 21 forks source link

KeyError: 'mqtt_host' #10

Closed ozett closed 4 years ago

ozett commented 4 years ago
root@eg-buero-olaf:/usr/src/enocean-mqtt# enoceanmqtt
Traceback (most recent call last):
  File "/usr/local/bin/enoceanmqtt", line 9, in <module>
    load_entry_point('enoceanmqtt==0.1.0', 'console_scripts', 'enoceanmqtt')()
  File "/usr/src/enocean-mqtt/enoceanmqtt/enoceanmqtt.py", line 105, in main
    com = Communicator(conf, sensors)
  File "/usr/src/enocean-mqtt/enoceanmqtt/communicator.py", line 41, in __init__
    self.mqtt.connect_async(self.conf['mqtt_host'], port=int(self.conf['mqtt_port']),
KeyError: 'mqtt_host'
root@eg-buero-olaf:/usr/src/enocean-mqtt#

any hint on this? i checked out latest version today and used the sample.conf

romor commented 4 years ago

It seems that the config file was not read.

Did you follow this step from the installation section in the readme?:

adapt the enoceanmqtt.conf.sample file and put it to /etc/enoceanmqtt.conf

ozett commented 4 years ago

thanks for fast solution 😄 i try to put the config into /etc.

i upgraded from version 0.1.0 and did not notice this chance, because in old version the config did not have to be in /etc...

image

i will report my findings.. 😄

ozett commented 4 years ago

"can" make a udev-device? seems that i "must" make a udev-device... i will try again

image

ozett commented 4 years ago

i set it all up now. but no verbose messages anymore... it there an option for debug-output?

image

crowbarz commented 4 years ago

You can include the "--debug" command line option or set "debug = true" to the "[CONFIG]" section, to get the debugging logs on the console. Hmm, I forgot to document this option in enoceanmqtt.conf.sample when I updated logging in my PR, although it does show you that this option is available in the output enoceanmqtt --help.

ozett commented 4 years ago

yes, thanks. just a second ago i found cmd-line options in the source here: https://github.com/romor/enocean-mqtt/blob/840c304dc134be26ff1867b87dd1bae83c949b28/enoceanmqtt/enoceanmqtt.py#L19

i will try

ozett commented 4 years ago

almost there... i get responses from the rocker. but i am a bit clueless how to handle/stop this "learning-modes" (even after a jear.., sorry.) any hints for me?

image

ozett commented 4 years ago

i think i go a one year circle and come back to https://github.com/romor/enocean-mqtt/issues/1

a little bit unsure, how to use the syntax of this option: log_learn (i will search the source..) ---update: https://github.com/romor/enocean-mqtt/search?q=log_learn&unscoped_q=log_learn

ozett commented 4 years ago

Up and running! 😄 👍

image

romor commented 4 years ago

"can" make a udev-device? seems that i "must" make a udev-device...

In the config file, you can configure enocean_port to e.g. /dev/ttyUSB0. Then you do not need to configure udev.

However, the device name may change if you have multiple devices connected to USB, so the udev rule is preferable.