Attempting reconnection.") Īfter setting the state to on, the led lights up as expected, but it also starts to blink. client.publish(light_set_topic, buffer, true) JsonObject& color = root.createNestedObject("color") JsonObject& root = jsonBuffer.createObject() JsonObject& root = jsonBuffer.parseObject(message) Įlse if(strcmp(root, off_cmd) = 0) Void callback(char* topic, byte* payload, unsigned int length) Serial.println(" try again in 5 seconds") ĬtServer(mqtt_server, mqtt_port) If(nnect("ESP", mqtt_username, mqtt_password)) Serial.print("Attempting MQTT connection.") #include Ĭonst char* light_state_topic = "esp/state" Ĭonst int BUFFER_SIZE = JSON_OBJECT_SIZE(10) Second one is a more complex one and the blinking start showing. Mosquitto server running on Raspberry pi 3.įirst simple sketch, with this one everything works as expected. Everything is taken from BruhAutomation's guide ( GitHub - bruhautomation/ESP-MQTT-JSON-Digital-LEDs: (OBSOLETE) ESP8266 MQTT JSON Digital LEDs for Home Assistant), same wiring and all. I am using a notebook charger as my power supply for the strip and the nodemcu. I have a WS2811 strip connected to a NodeMCU(Amica). After setting up my led strip with a simple sketch, everything is fine, but as soon as I upload a more complex sketch with networking and MQTT, this weird blinking is starting to show.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |