n8henrie / fauxmo

Emulated Belkin WeMo devices that work with the Amazon Echo
https://n8henrie.com/2016/02/fauxmo-home-automation-with-the-amazon-echo-raspberry-pi-and-homeassistant/
Other
376 stars 78 forks source link

Fauxmo Service does not start even after several new setups #113

Closed drak2021 closed 2 years ago

drak2021 commented 2 years ago

My Issue

I'm very desperate and tried to install it now several time sfrom scratch but it does not work, maybe just a minor mistake: After updating and upgrading the system I followed all instructions in "Installing Python 3.7 with pyenv", installed PIP bfeore and updated it :


pi@raspberrypi:~ $ pip install --upgrade pip Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting pip Downloading https://files.pythonhosted.org/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl (1.5MB) 100% |████████████████████████████████| 1.5MB 47kB/s Installing collected packages: pip Successfully installed pip-20.3.4


then I installed fauxmo with pyenv according to the instructions with python 3.7.1, but i was dropping a PIP warning:


pi@raspberrypi:~ $ "$(pyenv root)"/versions/3.7.3/bin/python3.7 -m pip install fauxmo Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting fauxmo Downloading https://files.pythonhosted.org/packages/b8/d0/d19e70f24ceb435015d02a44eff17e82249cdebcd3c674d81de1e275e75e/fauxmo-0.5.2-py3-none-any.whl Installing collected packages: fauxmo Successfully installed fauxmo-0.5.2 You are using pip version 19.0.3, however version 21.3.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.


Somehow after the fauxmo installation the "pyenv which fauxmo" command did not show the path but just said:


pi@raspberrypi:~ $ pyenv which fauxmo pyenv: fauxmo: command not found

The `fauxmo' command exists in these Python versions: 3.7.3

Note: See 'pyenv help global' for tips on allowing both python2 and python3 to be found.


When I now try to start the service I always get this error and I could only find an issue related to PIP version on it:


pi@raspberrypi:/opt/pyenv/versions/3.7.3/bin $ /opt/pyenv/versions/3.7.3/bin/fauxmo -c /home/pi/config.json -vvv 2022-01-03 00:58:12 fauxmo:42 INFO Fauxmo v0.5.2 2022-01-03 00:58:12 fauxmo:43 DEBUG 3.7.3 (default, Jan 3 2022, 00:03:19) [GCC 8.3.0] Traceback (most recent call last): File "/opt/pyenv/versions/3.7.3/bin/fauxmo", line 10, in sys.exit(cli()) File "/opt/pyenv/versions/3.7.3/lib/python3.7/site-packages/fauxmo/cli.py", line 37, in cli main(config_path_str=args.config, verbosity=verbosity) File "/opt/pyenv/versions/3.7.3/lib/python3.7/site-packages/fauxmo/fauxmo.py", line 55, in main config = json.loads(config_path.read_text()) File "/opt/pyenv/versions/3.7.3/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/opt/pyenv/versions/3.7.3/lib/python3.7/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 11 (char 10)


It's reproducable, I already fresh setup the raspberry Pi a couple of times. My config.json:


"FAUXMO": { "ip_address": "auto" }, "PLUGINS": { "CommandLinePlugin": { "path": "/home/pi/commandlineplugin.py", "DEVICES": [ { "name": "Amsterdam", "port": 49915, "on_cmd": "python /home/pi/Amsterdam-an.py", "off_cmd": "python /home/pi/Amsterdam-aus.py" }, { "name": "Barcelona", "port": 49916, "on_cmd": "python /home/pi/Barcelona-an.py", "off_cmd": "python /home/pi/Barcelona-aus.py" }, { "name": "Berlin", "port": 49917, "on_cmd": "python /home/pi/Berlin-an.py", "off_cmd": "python /home/pi/Berlin-aus.py" }, { "name": "Dublin", "port": 49918, "on_cmd": "python /home/pi/Dublin-an.py", "off_cmd": "python /home/pi/Dublin-aus.py" }, { "name": "Hamburg", "port": 49919, "on_cmd": "python /home/pi/Hamburg-an.py", "off_cmd": "python /home/pi/Hamburg-aus.py" }, { "name": "Hawaii", "port": 49920, "on_cmd": "python /home/pi/Hawaii-an.py", "off_cmd": "python /home/pi/Hawaii-aus.py" }, { "name": "Ladenburg", "port": 49921, "on_cmd": "python /home/pi/Ladenburg-an.py", "off_cmd": "python /home/pi/Ladenburg-aus.py" }, { "name": "Lissabon", "port": 49922, "on_cmd": "python /home/pi/Lissabon-an.py", "off_cmd": "python /home/pi/Lissabon-aus.py" }, { "name": "London", "port": 49923, "on_cmd": "python /home/pi/London-an.py", "off_cmd": "python /home/pi/London-aus.py" }, { "name": "Madrid", "port": 49924, "on_cmd": "python /home/pi/Madrid-an.py", "off_cmd": "python /home/pi/Madrid-aus.py" }, { "name": "Mannheim", "port": 49925, "on_cmd": "python /home/pi/Mannheim-an.py", "off_cmd": "python /home/pi/Mannheim-aus.py" }, { "name": "New York", "port": 49926, "on_cmd": "python /home/pi/New-York-an.py", "off_cmd": "python /home/pi/New-York-aus.py" }, { "name": "Paris", "port": 49927, "on_cmd": "python /home/pi/Paris-an.py", "off_cmd": "python /home/pi/Paris-aus.py" }, { "name": "Rom", "port": 49928, "on_cmd": "python /home/pi/Rom-an.py", "off_cmd": "python /home/pi/Rom-aus.py" }, { "name": "Sydney", "port": 49929, "on_cmd": "python /home/pi/Sydney-an.py", "off_cmd": "python /home/pi/Sydney-aus.py" }, { "name": "Tokio", "port": 49930, "on_cmd": "python /home/pi/Tokio-an.py", "off_cmd": "python /home/pi/Tokio-aus.py" } ] } } }


WHYT

Please help me here :)


Please make sure you've taken these steps before submitting a new issue:

n8henrie commented 2 years ago

This isn't a great way to go about it (note to self: remove this from the readme):

"$(pyenv root)"/versions/3.7.3/bin/python3.7 -m pip install fauxmo

Instead, please review this section and use a venv.

json.decoder.JSONDecodeError: Extra data: line 1 column 11 (char 10)

Please review the README regarding json.tool to validate your json: https://github.com/n8henrie/fauxmo/#troubleshooting--faq

drak2021 commented 2 years ago

This isn't a great way to go about it (note to self: remove this from the readme):

"$(pyenv root)"/versions/3.7.3/bin/python3.7 -m pip install fauxmo

Instead, please review this section and use a venv.

json.decoder.JSONDecodeError: Extra data: line 1 column 11 (char 10)

Please review the README regarding json.tool to validate your json: https://github.com/n8henrie/fauxmo/#troubleshooting--faq

Thank you so much!! With venv the fauxmo service starts now! My json had a copy & paste error, the beginning { was lost somehow....