![]() See also tutorial ESP8266 internet connected switch (EasyIoT Cloud MQTT API). stream = client.GetStream() Įnable program and go in EasyIoT Web interface. client = new ( ESP8266_IP_ADDRESS, port) īyte data = .GetBytes(message) Console.WriteLine("TCP client command:" + message) Private void sendToServer(String message) This code is running periodicaly when program is enabled. If (m.Domain = "Virtual" & m.Address = MODULE _ADDRESS & p.Property = "Sensor.DigitalValue") ("CMD.exe","") ĮventHelper.ModuleChangedHandler((o, m, p) =>Ĭonsole.WriteLine(m.Domain +" "+ m.Address + " in program id "+ ()+ " property "+ p.Property + " value " + p.Value) This code is running one time when program is enabled Correct ESP8266_IP_ADDRESS to your module address and module address MODULE_ADDRESS visible in Web configuration.Ĭonst String ESP8266_IP_ADDRESS = "192.168.1.6" You do not need to set CRON, just add following program. ![]() Automation program will call our ESP8266 module when we press button in Web interface. Read EasyIoT server automation tutorial how to add program in EasyIoT server. Remember module address, beacuse it's important. Set module type Digital output (DO). Read tutorial how to add new module. In EasyIoT server Web interface we add new module in Virtual driver. On relay we can connect different devices. Because relay module operats on 5V and ESP8266 operate on 3.3V we will use 2N2222 NPN transistor to shift levels. ConnectionĬonnect ESP8266 GPIO2 pin to 5V relay module IN. In Serial Monitor check if ESP module connects to AP. If connection is successful you will also see IP address of ESP8266. When you finish with program upload remove GND wire from GPIO0 pin to enter in program execution mode. Restart our module and keep FT232RL FTDI USB to TTL Serial+Adapte connected to Arduino tool. Correct AP name and password in following lines:Īfter you set proper AP name and password compile and upload program. Program is basic WiFiWebServer example but can be also found on GitHub. When we connect wires, we upload our program. ![]() See ESP8266 Arduino IDE blink example how to correctly program ESP8266 with Arduino IDE. ESP8266 ESP-01 Serial WIFI Wireless Transceiver ModuleĮSP8266 ESP-03 Serial WIFI Wireless Transceiver ModuleĮSP8266 ESP-12 Serial WIFI Wireless Transceiver ModuleĮSP8266 ESP-05 Serial WIFI Wireless Transceiver ModuleĮSP8266 ESP-07 Serial WIFI Wireless Transceiver ModuleĮSP8266 Lua Nodemcu WIFI Network Development BoardĤ00X 0.25w 1/4w Metal Film Resistor Pack Kit 1% 20 Value Each 20 Pcs 10 ~ 1M ohm ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |