Device will reboot when upload complete";
90 | message += red + " OTA is enabled - Restart device to disable " + endcolour;
91 |
92 |
93 | message += webfooter(); // add standard footer html
94 |
95 | server.send(200, "text/html", message); // send the web page
96 | message = ""; // clear string
97 |
98 | }
99 |
100 | // ---------------------------------------------- end ----------------------------------------------
101 |
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asjdf/ESP32CAMmotion_detection/9e519fb6e63d87f2582c1cf37461fde63cc942e2/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used.zip
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 mobizt
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/examples/Set_flag/Set_flag.ino:
--------------------------------------------------------------------------------
1 | /*
2 | * Created by K. Suwatchai (Mobizt)
3 | *
4 | * Email: k_suwatchai@hotmail.com
5 | *
6 | * Github: https://github.com/mobizt
7 | *
8 | * Copyright (c) 2019 mobizt
9 | *
10 | */
11 |
12 |
13 | #include
14 | #include "ESP32_MailClient.h"
15 |
16 | #define WIFI_SSID "YOUR_WIFI_SSID"
17 | #define WIFI_PASSWORD "YOUR_WIFI_PASSWORD"
18 |
19 | //The Email Reading data object contains config and data that received
20 | IMAPData imapData;
21 |
22 | void readEmail();
23 |
24 | unsigned long lastTime = 0;
25 |
26 | void setup()
27 | {
28 |
29 | Serial.begin(115200);
30 | Serial.println();
31 |
32 | Serial.print("Connecting to AP");
33 |
34 | WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
35 | while (WiFi.status() != WL_CONNECTED)
36 | {
37 | Serial.print(".");
38 | delay(200);
39 | }
40 |
41 | Serial.println("");
42 | Serial.println("WiFi connected.");
43 | Serial.println("IP address: ");
44 | Serial.println(WiFi.localIP());
45 |
46 | Serial.println();
47 |
48 | Serial.println();
49 |
50 | imapData.setLogin("imap.gmail.com", 993, "YOUR_EMAIL_ACCOUNT@gmail.com", "YOUR_EMAIL_PASSWORD");
51 | imapData.setFolder("INBOX");
52 | imapData.setDebug(true);
53 |
54 | //Set \Seen and \Answered to flags for message with UID 100
55 | MailClient.setFlag(imapData, 100, "\\Seen \\Answered");
56 |
57 | //Add \Seen and \Answered to flags for message with UID 100
58 | //MailClient.addFlag(imapData, 100, "\\Seen \\Answered");
59 |
60 | //Remove \Seen and \Answered from flags for message with UID 100
61 | //MailClient.removeFlag(imapData, 100, "\\Seen \\Answered");
62 | }
63 |
64 |
65 |
66 | void loop()
67 | {
68 |
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/keywords.txt:
--------------------------------------------------------------------------------
1 | #######################################
2 | # Syntax Coloring Map ESP32-Mail-Client
3 | #######################################
4 |
5 | #######################################
6 | # Classes (KEYWORD1)
7 | #######################################
8 |
9 | IMAPData KEYWORD1
10 | SMTPData KEYWORD1
11 | attachmentData KEYWORD1
12 | SendStatus KEYWORD1
13 | messageBodyData KEYWORD1
14 | DownloadProgress KEYWORD1
15 | MessageData KEYWORD1
16 |
17 | TIME KEYWORD1
18 |
19 |
20 | ##################################
21 | # Methods and Functions (KEYWORD2)
22 | ##################################
23 |
24 | sendMail KEYWORD2
25 | readMail KEYWORD2
26 | smtpErrorReason KEYWORD2
27 | imapErrorReason KEYWORD2
28 | sdBegin KEYWORD2
29 | setFlag KEYWORD2
30 | addFlag KEYWORD2
31 | removeFlag KEYWORD2
32 |
33 |
34 | setClock KEYWORD2
35 | getUnixTime KEYWORD2
36 | getTimestamp KEYWORD2
37 | getYear KEYWORD2
38 | getMonth KEYWORD2
39 | getDay KEYWORD2
40 | getDayOfWeek KEYWORD2
41 | getDayOfWeekString KEYWORD2
42 | getHour KEYWORD2
43 | getMin KEYWORD2
44 | getSec KEYWORD2
45 | getNumberOfDayThisYear KEYWORD2
46 | getTotalDays KEYWORD2
47 | dayofweek KEYWORD2
48 | getCurrentSecond KEYWORD2
49 | getCurrentTimestamp KEYWORD2
50 | getTimeFromSec KEYWORD2
51 |
52 | #########################################
53 | # Methods for IMAP Data object (KEYWORD2)
54 | #########################################
55 |
56 | setLogin KEYWORD2
57 | setSTARTTLS KEYWORD2
58 | setDebug KEYWORD2
59 | setFolder KEYWORD2
60 | setMessageBufferSize KEYWORD2
61 | setAttachmentSizeLimit KEYWORD2
62 | setSearchCriteria KEYWORD2
63 | setSaveFilePath KEYWORD2
64 | setFechUID KEYWORD2
65 | setDownloadAttachment KEYWORD2
66 | setHTMLMessage KEYWORD2
67 | setTextMessage KEYWORD2
68 | setSearchLimit KEYWORD2
69 | setRecentSort KEYWORD2
70 | setReadCallback KEYWORD2
71 | setDownloadReport KEYWORD2
72 | isHeaderOnly KEYWORD2
73 | getFrom KEYWORD2
74 | getFromCharset KEYWORD2
75 | getTo KEYWORD2
76 | getToCharset KEYWORD2
77 | getCC KEYWORD2
78 | getCCCharset KEYWORD2
79 | getSubject KEYWORD2
80 | getSubjectCharset KEYWORD2
81 | getHTMLMessage KEYWORD2
82 | getTextMessage KEYWORD2
83 | getHTMLMessgaeCharset KEYWORD2
84 | getTextMessgaeCharset KEYWORD2
85 | getDate KEYWORD2
86 | getUID KEYWORD2
87 | getNumber KEYWORD2
88 | getMessageID KEYWORD2
89 | getAcceptLanguage KEYWORD2
90 | getContentLanguage KEYWORD2
91 | isFetchMessageFailed KEYWORD2
92 | getFetchMessageFailedReason KEYWORD2
93 | isDownloadAttachmentFailed KEYWORD2
94 | getDownloadAttachmentFailedReason KEYWORD2
95 | isDownloadMessageFailed KEYWORD2
96 | getDownloadMessageFailedReason KEYWORD2
97 | saveHTMLMessage KEYWORD2
98 | saveTextMessage KEYWORD2
99 | getFolderCount KEYWORD2
100 | getFolder KEYWORD2
101 | getFlagCount KEYWORD2
102 | getFlag KEYWORD2
103 | totalMessages KEYWORD2
104 | searchCount KEYWORD2
105 | availableMessages KEYWORD2
106 | getAttachmentCount KEYWORD2
107 | getAttachmentFileName KEYWORD2
108 | getAttachmentName KEYWORD2
109 | getAttachmentFileSize KEYWORD2
110 | getAttachmentCreationDate KEYWORD2
111 | getAttachmentType KEYWORD2
112 | empty KEYWORD2
113 | clearMessageData KEYWORD2
114 |
115 | #########################################
116 | # Methods for SMTP Data object (KEYWORD2)
117 | #########################################
118 |
119 | setSender KEYWORD2
120 | getFromName KEYWORD2
121 | getSenderEmail KEYWORD2
122 | setPriority KEYWORD2
123 | getPriority KEYWORD2
124 | addRecipient KEYWORD2
125 | removeRecipient KEYWORD2
126 | clearRecipient KEYWORD2
127 | getRecipient KEYWORD2
128 | recipientCount KEYWORD2
129 | setSubject KEYWORD2
130 | getSubject KEYWORD2
131 | setMessage KEYWORD2
132 | getMessage KEYWORD2
133 | htmlFormat KEYWORD2
134 | addCC KEYWORD2
135 | removeCC KEYWORD2
136 | clearCC KEYWORD2
137 | getCC KEYWORD2
138 | ccCount KEYWORD2
139 | addBCC KEYWORD2
140 | removeBCC KEYWORD2
141 | clearBCC KEYWORD2
142 | getBCC KEYWORD2
143 | bccCount KEYWORD2
144 | addAttachData KEYWORD2
145 | removeAttachData KEYWORD2
146 | attachDataCount KEYWORD2
147 | addAttachFile KEYWORD2
148 | removeAttachFile KEYWORD2
149 | clearAttachData KEYWORD2
150 | clearAttachFile KEYWORD2
151 | clearAttachment KEYWORD2
152 | attachFileCount KEYWORD2
153 | setSendCallback KEYWORD2
154 |
155 |
156 | ############################################################
157 | # Functions for ReadStatus and SendStatus classes (KEYWORD2)
158 | ############################################################
159 |
160 | SendStatus KEYWORD2
161 | info KEYWORD2
162 | success KEYWORD2
163 | ReadStatus KEYWORD2
164 | status KEYWORD2
165 | startAt KEYWORD2
166 | endAt KEYWORD2
167 | equalTo KEYWORD2
168 | equalTo KEYWORD2
169 |
170 | clockReady KEYWORD3
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/library.properties:
--------------------------------------------------------------------------------
1 | name=ESP32 Mail Client
2 |
3 | version=2.1.1
4 |
5 | author=Mobizt
6 |
7 | maintainer=Mobizt
8 |
9 | sentence=Mail Client Arduino Library for ESP32
10 |
11 | paragraph=This library allows ESP32 to send Email with/without attachment and receive Email with/without attachment download through SMTP and IMAP servers.
12 |
13 | category=Communication
14 |
15 | url=https://github.com/mobizt/ESP32-Mail-Client
16 |
17 | architectures=esp32
18 |
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/media/images/esp32-mail.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asjdf/ESP32CAMmotion_detection/9e519fb6e63d87f2582c1cf37461fde63cc942e2/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/media/images/esp32-mail.jpg
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/media/images/esp32-mail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asjdf/ESP32CAMmotion_detection/9e519fb6e63d87f2582c1cf37461fde63cc942e2/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/media/images/esp32-mail.png
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/src/ESP32MailHTTPClient.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Customized version of ESP32 HTTPClient Library.
3 | * Allow custom header and payload with STARTTLS support
4 | *
5 | * v 1.0.0
6 | *
7 | * The MIT License (MIT)
8 | * Copyright (c) 2019 K. Suwatchai (Mobizt)
9 | *
10 | * HTTPClient Arduino library for ESP32
11 | *
12 | * Copyright (c) 2015 Markus Sattler. All rights reserved.
13 | * This file is part of the HTTPClient for Arduino.
14 | * Port to ESP32 by Evandro Luis Copercini (2017),
15 | * changed fingerprints to CA verification.
16 | *
17 | * This library is free software; you can redistribute it and/or
18 | * modify it under the terms of the GNU Lesser General Public
19 | * License as published by the Free Software Foundation; either
20 | * version 2.1 of the License, or (at your option) any later version.
21 | *
22 | * This library is distributed in the hope that it will be useful,
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 | * Lesser General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU Lesser General Public
28 | * License along with this library; if not, write to the Free Software
29 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 | *
31 | */
32 |
33 | #ifndef HTTP_CLIENT_ESP32EX_H_
34 | #define HTTP_CLIENT_ESP32EX_H_
35 |
36 | #include
37 | #include
38 |
39 | #include
40 | #include "WiFiClientSecureESP32.h"
41 |
42 | class ESP32MailHTTPClient : public HTTPClient
43 | {
44 | public:
45 | ESP32MailHTTPClient();
46 | ~ESP32MailHTTPClient();
47 |
48 | /**
49 | * Initialization of new http connection.
50 | * \param host - Host name without protocols.
51 | * \param port - Server's port.
52 | * \param uri - The URI of resource.
53 | * \param CAcert - The Base64 encode root certificate string
54 | * \return True as default.
55 | * If no certificate string provided, use (const char*)NULL to CAcert param
56 | */
57 | bool begin(const char *host, uint16_t port, const char *uri, const char *CAcert);
58 |
59 | /**
60 | * Check the http connection status.
61 | * \return True if connected.
62 | */
63 | bool connected();
64 |
65 | /**
66 | * Establish http connection if header provided and send it, send payload if provided.
67 | * \param header - The header string (constant chars array).
68 | * \param payload - The payload string (constant chars array), optional.
69 | * \return http status code, Return zero if new http connection and header and/or payload sent
70 | * with no error or no header and payload provided. If obly payload provided, no new http connection was established.
71 | */
72 | int sendRequest(const char *header, const char *payload);
73 |
74 | /**
75 | * Send extra header without making new http connection (if sendRequest has been called)
76 | * \param header - The header string (constant chars array).
77 | * \return True if header sending success.
78 | * Need to call sendRequest with header first.
79 | */
80 | bool sendHeader(const char *header);
81 |
82 | /**
83 | * Get the WiFi client pointer.
84 | * \return WiFi client pointer.
85 | */
86 | WiFiClient *getStreamPtr(void);
87 |
88 | uint16_t tcpTimeout = HTTPCLIENT_DEFAULT_TCP_TIMEOUT;
89 | bool connect(void);
90 | bool connect(bool starttls);
91 | void setDebugCallback(DebugMsgCallback cb);
92 |
93 | protected:
94 | TransportTraitsPtr transportTraits;
95 | std::unique_ptr _client;
96 | DebugMsgCallback _debugCallback = NULL;
97 |
98 | std::string _host = "";
99 | std::string _uri = "";
100 | uint16_t _port = 0;
101 | };
102 |
103 |
104 |
105 | #endif /* ESP32MailHTTPClient_H_ */
106 |
107 |
108 |
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/src/ESP32TimeHelper.h:
--------------------------------------------------------------------------------
1 | /*
2 | * ESP32 Internet Time Helper Arduino Library v 1.0.1
3 | *
4 | * The MIT License (MIT)
5 | * Copyright (c) 2019 K. Suwatchai (Mobizt)
6 | *
7 | *
8 | * Permission is hereby granted, free of charge, to any person returning a copy of
9 | * this software and associated documentation files (the "Software"), to deal in
10 | * the Software without restriction, including without limitation the rights to
11 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12 | * the Software, and to permit persons to whom the Software is furnished to do so,
13 | * subject to the following conditions:
14 | *
15 | * The above copyright notice and this permission notice shall be included in all
16 | * copies or substantial portions of the Software.
17 | *
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 | */
25 |
26 | #ifndef ESP_TIME_HELPER_h
27 | #define ESP_TIME_HELPER_h
28 | #include
29 | #include
30 | #include
31 |
32 | class ESP32TimeHelper
33 | {
34 | public:
35 | ESP32TimeHelper();
36 | bool clockReady = false;
37 | bool setClock(float gmtOffset, float daylightOffset);
38 | uint32_t getUnixTime();
39 | time_t getTimestamp(int year, int mon, int date, int hour, int mins, int sec);
40 | int getYear();
41 | int getMonth();
42 | int getDay();
43 | int getDayOfWeek();
44 | String getDayOfWeekString();
45 | int getHour();
46 | int getMin();
47 | int getSec();
48 | int getNumberOfDayThisYear();
49 | int getTotalDays(int year, int month, int day);
50 | int dayofWeek(int year, int month, int day);
51 | int getCurrentSecond();
52 | uint64_t getCurrentTimestamp();
53 | void getTimeFromSec(int secCount, int &yrs, int &months, int &days, int &hr, int &min, int &sec);
54 |
55 | private:
56 | time_t now;
57 | uint64_t msec_time_diff = 0;
58 | struct tm timeinfo;
59 | float TZ = 0.0;
60 | float DST_MN = 0.0;
61 |
62 | bool setClock();
63 | int totalDays(int y, int m, int d);
64 | const char *dow[20] = {"sunday", "monday", "tuesday", "wednesday", "thurseday", "friday", "saturday"};
65 | };
66 |
67 | #endif
68 |
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/src/RFC2047.cpp:
--------------------------------------------------------------------------------
1 | #include "RFC2047.h"
2 |
3 | RFC2047::RFC2047(){}
4 |
5 |
6 | void RFC2047::rfc2047Decode(char *d, const char *s, size_t dlen){
7 |
8 | const char *p, *q;
9 | size_t n;
10 | int found_encoded = 0;
11 |
12 | dlen--; /* save room for the terminal nul */
13 |
14 | while (*s && dlen > 0)
15 | {
16 | if ((p = strstr (s, "=?")) == NULL ||
17 | (q = strchr (p + 2, '?')) == NULL ||
18 | (q = strchr (q + 1, '?')) == NULL ||
19 | (q = strstr (q + 1, "?=")) == NULL)
20 | {
21 | /* no encoded words */
22 | if (d != s)
23 | strfcpy (d, s, dlen + 1);
24 | return;
25 | }
26 |
27 | if (p != s)
28 | {
29 | n = (size_t) (p - s);
30 | /* ignore spaces between encoded words */
31 | if (!found_encoded || strspn (s, " \t\r\n") != n)
32 | {
33 | if (n > dlen)
34 | n = dlen;
35 | if (d != s)
36 | memcpy (d, s, n);
37 | d += n;
38 | dlen -= n;
39 | }
40 | }
41 |
42 | rfc2047DecodeWord (d, p, dlen);
43 | found_encoded = 1;
44 | s = q + 2;
45 | n = strlen (d);
46 | dlen -= n;
47 | d += n;
48 | }
49 | *d = 0;
50 |
51 | }
52 |
53 | void RFC2047::rfc2047DecodeWord(char *d, const char *s, size_t dlen){
54 |
55 | char *p = safe_strdup (s);
56 | char *pp = p;
57 | char *pd = d;
58 | size_t len = dlen;
59 | int enc = 0, filter = 0, count = 0, c1, c2, c3, c4;
60 |
61 | while ((pp = strtok (pp, "?")) != NULL)
62 | {
63 | count++;
64 | switch (count)
65 | {
66 | case 2:
67 | if (strcasecmp (pp, Charset) != 0)
68 | {
69 | filter = 1;
70 | }
71 | break;
72 | case 3:
73 | if (toupper (*pp) == 'Q')
74 | enc = ENCQUOTEDPRINTABLE;
75 | else if (toupper (*pp) == 'B')
76 | enc = ENCBASE64;
77 | else
78 | return;
79 | break;
80 | case 4:
81 | if (enc == ENCQUOTEDPRINTABLE)
82 | {
83 | while (*pp && len > 0)
84 | {
85 | if (*pp == '_')
86 | {
87 | *pd++ = ' ';
88 | len--;
89 | }
90 | else if (*pp == '=')
91 | {
92 | *pd++ = (hexval(pp[1]) << 4) | hexval(pp[2]);
93 | len--;
94 | pp += 2;
95 | }
96 | else
97 | {
98 | *pd++ = *pp;
99 | len--;
100 | }
101 | pp++;
102 | }
103 | *pd = 0;
104 | }
105 | else if (enc == ENCBASE64)
106 | {
107 | while (*pp && len > 0)
108 | {
109 | c1 = base64val(pp[0]);
110 | c2 = base64val(pp[1]);
111 | *pd++ = (c1 << 2) | ((c2 >> 4) & 0x3);
112 | if (--len == 0) break;
113 |
114 | if (pp[2] == '=') break;
115 |
116 | c3 = base64val(pp[2]);
117 | *pd++ = ((c2 & 0xf) << 4) | ((c3 >> 2) & 0xf);
118 | if (--len == 0)
119 | break;
120 |
121 | if (pp[3] == '=')
122 | break;
123 |
124 | c4 = base64val(pp[3]);
125 | *pd++ = ((c3 & 0x3) << 6) | c4;
126 | if (--len == 0)
127 | break;
128 |
129 | pp += 4;
130 | }
131 | *pd = 0;
132 | }
133 | break;
134 | }
135 | pp = 0;
136 | }
137 | safe_free (&p);
138 | if (filter)
139 | {
140 |
141 | pd = d;
142 | while (*pd)
143 | {
144 | if (!IsPrint (*pd))
145 | *pd = '?';
146 | pd++;
147 | }
148 | }
149 | return;
150 | }
151 |
152 |
153 | void *RFC2047::safe_calloc (size_t nmemb, size_t size)
154 | {
155 | void *p;
156 |
157 | if (!nmemb || !size)
158 | return NULL;
159 | if (!(p = calloc (nmemb, size)))
160 | {
161 | //out of memory
162 | return NULL;
163 | }
164 | return p;
165 | }
166 |
167 | void *RFC2047::safe_malloc (unsigned int siz)
168 | {
169 | void *p;
170 |
171 | if (siz == 0)
172 | return 0;
173 | if ((p = (void *) malloc (siz)) == 0)
174 | {
175 | //out of memory
176 | return NULL;
177 | }
178 | return (p);
179 | }
180 |
181 | void RFC2047::safe_realloc (void **p, size_t siz)
182 | {
183 | void *r;
184 |
185 | if (siz == 0)
186 | {
187 | if (*p)
188 | {
189 | free (*p);
190 | *p = NULL;
191 | }
192 | return;
193 | }
194 |
195 | if (*p)
196 | r = (void *) realloc (*p, siz);
197 | else
198 | {
199 | r = (void *) malloc (siz);
200 | }
201 |
202 | if (!r)
203 | {
204 | //out of memory
205 | return;
206 | }
207 |
208 | *p = r;
209 | }
210 |
211 | void RFC2047::safe_free (void *ptr)
212 | {
213 | void **p = (void **)ptr;
214 | if (*p)
215 | {
216 | free (*p);
217 | *p = 0;
218 | }
219 | }
220 |
221 | char *RFC2047::safe_strdup (const char *s)
222 | {
223 | char *p;
224 | size_t l;
225 |
226 | if (!s || !*s) return 0;
227 | l = strlen (s) + 1;
228 | p = (char *)safe_malloc (l);
229 | memcpy (p, s, l);
230 | return (p);
231 | }
232 |
233 |
234 |
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP32_Mail_Client/src/RFC2047.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef RFC2047_H
3 | #define RFC2047_H
4 |
5 | #include
6 |
7 |
8 | #define strfcpy(A,B,C) strncpy(A,B,C), *(A+(C)-1)=0
9 |
10 | enum
11 | {
12 | ENCOTHER,
13 | ENC7BIT,
14 | ENC8BIT,
15 | ENCQUOTEDPRINTABLE,
16 | ENCBASE64,
17 | ENCBINARY
18 | };
19 |
20 | __attribute__((used)) static const char *Charset = "utf-8";
21 |
22 | __attribute__((used)) static int Index_hex[128] = {
23 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
24 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
25 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
26 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
27 | -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
28 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
29 | -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
30 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
31 |
32 | __attribute__((used)) static int Index_64[128] = {
33 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
34 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
35 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
36 | 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
37 | -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
38 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
39 | -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
40 | 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1};
41 |
42 | #define IsPrint(c) (isprint((unsigned char)(c)) || \
43 | ((unsigned char)(c) >= 0xa0))
44 |
45 | #define hexval(c) Index_hex[(unsigned int)(c)]
46 | #define base64val(c) Index_64[(unsigned int)(c)]
47 |
48 | class RFC2047{
49 |
50 | public:
51 | RFC2047();
52 | void rfc2047Decode(char *d, const char *s, size_t dlen);
53 |
54 |
55 | private:
56 | void rfc2047DecodeWord(char *d, const char *s, size_t dlen);
57 | void *safe_calloc (size_t nmemb, size_t size);
58 | void *safe_malloc (unsigned int siz);
59 | void safe_realloc (void **p, size_t siz);
60 | void safe_free (void *ptr);
61 | char *safe_strdup (const char *s);
62 |
63 |
64 | };
65 |
66 | #endif
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Compiled Object files
5 | *.slo
6 | *.lo
7 | *.o
8 | *.obj
9 |
10 | # Precompiled Headers
11 | *.gch
12 | *.pch
13 |
14 | # Compiled Dynamic libraries
15 | *.so
16 | *.dylib
17 | *.dll
18 |
19 | # Fortran module files
20 | *.mod
21 | *.smod
22 |
23 | # Compiled Static libraries
24 | *.lai
25 | *.la
26 | *.a
27 | *.lib
28 |
29 | # Executables
30 | *.exe
31 | *.out
32 | *.app
33 |
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contributing to ESP_WiFiManager
2 |
3 | ### Reporting Bugs
4 |
5 | Please report bugs in ESP_WiFiManager if you find them.
6 |
7 | However, before reporting a bug please check through the following:
8 |
9 | * [Existing Open Issues](https://github.com/khoih-prog/ESP_WiFiManager/issues) - someone might have already encountered this.
10 |
11 | If you don't find anything, please [open a new issue](https://github.com/khoih-prog/ESP_WiFiManager/issues/new).
12 |
13 | ### How to submit a bug report
14 |
15 | Please ensure to specify the following:
16 |
17 | * Arduino IDE version (e.g. 1.8.11) or Platform.io version
18 | * `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v2.6.3 or ESP32 v1.0.4)
19 | * Contextual information (e.g. what you were trying to achieve)
20 | * Simplest possible steps to reproduce
21 | * Anything that might be relevant in your opinion, such as:
22 | * Operating system (Windows, Ubuntu, etc.) and the output of `uname -a`
23 | * Network configuration
24 |
25 |
26 | ### Example
27 |
28 | ```
29 | Arduino IDE version: 1.8.11
30 | ESP8266 Core Version 2.6.3
31 | OS: Ubuntu 16.04 LTS
32 | Linux Inspiron 4.4.0-170-generic #199-Ubuntu SMP Thu Nov 14 01:45:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
33 |
34 | Context:
35 | I encountered an endless loop while trying to connect to Local WiFi.
36 |
37 | Steps to reproduce:
38 | 1. ...
39 | 2. ...
40 | 3. ...
41 | 4. ...
42 | ```
43 | ### Sending Feature Requests
44 |
45 | Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful.
46 |
47 | There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/ESP_WiFiManager/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
48 |
49 | ### Sending Pull Requests
50 |
51 | Pull Requests with changes and fixes are also welcome!
52 |
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Configuration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asjdf/ESP32CAMmotion_detection/9e519fb6e63d87f2582c1cf37461fde63cc942e2/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Configuration.png
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asjdf/ESP32CAMmotion_detection/9e519fb6e63d87f2582c1cf37461fde63cc942e2/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Info.png
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Info_Short.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asjdf/ESP32CAMmotion_detection/9e519fb6e63d87f2582c1cf37461fde63cc942e2/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Info_Short.png
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Info_Short_1-0-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asjdf/ESP32CAMmotion_detection/9e519fb6e63d87f2582c1cf37461fde63cc942e2/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Info_Short_1-0-5.png
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asjdf/ESP32CAMmotion_detection/9e519fb6e63d87f2582c1cf37461fde63cc942e2/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Main.png
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Main_1-0-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asjdf/ESP32CAMmotion_detection/9e519fb6e63d87f2582c1cf37461fde63cc942e2/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/Images/Main_1-0-5.png
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Khoi Hoang
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/examples/ConfigOnSwitch/README.md:
--------------------------------------------------------------------------------
1 | # The Config On Switch Example
2 | In this example we initiate the configuration portal to connect an ESP8266 to WiFi by pushing a button. The example requires this version of WiFi Manager. It will not work with the tzapu version.
3 |
4 | ## Why Have A Button To Initiate Configuration?
5 | Once the ESP device contains network credentials it will always try to connect to that network in the background and succeed whenever that network becomes visible. The application continues to function and because WiFi networks tend to be flaky only a human has the knowledge of whether a new network is required or it is better to wait for the network to become visible again. Therefore, providing a configuration portal must be human initiated and requiring a button push is a good way to get human input.
6 |
7 | The alternative of automatically going into configuration mode every time a WiFi network becomes invisible will cause the application to stop and the device will sit in configuration mode forever. This is undesirable when a network is temporarily unavailable.
8 |
9 | ## Issues With Automatically Going Into Configuration Mode
10 | Providing a timeout on configuration mode is one way to get the application running again when a network becomes temporarily unavailable and no one is around to reboot. However, the application will still not function while waiting for the timeout and the device is vulnerable to sabotage when in config mode. With a push button it will also be vulnerable to sabotage whenever the saboteur has physical access but then it is vulnerable in other ways as well. An assumption that saboteurs will not have physical access to the device is sufficient for most applications.
11 |
12 |
13 |
--------------------------------------------------------------------------------
/References/[copy]CameraWifiMotion-master/CameraWifiMotion-master/Libraries used/Libraries used/ESP_WiFiManager-master/examples/ESP_FSWebServer/README.md:
--------------------------------------------------------------------------------
1 | # ESP_FSWebServer Example
2 |
3 | ## First, how Config Portal works?
4 | In `Configuration Portal Mode`, it starts an access point called `ESP_xxxxxx`. Connect to it using the configurable password you can define in the code. For example, `your_password` (see examples):
5 |
6 | ```cpp
7 | // SSID and PW for Config Portal
8 | String ssid = "ESP_" + String(ESP_getChipId(), HEX);
9 | const char* password = "your_password";
10 | ```
11 | After you connected, please, go to http://192.168.4.1, you'll see this `Main` page:
12 |
13 |
14 |
15 |
16 |
17 | Select `Information` to enter the Info page where the board info will be shown (long page)
18 |
19 |
20 |
21 |
22 |
23 | or short page (default)
24 |
25 |
26 |
27 |
28 |
29 | Select `Configuration` to enter this page where you can select an AP and specify its WiFi Credentials
30 |
31 |
32 |
33 |
34 |
35 | Enter your credentials, then click `Save`. The WiFi Credentials will be saved and the board reboots to connect to the selected WiFi AP.
36 |
37 | If you're already connected to a listed WiFi AP and don't want to change anything, just select `Exit Portal` from the `Main` page to reboot the board and connect to the previously-stored AP. The WiFi Credentials are still intact.
38 |
39 |
40 | ## How to use this ESP_FSWebServer example?
41 |
42 | This shows you how to use this example in Ubuntu (but you can use similar commands in other OSes)
43 |
44 | 1. For example, you already downloaded from (https://github.com/khoih-prog/ESP_WiFiManager/tree/master/examples/ESP_FSWebServer/data) to a local folder, e.g.,
45 |
46 | ~/Arduino/libraries/ESP_WiFiManager-master/examples/ESP_FSWebServer/data
47 |
48 | 1. Upload the contents of that `data folder` with MkSPIFFS Tool ("ESP8266 Sketch Data Upload" in Tools menu in Arduino IDE)
49 | 2. or upload the contents of a folder by running the following commands:
50 | - Ubuntu$ cd ~/Arduino/libraries/ESP_WiFiManager-master/examples/ESP_FSWebServer/data
51 | - Ubuntu$ for file in \`\ls -A1\`; do curl -F "file=@$PWD/$file" esp8266fs.local/edit; done
52 | 3. Access the sample web page at http://esp8266fs.local
53 |
54 |
55 |
56 |
57 |
58 | 4. Edit / Delete / Download any file in the the folder by going to http://esp8266fs.local/edit
59 |
60 |