Manjaro gnome got froze when two python script was executed

Its been only a week I started using Manjaro Gnome, and I’m new to forums. So I’m working on a project related to MQTT, for which I executed two basic scripts of python. On executing the publisher script there is no issue, but when the subscriber script is executed the whole system got froze. Then I had to force shutdown it. I tried again after rebooting, still same issue.
Then I tried this scripts on windows, and there were no issue got the expected results.
These are the scripts

publisher.py

import paho.mqtt.client as mqtt 
from random import randrange, uniform
import time

mqttBroker ="mqtt.eclipseprojects.io" 

client = mqtt.Client("Temperature_Inside")
client.connect(mqttBroker) 

while True:
    randNumber = uniform(20.0, 21.0)
    client.publish("TEMPERATURE", randNumber)
    print("Just published " + str(randNumber) + " to topic TEMPERATURE")
    time.sleep(1)

subscriber.py

import paho.mqtt.client as mqtt
import time

def on_message(client, userdata, message):
    print("received message: " ,str(message.payload.decode("utf-8")))

mqttBroker ="mqtt.eclipseprojects.io"

client = mqtt.Client("Smartphone")
client.connect(mqttBroker) 

client.loop_start()

client.subscribe("TEMPERATURE")
client.on_message = on_message

time.sleep(30)
client.loop_stop()

test at first examples in this module :wink:
when I look at issues number, I don’t have much confidence in this library


NO relation here with manjaro :frowning:

I’m sorry, since this program was working in windows and not manjaro I thought it would be something related to gnome or manjaro.

Thanks for replying

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.