1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +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

@ -19,12 +19,12 @@ Usage
-----
1. Download this repository as a zip (button on the right) and follow [these instructions to install into Arduino](http://arduino.cc/en/Guide/Libraries).
2. Include the ESP8266mDNS library in the sketch.
3. Create an instance of the MDNSResponder class.
4. Call the begin method in the sketch's setup and provide a domain name (without
the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'), and the
IP address to advertise. Optionally provide a time to live (in seconds)
for the DNS record--the default is 1 hour.
5. Call the update method in each iteration of the sketch's loop function.
3. Call MDNS.begin method in the sketch's setup and provide a domain name (without
the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'). Optionally provide
the IP address to advertise and time to live (in seconds) for the DNS record -- the default is 1 hour.
4. To advertise DNS-SD services, call MDNS.addService(service, proto, port), where service and proto
are strings with service and protocol name (e.g. "http", "tcp"), and port is an integer port number
for this service (e.g. 80).
See the included MDNS + HTTP server sketch for a full example.
@ -49,4 +49,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.

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);