Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Add other examples to travis #110

Merged
merged 9 commits into from
Apr 29, 2016
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: c++
cache: ccache
sudo: false
addons:
apt:
Expand All @@ -12,17 +13,23 @@ env:
- ARDUINO_VERSION=nightly ARDUINO_ESP8266_VERSION=master ARDUINO_ROOT=${HOME}/arduino-${ARDUINO_VERSION} ARDUINO_ESP8266_ROOT=${ARDUINO_ROOT}/hardware/esp8266com/esp8266 ARDUINO_HOME=${HOME}/Arduino
install:
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
- ( cd ${HOME} && curl -O https://downloads.arduino.cc/arduino-${ARDUINO_VERSION}-linux64.tar.xz && tar xvf arduino-${ARDUINO_VERSION}-linux64.tar.xz )
- ( cd ${HOME} && curl -O https://downloads.arduino.cc/arduino-${ARDUINO_VERSION}-linux64.tar.xz && tar xf arduino-${ARDUINO_VERSION}-linux64.tar.xz )
- ( cd ${HOME} && wget -q -O SoftwareSerial.zip https://github.com/plerup/espsoftwareserial/archive/097712eb07f5b3a70ef419b6e7a7ed2ada5aab85.zip && unzip -q SoftwareSerial.zip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why no curl :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no real reason, wget is always my goto for this.

&& rm -rf SoftwareSerial.zip && mv espsoftwareserial-* SoftwareSerial)
- (cd ${HOME} && LIB=Adafruit_NeoPixel && wget https://github.com/adafruit/$LIB/archive/master.zip -O $LIB.zip && unzip $LIB.zip && mv $LIB-master $LIB)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure we want master? it would be nice to use env var and target the stable version and master in different build.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no easy way to do that. We could lock them onto various versions. The master is just easiest because they would all have the same url, but master could definitely be troublesome if these go into active development. I will lock them all to their current latest version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so if you define an env variable with a version suffix in the env: section. Travis will set this env variable before running install:, you can then wget from an url that include this env var.

When env: line will trigger a separate building, currently we have:
a. stable arduino + stable espcore
b. stable arduino + staging espcore
c. nightly arduino + master espcore

We could add the stable version of the lib to a. and b. and master to c. to get better converage.

Copy link
Collaborator Author

@ed7coyne ed7coyne Apr 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could, adding a variable for each library seemed like a lot of work but it shouldn't be too bad.

I guess I really meant a lot of noise more than work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to do it in a separate PR if you file an issue after merging :)

- (cd ${HOME} && LIB=Adafruit-GFX-Library && wget https://github.com/adafruit/$LIB/archive/master.zip -O $LIB.zip && unzip $LIB.zip && mv $LIB-master $LIB)
- (cd ${HOME} && LIB=Adafruit_SSD1306 && wget https://github.com/adafruit/$LIB/archive/master.zip -O $LIB.zip && unzip $LIB.zip && mv $LIB-master $LIB)
- git clone --branch ${ARDUINO_ESP8266_VERSION} https://github.com/esp8266/Arduino.git ${ARDUINO_ESP8266_ROOT}
- git submodule init && git submodule update
- ( cd ${ARDUINO_ESP8266_ROOT}/tools && python get.py )
before_script:
- mkdir -p ${ARDUINO_HOME}/libraries
- ( cd ${ARDUINO_HOME}/libraries && ln -s ${TRAVIS_BUILD_DIR} firebase-arduino && ln -s ${TRAVIS_BUILD_DIR}/src/third-party/arduino-json-5.2 ArduinoJson && ln -s ${HOME}/SoftwareSerial SoftwareSerial )
- ( cd ${ARDUINO_HOME}/libraries && ln -s ${TRAVIS_BUILD_DIR} firebase-arduino && ln -s ${TRAVIS_BUILD_DIR}/src/third-party/arduino-json-5.2 ArduinoJson && ln -s ${HOME}/SoftwareSerial ./
&& ln -s ${HOME}/Adafruit_NeoPixel ./ && ln -s ${HOME}/Adafruit-GFX-Library ./ && ln -s ${HOME}/Adafruit_SSD1306 ./)
script:
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseDemo_ESP8266/FirebaseDemo_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseSerialHost_ESP8266/FirebaseSerialHost_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/Firebase_ESP8266_LEDs/Firebase_ESP8266_Neopixel/Firebase_ESP8266_Neopixel.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino
- (cd test && make check)
- (cd test/modem/ && make test)
5 changes: 2 additions & 3 deletions examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <ESP8266WiFi.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <ArduinoJson.h>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is now built into our library you cannot include it directly.

#define OLED_RESET 3
Adafruit_SSD1306 display(OLED_RESET);
Expand Down Expand Up @@ -66,8 +65,8 @@ void loop() {
Serial.println(event);
JsonObject& json = buf.parseObject((char*)event.c_str());
String path = json["path"];
float data = json["data"];
float data = json["data"];

// TODO(proppy): parse JSON object.
display.clearDisplay();
display.setTextSize(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
// Firebase_ESP8266-Neopixel is a sample that demonstrates how
// to set pixel data using a firebase stream.
#include <Firebase.h>
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>

#include <Adafruit_NeoPixel.h>
Expand All @@ -26,11 +25,8 @@
const int PIN=13;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800);

#define JSON_BUFFER_SIZE 10*4

// TODO: Replace with your own credentials and keep these safe.
Firebase fbase = Firebase("YOUR-PROJECT.firebaseio.com")
.auth("YOUR_AUTH_SECRET");
Firebase fbase = Firebase("YOUR-PROJECT.firebaseio.com", "YOUR_AUTH_SECRET");

void setup() {
Serial.begin(9600);
Expand Down Expand Up @@ -75,14 +71,8 @@ void loop() {
return;
}

// Use dynamic for large JSON objects
// DynamicJsonBuffer jsonBuffer;
StaticJsonBuffer<JSON_OBJECT_SIZE(JSON_BUFFER_SIZE)> jsonBuffer;

// create an empty object
String ref = get.json();
Serial.println(ref);
JsonObject& pixelJSON = jsonBuffer.parseObject((char*)ref.c_str());
const JsonObject& pixelJSON = get.json();

if(pixelJSON.success()){
for (int i=0; i < strip.numPixels(); i++) {
Expand All @@ -94,7 +84,7 @@ void loop() {
strip.show();
} else {
Serial.println("Parse fail.");
Serial.println(get.json());
Serial.println(get.response());
}
}