richibrics / PyMonitorMQTT

Python computer monitor that sends real time information via MQTT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot make it work. Help

rnlascano opened this issue · comments

I´m stuck at "Sensors". Already installed Python, dependencies, wmi and Open Hardware Monitor, and modified configuration.yaml properly, but i don´t understand how to continue from there on. Thanks in advance

Are there any errors or don't you know how to use the program? Publish the log here.

It seems i dont know how to use it. Once i finished configuring "configuration.yaml" i dont know how to continue from there.

Well you don't "use" it, it's only a program that send information about your computer to a MQTT broker (Sensors) and waits for messages from it (Commands).
Once you configured it, it does it job and there are no actions to do.

Sorry, i probably didn´t explained myself correctly, my english is not very good. I´ll try to tell you what my problem is:

I started by downloading the folder to my PC, then installed Python, dindn´t install Pip because (correct me if i´m wrong, please) it is already preinstalled in Python 3.8.5; then, installed the dependencies (paho-mqtt and psutil), then installed wmi, and the last installation was Open Hardware Monitor.

I tried to do al steps in the exact order they apear in Readme.md, so the next thing i tried was to run the script (python main.py), but i got an error saying there was no .yaml file in the folder (see screenshot below, please)

Screenshot_20200825-093838

I figured there was a configuration problem, so i moved to the next step, modified the "configuration.yaml.example" file to "configuration.yaml.", and inside the file modified the first two items: in "broker" replaced BROKER_ADDRESS to my pc ip address, and in "name" replaced PC_NAME to the name of my pc, leaving the rest of the file untouched.

After that tried to run the script again with the same utcome.

I guess the problem is i dind´t finished the configuration process on my pc, the thing is i idon´t know how to continue from there: the next step says that on the server i must specify sensors and commands topics but i don´t know how to do that, meaning i don´t know where in my computer i have to make that modifications (where to put and modify the lines "Sensor Topic: monitor/PC_NAME/SENSOR_SPECIFIC_TOPIC" and "Command Topic: monitor/PC_NAME/COMMAND_SPECIFIC_TOPIC".

There is where i get lost. Sorry for the long post, i´n newbie at this. Thanks in advance

Yes sorry, I have to update pip requirements, you have to install also PyYaml to solve that error but I suggest you to run 'pip install -r requirements.txt' (update to the last commit before doing that). With that command you will install all packages needed.

Then it should work; the 'specify topics' part is only for the broker part, you don't have to edit Topics in python files

Thanks for the quick reply, i´ll try that when i am home later today, the only thing i don´t understand is the "specify topics" part, meaning where and how i have to modify that. Thanks

Try to read this.
My client works with the broker:

  • Sends (for each sensor) a message with information about a state of your pc with a specific topic (this topic is like an identifier of that type of information)
  • Receives (for each command) a message from a topic and when it is received, the client triggers a specific action

To receive data from a sensor (e.g. Sensor 1 through topic 'Topic_example_one'), another client connected to the same broker listens on the sensor's topic.
To trigger a command, another client sends a message to the command's topic, then my client discovers the new message on that topic and triggers the action.

Then to use my client you must have a MQTT broker and a client that manage information.
Example of topic for ExamplePC (Ram sensor) is: 'monitor/ExamplePC/ram_used_percentage'

C:\Users\rnlas\Desktop\PyMonitorMQTT-23680f01dee011152f698b7376d815b59cec7d8e>python -m pip install -r

Yes sorry, I have to update pip requirements, you have to install also PyYaml to solve that error but I suggest you to run 'pip install -r requirements.txt' (update to the last commit before doing that). With that command you will install all packages needed.

Then it should work; the 'specify topics' part is only for the broker part, you don't have to edit Topics in python files

I did wha you said but now i get this new error.

C:\Users\rnlas\Desktop\PyMonitorMQTT-23680f01dee011152f698b7376d815b59cec7d8e>python -m pip install -r requirements.txt
Defaulting to user installation because normal site-packages is not writeable
Collecting alabaster==0.7.12
Using cached alabaster-0.7.12-py2.py3-none-any.whl (14 kB)
Collecting appdirs==1.4.4
Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting Babel==2.8.0
Using cached Babel-2.8.0-py2.py3-none-any.whl (8.6 MB)
ERROR: Could not find a version that satisfies the requirement btrfsutil==1.2.0 (from -r requirements.txt (line 4)) (from versions: none)
ERROR: No matching distribution found for btrfsutil==1.2.0 (from -r requirements.txt (line 4))

WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the 'C:\Program Files\Python37\python.exe -m pip install --upgrade pip' command.

i´m stuck there

It seems that your pip can't find that version of btrfsuril, just try to install the first available version with 'python3 -m pip install btrfsutil'

It seems that your pip can't find that version of btrfsuril, just try to install the first available version with 'python3 -m pip install btrfsutil'

It´s weird, i tried 'python3 -m pip install btrfsutil'
but it does nothing, then i tried 'python -m pip install btrfsutil' (without the 3) and i get the following message (im running windows 10 by the way):

C:\Users\rnlas\Desktop\PyMonitorMQTT-23680f01dee011152f698b7376d815b59cec7d8e\PyMonitorMQTT-23680f01dee011152f698b7376d815b59cec7d8e>python3 -m pip install btrfsutil

C:\Users\rnlas\Desktop\PyMonitorMQTT-23680f01dee011152f698b7376d815b59cec7d8e\PyMonitorMQTT-23680f01dee011152f698b7376d815b59cec7d8e>python -m pip install btrfsutil
ERROR: Could not find a version that satisfies the requirement btrfsutil (from versions: none)
ERROR: No matching distribution found for btrfsutil

commented

Hello, I have the same issue trying to install btrfsutil and PIL.

Sorry there was ane error with requirements.txt file, try now with 'python3 -m pip install -r requirements.txt'

Sorry there was ane error with requirements.txt file, try now with 'python3 -m pip install -r requirements.txt'

The new requirements.txt gives me this error:

C:\Users\rnlas\Desktop\PyMonitorMQTT-23680f01dee011152f698b7376d815b59cec7d8e\PyMonitorMQTT-23680f01dee011152f698b7376d815b59cec7d8e>python -m pip install -r requirements.txt
Collecting EasyProcess==0.3
Using cached EasyProcess-0.3-py2.py3-none-any.whl (7.9 kB)
Collecting entrypoint2==0.2.1
Using cached entrypoint2-0.2.1-py2.py3-none-any.whl (8.7 kB)
Collecting jeepney==0.4.3
Using cached jeepney-0.4.3-py3-none-any.whl (21 kB)
Collecting mss==6.0.0
Using cached mss-6.0.0-py3-none-any.whl (76 kB)
Collecting paho-mqtt==1.5.0
Using cached paho-mqtt-1.5.0.tar.gz (99 kB)
Collecting Pillow==7.2.0
Using cached Pillow-7.2.0-cp37-cp37m-win_amd64.whl (2.1 MB)
ERROR: Could not find a version that satisfies the requirement pkg-resources==0.0.0 (from -r requirements.txt (line 7)) (from versions: none)
ERROR: No matching distribution found for pkg-resources==0.0.0 (from -r requirements.txt (line 7))

Remove 7th line from requirements.txt

Remove 7th line from requirements.txt

That did the trick. Thanks!!!!

Great, if you want you can make a pull request with the removed line, otherwise I will fix in some days.

Great, if you want you can make a pull request with the removed line, otherwise I will fix in some days.

Shure, give me a couple of minutes. One las thing, I finally got it to work, now i need to specify (on the server) sensors and commands topics. How do i do that? And where? Do i have to edit configuration.yaml?

Which server do you have ?

Which server do you have ?

That´s the thing, i don´t know what you mean by "server", so i don´t know where to specify the sensors and command topics. I´m new at this, sorry

Have you got a Mqtt Broker ?

Have you got a Mqtt Broker ?

Yes, cloudmqtt

commented

Opened a pull to fix the requirements.txt file. Let me know if there is something that you want me to change.

commented

I still had the error with PIL; however, I was able to solve it by running the following commands:

pip uninstall Pillow
pip uninstall PIL
pip install Pillow

Have you got a Mqtt Broker ?

Yes, cloudmqtt

Open a new issue for cloudMqtt and I will help you for that (to help others get to the right issue)

Have you got a Mqtt Broker ?

Yes, cloudmqtt

Open a new issue for cloudMqtt and I will help you for that (to help others get to the right issue)

Sure. Thanks.

Solved this issue deleting wrong packages from requirements.txt file.

If you have errors with PIL, follow @WeldFire steps:

pip uninstall Pillow
pip uninstall PIL
pip install Pillow