-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Hello there,
I'm currently trying to send a message from my Raspberry Pi Pico W to my Node-Red through MQTT.simple with the following snippet of code:
while True:
pin_state = gpio_pin.value()
print(f"Pin state: {pin_state}")
client.publish(MQTT_TOPIC, str(pin_state))
time.sleep(1)
"pin_state" is working as intended so I have no problems collecting the data I wish to but when I run the program I always get the error:
AttributeError: 'NoneType' object has no attribute 'write'
there was a issue previously where someone was suffering from the same issue and the two replies stated that you needed to connect to the broker first, which I have confirmed I am doing, and that it's possible that there isn't a connection to the broker at all; I believe there to be a connection between my Pi and the Broker because no errors are presented and the node within Node-Red does react to the connection.
If any more information is needed to help me, please do ask and I look forward to any help given!