FalconChristmas / fpp

Falcon Player
http://FalconChristmas.com
Other
543 stars 191 forks source link

FPP v8: Plugin Install Error: TP-Link(Kasa) #1778

Closed patdelaney closed 3 weeks ago

patdelaney commented 6 months ago

Failed Instalation

cybercop23 commented 6 months ago

I think these are fixed with this change... Fix "command not found" bug cause by https://github.com/FalconChristmas/fpp/commit/88b1606d77346fdda9bb4a7562ae147b1fd447a6

I was able to install TPLink on PI02W and Pi5 on latest master8 w/o issues.

OnlineDynamic commented 6 months ago

@computergeek1507 think the issue is the new handling of python enironments in bookworm

see https://www.raspberrypi.com/documentation/computers/os.html#python-on-raspberry-pi

Think the install script needs to be changed for bookworm to look something like: ` !/bin/bash

BASEDIR=$(dirname $0) cd $BASEDIR cd ..

sudo apt install python3.11-venv

python3 -m venv --system-site-packages env

source env/bin/activate

sudo env/bin/pip install python-kasa

make `

There is then a C++ compile issue which needs resolving by removing the 'const' from line 364 (virtual const std::shared_ptr<httpse) of src/tplinkPlugin.cpp

the callbacks.py file prob needs changing to ref the location of the virtual python3 bin #!env/bin python3

I have made those changes on my local install on a RPI5 running FPP v8 master branch and OS 2024-02 OS. It has installed successfully and is communicating with my test TPLink Kasa plug correctly

OnlineDynamic commented 6 months ago

I think these are fixed with this change... Fix "command not found" bug cause by https://github.com/FalconChristmas/fpp/commit/88b1606d77346fdda9bb4a7562ae147b1fd447a6

I was able to install TPLink on PI02W and Pi5 on latest master8 w/o issues.

Guessing you aren't running latest FPPOS with the master branch..think that might be why you didn't hit the python issue on install

darylc commented 2 months ago

@patdelaney is this still a problem in the latest image & version of master?

OnlineDynamic commented 2 months ago

As per my previous messages I still get these errors on install on a Pi5 related to python, doesn't look like @computergeek1507 has made any changes to the pluggin yet (I suggested a fix above):

error: externally-managed-environment

× This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. Building FPP on 'Raspberry Pi' platform ccache g++ -fpch-preprocess -O3 -Wno-psabi -pipe -I /opt/fpp/src -fpic -std=gnu++23 -I/opt/fpp/src -c src/tplinkPlugin.cpp -o src/tplinkPlugin.o src/tplinkPlugin.cpp:364:62: error: invalid covariant return type for ‘virtual const std::shared_ptr TPLinkPlugin::render_GET(const httpserver::http_request&)’ 364 | virtual const std::shared_ptr render_GET(const httpserver::http_request &req) override { | ^~~~~~ In file included from /usr/include/httpserver.hpp:36, from /opt/fpp/src/fpp-pch.h:48, from src/tplinkPlugin.cpp:1: /usr/include/httpserver/http_resource.hpp:71:45: note: overridden function is ‘virtual std::shared_ptr httpserver::http_resource::render_GET(const httpserver::http_request&)’ 71 | virtual std::shared_ptr render_GET(const http_request& req) { | ^~~~~~ make: *** [Makefile:11: src/tplinkPlugin.o] Error 1 {"Status":"Error","Message":"Could not properly install plugin"}

computergeek1507 commented 2 months ago

I tied this on FPP8 and the discovery tab is still broken. Do I need to update the Shell command in the php to us the environment as well?

patdelaney commented 2 months ago

I was able to install the plugin on latest v8 master [v8.x-master-306-gfa61f2a6 (master branch)] with no issues. I did the following config: image This is a 6 outlet strip. I was able to send e1.31 commands to turn each port on and off.

Display testing does not toggle through the ports. I'm not sure if that is by design, @computergeek1507 what discovery tab?

OnlineDynamic commented 2 months ago

I just tried to install on latest fpp image:

v8.x-master-311-gf08308a7 (master branch)

and still get this error during install, full install output looks like:

`Installing plugin fpp-plugin-tplink Cloning into 'fpp-plugin-tplink'... Running fpp_install.sh script for fpp-plugin-tplink Reading package lists... Building dependency tree... Reading state information... The following additional packages will be installed: javascript-common libexpat1-dev libjs-jquery libjs-sphinxdoc libjs-underscore libpython3-dev libpython3.11-dev python3-dev python3-setuptools python3-wheel python3.11-dev Suggested packages: python-setuptools-doc The following NEW packages will be installed: javascript-common libexpat1-dev libjs-jquery libjs-sphinxdoc libjs-underscore libpython3-dev libpython3.11-dev python3-dev python3-pip python3-setuptools python3-wheel python3.11-dev 0 upgraded, 12 newly installed, 0 to remove and 1 not upgraded. Need to get 6,495 kB of archives. After this operation, 29.5 MB of additional disk space will be used. Get:1 http://archive.raspberrypi.com/debian bookworm/main armhf python3-pip all 23.0.1+dfsg-1+rpt1 [1,325 kB] Get:3 http://mirror.cxserv.de/raspbian bookworm/main armhf libexpat1-dev armhf 2.5.0-1 [130 kB] Get:6 http://mirror.cxserv.de/raspbian bookworm/main armhf libjs-sphinxdoc all 5.3.0-4 [130 kB] Get:2 http://raspbian.raspberrypi.com/raspbian bookworm/main armhf javascript-common all 11+nmu1 [6,260 B] Get:4 http://raspbian.raspberrypi.com/raspbian bookworm/main armhf libjs-jquery all 3.6.1+dfsg+~3.5.14-1 [326 kB] Get:7 http://mirror.cxserv.de/raspbian bookworm/main armhf libpython3.11-dev armhf 3.11.2-6 [3,364 kB] Get:8 http://mirror.pyratelan.org/raspbian/raspbian bookworm/main armhf libpython3-dev armhf 3.11.2-1 [9,248 B] Get:5 http://raspbian.raspberrypi.com/raspbian bookworm/main armhf libjs-underscore all 1.13.4~dfsg+~1.11.4-3 [116 kB] Get:9 http://mirror.cxserv.de/raspbian bookworm/main armhf python3.11-dev armhf 3.11.2-6 [511 kB] Get:10 http://mirror.cxserv.de/raspbian bookworm/main armhf python3-dev armhf 3.11.2-1 [26.2 kB] Get:11 http://mirror.cxserv.de/raspbian bookworm/main armhf python3-setuptools all 66.1.1-1 [521 kB] Get:12 http://mirror.cxserv.de/raspbian bookworm/main armhf python3-wheel all 0.38.4-2 [30.8 kB] debconf: unable to initialize frontend: Dialog debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (This frontend requires a controlling tty.) debconf: falling back to frontend: Teletype dpkg-preconfigure: unable to re-open stdin: Fetched 6,495 kB in 2s (4,165 kB/s) Selecting previously unselected package javascript-common. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 117116 files and directories currently installed.) Preparing to unpack .../00-javascript-common_11+nmu1_all.deb ... Unpacking javascript-common (11+nmu1) ... Selecting previously unselected package libexpat1-dev:armhf. Preparing to unpack .../01-libexpat1-dev_2.5.0-1_armhf.deb ... Unpacking libexpat1-dev:armhf (2.5.0-1) ... Selecting previously unselected package libjs-jquery. Preparing to unpack .../02-libjs-jquery_3.6.1+dfsg+~3.5.14-1_all.deb ... Unpacking libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... Selecting previously unselected package libjs-underscore. Preparing to unpack .../03-libjs-underscore_1.13.4~dfsg+~1.11.4-3_all.deb ... Unpacking libjs-underscore (1.13.4~dfsg+~1.11.4-3) ... Selecting previously unselected package libjs-sphinxdoc. Preparing to unpack .../04-libjs-sphinxdoc_5.3.0-4_all.deb ... Unpacking libjs-sphinxdoc (5.3.0-4) ... Selecting previously unselected package libpython3.11-dev:armhf. Preparing to unpack .../05-libpython3.11-dev_3.11.2-6_armhf.deb ... Unpacking libpython3.11-dev:armhf (3.11.2-6) ...

Selecting previously unselected package libpython3-dev:armhf. Preparing to unpack .../06-libpython3-dev_3.11.2-1_armhf.deb ... Unpacking libpython3-dev:armhf (3.11.2-1) ...

Selecting previously unselected package python3.11-dev. Preparing to unpack .../07-python3.11-dev_3.11.2-6_armhf.deb ... Unpacking python3.11-dev (3.11.2-6) ...

Selecting previously unselected package python3-dev. Preparing to unpack .../08-python3-dev_3.11.2-1_armhf.deb ... Unpacking python3-dev (3.11.2-1) ...

Selecting previously unselected package python3-setuptools. Preparing to unpack .../09-python3-setuptools_66.1.1-1_all.deb ...

Unpacking python3-setuptools (66.1.1-1) ...

Selecting previously unselected package python3-wheel. Preparing to unpack .../10-python3-wheel_0.38.4-2_all.deb ... Unpacking python3-wheel (0.38.4-2) ...

Selecting previously unselected package python3-pip. Preparing to unpack .../11-python3-pip_23.0.1+dfsg-1+rpt1_all.deb ... Unpacking python3-pip (23.0.1+dfsg-1+rpt1) ...

Setting up javascript-common (11+nmu1) ...

apache2_invoke: Enable configuration javascript-common

Setting up python3-setuptools (66.1.1-1) ...

Setting up python3-wheel (0.38.4-2) ...

Setting up libexpat1-dev:armhf (2.5.0-1) ... Setting up libpython3.11-dev:armhf (3.11.2-6) ... Setting up python3-pip (23.0.1+dfsg-1+rpt1) ...

Setting up libjs-jquery (3.6.1+dfsg+~3.5.14-1) ... Setting up libjs-underscore (1.13.4~dfsg+~1.11.4-3) ...

Setting up libpython3-dev:armhf (3.11.2-1) ... Setting up python3.11-dev (3.11.2-6) ...

Setting up libjs-sphinxdoc (5.3.0-4) ... Setting up python3-dev (3.11.2-1) ...

Processing triggers for man-db (2.11.2-2) ...

error: externally-managed-environment

× This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. Building FPP on 'Raspberry Pi' platform ccache g++ -fpch-preprocess -O3 -Wno-psabi -pipe -I /opt/fpp/src -fpic -std=gnu++23 -I/opt/fpp/src -c src/tplinkPlugin.cpp -o src/tplinkPlugin.o ccache g++ -fpch-preprocess -O3 -Wno-psabi -pipe -I /opt/fpp/src -fpic -std=gnu++23 -c src/TPLinkItem.cpp -o src/TPLinkItem.o ccache g++ -fpch-preprocess -O3 -Wno-psabi -pipe -I /opt/fpp/src -fpic -std=gnu++23 -c src/TPLinkLight.cpp -o src/TPLinkLight.o ccache g++ -fpch-preprocess -O3 -Wno-psabi -pipe -I /opt/fpp/src -fpic -std=gnu++23 -c src/TPLinkSwitch.cpp -o src/TPLinkSwitch.o ccache g++ -shared src/tplinkPlugin.o src/TPLinkItem.o src/TPLinkLight.o src/TPLinkSwitch.o -L/opt/fpp/src -lfpp -o libfpp-plugin-tplink.so

Done`

patdelaney commented 2 months ago

So you installed https://github.com/FalconChristmas/fpp/releases/download/8.0-pre-alpha1/FPP-v8.0-alpha5-Pi.img.zip FPP-v8.0-alpha5-Pi.img.zip then the latest code on top of that?

patdelaney commented 2 months ago

What flavor of Pi

OnlineDynamic commented 2 months ago

Correct on a pi5

patdelaney commented 2 months ago

I tried to install Kasa again on Pi 5. I did see this error during the install, but I'm not sure if it's an issue: `Processing triggers for man-db (2.11.2-2) ...

error: externally-managed-environment

× This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv`

I believe that it does require a reboot though to work

darylc commented 3 weeks ago

@patdelaney Shall we log this against the plugin and close it out under fpp?

computergeek1507 commented 3 weeks ago

this is fixed