--- /dev/null
+#include <ESP8266WiFi.h>
+void connection() ;
+
+#include <PubSubClient.h>
+const char* mqtt_server = "chrome";
+const char* input = "inTopic" ;
+const char* output = "outTopic" ;
+
+WiFiClient espClient; // WiFi connection obj
+PubSubClient client(espClient); // MQTT client obj
+
+const byte ledPin = 2; // GPIO2 on LoLin Nodemcu
+
+void setup() {
+ Serial.begin(115200);
+ delay(10);
+
+ pinMode(ledPin, OUTPUT);
+ digitalWrite(ledPin, HIGH); // OnBoard LED is inverted
+
+ connection();
+ client.setServer(mqtt_server, 1883);
+}
+
+void loop() {
+
+if (!client.connected()) { // Keep MQTT connection on
+ reconnect();
+ }
+
+
+char msg[50];
+ snprintf (msg, 75, "Test message @millis: %ld", millis());
+client.publish(output, msg);
+delay(1000);
+
+client.loop();
+}
+