This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"cafd679a.f97188","type":"ui_button","z":"e9d07bbd.7b2858","name":"","group":"81663b62.2c0d78","order":0,"width":0,"height":0,"passthru":false,"label":"submit","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"submit","x":278.99998474121094,"y":1804.999984741211,"wires":[["55d671c0.b45048"]]},{"id":"504f598.eee46a8","type":"ui_text_input","z":"e9d07bbd.7b2858","name":"","label":"message","tooltip":"","group":"81663b62.2c0d78","order":1,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"message","x":275.99998474121094,"y":1850.999984741211,"wires":[["55d671c0.b45048"]]},{"id":"55d671c0.b45048","type":"function","z":"e9d07bbd.7b2858","name":"","func":"context.msg = context.msg || {};\n\nswitch (msg.topic){\n case 'message':\n context.msg.payload = msg.payload;\n break;\n case 'submit':\n if(context.msg.payload){\n return context.msg;\n }\n}","outputs":1,"noerr":0,"x":477.99998474121094,"y":1829.199996 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context.msg = context.msg || {}; | |
switch (msg.topic){ | |
case 'message': | |
context.msg.payload = msg.payload; | |
break; | |
case 'topic': | |
context.msg.topic = msg.payload; | |
break; | |
case 'submit': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <WiFiClientSecure.h> | |
#include <PubSubClient.h> | |
#include <ESP8266mDNS.h> | |
#include <WiFiUdp.h> | |
#include <ArduinoOTA.h> | |
#include "/usr/local/src/ap_setting.h" | |
#define DEBUG_PRINT 1 |