Add link to dependices
This commit is contained in:
@@ -16,4 +16,5 @@ lib_deps =
|
||||
robtillaart/RunningMedian @ ^0.3.3
|
||||
lewapek/Nova Fitness Sds dust sensors library @ ^1.5.1
|
||||
ottowinter/AsyncMqttClient-esphome @ ^0.8.6
|
||||
climateguard/ClimateGuard RadSens @ ^1.1.3
|
||||
monitor_speed = 115200
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <RunningMedian.h>
|
||||
#include <EEPROM.h>
|
||||
#include <WiFi.h>
|
||||
#include <esp_now.h>
|
||||
|
||||
extern "C" {
|
||||
#include "freertos/FreeRTOS.h"
|
||||
@@ -27,6 +26,12 @@ extern "C" {
|
||||
}
|
||||
#include <AsyncMqttClient.h>
|
||||
|
||||
#include "CG_RadSens.h"
|
||||
|
||||
CG_RadSens radSens(RS_DEFAULT_I2C_ADDRESS); /*Constructor of the class ClimateGuard_RadSens1v2,
|
||||
sets the address parameter of I2C sensor.
|
||||
Default address: 0x66.*/
|
||||
|
||||
typedef struct message {
|
||||
float temperature;
|
||||
float humidity;
|
||||
@@ -97,12 +102,9 @@ void setup() {
|
||||
WiFi.mode(WIFI_MODE_APSTA);
|
||||
connectToWifi();
|
||||
|
||||
// Initializing the ESP-NOW
|
||||
if (esp_now_init() != 0) {
|
||||
Serial.println("Problem during ESP-NOW init");
|
||||
return;
|
||||
}
|
||||
esp_now_register_recv_cb(onDataReceiver);
|
||||
radSens.init();
|
||||
radSens.setSensitivity(105);
|
||||
|
||||
oldmov = 0;
|
||||
lamp = false;
|
||||
cRun = millis();
|
||||
|
||||
@@ -26,6 +26,7 @@ extern "C" {
|
||||
#include <SoftwareSerial.h>
|
||||
#include <SerialTransfer.h>
|
||||
#include <PubSubClient.h>
|
||||
#include "CG_RadSens.h"
|
||||
|
||||
#define BAUDRATE 9600
|
||||
|
||||
@@ -61,6 +62,9 @@ float temp, hum;
|
||||
bool bLamp, wLamp, reciever;
|
||||
uint8_t statLamp;
|
||||
|
||||
CG_RadSens radSens(RS_DEFAULT_I2C_ADDRESS); /*Constructor of the class ClimateGuard_RadSens1v2,
|
||||
sets the address parameter of I2C sensor.
|
||||
Default address: 0x66.*/
|
||||
|
||||
AsyncWebServer server(80);
|
||||
struct I2cTxStruct {
|
||||
@@ -90,4 +94,5 @@ PubSubClient client(espClient);
|
||||
boolean reconnect();
|
||||
void callback(char* topic, byte* payload, unsigned int length);
|
||||
|
||||
|
||||
#endif // __MAIN__
|
||||
|
||||
@@ -29,6 +29,7 @@ lib_deps =
|
||||
plerup/EspSoftwareSerial @ ^8.1.0
|
||||
powerbroker2/SerialTransfer @ ^3.1.3
|
||||
knolleary/PubSubClient @ ^2.8
|
||||
climateguard/ClimateGuard RadSens @ ^1.1.3
|
||||
;upload_protocol = espota
|
||||
;upload_port = 192.168.1.138
|
||||
|
||||
|
||||
@@ -126,12 +126,16 @@ void setup() {
|
||||
#undef SCL //delete dafault SCL pin number
|
||||
#define SDA 33 //assign new SDA pin to GPIO1/D2/0TX for all slaves on i2c bus
|
||||
#define SCL 32 //assign new SCL pin to GPIO3/D7/0RX for all slaves on i2c bus
|
||||
Wire.begin(SDA, SCL);
|
||||
if (!htu.begin(SDA, SCL)) {
|
||||
Serial.println("Couldn't find sensor!");
|
||||
while (1);
|
||||
}
|
||||
Serial.println("Sensor found!");
|
||||
|
||||
radSens.init();
|
||||
radSens.setSensitivity(105);
|
||||
|
||||
//char s[8];
|
||||
EEPROM.begin(20);
|
||||
EEPROM.get(0, periodMotion);
|
||||
@@ -331,6 +335,14 @@ void loop() {
|
||||
WebSerial.println("Temp: " + String(temp));
|
||||
WebSerial.println("Hum: " + String(hum));
|
||||
Serial.println(sec);
|
||||
radSens.getRadIntensyDynamic();
|
||||
}
|
||||
if ((sec + 1) % 30 == 0){
|
||||
float mkr = radSens.getRadIntensyStatic();
|
||||
dtostrf(mkr, 6, 1, s);
|
||||
client.publish(TOPIC"mkr", s);
|
||||
WebSerial.println("mkR: " + String(mkr));
|
||||
Serial.println("mkR: " + String(mkr));
|
||||
}
|
||||
itoa(WiFi.RSSI(), s, 10);
|
||||
client.publish(TOPIC"RSSI", s);
|
||||
|
||||
@@ -22,3 +22,4 @@ lib_deps =
|
||||
ottowinter/ESPAsyncWebServer-esphome @ ^3.0.0
|
||||
lewapek/Nova Fitness Sds dust sensors library @ ^1.5.1
|
||||
ottowinter/AsyncMqttClient-esphome @ ^0.8.6
|
||||
https://github.com/climateguard/RadSens.git
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <ESPAsyncWebServer.h>
|
||||
#include <WebSerial.h>
|
||||
#include <ESP8266WiFiMulti.h>
|
||||
#include "CG_RadSens.h"
|
||||
|
||||
#define WIFI_SSID "wf-home"
|
||||
#define WIFI_PASSWORD "0ndthnrf"
|
||||
@@ -62,6 +63,12 @@ unsigned long stled;
|
||||
ESP8266WiFiMulti wifiMulti;
|
||||
AsyncWebServer server(80);
|
||||
|
||||
CG_RadSens radSens(RS_DEFAULT_I2C_ADDRESS);
|
||||
bool rsOk;
|
||||
float dynval; // Переменная для динамического значения интенсивности
|
||||
float statval; // Переменная для статического значения интенсивности
|
||||
uint32_t impval; // Переменная для кол-ва импульсов
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
@@ -111,6 +118,9 @@ void setup()
|
||||
pinMode(LED_MQ, OUTPUT);
|
||||
pinMode(LED_WRK, OUTPUT);
|
||||
pinMode(LAMP_OUT, OUTPUT);
|
||||
//pinMode(3, FUNCTION_3);
|
||||
//delay(10);
|
||||
//digitalWrite(3, LOW);
|
||||
pinMode(PIN_MOVE, INPUT);
|
||||
|
||||
digitalWrite(LED_WF, LOW);
|
||||
@@ -143,6 +153,9 @@ void setup()
|
||||
WebSerial.begin(&server);
|
||||
/* Attach Message Callback */
|
||||
server.begin();
|
||||
//Wire.begin();
|
||||
//rsOk = radSens.init();
|
||||
radSens.setSensitivity(105);
|
||||
}
|
||||
|
||||
void loop()
|
||||
@@ -160,6 +173,7 @@ void loop()
|
||||
cRunADC = millis();
|
||||
adc = analogRead(A0);
|
||||
samples.add(adc);
|
||||
//if (mqttClient.connected()) analogWrite(LED_MQ, int(samples.getMedian()));
|
||||
}
|
||||
//adc = samples.getMedian();
|
||||
|
||||
@@ -199,6 +213,14 @@ void loop()
|
||||
}
|
||||
if(cRun + 999 < millis()){
|
||||
cRun = millis();
|
||||
//if(!rsOk){
|
||||
// WebSerial.println("RadSens not Ok");
|
||||
// rsOk = radSens.init();
|
||||
//}
|
||||
//dynval = radSens.getRadIntensyDynamic();
|
||||
//statval = radSens.getRadIntensyStatic();
|
||||
//impval = radSens.getNumberOfPulses();
|
||||
|
||||
cSec++;
|
||||
mins += 1 / 60.0;
|
||||
if(cSec == 10){
|
||||
@@ -206,6 +228,8 @@ void loop()
|
||||
mqttClient.publish(TOPIC"minsmain", 1, false, v);
|
||||
itoa(int(samples.getMedian()), v, 10);
|
||||
mqttClient.publish(TOPIC"adc", 1, false, v);
|
||||
//sprintf(v, "%.1f", statval);
|
||||
//mqttClient.publish(TOPIC"mkr", 1, false, v);
|
||||
cSec = 0;
|
||||
}
|
||||
if(curDelay == 0) {
|
||||
@@ -296,6 +320,7 @@ void onMqttConnect(bool sessionPresent) {
|
||||
mqttClient.subscribe(TOPIC"sdsperiod", 1);
|
||||
mqttClient.subscribe(TOPIC"lightlev", 1);
|
||||
|
||||
//analogWrite(LED_MQ, 1023);
|
||||
digitalWrite(LED_MQ, LOW);
|
||||
}
|
||||
|
||||
@@ -305,6 +330,7 @@ void onMqttDisconnect(AsyncMqttClientDisconnectReason reason) {
|
||||
if (WiFi.isConnected()) {
|
||||
mqttReconnectTimer.once(2, connectToMqtt);
|
||||
}
|
||||
//analogWrite(LED_MQ, 0);
|
||||
digitalWrite(LED_MQ, HIGH);
|
||||
}
|
||||
|
||||
|
||||
17
Sw_BigRoom/.vscode/extensions.json
vendored
17
Sw_BigRoom/.vscode/extensions.json
vendored
@@ -1,7 +1,10 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"platformio.platformio-ide"
|
||||
]
|
||||
}
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"platformio.platformio-ide"
|
||||
],
|
||||
"unwantedRecommendations": [
|
||||
"ms-vscode.cpptools-extension-pack"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -15,5 +15,12 @@ framework = arduino
|
||||
board_build.ldscript = eagle.flash.2m.ld
|
||||
upload_protocol = espota
|
||||
upload_port = 192.168.1.129
|
||||
|
||||
lib_deps =
|
||||
# RECOMMENDED
|
||||
# Accept new functionality in a backwards compatible manner and patches
|
||||
marvinroger/AsyncMqttClient @ ^0.9.0
|
||||
thomasfredericks/Bounce2 @ ^2.72
|
||||
jwrw/ESP_EEPROM @ ^2.2.1
|
||||
;lib_deps =
|
||||
; joaolopesf/RemoteDebug @ ^3.0.5
|
||||
Reference in New Issue
Block a user