Minor adjustments
This commit is contained in:
@@ -64,7 +64,7 @@ void connectToWifi() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(connectTries >= 20) {
|
if(connectTries >= 20) {
|
||||||
Serial.println("Unable to connect to " + WiFi.SSID() + ". ESP32 going to deep sleep.");
|
Serial.println("WIFI: Unable to connect to " + WiFi.SSID() + ". ESP32 going to deep sleep.");
|
||||||
esp_wifi_stop();
|
esp_wifi_stop();
|
||||||
esp_bt_controller_disable();
|
esp_bt_controller_disable();
|
||||||
esp_deep_sleep_start();
|
esp_deep_sleep_start();
|
||||||
@@ -72,7 +72,7 @@ void connectToWifi() {
|
|||||||
connectTries++;
|
connectTries++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial.println("WIFI: Connected to network");
|
Serial.println("WIFI: Connected to network: " + WiFi.SSID());
|
||||||
Serial.println(WiFi.localIP());
|
Serial.println(WiFi.localIP());
|
||||||
Serial.println(WiFi.macAddress());
|
Serial.println(WiFi.macAddress());
|
||||||
}
|
}
|
||||||
@@ -111,8 +111,8 @@ String getShowerthought() {
|
|||||||
// Connect to reddit.com and fetch the showerthought data using the web client
|
// Connect to reddit.com and fetch the showerthought data using the web client
|
||||||
Serial.println("Fetching Showerthougt");
|
Serial.println("Fetching Showerthougt");
|
||||||
if(!client.connect(host, port)) {
|
if(!client.connect(host, port)) {
|
||||||
Serial.println("connection 1 failed!");
|
Serial.println("SECURE CLIENT: Connection 1 failed!");
|
||||||
return "Impossible to connect to Reddit";
|
return "Unable to connect to Reddit";
|
||||||
}
|
}
|
||||||
String url = "/r/Showerthoughts/random.json?sort=hot&limit=1&t=day";
|
String url = "/r/Showerthoughts/random.json?sort=hot&limit=1&t=day";
|
||||||
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
|
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
|
||||||
@@ -122,7 +122,7 @@ String getShowerthought() {
|
|||||||
unsigned long timeout = millis();
|
unsigned long timeout = millis();
|
||||||
while (client.available() == 0) {
|
while (client.available() == 0) {
|
||||||
if (millis() - timeout > 5000) {
|
if (millis() - timeout > 5000) {
|
||||||
Serial.println(">>> Client Timeout !");
|
Serial.println("SECURE CLIENT: Client Timeout!");
|
||||||
client.stop();
|
client.stop();
|
||||||
return "Reddit did not respond in time";
|
return "Reddit did not respond in time";
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,7 @@ String getShowerthought() {
|
|||||||
while(client.connected()) {
|
while(client.connected()) {
|
||||||
String line = client.readStringUntil('\n');
|
String line = client.readStringUntil('\n');
|
||||||
if (line == "\r") {
|
if (line == "\r") {
|
||||||
Serial.println("headers received");
|
Serial.println("DEBUG: Headers received");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
This code uses an ESP32 to fetch latest posts from [/r/showerthoughts](https://www.reddit.com/r/Showerthoughts/) and displays them on a Waveshare e-paper display. Afterwards it puts the ESP to deep sleep mode. All components run on battery power without annoying cables.
|
This code uses an ESP32 to fetch latest posts from [/r/showerthoughts](https://www.reddit.com/r/Showerthoughts/) and displays them on a Waveshare e-paper display. Afterwards it puts the ESP to deep sleep mode. All components run on battery power without annoying cables.
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
#### Used Hardware
|
#### Used Hardware
|
||||||
+ [Waveshare 7.5" e-paper display](https://www.waveshare.com/7.5inch-e-paper.htm)
|
+ [Waveshare 7.5" e-paper display](https://www.waveshare.com/7.5inch-e-paper.htm)
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
// WIFI
|
|
||||||
const char* ssid = "";
|
|
||||||
const char* password = "";
|
|
||||||
|
|
||||||
// REDDIT
|
|
||||||
const char* host = "www.reddit.com";
|
|
||||||
const int port = 443;
|
|
||||||
const char fingerprint[] = "77:C7:6C:11:70:33:25:EE:F0:6C:3B:E3:0F:15:C2:CB:2A:73:7A:56:F3:40:FD:76:29:1E:06:CB:0D:45:48:2C";
|
|
||||||
BIN
img/original_logo.jpg
Normal file
BIN
img/original_logo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
2
logo.h
2
logo.h
@@ -11,7 +11,7 @@
|
|||||||
// * Output: Arduino Code
|
// * Output: Arduino Code
|
||||||
// * Draw Mode: Horizontal - 1 bit per pixel
|
// * Draw Mode: Horizontal - 1 bit per pixel
|
||||||
|
|
||||||
const unsigned char logo [] PROGMEM = {
|
const unsigned char logo_225x225 [] PROGMEM = {
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
|||||||
Reference in New Issue
Block a user