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

how can I update mpp-solar #421

Closed
ts1cos opened this issue Nov 5, 2023 · 28 comments
Closed

how can I update mpp-solar #421

ts1cos opened this issue Nov 5, 2023 · 28 comments

Comments

@ts1cos
Copy link

ts1cos commented Nov 5, 2023

I'm on version 0.14.12 and would like to update mpp-solar but I don't know how.

@Saentist
Copy link
Contributor

Saentist commented Nov 5, 2023

@ts1cos
Copy link
Author

ts1cos commented Nov 5, 2023

root@mpp-solar:~# sudo pip install mppsolar
Requirement already satisfied: mppsolar in /usr/local/lib/python3.10/dist-packages (0.14.12)
Requirement already satisfied: PyYAML in /usr/lib/python3/dist-packages (from mppsolar) (5.4.1)
Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.10/dist-packages (from mppsolar) (1.6.1)
Requirement already satisfied: pyserial in /usr/local/lib/python3.10/dist-packages (from mppsolar) (3.5)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

@Saentist
Copy link
Contributor

Saentist commented Nov 5, 2023

mpp-solar -v
Solar Device Command Utility, version: 0.16.11-dev, python version: 3.8.10

@jblance
Copy link
Owner

jblance commented Nov 22, 2023

@ts1cos did you get updated?

@ts1cos
Copy link
Author

ts1cos commented Nov 23, 2023

yes, I had to uninstall it and reinstall it and then it worked

@Saentist
Copy link
Contributor

yes, I had to uninstall it and reinstall it and then it worked

How you uninstall it I can't

@jblance
Copy link
Owner

jblance commented Nov 26, 2023

yes, I had to uninstall it and reinstall it and then it worked

How you uninstall it I can't

@Saentist - How did you install?
if you used pip, then pip uninstall mppsolar (or sudo pip uninstall mppsolar) should do it

@jblance jblance closed this as completed Nov 26, 2023
@Saentist
Copy link
Contributor

@jblance

root@ET1610PT:~# pip uninstall mppsolar
WARNING: Skipping mppsolar as it is not installed.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

root@ET1610PT:~# pip3 uninstall mppsolar
WARNING: Skipping mppsolar as it is not installed.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

root@ET1610PT:~# mpp-solar -v
Solar Device Command Utility, version: 0.16.11-dev, python version: 3.8.10

@ts1cos
Copy link
Author

ts1cos commented Nov 27, 2023

pip uninstall mpp-solar

@Saentist
Copy link
Contributor

pip uninstall mpp-solar

nothing different

root@ET1610PT:~# pip3 uninstall mpp-solar
WARNING: Skipping mpp-solar as it is not installed.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

root@ET1610PT:~# pip uninstall mpp-solar
WARNING: Skipping mpp-solar as it is not installed.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

@ts1cos
Copy link
Author

ts1cos commented Nov 27, 2023

sudo pip uninstall mpp-solar or login as root

@jblance
Copy link
Owner

jblance commented Nov 27, 2023 via email

@Saentist
Copy link
Contributor

Saentist commented Nov 27, 2023

How did you install it?

On Mon, 27 Nov 2023, 8:26 pm ts1cos, @.> wrote: sudo pip uninstall mpp-solar or login as root — Reply to this email directly, view it on GitHub <#421 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNQ5QSXUVONE3TV2CDDYGQ6BTAVCNFSM6AAAAAA66NRFQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRXGI3DGNBQGQ . You are receiving this because you were mentioned.Message ID: @.>

With PIP i guess
pip install -e "git+https://github.com/jblance/mpp-solar.git#egg=mppsolar"

# whereis mpp-solar
mpp-solar: /usr/local/bin/mpp-solar

@jblance
Copy link
Owner

jblance commented Nov 27, 2023 via email

@Saentist
Copy link
Contributor

# find / -name mppsola
/root/src/mppsolar
/root/src/mppsolar/mppsolar
/opt/INV/mpp-solar/build/lib/mppsolar     #cloned repo
/opt/INV/mpp-solar/src/mppsolar    #cloned repo
/opt/INV/mpp-solar/src/mppsolar/mppsolar   #cloned repo
/opt/INV/mpp-solar/mppsolar #cloned repo
/opt/INV/src/mppsolar
/opt/INV/src/mppsolar/tests/mppsolar
/opt/INV/src/mppsolar/mppsolar
/opt/src/mppsolar
/opt/src/mppsolar/mppsolar
/usr/lib/python3.8/site-packages/mppsolar-0.13.6-py3.8.egg/mppsolar

# find / -name mpp-solar
/opt/INV/mpp-solar #cloned repo
/usr/local/bin/mpp-solar

To remove them all or?

@jblance
Copy link
Owner

jblance commented Nov 27, 2023 via email

@Saentist
Copy link
Contributor

deleted all but as before same error with paho-mqtt #397

~# pip install mppsolar
Collecting mppsolar
  Downloading mppsolar-0.16.13-py3-none-any.whl.metadata (2.0 kB)
Collecting PyYAML>=6 (from mppsolar)
  Using cached PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
Collecting fastapi>=0.68.0 (from mppsolar)
  Using cached fastapi-0.104.1-py3-none-any.whl.metadata (24 kB)
Collecting fastapi-mqtt>=1.1 (from mppsolar)
  Using cached fastapi_mqtt-2.0.0-py3-none-any.whl.metadata (5.1 kB)
Collecting jinja2>=3.0.0 (from mppsolar)
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting paho-mqtt>=1.6 (from mppsolar)
  Using cached paho-mqtt-1.6.1.tar.gz (99 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@jblance
Copy link
Owner

jblance commented Nov 27, 2023 via email

@Saentist
Copy link
Contributor

Not find any paho tar file.

@jblance
Copy link
Owner

jblance commented Nov 27, 2023

Try pip cache remove paho-mqtt

@Saentist
Copy link
Contributor

~# pip cache remove paho-mqtt
WARNING: No matching packages for pattern "paho-mqtt"

really start to think it's something very small and hope it will help in feature to many people

@jblance
Copy link
Owner

jblance commented Nov 27, 2023 via email

@Saentist
Copy link
Contributor

Saentist commented Nov 27, 2023

defensively small but important think
Ubuntu 20.04 desktop come with python 3.8
no matter also python 3.10 installed, install script use smaller version 3.8

python3.10          python3.10-minimal  
python3.11          python3.11-minimal
~# pip3 install mppsolar
Collecting mppsolar
  Using cached mppsolar-0.16.13-py3-none-any.whl.metadata (2.0 kB)
Collecting PyYAML>=6 (from mppsolar)
  Using cached PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
Collecting fastapi>=0.68.0 (from mppsolar)
  Using cached fastapi-0.104.1-py3-none-any.whl.metadata (24 kB)
Collecting fastapi-mqtt>=1.1 (from mppsolar)
  Using cached fastapi_mqtt-2.0.0-py3-none-any.whl.metadata (5.1 kB)
Collecting jinja2>=3.0.0 (from mppsolar)
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting paho-mqtt>=1.6 (from mppsolar)
  Using cached paho-mqtt-1.6.1.tar.gz (99 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pydantic>=1.8.0 (from mppsolar)
  Downloading pydantic-2.5.2-py3-none-any.whl.metadata (65 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.2/65.2 kB 767.7 kB/s eta 0:00:00
Collecting pyserial>3 (from mppsolar)
  Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.6/90.6 kB 2.8 MB/s eta 0:00:00
Collecting sqlalchemy<3.0.0,>=2.0.15 (from mppsolar)
  Downloading SQLAlchemy-2.0.23-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (9.6 kB)
Collecting strenum<0.5.0,>=0.4.10 (from mppsolar)
  Downloading StrEnum-0.4.15-py3-none-any.whl.metadata (5.3 kB)
Collecting uvicorn>=0.15.0 (from mppsolar)
  Downloading uvicorn-0.24.0.post1-py3-none-any.whl.metadata (6.4 kB)
Collecting anyio<4.0.0,>=3.7.1 (from fastapi>=0.68.0->mppsolar)
  Downloading anyio-3.7.1-py3-none-any.whl.metadata (4.7 kB)
Collecting starlette<0.28.0,>=0.27.0 (from fastapi>=0.68.0->mppsolar)
  Downloading starlette-0.27.0-py3-none-any.whl.metadata (5.8 kB)
Collecting typing-extensions>=4.8.0 (from fastapi>=0.68.0->mppsolar)
  Downloading typing_extensions-4.8.0-py3-none-any.whl.metadata (3.0 kB)
Collecting gmqtt>=0.6.11 (from fastapi-mqtt>=1.1->mppsolar)
  Downloading gmqtt-0.6.12-py3-none-any.whl (30 kB)
Collecting MarkupSafe>=2.0 (from jinja2>=3.0.0->mppsolar)
  Downloading MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.0 kB)
Collecting annotated-types>=0.4.0 (from pydantic>=1.8.0->mppsolar)
  Downloading annotated_types-0.6.0-py3-none-any.whl.metadata (12 kB)
Collecting pydantic-core==2.14.5 (from pydantic>=1.8.0->mppsolar)
  Downloading pydantic_core-2.14.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.5 kB)
Collecting greenlet!=0.4.17 (from sqlalchemy<3.0.0,>=2.0.15->mppsolar)
  Downloading greenlet-3.0.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (3.7 kB)
Collecting click>=7.0 (from uvicorn>=0.15.0->mppsolar)
  Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting h11>=0.8 (from uvicorn>=0.15.0->mppsolar)
  Downloading h11-0.14.0-py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 2.0 MB/s eta 0:00:00
Collecting idna>=2.8 (from anyio<4.0.0,>=3.7.1->fastapi>=0.68.0->mppsolar)
  Downloading idna-3.6-py3-none-any.whl.metadata (9.9 kB)
Collecting sniffio>=1.1 (from anyio<4.0.0,>=3.7.1->fastapi>=0.68.0->mppsolar)
  Downloading sniffio-1.3.0-py3-none-any.whl (10 kB)
Downloading mppsolar-0.16.13-py3-none-any.whl (204 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 204.1/204.1 kB 2.8 MB/s eta 0:00:00
Downloading fastapi-0.104.1-py3-none-any.whl (92 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 92.9/92.9 kB 2.9 MB/s eta 0:00:00
Downloading fastapi_mqtt-2.0.0-py3-none-any.whl (8.6 kB)
Downloading pydantic-2.5.2-py3-none-any.whl (381 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 381.9/381.9 kB 3.0 MB/s eta 0:00:00
Downloading pydantic_core-2.14.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 3.6 MB/s eta 0:00:00
Downloading PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 757.7/757.7 kB 3.4 MB/s eta 0:00:00
Downloading SQLAlchemy-2.0.23-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 3.4 MB/s eta 0:00:00
Downloading StrEnum-0.4.15-py3-none-any.whl (8.9 kB)
Downloading uvicorn-0.24.0.post1-py3-none-any.whl (59 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59.7/59.7 kB 2.3 MB/s eta 0:00:00
Downloading annotated_types-0.6.0-py3-none-any.whl (12 kB)
Downloading anyio-3.7.1-py3-none-any.whl (80 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.9/80.9 kB 2.8 MB/s eta 0:00:00
Downloading click-8.1.7-py3-none-any.whl (97 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 3.2 MB/s eta 0:00:00
Downloading greenlet-3.0.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (616 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 616.7/616.7 kB 3.8 MB/s eta 0:00:00
Downloading MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28 kB)
Downloading starlette-0.27.0-py3-none-any.whl (66 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 67.0/67.0 kB 2.4 MB/s eta 0:00:00
Downloading typing_extensions-4.8.0-py3-none-any.whl (31 kB)
Downloading idna-3.6-py3-none-any.whl (61 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.6/61.6 kB 2.1 MB/s eta 0:00:00
Building wheels for collected packages: paho-mqtt
  Building wheel for paho-mqtt (pyproject.toml) ... done
  Created wheel for paho-mqtt: filename=paho_mqtt-1.6.1-py3-none-any.whl size=62120 sha256=185aeea5e125317c145574f9c7a14dd2fbbf9ec0dc5c75a1d39b1c7986a0bc06
  Stored in directory: /root/.cache/pip/wheels/29/ea/a5/ba9a63aaf4cd4e16e8a87ee31fb4d11b04ff5e1735d312619a
Successfully built paho-mqtt
Installing collected packages: strenum, pyserial, paho-mqtt, typing-extensions, sniffio, PyYAML, MarkupSafe, idna, h11, greenlet, gmqtt, click, annotated-types, uvicorn, sqlalchemy, pydantic-core, jinja2, anyio, starlette, pydantic, fastapi, fastapi-mqtt, mppsolar
Successfully installed MarkupSafe-2.1.3 PyYAML-6.0.1 annotated-types-0.6.0 anyio-3.7.1 click-8.1.7 fastapi-0.104.1 fastapi-mqtt-2.0.0 gmqtt-0.6.12 greenlet-3.0.1 h11-0.14.0 idna-3.6 jinja2-3.1.2 mppsolar-0.16.13 paho-mqtt-1.6.1 pydantic-2.5.2 pydantic-core-2.14.5 pyserial-3.5 sniffio-1.3.0 sqlalchemy-2.0.23 starlette-0.27.0 strenum-0.4.15 typing-extensions-4.8.0 uvicorn-0.24.0.post1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

~# mpp-solar -v
Solar Device Command Utility, version: 0.16.13, python version: 3.11.6

@jblance
Copy link
Owner

jblance commented Nov 28, 2023

great that you've figured it out
another reason to use venv or docker

@Saentist
Copy link
Contributor

Saentist commented Nov 29, 2023

great that you've figured it out another reason to use venv or docker

Venv complicated configuration for end user https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html
Docker 1.5gb extra space just to run it slower running extra memory usage

Native is best solution but python version selection when there is more then one is problematical.


Interesting solution will be using PyInstaller or Nuitka

@multilectical
Copy link

Hmmm, I just attempted to upgrade and ended doing a dist upgrade on raspbian, but now can only seem to get mppsolar running via venv which works. But can't figure out how to get the service started up again. Any direction here would be super appreciated.

I edited the path to where mpp seems to run in venv (/home/onion/venv/mppsolar/bin/mpp-solar) , but it's not working. Anyone have a good idea how to make this happen?

here's my service file. I think I need to prefix python under execstart possibly???

onion@raspberrypi:~ $ cat /etc/xdg/systemd/user/mpp-solar.service

# systemd unit file for the MPP-Solar Service
#
# needs to go to /etc/systemd/user/*

[Unit]
# Human readable name of the unit
Description=MPP Solar Service


[Service]
# Command to execute when the service is started
ExecStart=/home/onion/venv/mppsolar/bin/python /home/onion/venv/mppsolar/bin/mpp-solar -C /etc/mpp-solar/mpp-solar.conf --daemon

# Disable Python's buffering of STDOUT and STDERR, so that output from the
# service shows up immediately in systemd's logs
Environment=PYTHONUNBUFFERED=1

# Automatically restart the service if it crashes
Restart=always
WatchdogSec=60

# Our service will notify systemd once it is up and running
Type=notify

# Use a dedicated user to run our service
# User=mpp_service


[Install]
# Tell systemd to automatically start this service when the system boots
# (assuming the service is enabled)
WantedBy=default.target

here's what it tells me went wrong:

onion@raspberrypi:~ $ systemctl --user status mpp-solar.service
× mpp-solar.service - MPP Solar Service
     Loaded: loaded (/etc/xdg/systemd/user/mpp-solar.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Fri 2023-12-01 12:31:15 EST; 3min 30s ago
    Process: 873 ExecStart=/home/onion/venv/mppsolar/bin/python /home/onion/venv/mppsolar/bin/mpp-solar -C /etc/mpp-solar/mpp-solar.conf ->
   Main PID: 873 (code=exited, status=1/FAILURE)
        CPU: 321ms

but when I try it directly it works:

onion@raspberrypi:~ $ /home/onion/venv/mppsolar/bin/python /home/onion/venv/mppsolar/bin/mpp-solar -P PI41 -o screen -c QPIGS -p /dev/hidraw0
Command: QPIGS - General Status Parameters inquiry LV5048
--------------------------------------------------------------------------------
Parameter                      Value          	Unit
l1_ac_input_voltage            121.6          	V   
l1_ac_input_frequency          60.0           	Hz  
l1_ac_output_voltage           121.6          	V   
l1_ac_output_frequency         60.0           	Hz  
l1_ac_output_apparent_power    85             	VA  
l1_ac_output_active_power      66             	W   
l1_ac_output_load              3              	%   
bus_voltage                    201            	V   
battery_voltage                50.7           	V   
battery_charging_current       4              	A   
battery_capacity               25             	%   
inverter_heat_sink_temperature 20             	Deg_C
pv_input_current_for_battery   4.0            	A   
pv_input_voltage               105.7          	V   
battery_voltage_from_scc       50.86          	V   
battery_discharge_current      0              	A   
is_l1_scc_ok                   1              	bool
is_l1_ac_charging_on           0              	bool
is_l1_scc_charging_on          1              	bool
is_battery_over                0              	bool
is_battery_under               0              	bool
is_l1_line_not_ok              1              	bool
is_load_on                     0              	bool
rsv1                           0              	A   
rsv2                           0              	A   
pv_input_power                 208            	W   
is_charging_to_float           0              	bool
is_switched_on                 1              	bool
is_reserved                    0              	bool
--------------------------------------------------------------------------------

@multilectical
Copy link

multilectical commented Dec 4, 2023

I got it working. Just in case it can help others while updating, what I did that I think fixed things after updating to the virtual environment (this: https://github.com/jblance/mpp-solar/wiki/Installation#using-a-virtual-environment ) :

source venv/mppsolar/bin/activate // enter the new virtual env
pip install systemd-python // install python systemd which wasn't yet installed in the virtual env

I also made put a file with the following where the previous mpp-solar used to live at /usr/local/bin/mpp-solar

#!/bin/bash
/home/onion/venv/mppsolar/bin/python /home/onion/venv/mppsolar/bin/mpp-solar

That just calls the virtual env version without having to enter that environment on the cli and might be enough to make the service work without the above step.

edit: replace any path with onion in it with to reflect the proper path in your own setup.

@jblance
Copy link
Owner

jblance commented Dec 6, 2023

good news, thanks for the update - Ive added to the wiki

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

No branches or pull requests

4 participants