mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
1mb
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
#include "items/vLogging.h"
|
||||
#include "items/vImpulsOut.h"
|
||||
#include "items/vCountDown.h"
|
||||
#include "items/SensorModbusClass.h"
|
||||
|
||||
void loopCmdAdd(const String& cmdStr) {
|
||||
orderBuf += cmdStr;
|
||||
@@ -88,11 +87,6 @@ void csvCmdExecute(String& cmdStr) {
|
||||
else if (order == F("bmp280-press")) {
|
||||
sCmd.addCommand(order.c_str(), bmp280Press);
|
||||
}
|
||||
#endif
|
||||
#ifdef SensorModbusEnabled
|
||||
else if (order == F("modbus")) {
|
||||
sCmd.addCommand(order.c_str(), modbus);
|
||||
}
|
||||
#endif
|
||||
else if (order == F("uptime")) {
|
||||
sCmd.addCommand(order.c_str(), sysUptime);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Consts.h"
|
||||
#ifdef uartEnable
|
||||
#include "SoftUART.h"
|
||||
#include "Global.h"
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#ifdef telegram
|
||||
#include "Consts.h"
|
||||
#ifdef telegramEnable
|
||||
#include "Telegram.h"
|
||||
CTBot* myBot{ nullptr };
|
||||
|
||||
void telegramInit() {
|
||||
if (isTelegramEnabled()) {
|
||||
telegramInitBeen = true;
|
||||
sCmd.addCommand("telegram", sendTelegramMsg);
|
||||
sCmd.addCommand("telegramEnable", sendTelegramMsg);
|
||||
String token = jsonReadStr(configSetupJson, "telegramApi");
|
||||
if (!myBot) {
|
||||
myBot = new CTBot();
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
#include "Utils/StringUtils.h"
|
||||
|
||||
static const uint8_t days_in_month[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
static const char* week_days[7] = { "Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat" };
|
||||
|
||||
//static const char* week_days[7] = { "Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat" };
|
||||
|
||||
// String getTimeUnix() {
|
||||
// time_t t;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#include "Consts.h"
|
||||
#ifdef SensorModbusEnabled
|
||||
#include "items/SensorModbusClass.h"
|
||||
#include "BufferExecute.h"
|
||||
//=========================================Модуль modbus===================================================================================
|
||||
//modbus;id;anydata;Сенсоры;Температура;order;addr[1];regaddr[0];c[1]
|
||||
//=========================================================================================================================================
|
||||
SensorModbusClass mySensorModbus;
|
||||
|
||||
void modbus() {
|
||||
mySensorModbus.update();
|
||||
String key = mySensorModbus.gkey();
|
||||
sCmd.addCommand(key.c_str(), modbusReading);
|
||||
mySensorModbus.SensorModbusInit();
|
||||
mySensorModbus.clear();
|
||||
}
|
||||
void modbusReading() {
|
||||
String key = sCmd.order();
|
||||
String addr = sCmd.next();
|
||||
String regaddr = sCmd.next();
|
||||
mySensorModbus.SensorModbusRead(key, addr.toInt(), regaddr.toInt());
|
||||
}
|
||||
#endif
|
||||
@@ -50,7 +50,7 @@ void setup() {
|
||||
itemsListInit();
|
||||
espInit();
|
||||
routerConnect();
|
||||
#ifdef telegram
|
||||
#ifdef telegramEnable
|
||||
telegramInit();
|
||||
#endif
|
||||
uptime_init();
|
||||
@@ -95,7 +95,7 @@ void loop() {
|
||||
myNotAsyncActions->loop();
|
||||
ts.update();
|
||||
|
||||
#ifdef telegram
|
||||
#ifdef telegramEnable
|
||||
handleTelegram();
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user