Internet Speed monitoring with Qubitro

Let’s start

Python Download Page
Python Installation
VS Code Download Page
Python Extension for VS Code
VS Code with Python Script
import speedtest
import paho.mqtt.client as mqtt
import json
broker_host = ""
broker_port = 8883
device_id = "bae59a13-822d-4e20-8b18-e4cbd534dc00"
device_token = "ShVwmHXpVv9Idvywv6QPbs4UzJzWAq8inveKOzqj"
def on_connect(client, userdata, flags, rc):
if rc == 0:
print("Connected to Qubitro!")
client.on_publish = on_publish
print("Failed to connect, visit:\n return code:", rc)
def on_publish(client, obj, publish):
print("Published: " + str(payload))
client = mqtt.Client(client_id=device_id)
client.username_pw_set(username=device_id, password=device_token)
client.connect(broker_host, broker_port, 60)
client.on_connect = on_connect
while True:
st = speedtest.Speedtest()
payload = {'Download': round( / 1000000, 2) , 'Upload': round(st.upload() / 1000000, 2), 'Ping': round(, 2)}
client.publish(device_id, payload=json.dumps(payload))
Terminal Results
Qubitro Portal Page
Charts in Qubitro Portal



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Infrastructure for the Internet of Things solutions. Build connected solutions faster than ever.