Raspberry Pi Device
A Pi is just another MQTT client. The same topic conventions and data types apply — here's the smallest Python publish to prove it.
Nothing special required
OhioIoT is an MQTT broker, so any standard client works — on a Pi, the usual choice is paho-mqtt. There's no Pi-specific SDK you need: connect with TLS on port 8883, authenticate with your MQTT credentials, and publish to the same five-segment topics you'd use anywhere.
pip install paho-mqttA minimal publish
import os, ssl
import paho.mqtt.client as mqtt
USER = os.environ["MQTT_USER"] # e.g. "larry"
PASS = os.environ["MQTT_PASS"]
client = mqtt.Client()
client.username_pw_set(USER, PASS)
client.tls_set(cert_reqs=ssl.CERT_REQUIRED) # verify the broker cert
client.connect("mqtt.ohioiot.com", 8883)
client.loop_start()
topic = f"{USER}/pi01/numb/temperature/celsius"
client.publish(topic, "23.5")
print("published 23.5 to", topic)That value shows up under a pi01 device card with a temperature graph — exactly as an ESP32 publish would. The topic shape is the contract; the language and hardware are up to you.
Subscribing
Receiving messages is the mirror image: subscribe to the topic you care about and handle them in on_message. The wildcard rules and shared-topic behavior are the same as everywhere — see Subscribing.
