ESP8266 ESP-12F Serial Port Module: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 6: | Line 6: | ||
# Download the ESPlorer [https://esp8266.ru/esplorer/] | # Download the ESPlorer [https://esp8266.ru/esplorer/] | ||
# Download latest greatest NodeMCU build [https://nodemcu-build.com/stats.php] | # Download latest greatest NodeMCU build [https://nodemcu-build.com/stats.php] | ||
== Software == | |||
<syntaxhighlight lang="C/C++"> | |||
#include <Homie.h> | |||
HomieNode lightNode("light", "Light", "switch"); | |||
bool globalInputHandler(const HomieNode& node, const HomieRange& range, const String& property, const String& value) { | |||
Homie.getLogger() << "Received on node " << node.getId() << ": " << property << " = " << value << endl; | |||
return true; | |||
} | |||
void setup() { | |||
Serial.begin(115200); | |||
Serial << endl << endl; | |||
Homie_setFirmware("global-input-handler", "1.0.1"); | |||
Homie.setGlobalInputHandler(globalInputHandler); | |||
lightNode.advertise("on").setName("On").setDatatype("boolean").settable(); | |||
// set the name of the device family | |||
Homie_setBrand("T19SMWV01"); | |||
// stup homie | |||
Homie.setup(); | |||
} | |||
void loop() { | |||
Homie.loop(); | |||
} | |||
</syntaxhighlight> | |||
== Documentation Arduino ESP8266 == | == Documentation Arduino ESP8266 == |
Revision as of 15:32, 28 April 2019
Flashing the ESP8266
- Download the NodeMCU PyFlasher [1]
- Download the ESPlorer [2]
- Download latest greatest NodeMCU build [3]
Software
<syntaxhighlight lang="C/C++">
- include <Homie.h>
HomieNode lightNode("light", "Light", "switch");
bool globalInputHandler(const HomieNode& node, const HomieRange& range, const String& property, const String& value) {
Homie.getLogger() << "Received on node " << node.getId() << ": " << property << " = " << value << endl; return true;
}
void setup() {
Serial.begin(115200); Serial << endl << endl; Homie_setFirmware("global-input-handler", "1.0.1"); Homie.setGlobalInputHandler(globalInputHandler);
lightNode.advertise("on").setName("On").setDatatype("boolean").settable();
// set the name of the device family Homie_setBrand("T19SMWV01"); // stup homie Homie.setup();
}
void loop() {
Homie.loop();
} </syntaxhighlight>
Documentation Arduino ESP8266
Pinout overview
Esp minimal connection
Esp minimal connection mechanical
Design image | Implementation result | Thingiverse link |
---|---|---|
https://www.thingiverse.com/thing:3562829 | ||
To edit table: File:Esp minimal mechanical jig.tng |
Pinout
Mapping | ADC | Serial | Pin | Pin | Serial | Mapping | |
---|---|---|---|---|---|---|---|
RESET | D1 | TX0 | |||||
ADC | ADC | D3 | RX0 | ||||
CHPD | D5 | SCL | |||||
D16 | D4 | SDA | |||||
SCK | D14 | D0 | |||||
MISO | D12 | D2 | TX1 | ||||
RX0* / MOSI | D13 | D15 | SS /TX0* | ||||
3V3 | VCC | GND | GND | ||||
To edit table: File:ESP8266-12.tgn |