I am trying to display the adc pcf8591 data to Cayenne by utilizing the “Build Your Own Thing” function. But I can’t seem to get the connection from hardware.
This is the coding that I am currently using to connect the hardware to mqtt.
MQTT_USERNAME = “3baa9320-3aa9-11ea-a38a-d57172a4b4d4”
MQTT_PASSWORD = “95a5bce532fa419bb8d44db8a048bf8df676c1df”
MQTT_CLIENT_ID = “e0cf4260-3ce8-11ea-ba7c-716e7f5ba423”
address = 0x48
A0 = 0x40
A1 = 0x41
A2 = 0x42
A3 = 0x43
bus = smbus.SMBus(1)
print("message received: " + str(message))
value = bus.read_byte(address)
print("AOUT:%1.3f " %(value*5.0/255))
client = cayenne.client.CayenneMQTTClient()
client.on_message = on_message
client.read_volt = read_volt
client.begin(MQTT_USERNAME, MQTT_PASSWORD, MQTT_CLIENT_ID, port=8883)
Forgive me for my poor coding as I am really new to this and still trying to learn more everyday.
Thanks in advance