I have a program for my MQTT stuff, and my subscriber file that receives 
instructions from the publisher failed  after I had made some modifications to 
it.

When I look at the file in kate, there is a difference that I cannot explain.

In these following lines, the word 'connect' is in blue in the failing version, 
but not highlighted in the good version. Here are the first few lines:

# 2020-09-14  This is a change to  RC car-7 from using Flask and HTML to using 
Mosquitto
# 2020-11-06  Edited to remove all the calculations leading up to the PWM 
percentage
#!python3

# *** SET UP MQTT   ***

# from https://techtutorialsx.com/2017/04/23/python-subscribing-to-mqtt-topic/
import paho.mqtt.client as mqtt
import time

Connected = False #global variable for the state of the connection

broker_address= "192.168.4.1"
port = 1883
user = "rc-car-11"
password = "N0YB"

# Create client   --?? Is this the same as User?
client = mqtt.Client(client_id="rc-car-11")

# Connect to broker
client.connect(broker_address,1883,60)                     # bad connect word.

# Subscriber to topic
client.subscribe("rc-car-pwm")

I even copied the line out of the good file and pasted into the faulty one, but 
'connect' turned blue.

Any thoughts?

peter M.



--
 Next meeting: Online, Jitsi, Tuesday, 2020-12-01 20:00
 Check to whom you are replying
 Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
 New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to