jziolkowski / tdm

GUI application to discover and monitor devices flashed with https://github.com/arendst/tasmota
GNU General Public License v3.0
651 stars 84 forks source link

60 devices - TDM extremely slow - not usable #185

Open Montreal666 opened 2 years ago

Montreal666 commented 2 years ago

I have about 60 active Tasmota devices;

TDM works but seems to be in a perpetual scanning/discovery state, making the app unusable; App starts populating fields, then hangs, doesn't respond for several minutes, then back for a second or two. Can't click menus or takes forever to respond, etc. I've tried playing around with all parameters, disabled telemetry, etc.

I also installed TasmoAdmin, and it works smoothly so really seems to be app related; I'd prefer the TDM interface if I manage to get it working.

Let me know what you think and how I should troubleshoot this,

Thanks!

jziolkowski commented 2 years ago

Finally, someone with a lot of hardware :)

First of all, TasmoAdmin works in a completely different manner connection-wise. Also TDM pulls (and internally updates) much more stuff from Tasmota.

Are you able to prepare the venv for TDM and run some debug/tests for me from console?

Montreal666 commented 2 years ago

Sure can. Just guide me through the process as I'm not familiar with the console (unless you are talking about the Tasmota console) . Fyi I am running Windows 10. Thx

Montreal666 commented 2 years ago

Had to create a few custom bins so I have a number of tools already installed (IOplatform, VB, etc.) But not an expert so will need some guidance.

barbudor commented 2 years ago

@homeseer666 Do you already have a Python interpreter on your computer ? If not, the easiest could be that we provide you a ZIP file which include the VENV + TDM sources code

@jziolkowski If you don't have a Windows computer handy, I can do it : VENV Python 3.8 + latest TDM source tree ?

Montreal666 commented 2 years ago

Python 3.10.2 installed, had to use it for esptool.py/ PYFlasher. Let me know what is the simplest course of action. Thx,

jziolkowski commented 2 years ago

@barbudor please provide the zip, that would make it easier. TIA

barbudor commented 2 years ago

@homeseer666 As per @jziolkowski suggestion, please find here a lkink to download a ZIP with latest TDM source + minimum Python env https://transfert.free.fr/mMgxcV Unzip the file To activate the VENV (Virtual ENVironement), open a CMD console, go to the folder where you have unzipped the content and type venv\Scripts\activate.bat This will add a (venv) at the beginning of the prompt which confirm that from now on you are running a local Python environment wuth all hte dependencies To check that it is working, just type python tdm.py and that should launch TDM From there, @jziolkowski will tell you how to enable the debug features he needs

Thanks

Montreal666 commented 2 years ago

Sounds good, should have time later this evening or tomorrow, will report back. Thx

Montreal666 commented 2 years ago

All set. Except fot the last command (python tdm.py) where I get:

(venv) C:\xxxxxxxxxxxxxxxx\tdm_venv>python tdm.py python: can't open file 'C:\xxxxxxxxxxxxxxxxxx\tdm_venv\tdm.py': [Errno 2] No such file or directory

barbudor commented 2 years ago

my bad, it's python tdmgr.py

Montreal666 commented 2 years ago

Originally thought this was the problem but it was also returning an error....

(venv) C:\xxxxxxxxxxxxxx\tdm_venv>python tdmgr.py Traceback (most recent call last): File "C:\xxxxxxxxxxxxxxxxxxxx\tdm_venv\tdmgr.py", line 10, in from PyQt5.QtCore import QTimer, pyqtSlot, QSettings, QDir, QSize, Qt, QDateTime, QUrl ModuleNotFoundError: No module named 'PyQt5'

barbudor commented 2 years ago

Strange. I just deleted my original tdm_env folder, restored from the zip and it works PyQt5 should be there in tdm_venv\venv\Lib\site-packages\PyQt5

jziolkowski commented 2 years ago

@homeseer666 did you activate the venv?

barbudor commented 2 years ago

the (venv) marker at the beginning of the prompt suggests he did

Montreal666 commented 2 years ago

yes I did , (venv) marker is there.

BartGijsbers commented 2 years ago

I have/had the same problem. I needed to change the code a little because I am not using %prefix% at all in any of my 42 tasmota devices. Due to the changes TDM subscibed to '#' 42 times. This seems to start 42 times a request with each receiving mqtt entry. First I try-ed to fix it by removing duplicate entry's in the mqtt queue and the lwts list. I was hitting over 100.000 entry's in the mqtt queue. Now I hard coded subscribe to just '#' only ones. That seems to work for me but sometimes it still get's very slow.

btw, I love your program!!

jziolkowski commented 2 years ago

Can you show me a line from debug that can back the claim that it subbed to "#" 40 times?

BartGijsbers commented 2 years ago

2022-02-17 17:05:57 [INFO] ### TDM START ### 2022-02-17 17:06:03 [INFO] MQTT: Subscribed to +//#, +//#, +/cmnd/#, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #, #

My devices look like (only showing 2):

[5C-CF-7F-2C-19-AC] topic=relayserverwaskamer full_topic=%topic%/ device_name=RelayServerWaskamer

[A0-20-A6-26-74-DD] topic=DS18B20-02 full_topic=%topic%/ device_name=DS18B20-02

So they only have %topic% and no %prefix%

barbudor commented 2 years ago

Which is totally wrong Without prefix you can't manage tasmota

jziolkowski commented 2 years ago

also pls paste your discovery topics

BartGijsbers commented 2 years ago

Remember I changed some code in order to make the program work without the %prefix%.

Discovery topics: %topic%/%prefix%

Changes: prefix_tele = "" prefix_stat = "" prefix_cmd = "cmnd"

    self.prefix_cmd = prefix_cmd
    self.prefix_stat = prefix_stat
    self.prefix_tele = prefix_tele

def build_topic(self, prefix):
    return self.p['Topic'] + "/" + prefix

def cmnd_topic(self, command=""):
    if command:
        return "{}/{}".format(self.build_topic(self.prefix_cmd), command)
    return self.build_topic(self.prefix_cmd)

def stat_topic(self):
    return self.build_topic(self.prefix_stat)

def tele_topic(self, endpoint=""):
    if endpoint:
        return "{}/{}".format(self.build_topic(self.prefix_tele), endpoint)
    return self.build_topic(self.prefix_tele)

def mqtt_subscribe(self):
    self.topics.append("#")
    self.mqtt.subscribe([(topic, 0) for topic in self.topics])
jziolkowski commented 2 years ago

You removed the whole logic behind finding duplicate topics. That's why there are duplicated subscriptions.

BartGijsbers commented 2 years ago

I did that after I found out that there were duplicate topics. I just wanted to say that if you have duplicated topics the program gets very slow.

jziolkowski commented 2 years ago

Well, duh :)

jziolkowski commented 2 years ago

Couldn't help myself, sorry :D

image

BartGijsbers commented 2 years ago

:-) No problem, you are more then welcome. The sequence was however. TDM was slow, removed duplicate topics. TDM is ok.

Montreal666 commented 2 years ago

Back to my original request; still interested to troubleshoot ? I'd like to find a way to make the tool usable. Thank you!

barbudor commented 2 years ago

HI @homeseer666 I didn't even noticed that there was a switch between 2 people :) So where are you If you can't run the tdmgr.py script from what I provided, are you able to run it from your own Python install ?

Montreal666 commented 2 years ago

still at the same place, getting this error when runnning tdmgr.py:

(venv) C:\Users\xxx\Downloads\tdm_venv>python tdmgr.py Traceback (most recent call last): File "C:\Users\xxx\Downloads\tdm_venv\tdmgr.py", line 10, in from PyQt5.QtCore import QTimer, pyqtSlot, QSettings, QDir, QSize, Qt, QDateTime, QUrl ModuleNotFoundError: No module named 'PyQt5'

barbudor commented 2 years ago

While in the venv, can you please try to re-install dependencies: pip install -U -r requirements.txt

Montreal666 commented 2 years ago

Result:

(venv) C:\Users\xxx\Downloads\tdm_venv>pip install -U -r requirements.txt Requirement already up-to-date: paho_mqtt>=1.4 in c:\users\xxx\appdata\roaming\python\python310\site-packages (from -r requirements.txt (line 1)) (1.6.1) Collecting PyQt5==5.14.2 Downloading PyQt5-5.14.2.tar.gz (3.2 MB) |████████████████████████████████| 3.2 MB ... Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... error ERROR: Command errored out with exit status 1: command: 'c:\users\xxx\appdata\local\programs\python\python310\python.exe' 'C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\YXXX~1\AppData\Local\Temp\tmpmgd5_zub' cwd: C:\Users\xxx\AppData\Local\Temp\pip-install-rxmwz4ig\pyqt5 Complete output (31 lines): Traceback (most recent call last): File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\pep517_in_process.py", line 126, in prepare_metadata_for_build_wheel hook = backend.prepare_metadata_for_build_wheel AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
    main()
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 130, in prepare_metadata_for_build_wheel
    return _get_wheel_metadata_from_wheel(backend, metadata_directory,
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 159, in _get_wheel_metadata_from_wheel
    whl_basename = backend.build_wheel(metadata_directory, config_settings)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-3_vuvmhp\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
    project = AbstractProject.bootstrap('pep517')
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-3_vuvmhp\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
    project.setup(pyproject, tool, tool_description)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-3_vuvmhp\overlay\Lib\site-packages\sipbuild\project.py", line 479, in setup
    self.apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-install-rxmwz4ig\pyqt5\project.py", line 62, in apply_user_defaults
    super().apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-3_vuvmhp\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
    super().apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-3_vuvmhp\overlay\Lib\site-packages\sipbuild\project.py", line 225, in apply_user_defaults
    self.builder.apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-3_vuvmhp\overlay\Lib\site-packages\pyqtbuild\builder.py", line 67, in apply_user_defaults
    raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
----------------------------------------

ERROR: Command errored out with exit status 1: 'c:\users\xxx\appdata\local\programs\python\python310\python.exe' 'C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\YXXX~1\AppData\Local\Temp\tmpmgd5_zub' Check the logs for full command output. WARNING: You are using pip version 20.2.4; however, version 22.0.3 is available. You should consider upgrading via the 'c:\users\xxx\appdata\local\programs\python\python310\python.exe -m pip install --upgrade pip' command.

jziolkowski commented 2 years ago

try this before installing requirements:

pip install --upgrade pip wheel setuptools

Montreal666 commented 2 years ago

(venv) C:\Users\xxx\Downloads\tdm_venv>pip install --upgrade pip wheel setuptools Collecting pip Using cached pip-22.0.3-py3-none-any.whl (2.1 MB) Requirement already up-to-date: wheel in c:\users\xxx\appdata\local\programs\python\python310\lib\site-packages (0.37.1) Collecting setuptools Using cached setuptools-60.9.3-py3-none-any.whl (1.1 MB) Installing collected packages: pip, setuptools Attempting uninstall: pip Found existing installation: pip 20.2.4 Uninstalling pip-20.2.4: Successfully uninstalled pip-20.2.4 Rolling back uninstall of pip Moving to c:\users\xxx\appdata\roaming\python\python310\scripts\pip.exe from C:\Users\xxx\AppData\Local\Temp\pip-uninstall-zb4w7gsy\pip.exe Moving to c:\users\xxx\appdata\roaming\python\python310\scripts\pip3.10.exe from C:\Users\xxx\AppData\Local\Temp\pip-uninstall-zb4w7gsy\pip3.10.exe Moving to c:\users\xxx\appdata\roaming\python\python310\scripts\pip3.exe from C:\Users\xxx\AppData\Local\Temp\pip-uninstall-zb4w7gsy\pip3.exe Moving to c:\users\xxx\appdata\roaming\python\python310\site-packages\pip-20.2.4.dist-info\ from C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\~ip-20.2.4.dist-info Moving to c:\users\xxx\appdata\roaming\python\python310\site-packages\pip\ from C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\~ip ERROR: Exception: Traceback (most recent call last): File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\cli\base_command.py", line 228, in _main status = self.run(options, args) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\cli\req_command.py", line 182, in wrapper return func(self, options, args) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\commands\install.py", line 397, in run installed = install_given_reqs( File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\req__init__.py", line 82, in install_given_reqs requirement.install( File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\req\req_install.py", line 814, in install install_wheel( File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\operations\install\wheel.py", line 852, in install_wheel _install_wheel( File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\operations\install\wheel.py", line 762, in _install_wheel generated_console_scripts = maker.make_multiple(scripts_to_generate) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\distlib\scripts.py", line 418, in make_multiple filenames.extend(self.make(specification, options)) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\operations\install\wheel.py", line 498, in make return super(PipScriptMaker, self).make(specification, options) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\distlib\scripts.py", line 407, in make self._make_script(entry, filenames, options=options) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\distlib\scripts.py", line 307, in _make_script self._write_script(scriptnames, shebang, script, filenames, ext) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\distlib\scripts.py", line 242, in _write_script launcher = self._get_launcher('t') File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\distlib\scripts.py", line 386, in _get_launcher raise ValueError(msg) ValueError: Unable to find resource t64.exe in package pip._vendor.distlib WARNING: You are using pip version 20.2.4; however, version 22.0.3 is available. You should consider upgrading via the 'c:\users\xxx\appdata\local\programs\python\python310\python.exe -m pip install --upgrade pip' command.

(venv) C:\Users\xxx\Downloads\tdm_venv>pip install -U -r requirements.txt Requirement already up-to-date: paho_mqtt>=1.4 in c:\users\xxx\appdata\roaming\python\python310\site-packages (from -r requirements.txt (line 1)) (1.6.1) Collecting PyQt5==5.14.2 Using cached PyQt5-5.14.2.tar.gz (3.2 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... error ERROR: Command errored out with exit status 1: command: 'c:\users\xxx\appdata\local\programs\python\python310\python.exe' 'C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\YXXX~1\AppData\Local\Temp\tmptetr53lh' cwd: C:\Users\xxx\AppData\Local\Temp\pip-install-n3p6kby4\pyqt5 Complete output (31 lines): Traceback (most recent call last): File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\pep517_in_process.py", line 126, in prepare_metadata_for_build_wheel hook = backend.prepare_metadata_for_build_wheel AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
    main()
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 130, in prepare_metadata_for_build_wheel
    return _get_wheel_metadata_from_wheel(backend, metadata_directory,
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 159, in _get_wheel_metadata_from_wheel
    whl_basename = backend.build_wheel(metadata_directory, config_settings)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-2l2lgdf5\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
    project = AbstractProject.bootstrap('pep517')
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-2l2lgdf5\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
    project.setup(pyproject, tool, tool_description)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-2l2lgdf5\overlay\Lib\site-packages\sipbuild\project.py", line 479, in setup
    self.apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-install-n3p6kby4\pyqt5\project.py", line 62, in apply_user_defaults
    super().apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-2l2lgdf5\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
    super().apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-2l2lgdf5\overlay\Lib\site-packages\sipbuild\project.py", line 225, in apply_user_defaults
    self.builder.apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-2l2lgdf5\overlay\Lib\site-packages\pyqtbuild\builder.py", line 67, in apply_user_defaults
    raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
----------------------------------------

ERROR: Command errored out with exit status 1: 'c:\users\xxx\appdata\local\programs\python\python310\python.exe' 'C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\YXXX~1\AppData\Local\Temp\tmptetr53lh' Check the logs for full command output. WARNING: You are using pip version 20.2.4; however, version 22.0.3 is available. You should consider upgrading via the 'c:\users\xxx\appdata\local\programs\python\python310\python.exe -m pip install --upgrade pip' command.

(venv) C:\Users\xxx\Downloads\tdm_venv>

jziolkowski commented 2 years ago

looks like something wrong with your python environment. Despite installing pip 22.0.3, still shows you that you ise 20.2.4

Did you install python from installer package from the web, or via microsoft store?

Montreal666 commented 2 years ago

Installer package I believe, what do you recommend?

jziolkowski commented 2 years ago

installer package is ok.

drop the venv and start new.

python3 -m venv venv

then activate it like before. Then follow up with pip install --upgrade pip wheel setuptools

Don't install requirements.txt yet, show me the output of the above first.

jziolkowski commented 2 years ago

you can do all that in some new empty folder, wherever is convenient for you

Montreal666 commented 2 years ago

"Python3" doesn't seem to work, not sure why; tried with "Python", some permission error; Am using a standard cmd prompt (admin)... should I use Powershell admin? other folder ? change folder permissions?

C:\Users\xxx\Downloads\tdm_venv>python3 -m venv venv Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

C:\Users\xxx\Downloads\tdm_venv>python -m venv venv

C:\Users\xxx\Downloads\tdm_venv>cd venv

C:\Users\xxx\Downloads\tdm_venv\venv>cd scripts

C:\Users\xxx\Downloads\tdm_venv\venv\Scripts>activate

(venv) C:\Users\xxx\Downloads\tdm_venv\venv\Scripts>cd..

(venv) C:\Users\xxx\Downloads\tdm_venv\venv>cd..

(venv) C:\Users\xxx\Downloads\tdm_venv>pip install --upgrade pip wheel setuptools Requirement already satisfied: pip in c:\users\xxx\downloads\tdm_venv\venv\lib\site-packages (21.2.4) Collecting pip Using cached pip-22.0.3-py3-none-any.whl (2.1 MB) Collecting wheel Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB) Requirement already satisfied: setuptools in c:\users\xxx\downloads\tdm_venv\venv\lib\site-packages (58.1.0) Collecting setuptools Using cached setuptools-60.9.3-py3-none-any.whl (1.1 MB) Installing collected packages: wheel, setuptools, pip Attempting uninstall: setuptools Found existing installation: setuptools 58.1.0 Uninstalling setuptools-58.1.0: Successfully uninstalled setuptools-58.1.0 Attempting uninstall: pip Found existing installation: pip 21.2.4 Uninstalling pip-21.2.4: Successfully uninstalled pip-21.2.4 ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\Users\xxx\AppData\Local\Temp\pip-uninstall-0l5tmrwe\pip.exe' Check the permissions.

(venv) C:\Users\xxx\Downloads\tdm_venv>

jziolkowski commented 2 years ago

Ahh the woes of python on windows... I'll get back to you on friday, tomorrow I'm unavailable whole day

Montreal666 commented 2 years ago

ok keep me posted, thx

barbudor commented 2 years ago

Don't use python3 on windows, that will lead you to the Microsoft python on the Windows Store. Run away...

If you installed Python from the Python.Org installer org, you must check the box for setting up python in the PATH. The command is python, not python3 If you are not confortable to play with permissions and having different python installed insure that

Montreal666 commented 2 years ago

Ok, had an older 32bit Python version still installed, after uninstalling it I'm left with 3.10.2 (64 bit) in the windows add/remove programs menu; this got rid of the previous error, but the 'PyQt5.sip' error still remains (see below) Weird as all requirements seem to be correctly installed... Should I delete all Windows/Python instances or is there something else going on? Thx,

C:\Users\xxx\Downloads\tdm_venv>python -m venv venv

C:\Users\xxx\Downloads\tdm_venv>cd venv

C:\Users\xxx\Downloads\tdm_venv\venv>cd scripts

C:\Users\xxx\Downloads\tdm_venv\venv\Scripts>activate

(venv) C:\Users\xxx\Downloads\tdm_venv\venv\Scripts>cd..

(venv) C:\Users\xxx\Downloads\tdm_venv\venv>cd..

(venv) C:\Users\xxx\Downloads\tdm_venv>pip install --upgrade pip wheel setuptools Requirement already satisfied: pip in c:\users\xxx\downloads\tdm_venv\venv\lib\site-packages (22.0.3) Requirement already satisfied: wheel in c:\users\xxx\downloads\tdm_venv\venv\lib\site-packages (0.37.1) Requirement already satisfied: setuptools in c:\users\xxx\downloads\tdm_venv\venv\lib\site-packages (60.9.3)

(venv) C:\Users\xxx\Downloads\tdm_venv>pip install -U -r requirements.txt Requirement already satisfied: paho_mqtt>=1.4 in c:\users\xxx\downloads\tdm_venv\venv\lib\site-packages (from -r requirements.txt (line 1)) (1.6.1) Requirement already satisfied: PyQt5==5.14.2 in c:\users\xxx\downloads\tdm_venv\venv\lib\site-packages (from -r requirements.txt (line 2)) (5.14.2) Requirement already satisfied: PyQt5-sip<13,>=12.7 in c:\users\xxx\downloads\tdm_venv\venv\lib\site-packages (from PyQt5==5.14.2->-r requirements.txt (line 2)) (12.9.1)

(venv) C:\Users\xxx\Downloads\tdm_venv>python tdmgr.py Traceback (most recent call last): File "C:\Users\xxx\Downloads\tdm_venv\tdmgr.py", line 10, in from PyQt5.QtCore import QTimer, pyqtSlot, QSettings, QDir, QSize, Qt, QDateTime, QUrl ModuleNotFoundError: No module named 'PyQt5.sip'

(venv) C:\Users\xxx\Downloads\tdm_venv>

barbudor commented 2 years ago

You still seem to run in the venv : (venv) C:\Users\xxx\Downloads\tdm_venv> I think the idea was to get rid of the venv and use the python from your windows installation

Montreal666 commented 2 years ago

Here's the output without the venv:

Microsoft Windows [Version 10.0.19043.1526] (c) Microsoft Corporation. All rights reserved.

C:\Users\xxx\Downloads\tdm_venv>pip install --upgrade pip wheel setuptools Collecting pip Using cached pip-22.0.3-py3-none-any.whl (2.1 MB) Requirement already up-to-date: wheel in c:\users\xxx\appdata\local\programs\python\python310\lib\site-packages (0.37.1) Collecting setuptools Using cached setuptools-60.9.3-py3-none-any.whl (1.1 MB) Installing collected packages: pip, setuptools Attempting uninstall: pip Found existing installation: pip 20.2.4 Uninstalling pip-20.2.4: Successfully uninstalled pip-20.2.4 Rolling back uninstall of pip Moving to c:\users\xxx\appdata\roaming\python\python310\scripts\pip.exe from C:\Users\xxx\AppData\Local\Temp\pip-uninstall-z19g2_80\pip.exe Moving to c:\users\xxx\appdata\roaming\python\python310\scripts\pip3.10.exe from C:\Users\xxx\AppData\Local\Temp\pip-uninstall-z19g2_80\pip3.10.exe Moving to c:\users\xxx\appdata\roaming\python\python310\scripts\pip3.exe from C:\Users\xxx\AppData\Local\Temp\pip-uninstall-z19g2_80\pip3.exe Moving to c:\users\xxx\appdata\roaming\python\python310\site-packages\pip-20.2.4.dist-info\ from C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\~ip-20.2.4.dist-info Moving to c:\users\xxx\appdata\roaming\python\python310\site-packages\pip\ from C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\~ip ERROR: Exception: Traceback (most recent call last): File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\cli\base_command.py", line 228, in _main status = self.run(options, args) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\cli\req_command.py", line 182, in wrapper return func(self, options, args) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\commands\install.py", line 397, in run installed = install_given_reqs( File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\req__init__.py", line 82, in install_given_reqs requirement.install( File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\req\req_install.py", line 814, in install install_wheel( File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\operations\install\wheel.py", line 852, in install_wheel _install_wheel( File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\operations\install\wheel.py", line 762, in _install_wheel generated_console_scripts = maker.make_multiple(scripts_to_generate) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\distlib\scripts.py", line 418, in make_multiple filenames.extend(self.make(specification, options)) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_internal\operations\install\wheel.py", line 498, in make return super(PipScriptMaker, self).make(specification, options) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\distlib\scripts.py", line 407, in make self._make_script(entry, filenames, options=options) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\distlib\scripts.py", line 307, in _make_script self._write_script(scriptnames, shebang, script, filenames, ext) File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\distlib\scripts.py", line 242, in _write_script launcher = self._get_launcher('t') File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\distlib\scripts.py", line 386, in _get_launcher raise ValueError(msg) ValueError: Unable to find resource t64.exe in package pip._vendor.distlib WARNING: You are using pip version 20.2.4; however, version 22.0.3 is available. You should consider upgrading via the 'c:\users\xxx\appdata\local\programs\python\python310\python.exe -m pip install --upgrade pip' command.

C:\Users\xxx\Downloads\tdm_venv>pip install -U -r requirements.txt Requirement already up-to-date: paho_mqtt>=1.4 in c:\users\xxx\appdata\roaming\python\python310\site-packages (from -r requirements.txt (line 1)) (1.6.1) Collecting PyQt5==5.14.2 Using cached PyQt5-5.14.2.tar.gz (3.2 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... error ERROR: Command errored out with exit status 1: command: 'c:\users\xxx\appdata\local\programs\python\python310\python.exe' 'C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\XXX~1\AppData\Local\Temp\tmpdmm9x5at' cwd: C:\Users\xxx\AppData\Local\Temp\pip-install-sbp68_bl\pyqt5 Complete output (31 lines): Traceback (most recent call last): File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\pep517_in_process.py", line 126, in prepare_metadata_for_build_wheel hook = backend.prepare_metadata_for_build_wheel AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
    main()
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 130, in prepare_metadata_for_build_wheel
    return _get_wheel_metadata_from_wheel(backend, metadata_directory,
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pep517\_in_process.py", line 159, in _get_wheel_metadata_from_wheel
    whl_basename = backend.build_wheel(metadata_directory, config_settings)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-dougji5l\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
    project = AbstractProject.bootstrap('pep517')
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-dougji5l\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
    project.setup(pyproject, tool, tool_description)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-dougji5l\overlay\Lib\site-packages\sipbuild\project.py", line 479, in setup
    self.apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-install-sbp68_bl\pyqt5\project.py", line 62, in apply_user_defaults
    super().apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-dougji5l\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
    super().apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-dougji5l\overlay\Lib\site-packages\sipbuild\project.py", line 225, in apply_user_defaults
    self.builder.apply_user_defaults(tool)
  File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-dougji5l\overlay\Lib\site-packages\pyqtbuild\builder.py", line 67, in apply_user_defaults
    raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
----------------------------------------

ERROR: Command errored out with exit status 1: 'c:\users\xxx\appdata\local\programs\python\python310\python.exe' 'C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\XXX~1\AppData\Local\Temp\tmpdmm9x5at' Check the logs for full command output. WARNING: You are using pip version 20.2.4; however, version 22.0.3 is available. You should consider upgrading via the 'c:\users\xxx\appdata\local\programs\python\python310\python.exe -m pip install --upgrade pip' command.

C:\Users\xxx\Downloads\tdm_venv>python tdmgr.py Traceback (most recent call last): File "C:\Users\xxx\Downloads\tdm_venv\tdmgr.py", line 10, in from PyQt5.QtCore import QTimer, pyqtSlot, QSettings, QDir, QSize, Qt, QDateTime, QUrl ModuleNotFoundError: No module named 'PyQt5'

C:\Users\xxx\Downloads\tdm_venv>

barbudor commented 2 years ago

I'm on a Windows10 PC with Python 3.9.9 and I also get a problem installing PyQt 5.14.2 Not exactly the same but almost similar place

However installing manuall pip install -u PyQt5 got me 5.15.6 correctly. Looks like the Windows package for 5.14.2 has some problem... Not sure why @jziolkowski has frozen 5.14.2, may be cause of an dependency problem on another environment pitfalls of Python dependencies management

jziolkowski commented 2 years ago

The code freeze came from another issue on raspbian. Now we seem to be fixing one problem here and creating another there.

jziolkowski commented 2 years ago

For the purpose of fixing the main problem of this issue, let's install any version of pyqt that's installable. We'll take care of that later

Montreal666 commented 2 years ago

Uninstalled all instances of Python and reinstalled; now works. tdmgr.py launches the app. let me know what's next, thx

Microsoft Windows [Version 10.0.19043.1526] (c) Microsoft Corporation. All rights reserved.

C:\TEMP\TDM\tdm_venv>pip install --upgrade pip wheel setuptools Requirement already satisfied: pip in c:\users\xxx.platformio\penv\lib\site-packages (22.0.3) Requirement already satisfied: wheel in c:\users\xxx.platformio\penv\lib\site-packages (0.35.1) Collecting wheel Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB) Requirement already satisfied: setuptools in c:\users\xxx.platformio\penv\lib\site-packages (41.2.0) Collecting setuptools Using cached setuptools-60.9.3-py3-none-any.whl (1.1 MB) Installing collected packages: wheel, setuptools Attempting uninstall: wheel Found existing installation: wheel 0.35.1 Uninstalling wheel-0.35.1: Successfully uninstalled wheel-0.35.1 Attempting uninstall: setuptools Found existing installation: setuptools 41.2.0 Uninstalling setuptools-41.2.0: Successfully uninstalled setuptools-41.2.0 Successfully installed setuptools-60.9.3 wheel-0.37.1

C:\TEMP\TDM\tdm_venv>pip install -U -r requirements.txt Requirement already satisfied: paho_mqtt>=1.4 in c:\users\xxx.platformio\penv\lib\site-packages (from -r requirements.txt (line 1)) (1.6.1) Collecting PyQt5==5.14.2 Downloading PyQt5-5.14.2-5.14.2-cp35.cp36.cp37.cp38-none-win_amd64.whl (52.9 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 52.9/52.9 MB 12.6 MB/s eta 0:00:00 Collecting PyQt5-sip<13,>=12.7 Downloading PyQt5_sip-12.9.1-cp37-cp37m-win_amd64.whl (76 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 76.9/76.9 KB 854.4 kB/s eta 0:00:00 Installing collected packages: PyQt5-sip, PyQt5 Successfully installed PyQt5-5.14.2 PyQt5-sip-12.9.1

C:\TEMP\TDM\tdm_venv>python tdmgr.py

jziolkowski commented 2 years ago

Good job. Now please paste your autodiscovery paths and TDM debug log (the part with "subscribed to topics blah blah")

Montreal666 commented 2 years ago

Sorry but where can I get the autodiscovery paths and TDM debug log ? I've checked briefly the app menus and file structure for logs or some config file to enable logging but couldn't find it. Thx