Skip to content

Commit 7fdbf77

Browse files
authored
Merge pull request #5 from jehy/feature/travis
add travis check and update readme
2 parents 91a449a + 33d400d commit 7fdbf77

File tree

4 files changed

+64
-10
lines changed

4 files changed

+64
-10
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
.idea
12
WiFiCreds.h
2-
dataServer.h
3+
dataServer.h

.travis.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
language: c
2+
env:
3+
global:
4+
- ARDUINO_VERSION=1.8.4
5+
- BD=esp8266:esp8266:d1:CpuFrequency=80,FlashSize=4M3M
6+
before_install:
7+
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
8+
- sleep 3
9+
- export DISPLAY=:1.0
10+
- wget http://downloads.arduino.cc/arduino-${ARDUINO_VERSION}-linux64.tar.xz
11+
- tar xf arduino-${ARDUINO_VERSION}-linux64.tar.xz
12+
- sudo mv arduino-${ARDUINO_VERSION} /usr/local/share/arduino
13+
- sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino
14+
install:
15+
- ln -s $PWD /usr/local/share/arduino/libraries/co2
16+
- arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --save-prefs
17+
- arduino --install-library "ArduinoJson:5.13.3"
18+
- arduino --install-library "DHT sensor library:1.2.3"
19+
- arduino --install-library "LiquidCrystal I2C:1.1.2"
20+
- arduino --install-boards esp8266:esp8266
21+
- arduino --board esp8266:esp8266:generic --save-prefs
22+
- arduino --pref "compiler.warning_level=all" --save-prefs
23+
- cp WiFiCreds.h.sample WiFiCreds.h
24+
- cp dataServer.h.sample dataServer.h
25+
script:
26+
- "echo $PWD"
27+
- "echo $HOME"
28+
- "ls $PWD"
29+
- "echo $BD"
30+
- arduino --verify --board $BD $PWD/arduino-esp8266-mh-z19-serial.ino
31+
notifications:
32+
email:
33+
on_success: change
34+
on_failure: change

README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,39 @@
11
# Arduino esp8266 mh-z19 serial
22

3+
[![Build Status](https://travis-ci.org/jehy/arduino-esp8266-mh-z19-serial.svg?branch=master)](https://travis-ci.org/jehy/arduino-esp8266-mh-z19-serial)
4+
35
CO2, humidity and temperature sensor on ESP8266 with mh-z19 co2 sensor and dht-22 temperature and humidity sensor.
46

5-
You can use project https://github.com/jehy/co2-online-display as backend to this program.
6-
See full description on https://geektimes.ru/post/270958/ (you can use Google translate from Russian).
7+
You can use project [https://github.com/jehy/co2-online-display](https://github.com/jehy/co2-online-display) as backend to this program.
8+
See full description on [https://geektimes.ru/post/270958/](https://geektimes.ru/post/270958/) (you can use Google translate from Russian).
79

810
# Compilation
911

10-
All required libraries can be installed with Arduino IDE.
11-
12+
All required libraries can be installed with Arduino IDE:
13+
14+
## Via console:
15+
16+
```bash
17+
arduino --pref "boardsmanager.additional.urls=http://arduino.esp8266.com/stable/package_esp8266com_index.json" --save-prefs
18+
arduino --install-library "ArduinoJson:5.13.3"
19+
arduino --install-library "DHT sensor library:1.2.3"
20+
arduino --install-library "LiquidCrystal I2C:1.1.2"
21+
arduino --install-boards esp8266:esp8266
22+
23+
cp WiFiCreds.h.sample WiFiCreds.h # EDIT AFTER COP# Y!
24+
cp dataServer.h.sample dataServer.h # EDIT AFTER COPY!
25+
26+
arduino --verify --board esp8266:esp8266:d1:CpuFrequency=80,FlashSize=4M3M arduino-esp8266-mh-z19-serial.ino
27+
28+
```
29+
30+
## Manualy:
31+
1232
1. Copy file `dataServer.h.sample` to `dataServer.h` and specify there your server address;
1333
2. Copy file `WiFiCreds.h.sample` to `WiFiCreds.h` and specify there your WiFi cridentials;
1434
3. Install [DHT sensor library](https://github.com/adafruit/DHT-sensor-library) version 1.2.3;
1535
4. Install [ArduinoJson library](https://arduinojson.org/) v 5.13.3;
16-
5. Install [LiquidCrystal_I2C library](https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library) v 1.1.2;
17-
6. Install [Adafruit unified sensor library](https://github.com/adafruit/Adafruit_Sensor) (required for DHT library);
36+
5. Install [LiquidCrystal_I2C library](https://github.com/marcoschwartz/LiquidCrystal_I2C) v 1.1.2;
1837
7. Compile and upload your sketch;
1938
8. Enjoy!
2039

arduino-esp8266-mh-z19-serial.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
#define USE_GOOGLE_DNS true
1111

1212
#include <SoftwareSerial.h>
13-
#include <DHT.h> // https://github.com/adafruit/DHT-sensor-library
13+
#include <DHT.h>
1414
#include <ESP8266WiFi.h>
1515
#include <WiFiClient.h>
1616
#include <Wire.h>
17-
#include <ArduinoJson.h> // https://github.com/bblanchon/ArduinoJson
18-
#include <LiquidCrystal_I2C.h> // https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
17+
#include <ArduinoJson.h>
18+
#include <LiquidCrystal_I2C.h>
1919
#include "WiFiUtils.h"
2020
#include "WiFiCreds.h"
2121
#include "LcdPrint.h"

0 commit comments

Comments
 (0)