From 87db536cfbfd22d5f982de6021cad13305b082df Mon Sep 17 00:00:00 2001 From: Kyle Gordon Date: Fri, 5 Oct 2018 21:41:25 +0100 Subject: [PATCH] Initial PlatformIO and Travis support --- .gitignore | 3 +++ .travis.yml | 26 ++++++++++++++++++++++++++ Settings_CI.h | 10 ++++++++++ platformio.ini | 18 ++++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 .travis.yml create mode 100644 Settings_CI.h create mode 100644 platformio.ini diff --git a/.gitignore b/.gitignore index dcab3a6..79d222a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ Settings_local.h +.pioenvs +.piolibdeps +lib diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1a4b318 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +language: python +python: + - "2.7" + +# Cache PlatformIO packages using Travis CI container-based infrastructure +sudo: false + +git: + submodules: true + +cache: + directories: + - "~/.platformio" + +env: + - PLATFORMIO_CI_SRC=ESP32-mqtt-room.ino.ino + +install: + - pip install -U platformio + +before_script: + - cp Settings_CI.h Settings_local.h + +script: + - platformio lib update + - platformio run diff --git a/Settings_CI.h b/Settings_CI.h new file mode 100644 index 0000000..e7084af --- /dev/null +++ b/Settings_CI.h @@ -0,0 +1,10 @@ +#define ssid "Travis" +#define password "123456789" +#define hostname "esp32_room_presence" +#define mqttServer "192.168.1.1" +#define mqttPort 1883 +#define mqttUser "homeassistant" +#define mqttPassword "123456789" +#define room "living-room" +#define channel "room_presence" +#define scanInterval 15 diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 0000000..78fa11f --- /dev/null +++ b/platformio.ini @@ -0,0 +1,18 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; http://docs.platformio.org/page/projectconf.html + +[platformio] +src_dir = . + +[env:esp32] +platform = espressif32 +framework = arduino +board = esp32dev +lib_deps = PubSubClient, ArduinoJSON