Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:iot:examples:current [2021/03/04 23:21] heiko.pikneren:iot:examples:current [Unknown date] (current) – external edit (Unknown date) 127.0.0.1
Line 16: Line 16:
 #include "EmonLib.h" #include "EmonLib.h"
 #include <Ticker.h> #include <Ticker.h>
 +
 +#define WIFI_NAME "name"
 +#define WIFI_PASSWORD "password"
  
 // Pin definition for the current sensor // Pin definition for the current sensor
Line 45: Line 48:
     Serial.begin(115200);     Serial.begin(115200);
     Serial.println("Booting");     Serial.println("Booting");
 +
 +    //iot.setConfig("wname", WIFI_NAME);
 +    //iot.setConfig("wpass", WIFI_PASSWORD);
 +    
     // print json config to serial     // print json config to serial
     iot.printConfig();     iot.printConfig();
Line 70: Line 77:
       String msg = String(val);       String msg = String(val);
       // publishing measured current value to a MQTT broker       // publishing measured current value to a MQTT broker
-      iot.publishMsg("curr", msg.c_str()); +      iot.publishMsg("curr", msg.c_str());
       // sending measured current value to a computer       // sending measured current value to a computer
       Serial.println(msg);       Serial.println(msg);
   }   }
 } }
 +
 </code> </code>
  
en/iot/examples/current.1614900109.txt.gz · Last modified: 2021/03/04 10:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0