-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTelegramCommandBot.ino
64 lines (49 loc) · 1.91 KB
/
TelegramCommandBot.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*******************************************************************
A telegram bot for ESP32 that responds to preset commands.
Using various Arduino libraries, most notably UniveralTelegramBot
Modified by Retrojon
/***************************************************
* Version information
***************************************************/
int majorVersion = 0;
int minorVersion = 90;
/***************************************************
* Include files
***************************************************/
#include <SimpleTimer.h> // timer lib
#include <Wire.h>
#include "variables.h" // credentials
#include <esp_task_wdt.h> // watchdog timer
#include <IRremote.h> // infrared mod
#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiClientSecure.h>
#include <ESP32Ping.h> // wifi Ping
#include <esp_wifi.h> // wifi psave
#include <soc/rtc.h> // 80mhz cpu
#include <UniversalTelegramBot.h> // telegram client
#include "WiFiClientSecure.h"
#include <Time.h> // time () ctime ()
#include "handleNewMessages.h" // telegram processing
#include <WebServer.h> // ota http server
#include <Update.h> // ota
#include "setup.h"
#include "handleWiFiReconnect.h" // recon to wifi
#include "handleTelegramPoll.h" // check new msgs
#include "handleFirstTimer.h" // main timer
#include "handleSecondTimer.h" // keep alive
/***************************************************
* Name: loop
* Returns: Nothing.
* Parameters: None.
* Description: Main application loop.
*
***************************************************/
void loop() {
/* WiFi Reconnect */
handleWiFiReconnect();
/* Poll new Telegram messages */
handleTelegramPoll();
/* Sleep/Power saving */
handleFirstTimer();
handleSecondTimer(); }