1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Verify sketches as part of travis build

Squashed commits:
[7d1b42f] Encrypt token, skip some tests
[17b8f39] Fix sha1 example path
[f3050b1] Fix build, add webhook
[fd2c9bd] Fix build errors, update mDNS library readme
[7b87031] Make common.sh more flexible
[3ba3eb2] Test all sketches
[87beb8a] Build all sketches in esp8266 core
[f2464f1] Fix paths
[823a9ae] Remove sudo usage
[7fce734] Fix arduino commands
[619bc7d] Move all commands into travis script
[15a5ada] First attempt test runner
This commit is contained in:
Ivan Grokhotkov
2015-07-23 12:11:59 +03:00
parent d35b72d41c
commit 496da02f14
10 changed files with 115 additions and 91 deletions

View File

@ -1,12 +1,12 @@
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUDP.h>
#include <WiFiUdp.h>
const char* host = "esp8266-ota";
const char* ssid = "**********";
const char* pass = "**********";
const uint16_t aport = 8266;
WiFiServer TelnetServer(aport);
WiFiClient Telnet;
WiFiUDP OTA;
@ -15,10 +15,10 @@ void setup() {
Serial.begin(115200);
Serial.println("");
Serial.println("Arduino OTA Test");
Serial.printf("Sketch size: %u\n", ESP.getSketchSize());
Serial.printf("Free size: %u\n", ESP.getFreeSketchSpace());
WiFi.begin(ssid, pass);
if(WiFi.waitForConnectResult() == WL_CONNECTED){
MDNS.begin(host);
@ -43,24 +43,24 @@ void loop() {
Serial.print(remote);
Serial.printf(", port:%d, size:%d\n", port, size);
uint32_t startTime = millis();
WiFiUDP::stopAll();
if(!Update.begin(size)){
Serial.println("Update Begin Error");
return;
}
WiFiClient client;
if (client.connect(remote, port)) {
uint32_t written;
while(!Update.isFinished()){
written = Update.write(client);
if(written > 0) client.print(written, DEC);
}
Serial.setDebugOutput(false);
if(Update.end()){
client.println("OK");
Serial.printf("Update Success: %u\nRebooting...\n", millis() - startTime);