forked from esp8266/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into espino-support
- Loading branch information
Showing
13 changed files
with
178 additions
and
59 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
vecho := @echo | ||
Q := @ | ||
|
||
PROJECT_NAME=project_name | ||
|
||
OTA_IP=192.168.254.100 | ||
OTA_PORT=8266 | ||
|
||
SERIAL_PORT=COM3 | ||
SERIAL_BAUD=230400 | ||
|
||
ARDUINO_BASE = D:/Coding/avr/Programme/arduino-nightly | ||
ESP8266_BASE = $(ARDUINO_BASE)/hardware/esp8266com/esp8266 | ||
ESP8266_TOOLS = $(ESP8266_BASE)/tools | ||
XTENSA_TOOLS_ROOT = $(ESP8266_TOOLS)/xtensa-lx106-elf/bin | ||
|
||
PYTHON_BIN = python | ||
ESPTOOL_PY_BIN = $(ESP8266_TOOLS)/esptool.py | ||
ESPOTA_PY_BIN = $(ESP8266_TOOLS)/espota.py | ||
ESPTOOL_BIN = $(ESP8266_TOOLS)/esptool/esptool.exe | ||
|
||
ota: | ||
$(vecho) ota... | ||
$(PYTHON_BIN) $(ESPOTA_PY_BIN) -i $(OTA_IP) -p $(OTA_PORT) --auth= -f ./$(PROJECT_NAME).bin | ||
|
||
ota_spiffs: | ||
$(vecho) ota spiffs... | ||
$(PYTHON_BIN) $(ESPOTA_PY_BIN) -i $(OTA_IP) -p $(OTA_PORT) --auth= -s -f ./$(PROJECT_NAME)_spiffs.bin | ||
|
||
erase_flash: | ||
$(vecho) "Erase Flash" | ||
$(PYTHON_BIN) $(ESPTOOL_PY_BIN) -p $(SERIAL_PORT) -b $(SERIAL_BAUD) erase_flash | ||
|
||
dumpmem: | ||
$(vecho) "Read Flash need some time..." | ||
$(PYTHON_BIN) $(ESPTOOL_PY_BIN) -p $(SERIAL_PORT) -b $(SERIAL_BAUD) read_flash 0 4194304 dump.bin | ||
|
||
objdump: | ||
"$(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-objdump" -S $(PROJECT_NAME).elf > $(PROJECT_NAME).dobj |
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
68 changes: 68 additions & 0 deletions
68
libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* This sketch sends a message to a TCP server | ||
* | ||
*/ | ||
|
||
#include <ESP8266WiFi.h> | ||
#include <ESP8266WiFiMulti.h> | ||
|
||
ESP8266WiFiMulti WiFiMulti; | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
delay(10); | ||
|
||
// We start by connecting to a WiFi network | ||
WiFiMulti.addAP("SSID", "passpasspass"); | ||
|
||
Serial.println(); | ||
Serial.println(); | ||
Serial.print("Wait for WiFi... "); | ||
|
||
while(WiFiMulti.run() != WL_CONNECTED) { | ||
Serial.print("."); | ||
delay(500); | ||
} | ||
|
||
Serial.println(""); | ||
Serial.println("WiFi connected"); | ||
Serial.println("IP address: "); | ||
Serial.println(WiFi.localIP()); | ||
|
||
delay(500); | ||
} | ||
|
||
|
||
void loop() { | ||
const uint16_t port = 80; | ||
const char * host = "192.168.1.1"; // ip or dns | ||
|
||
|
||
|
||
Serial.print("connecting to "); | ||
Serial.println(host); | ||
|
||
// Use WiFiClient class to create TCP connections | ||
WiFiClient client; | ||
|
||
if (!client.connect(host, port)) { | ||
Serial.println("connection failed"); | ||
Serial.println("wait 5 sec..."); | ||
delay(5000); | ||
return; | ||
} | ||
|
||
// This will send the request to the server | ||
client.print("Send this data to server"); | ||
|
||
//read back one line from server | ||
String line = client.readStringUntil('\r'); | ||
client.println(line); | ||
|
||
Serial.println("closing connection"); | ||
client.stop(); | ||
|
||
Serial.println("wait 5 sec..."); | ||
delay(5000); | ||
} | ||
|
Oops, something went wrong.