Skip to content

Commit c65aff2

Browse files
committed
Removing token and ssid
1 parent 5678a70 commit c65aff2

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

examples/ESP8266/ImageFromSD/ImageFromSD.ino

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515

1616

1717
// Initialize Wifi connection to the router
18-
char ssid[] = "Mikrotik"; // your network SSID (name)
19-
char password[] = "carolinebrian"; // your network key
20-
18+
char ssid[] = "xxxxxxxxxxxxxxxxxxxxxx"; // your network SSID (name)
19+
char password[] = "yyyyyyyy"; // your network key
2120

2221

2322
// Initialize Telegram BOT
24-
#define BOTtoken "245123272:AAF0si333T4uO9b8soU7sC1nNy2ksmEdqFU" //token of test2
23+
#define BOTtoken "XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" // your Bot Token (Get from Botfather)
2524

2625
WiFiClientSecure client;
2726
UniversalTelegramBot bot(BOTtoken, client);
@@ -63,7 +62,6 @@ void setup() {
6362
IPAddress ip = WiFi.localIP();
6463
Serial.println(ip);
6564

66-
//ESP.wdtEnable(15000000); // make the watch dog timeout longer
6765

6866
}
6967

@@ -77,7 +75,7 @@ void loop() {
7775
DynamicJsonBuffer jsonBuffer;
7876
JsonObject& payload = jsonBuffer.createObject();
7977
payload["chat_id"] = bot.messages[0].chat_id;
80-
78+
8179
File myFile = SD.open("box.jpg");
8280
if (myFile) {
8381
Serial.println("box.jpg:");

src/UniversalTelegramBot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ String UniversalTelegramBot::sendImageFromFileToTelegram(File* file, String chat
130130
client->print("Host:"); client->println(HOST);
131131
client->println("User-Agent: arduino/1.0");
132132
client->println("Accept: */*");
133-
client->println("Expect: 100-continue");
134133
// JSON content type
135134
//client->print("Content-Length:"); client->println(file->size() + 225);
136135
//175753396
137136
Serial.println("Content-Length: " + String(file->size() + 317 + chat_id.length()));
138137
Serial.println("File-Length: " + String(file->size()));
139138
client->print("Content-Length: "); client->println(file->size() + 317 + chat_id.length());
139+
client->println("Expect: 100-continue");
140140
client->println("Content-Type: multipart/form-data, boundary=boundary=------------------------fa174948e0da42aa");
141141
client->println(); //
142142
delay(500);

0 commit comments

Comments
 (0)