Skip to content

Commit

Permalink
Merge pull request #242 from Qrome/3.0
Browse files Browse the repository at this point in the history
3.0
  • Loading branch information
Qrome authored May 9, 2022
2 parents c0d3261 + f3abaee commit bdac023
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 296 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Marquee Scroller (Clock, Weather, News, and More)

## NOTICE
The latest version of Marquee Scroller 3.0 works with **ESP8266 Core 3.0.2** -- if you are upgrading from Marquee Scroller 2.X version this may require you to enter in all your API Keys and settings. Always meake sure you have coppied all your API keys somewhere before updating. The ESP8266 Core 3.0.2 uses the newer FS (file system) that may require a fresh start on the configuration.
Make sure you update to the latest version of WifiManager library (link below).
* Removed Bitcoin features in 3.0

## Features include:
* Accurate Clock refresh off Internet Time Servers
* Local Weather and conditions (refreshed every 10 - 30 minutes)
* News Headlines from all the major sources
* Configured through Web Interface
* Display 3D print progress from your OctoPrint Server
* Option to display Bitcoin current value
* Option to display Pi-hole status and graph (each pixel accross is 10 minutes)
* Basic Authorization around Configuration web interface
* Support for OTA (loading firmware over WiFi)
Expand All @@ -19,7 +23,7 @@
* Build Video by Chris Riley: https://youtu.be/KqBiqJT9_lE

## Required Parts:
* Wemos D1 Mini: https://amzn.to/2qLyKJd
* Wemos D1 Mini: https://amzn.to/3tMl81U
* Dot Matrix Module: https://amzn.to/2HtnQlD

Note: Using the links provided here help to support these types of projects. Thank you for the support.
Expand All @@ -38,27 +42,23 @@ Original Single Panel version: https://www.thingiverse.com/thing:2867294
Double Wide LED version: https://www.thingiverse.com/thing:2989552

## Upgrading from version 2.5 or Higher
Version 2.5 introduced the ability to upgrade pre-compiled firmware from a binary file. In version 2.6 and on you should find binary files that can be uploaded to your marque scrolling clock via the web interface. From the main menu in the web interface select "Firmware Update" and follow the prompts.
* **marquee.ino.d1_mini_2.18.bin** - compiled for Wemos D1 Mini and standard 4x1 LED (default)
* **marquee.ino.d1_mini_wide_2.18.bin** - compiled for Wemos D1 Mini and double wide 8x1 LED display
In version 2.6 and higher, the binary files that can be uploaded to your marque scrolling clock via the web interface. From the main menu in the web interface select "Firmware Update" and follow the prompts.
* **marquee.ino.d1_mini_3.0.bin** - compiled for Wemos D1 Mini and standard 4x1 LED (default)
* **marquee.ino.d1_mini_wide_3.0.bin** - compiled for Wemos D1 Mini and double wide 8x1 LED display

## Compiling and Loading to Wemos D1
It is recommended to use Arduino IDE. You will need to configure Arduino IDE to work with the Wemos board and USB port and installed the required USB drivers etc.
* USB CH340G drivers: https://sparks.gogo.co.nz/ch340.html
* Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas. This will add support for the Wemos D1 Mini to Arduino IDE.
* Open Boards Manager from Tools > Board menu and install esp8266 Core platform version **2.5.2**
* Select Board: "LOLIN(WEMOS) D1 R2 & mini"
* Set Flash Size to 1M SPIFFS -- **this project requires SPIFFS for saving and reading configuration settings.**
* Open Boards Manager from Tools > Board menu and install esp8266 Core platform version Latest **3.0.2**
* Select Board: "ESP8266 Boards (3.0.2)" --> "LOLIN(WEMOS) D1 R2 & mini"
* Set Flash Size: 4MB (FS:1MB OTA:~1019KB) -- **this project requires FS for saving and reading configuration settings.**
* Select the **Port** from the tools menu.

## Loading Supporting Library Files in Arduino
Use the Arduino guide for details on how to installing and manage libraries https://www.arduino.cc/en/Guide/Libraries
**Packages** -- the following packages and libraries are used (download and install):
<ESP8266WiFi.h>
<ESP8266WebServer.h>
<WiFiManager.h> --> https://github.com/tzapu/WiFiManager
"FS.h"
<SPI.h>
<WiFiManager.h> --> https://github.com/tzapu/WiFiManager (latest)
<TimeLib.h> --> https://github.com/PaulStoffregen/Time
<Adafruit_GFX.h> --> https://github.com/adafruit/Adafruit-GFX-Library
<Max72xxPanel.h> --> https://github.com/markruys/arduino-Max72xxPanel
Expand All @@ -67,12 +67,12 @@ Use the Arduino guide for details on how to installing and manage libraries http
Note ArduinoJson (version 5.13.1) is now included as a library file in version 2.7 and later.

## Initial Configuration
Starting with version 2.0 editing the **Settings.h** file is optional. All API Keys are now managed in the Web Interface except for the GeoNames Key. It is not required to edit the Settings.h file before loading and running the code.
Editing the **Settings.h** file is totally optional and not required. All API Keys are now managed in the Web Interface. It is not required to edit the Settings.h file before loading and running the code.
* Open Weather Map free API key: http://openweathermap.org/ -- this is used to get weather data and the latitude and longitude for the current time zone. Weather API key is required for correct time.
* TimeZoneDB free registration for API key: https://timezonedb.com/register -- this is used for setting the time and getting the correct time zone as well as managing time changes due to Day Light Savings time by regions. This key is set and managed only through the web interface and added in version 2.10 of Marquee Scroller. TimeZoneDB key is required for correct time display.
* News API key (free): https://newsapi.org/ -- Optional if you want to get current news headlines.
* Your OctoPrint API Key -- optional if you use the OctoPrint status.
* Version 2.0 supports Chained 4x1 LED displays -- configure in the Settings.h file.
* Version 2.0 supports Chained 4x1 LED displays -- configure up to 16x1 in the Settings.h file.

NOTE: The settings in the Settings.h are the default settings for the first loading. After loading you will manage changes to the settings via the Web Interface. If you want to change settings again in the settings.h, you will need to erase the file system on the Wemos or use the “Reset Settings” option in the Web Interface.

Expand Down
Binary file removed marquee.ino.d1_mini_2.19.bin
Binary file not shown.
Binary file added marquee.ino.d1_mini_3.0.bin
Binary file not shown.
Binary file removed marquee.ino.d1_mini_wide_2.19.bin
Binary file not shown.
Binary file added marquee.ino.d1_mini_wide_3.0.bin
Binary file not shown.
130 changes: 0 additions & 130 deletions marquee/BitcoinApiClient.cpp

This file was deleted.

54 changes: 0 additions & 54 deletions marquee/BitcoinApiClient.h

This file was deleted.

8 changes: 7 additions & 1 deletion marquee/NewsApiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,19 @@ void NewsApiClient::updateNewsClient(String ApiKey, String NewsSource) {
void NewsApiClient::updateNews() {
JsonStreamingParser parser;
parser.setListener(this);
WiFiClient wifiClient;
HTTPClient http;

if (myApiKey == "") {
Serial.println("Please provide an API key for the News.");
return;
}

String apiGetData = "http://" + String(servername) + "/v2/top-headlines?sources=" + mySource + "&apiKey=" + myApiKey;

Serial.println("Getting News Data");
Serial.println(apiGetData);
http.begin(apiGetData);
http.begin(wifiClient, apiGetData);
int httpCode = http.GET();

if (httpCode > 0) { // checks for connection
Expand Down
1 change: 1 addition & 0 deletions marquee/NewsApiClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SOFTWARE.
#pragma once
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>
#include <JsonListener.h>
#include <JsonStreamingParser.h> // --> https://github.com/squix78/json-streaming-parser

Expand Down
5 changes: 5 additions & 0 deletions marquee/OpenWeatherMapClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ void OpenWeatherMapClient::updateWeatherApiKey(String ApiKey) {

void OpenWeatherMapClient::updateWeather() {
WiFiClient weatherClient;
if (myApiKey == "") {
weathers[0].error = "Please provide an API key for weather.";
Serial.println(weathers[0].error);
return;
}
String apiGetData = "GET /data/2.5/group?id=" + myCityIDs + "&units=" + units + "&cnt=1&APPID=" + myApiKey + " HTTP/1.1";

Serial.println("Getting Weather Data");
Expand Down
10 changes: 6 additions & 4 deletions marquee/PiHoleClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ PiHoleClient::PiHoleClient() {

void PiHoleClient::getPiHoleData(String server, int port) {

WiFiClient wifiClient;
errorMessage = "";
String response = "";

String apiGetData = "http://" + server + ":" + String(port) + "/admin/api.php?summary";
Serial.println("Sending: " + apiGetData);
HTTPClient http; //Object of class HTTPClient
http.begin(apiGetData);// get the result
http.begin(wifiClient, apiGetData);// get the result
int httpCode = http.GET();
//Check the returning code
if (httpCode > 0) {
Expand Down Expand Up @@ -89,6 +90,7 @@ void PiHoleClient::getPiHoleData(String server, int port) {
}

void PiHoleClient::getTopClientsBlocked(String server, int port, String apiKey) {
WiFiClient wifiClient;
errorMessage = "";
resetClientsBlocked();

Expand All @@ -102,7 +104,7 @@ void PiHoleClient::getTopClientsBlocked(String server, int port, String apiKey)
String apiGetData = "http://" + server + ":" + String(port) + "/admin/api.php?topClientsBlocked=3&auth=" + apiKey;
Serial.println("Sending: " + apiGetData);
HTTPClient http; //Object of class HTTPClient
http.begin(apiGetData);// get the result
http.begin(wifiClient, apiGetData);// get the result
int httpCode = http.GET();
//Check the returning code
if (httpCode > 0) {
Expand Down Expand Up @@ -145,14 +147,14 @@ void PiHoleClient::getTopClientsBlocked(String server, int port, String apiKey)
}

void PiHoleClient::getGraphData(String server, int port) {

WiFiClient wifiClient;
HTTPClient http;

String apiGetData = "http://" + server + ":" + String(port) + "/admin/api.php?overTimeData10mins";
resetBlockedGraphData();
Serial.println("Getting Pi-Hole Graph Data");
Serial.println(apiGetData);
http.begin(apiGetData);
http.begin(wifiClient, apiGetData);
int httpCode = http.GET();

String result = "";
Expand Down
1 change: 1 addition & 0 deletions marquee/PiHoleClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SOFTWARE.
#pragma once
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>
#include "libs/ArduinoJson/ArduinoJson.h"

class PiHoleClient {
Expand Down
4 changes: 0 additions & 4 deletions marquee/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ SOFTWARE.
#include "TimeDB.h"
#include "NewsApiClient.h"
#include "OctoPrintClient.h"
#include "BitcoinApiClient.h"
#include "PiHoleClient.h"

//******************************
Expand Down Expand Up @@ -107,9 +106,6 @@ int OctoPrintPort = 80; // the port you are running your OctoPrint server
String OctoAuthUser = ""; // only used if you have haproxy or basic athentintication turned on (not default)
String OctoAuthPass = ""; // only used with haproxy or basic auth (only needed if you must authenticate)

// Bitcoin Client - NONE or empty is off
String BitcoinCurrencyCode = "NONE"; // Change to USD, GBD, EUR, or NONE -- this can be managed in the Web Interface

// Pi-hole Client -- monitor basic stats from your Pi-hole server (see http://pi-hole.net)
boolean USE_PIHOLE = false; // Set true to display your Pi-hole details
String PiHoleServer = ""; // IP or Address only (DO NOT include http://)
Expand Down
Loading

0 comments on commit bdac023

Please sign in to comment.