Updated library to work with ESP8266 board manager version 3.0.0

This commit is contained in:
achim
2021-06-08 08:33:51 +07:00
parent 0753a4c9dd
commit c270cda600
10 changed files with 69 additions and 61 deletions

Binary file not shown.

View File

@ -10,11 +10,11 @@ Plantower PMS5003 (Fine Particle Sensor)
SenseAir S8 (CO2 Sensor)
SHT30/31 (Temperature/Humidity Sensor)
Dependent Libraries:
Please install ESP8266 board manager (tested with version 3.0.0)
The codes needs the following libraries installed:
ESP8266 board with standard libraries
WifiManager by tzar, tablatronix tested with Version 2.0.3-alpha
ESP8266 and ESP32 OLED driver for SSD1306 displays by ThingPulse, Fabrice Weinberg tested with Version 4.1.0
"WifiManager by tzapu, tablatronix" tested with Version 2.0.3-alpha
"ESP8266 and ESP32 OLED driver for SSD1306 displays by ThingPulse, Fabrice Weinberg" tested with Version 4.1.0
Configuration:
Please set in the code below which sensor you are using and if you want to connect it to WiFi.
@ -99,8 +99,9 @@ void loop(){
Serial.println(payload);
String POSTURL = APIROOT + "sensors/airgradient:" + String(ESP.getChipId(),HEX) + "/measures";
Serial.println(POSTURL);
WiFiClient client;
HTTPClient http;
http.begin(POSTURL);
http.begin(client, POSTURL);
http.addHeader("content-type", "application/json");
int httpCode = http.POST(payload);
String response = http.getString();

View File

@ -1,3 +1,21 @@
/*
This is the code for the AirGradient DIY Air Quality Sensor with an ESP8266 Microcontroller.
It is a high quality sensor showing PM2.5, CO2, Temperature and Humidity on a small display and can send data over Wifi.
For build instructions please visit https://www.airgradient.com/diy/
Compatible with the following sensors:
SenseAir S8 (CO2 Sensor)
Please install ESP8266 board manager (tested with version 3.0.0)
If you are a school or university contact us for a free trial on the AirGradient platform.
https://www.airgradient.com/schools/
MIT License
*/
#include <AirGradient.h>
AirGradient ag = AirGradient();

View File

@ -1,16 +0,0 @@
#include <AirGradient.h>
AirGradient ag = AirGradient();
void setup(){
Serial.begin(9600);
ag.MHZ19_Init(MHZ19B);
}
void loop(){
int MHZ19_C02 = ag.readMHZ19();
Serial.print("C02: ");
Serial.println(MHZ19_C02);
delay(5000);
}

View File

@ -1,3 +1,21 @@
/*
This is the code for the AirGradient DIY Air Quality Sensor with an ESP8266 Microcontroller.
It is a high quality sensor showing PM2.5, CO2, Temperature and Humidity on a small display and can send data over Wifi.
For build instructions please visit https://www.airgradient.com/diy/
Compatible with the following sensors:
Plantower PMS5003 (Fine Particle Sensor)
Please install ESP8266 board manager (tested with version 3.0.0)
If you are a school or university contact us for a free trial on the AirGradient platform.
https://www.airgradient.com/schools/
MIT License
*/
#include <AirGradient.h>
AirGradient ag = AirGradient();

View File

@ -1,3 +1,21 @@
/*
This is the code for the AirGradient DIY Air Quality Sensor with an ESP8266 Microcontroller.
It is a high quality sensor showing PM2.5, CO2, Temperature and Humidity on a small display and can send data over Wifi.
For build instructions please visit https://www.airgradient.com/diy/
Compatible with the following sensors:
SHT30/31 (Temperature/Humidity Sensor)
Please install ESP8266 board manager (tested with version 3.0.0)
If you are a school or university contact us for a free trial on the AirGradient platform.
https://www.airgradient.com/schools/
MIT License
*/
#include <AirGradient.h>
AirGradient ag = AirGradient();