How to Flash the ESP8266 ….
ATENŢIE : Dacă distrugeţi modulul este pe propria dumneavoastră răspundere. Mai bine îl aduceţi la sediu şi îl schimbăm noi.
Conexiuni cu fire Dupont :
Puteți să montați 2 întrerupătoare pe firul portocaliu (Flash) și pe firul rosu – CH_PD (Reset).
Se deschide ESP 8266 Flasher (esp8266_flasher.exe) şi Arduino 1.6.4 sau oricare
Tools –>Port : COMxx (Exemlpu : COM18) După aflarea COM-ului se scrie în “esp8266_flasher.exe”
închidem Arduino 1.6.4
Se selectează “Bin”
“ESP_8266_v0.9.5.2 AT Firmware.bin” sau “ESP_8266_BIN0.92.bin”
–> Download (trebuie închis Arduino 1.6.4)
Până când va scrie: “Leaving… Failed to leave Flash mode”
E gata.
Închidem “ESP 8266 Flasher” si verificăm ce am făcut !
Scoatem firul portocaliu de la GND
Reset ESP8266 (Scoatem şi băgăm firul roşu la pin CH_PD)
Deschidem “Arduino 1.6.4” sau oricare.
–> Tool –> Port : COM18
–> File: –> Preference:
URLs: “http://arduino.esp8266.com/stable/package_esp8266com_index.json“ –> OK
Board: –> Boards Manager –> Type: –> Contributed –> esp8266 by ESP8266 Community
INSTALL –> Close
Sketch –> Include Library –> Manage Libraries
Library Manager : căutare: ESP8266
Alege : ESP8266 Built-In By Simon Peter,Markus…
INSTALL –> Close
Deschidem : Arduino
CODE :
// –––––––––––––
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
IPAddress ip(192,168,1,100); // choose IP address
IPAddress subnet(255,255,255,0);
ESP8266WebServer server(80);
void handleRoot() {
String page = „<!DOCTYPE html>\n”;
page += „<html>\n<body>\n<h1>Multumim pentru Achizitie</h1><br>http://RoboRomania.ro\n</body></html>”;
server.send(200, „text/html”, page);
}
// what to do when accessed through http://ip_address/something_undefined
void handleNotFound(){
String message = „File not found\n\n”;
message += „URI: „;
message += server.uri();
message += „\nMethod: „;
message += (server.method() == HTTP_GET)?”GET”:”POST”;
message += „\nArguments: „;
message += server.args();
message += „\n”;
for (uint8_t i=0; i<server.args(); i++){
message += ” ” + server.argName(i) + „: ” + server.arg(i) + „\n”;
}
server.send(404, „text/plain”, message);
}
void setup(void){
Serial.begin(74880); // so you can see debug messages automatically sent by ESP8266
WiFi.mode(WIFI_AP);
WiFi.softAPConfig(ip, ip, subnet); // declared as: bool softAPConfig (IPAddress local_ip, IPAddress gateway, IPAddress subnet)
WiFi.softAP(„RoboRomania-8266”, „roborobo”, 7); // network name, network password, wifi channel
IPAddress myIP = WiFi.softAPIP();
Serial.println();
Serial.print(„AP IP address: „);
Serial.println(myIP);
server.on(„/”, handleRoot); // what to do when accessed through browser using http://IP_address
// what to do when accessed through http://ip_address/test
server.on(„/test”, [](){
server.send(200, „text/plain”, „This is another page”);
});
server.onNotFound(handleNotFound);
server.begin();
Serial.println(„HTTP server started…”);
}
void loop(void){
server.handleClient();
}
// –––––––––––––––
–> Upload
Gata. Verificăm dacă merge.
Reset ESP8266 (Scoatem şi băgăm firul roşu la pin CH_PD)
Căutăm rețea ….
Poţi să te conectezi.\
ATENŢIE : Dacă distrugeţi modulul este pe propria dumneavoastră răspundere. Mai bine îl aduceţi la sediu şi îl schimbăm noi.
„How to Flash the ESP8266” de Popescu Viorel licențiat sub Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.