MintyTrebor / MQTT4DSF

A Python script/service to send MQTT msgs from a SBC running Duet DSF. Uses the DSF pydsfapi plugin.
GNU General Public License v3.0
5 stars 0 forks source link

Can you Help #3

Closed lbpuma3 closed 3 years ago

lbpuma3 commented 3 years ago

MQTT4DSF ERROR MQTT4DSF_SndMsg_Queue_Monitor _monitor_msgq : module 'paho.mqtt.client' has no attribute 'Client'

"MQTT_SETTINGS" : { "Note" : "Change these to your MQTT Msg Brokers values", "MQTT_SVR_ADD" : "192.168.10.108", "MQTT_SVR_PORT" : 1883, "MQTT_Client_Name" : "RatRigVCOREPro", "MQTT_UserName" : "thomas", "MQTT_Password" : "123" }, "GENERAL_SETTINGS" :{ "PollFrequencySeconds" : 5, "MQTT_MSG_CMD_Prefix" : "MQTTCMD:", "MQTT_MSG_CMD_RESPONSE" : "MQTT4DSF has actioned the command", "MQTT_MSG_QUEUE_SIZE" : 200, "DSF_UPDATE_QUEUE_SIZE" : 200, "HTTP_DSF_REQ_ADD" : "http://192.168.10.117/machine/status", "MACHINE_NAME" : "RatRigVCOREPro", "MQTT4DSF_SYSTEM_LOGGING_LEVEL" : "WARNING", "ENABLE_MQTT4DSF_GCODE_PROXY" : "N", "MQTT4DSF_GCODE_PROXY_TOPIC" : "Duet/[!MachineName!]/gcode", "MQTT4DSF_SYSTEM_TOPIC" : "Duet/Announce" }, "SYS_SETTINGS" : { "WARNING" : "Do Not Change anything in SYS_SETTINGS", "Default_Replace_Strings" : { "Machine_Name" : "[!MachineName!]"

was mach ich falsch?

MintyTrebor commented 3 years ago

I will try :-) I Need to ask a few basic questions though, as I am unable to re-create the issue (sorry). I am assuming you complete the additional steps detailed in "other_setup_steps.txt"? Does this happen at MQTT4DSF start or after it has been running a while? Can you confirm the version of the mqtt client you have installed by running : sudo pip3 show paho-mqtt What version of python are you running (needs to be 3+)? What MQTT broker are you using, and have you tested it is working with the same client information? Can you confirm the rPI can ping/see the broker? Can you attach you log and config files pls.

lbpuma3 commented 3 years ago

thanks I have make the steps from other_setup_steps.txt. its at start.

pi@duet3:~ $ sudo pip3 show paho-mqtt Name: paho-mqtt Version: 1.5.1 Summary: None Home-page: None Author: None Author-email: None License: None Location: /usr/local/lib/python3.7/dist-packages Requires: Required-by: pi@duet3:~ $ sudo apt-get install python3-pip Reading package lists... Done Building dependency tree Reading state information... Done python3-pip is already the newest version (18.1-5+rpt1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I use the IOBrocker as MQTT Broker. Ping its OK and another MQTT CLient its work

MintyTrebor commented 3 years ago

Is the broker configured to use SSL (secure)? (MQTT4DSF does not deal with SSL brokers currently)

I have attached a MQTT test script testmqtt.py, please put in your home folder (rename it to testmqtt.py) on the rPI and run it with :

sudo python3 testmqtt.py

It should publish a short text msg to "Duet/Announce" topic.

The file contains the following code:

import paho.mqtt.client as Main_Msg_MQTT MQTTClient = Main_Msg_MQTT.Client("RatRigVCOREPro") MQTTClient.username_pw_set("thomas", "123") MQTTClient.connect("192.168.10.108", 1883, 60) MQTTClient.publish("Duet/Announce", "This is a Test MQTT MSG")

If the values I have used from your first post are wrong then please correct them before running.

The script will test the installation of the paho.mqtt python module, which is a third party module used to handle MQTT. If this script fails then we know that paho.mqtt is not running correctly in your environment. The script has no error trapping so any errors should be reported directly to the console.

testmqtt.py.txt

lbpuma3 commented 3 years ago

I have test it have an error

pi@duet3:~ $ sudo python3 testmqtt.py Traceback (most recent call last): File "testmqtt.py", line 2, in MQTTClient = Main_Msg_MQTT.Client("RatRigVCOREPro") AttributeError: module 'paho.mqtt.client' has no attribute 'Client' pi@duet3:~ $

lbpuma3 commented 3 years ago

hello you can close. I flash the card new an works :)