Skip to content

Commit e229752

Browse files
committed
config page rework: regroup items, unify layout with CSS, Add wide clock formats (now 8), ...
Add display width configurability (will restart ESP to effectuate)
1 parent 9364fb5 commit e229752

File tree

5 files changed

+382
-272
lines changed

5 files changed

+382
-272
lines changed

TODO.txt

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ TODO items
1919
4.1 Add MQTT server username and password authentication and configuration
2020
=> DONE v3.1.23
2121
4.2 Add MQTT control of display brightness, display on/off,
22-
4.3 publish some weather info,
23-
4.4 pub statistical data,
22+
4.3 publish some weather info,
23+
4.4 pub statistical data,
2424
4.5 pub debug help, like free heap, max allocatable block; to monitor memory fragmentation and memory leaks
2525
5. Compile under PlatformIO / PIOarduino in VScode, perhaps saying goodbye to Arduino IDE (PIO provides control over used library versions, which is near impossible with Arduino IDE for different projects)
2626
=> Done, Arduino IDE still supported
@@ -39,39 +39,51 @@ TODO items
3939
may be provide PR's to Original repo, though the changes might be too large to be acceptable/merge-able
4040
=> ongoing
4141
11. make it compile and run on ESP32 variants
42-
=> future (though it shouldnt be that hard, been there done that...
42+
=> future (though it shouldnt be that hard, been there done that...) For me this is 'easy' reuse of some older HW.
4343
12. Adaptive brightness option; add LDR on ADC input and heavily filter for slow changes
4444
13. make it possible to show alternate display (temperature) statically (without scrolling), alternating with time, like 10s temperature, 50s time
4545
=> DONE v1.3.19 (disable all display options will leave temperature, which is statically shown for 10s, which is quite long)
4646
13.1 make display functions showing time, scrolling message, static temperature display re-entrant from loop,
4747
e.g. call scroll message for every pixel shift, call show time for every 1/2 second to blink center colon when enabled, etc
4848
This allows the webserver and OTA to be serviced within the loop, iso at 3-4 places, and should increase web service responsiveness.
49-
14. Change from OWM city-ID to city/[state/]country or lat/lon coordinates or allow them all for maximum flexibility.
49+
14. Change from OWM city-ID to city/[state/]country or lat/lon coordinates or allow them all for maximum flexibility.
5050
The OWM geocoding-api will translate to lat/lon coordinates for weather requests.
5151
15. Check which font type/file is used.
52-
16. Add slider checkbox (see w3schools) (instead of oldfashioned checkboxes) to mainpage header for autorefresh and darkmode
52+
16. Add slider checkbox (see w3schools) (instead of oldfashioned checkboxes) to mainpage header for autorefresh and darkmode
5353
16.1 How to preserve these settings in browser? cookie?
5454
17. Enhance display off quiet period with options like {display off, dimmed, dimmed time + temp, dimmed only time}. Should we configure dimmed level as well?
5555
18. Add local temperature sensor and show inside temperature. Support only a few I2C sensors. Caveat: here we might get requests like can you support this or that sensor....
56-
19. add Config option: "Flash System LED on Service Calls"; the blue onboard LED is quite bright, shining through the case and can be annoying.
56+
19. Add Config option: "Flash System LED on Service Calls"; the blue onboard LED is quite bright, shining through the case and can be annoying.
5757
20. config page rework; In general, create more logical order, it is a mess now.
58-
group 'Display' items name 'LED display',
59-
move 'use metric' to bottom (point 9!),
60-
rename 'Minutes Between Refresh Data' to 'Clock Sync / Weather Refresh (minutes)'
61-
and change NTP sync accordingly,
62-
=> NTP sync fixed in v3.1.22
63-
move 'Minutes Between Scrolling Data' to display items and rename to 'Display interval',
64-
rename 'Flash : in the time' to 'Blink time colon',
65-
move 'marquee message' setting to 3rd line and name 'Scroll message',
66-
'Start time'/'End time' group in 'Quiet period' with start and end reversed + point 17,
67-
58+
20.1 group 'Display' items name 'LED display',
59+
==> Done v3.1.25 All config page items are now re-grouped
60+
20.2 move 'use metric' to bottom (point 9!),
61+
-> relocated to Data Display Settings group
62+
20.3 rename 'Minutes Between Refresh Data' to 'Clock Sync / Weather Refresh (minutes)'
63+
and change NTP sync accordingly,
64+
=> NTP sync fixed in v3.1.22
65+
==> DONE v3.1.25; now called 'Data refresh interval'
66+
20.4 move 'Minutes Between Scrolling Data' to display items and rename to 'Display interval',
67+
==> DONE v3.1.25; now called 'Display Scrolling Data interval'
68+
20.5 rename 'Flash : in the time' to 'Blink time colon',
69+
==> Done v3.1.25
70+
20.6 move 'marquee message' setting to 3rd line and name 'Scroll message',
71+
==> Done v3.1.25
72+
20.7 'Start time'/'End time' group in 'Quiet period' with start and end reversed + point 17,
73+
- later
74+
20.8 Add config of display width (# of tiles, default 4, max 32?); rename numberOfHorizontalDisplays, add to R/W configuration,
75+
==> Done v3.1.25
76+
20.9 Add wide clock style config, different screen formats for 8+ tiles: HH:MM, HH:MM:SS, HH:MM *CF, HH:MM %RH, mm dd HH:MM, HH:MM Www DD (12 chars! 8 tiles fit 10 chars! ,
77+
(There are smaller fonts, but everything in this code is assuming fixed size chars.)
78+
==> Done v3.1.25; now there are 8 variants. No font change.
79+
21. News headlines: Do not use newsapi.org, it is NOT free but costs 450 USD per __MONTH__ (5400 USD per annum)! rediculous pricing for this Indian company!
6880

6981
Future
7082
- Change to use latest Arduino json V7 library. this makes the JsonStreamingParser and json buffer size calculation unnecessary.
7183
- Add REST API for various controls
7284
- Update webpage with json data; requires JS code
7385
- Investigate if we can run without adafruit library
74-
https://github.com/markruys/arduino-Max72xxPanel/pull/7 BitBang and no Adafruit_GFX #7
86+
https://github.com/markruys/arduino-Max72xxPanel/pull/7 BitBang and no Adafruit_GFX #7
7587
who defines the character map?
7688
Major overhaul
7789
+ html main page: store whole page as one big array and process it as a stream, search for $marker$. Have a table with markers matching a callable function that returns the replacement text. callback could be anon inline function. This should reduce the number of string operations and memory allocations considerably.

marquee/Settings.h

Lines changed: 64 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -56,46 +56,82 @@ SOFTWARE.
5656
#include "MqttClient.h"
5757

5858
//******************************
59-
// Start Settings
59+
// Hard(-ware related) settings
60+
//******************************
61+
// Display Settings
62+
// CLK -> D5 (SCK) GPIO14 on ESP8266
63+
// CS -> D6 GPIO12 on ESP8266
64+
// DIN -> D7 (MOSI) GPIO13 on ESP8266
65+
const int pinCS = D6; // Attach CS to this pin, DIN to MOSI and CLK to SCK (cf http://arduino.cc/en/Reference/SPI )
66+
int displayIntensity = 1; //(This can be set from 0 - 15)
67+
int displayWidth = 4; // default 4 for standard 4 x 1 display Max size of 16 (FIXME: rename to displayTilesWidth)
68+
const int displayHeight = 1; // default 1 for a single row height (do not change, this SW does not support multiple lines, nor double hight chars)
69+
/* set ledRotation for LED Display panels (3 is default)
70+
0: no rotation
71+
1: 90 degrees clockwise
72+
2: 180 degrees
73+
3: 90 degrees counter clockwise (default)
74+
*/
75+
const int ledRotation = 3;
76+
77+
// Change the LED_ONBOARD to the pin you wish to use if other than the Built-in LED
78+
#define LED_ONBOARD LED_BUILTIN // LED_BUILTIN is the on-board LED on the ESP12E module on the Wemos
79+
#define LED_ON LOW // define polarity of LED_ONBOARD
80+
#define LED_OFF HIGH // define polarity of LED_ONBOARD
81+
82+
83+
//******************************
84+
// Configuration default Settings
85+
// (no need to change; all can be set on configuration page)
6086
//******************************
6187

6288
String APIKEY = ""; // Your API Key from http://openweathermap.org/
6389
// Default City Location (use http://openweathermap.org/find to find city ID)
64-
int CityID = 5304391;
90+
int CityID = 2759794;
6591
String marqueeMessage = "";
66-
boolean IS_METRIC = false; // false = Imperial and true = Metric
67-
boolean IS_24HOUR = false; // 23:00 military 24 hour clock
92+
93+
// (some) Default Weather Settings
94+
//FIXME TODO: do not use uppercase for variables
95+
boolean SHOW_DATE = false;
96+
boolean SHOW_CITY = true;
97+
boolean SHOW_CONDITION = true;
98+
boolean SHOW_HUMIDITY = true;
99+
boolean SHOW_WIND = true;
100+
boolean SHOW_WINDDIR = true;
101+
boolean SHOW_PRESSURE = false;
102+
boolean SHOW_HIGHLOW = true;
103+
104+
boolean IS_METRIC = true; // false = Imperial and true = Metric
105+
boolean IS_24HOUR = true; // 23:00 military 24 hour clock
68106
boolean IS_PM = true; // Show PM indicator on Clock when in AM/PM mode
69107
const int WEBSERVER_PORT = 80; // The port you can access this device on over HTTP
70108
const boolean WEBSERVER_ENABLED = true; // Device will provide a web interface via http://[ip]:[port]/
71109
boolean IS_BASIC_AUTH = false; // Use Basic Authorization for Configuration security on Web Interface
72110
char www_username[32] = {"admin"}; // User account for the Web Interface
73111
char www_password[32] = {"password"}; // Password for the Web Interface
74-
int minutesBetweenDataRefresh = 15; // Time in minutes between data refresh (default 15 minutes)
75-
int minutesBetweenScrolling = 1; // Time in minutes between scrolling data (default 1 minutes and max is 10)
112+
int refreshDataInterval = 15; // Time in minutes between data refresh (default 15 minutes)
113+
int displayScrollingInterval = 1; // Time in minutes between scrolling data (default 1 minutes and max is 10)
76114
int displayScrollSpeed = 25; // In milliseconds -- Configurable by the web UI (slow = 35, normal = 25, fast = 15, very fast = 5)
77-
boolean flashOnSeconds = true; // when true the : character in the time will flash on and off as a seconds indicator
78-
79-
boolean NEWS_ENABLED = true;
115+
boolean flashOnSeconds = true; // when true the ':' character in the time will flash on and off as a seconds indicator
116+
117+
// New wide clock style config, different screen formats for 8+ tiles:
118+
int wideClockStyle = 1; // 1=HH:MM, 2=HH:MM:SS, 3=HH:MM *CF, 4=HH:MM %RH, 5=mm dd HH:MM, 6=HH:MM mmdd, 7=HH:MM ddmm, 8=HH:MM WwwDD (or HH:MM Www DD on >= 10 tile display)
119+
120+
#define WIDE_CLOCK_STYLE_HHMM 1
121+
#define WIDE_CLOCK_STYLE_HHMMSS 2
122+
#define WIDE_CLOCK_STYLE_HHMM_CF 3
123+
#define WIDE_CLOCK_STYLE_HHMM_RH 4
124+
#define WIDE_CLOCK_STYLE_MMDD_HHMM 5
125+
#define WIDE_CLOCK_STYLE_HHMM_MMDD 6
126+
#define WIDE_CLOCK_STYLE_HHMM_DDMM 7
127+
#define WIDE_CLOCK_STYLE_HHMM_WWWDD 8
128+
#define WIDE_CLOCK_STYLE_LAST WIDE_CLOCK_STYLE_HHMM_WWWDD
129+
#define WIDE_CLOCK_STYLE_FIRST WIDE_CLOCK_STYLE_HHMM
130+
131+
boolean NEWS_ENABLED = false;
80132
String NEWS_API_KEY = ""; // Get your News API Key from https://newsapi.org
81133
String NEWS_SOURCE = "reuters"; // https://newsapi.org/sources to get full list of news sources available
82134

83-
// Display Settings
84-
// CLK -> D5 (SCK) GPIO14 on ESP8266
85-
// CS -> D6 GPIO12 on ESP8266
86-
// DIN -> D7 (MOSI) GPIO13 on ESP8266
87-
const int pinCS = D6; // Attach CS to this pin, DIN to MOSI and CLK to SCK (cf http://arduino.cc/en/Reference/SPI )
88-
int displayIntensity = 1; //(This can be set from 0 - 15)
89-
const int numberOfHorizontalDisplays = 4; // default 4 for standard 4 x 1 display Max size of 16
90-
const int numberOfVerticalDisplays = 1; // default 1 for a single row height
91-
/* set ledRotation for LED Display panels (3 is default)
92-
0: no rotation
93-
1: 90 degrees clockwise
94-
2: 180 degrees
95-
3: 90 degrees counter clockwise (default)
96-
*/
97-
int ledRotation = 3;
98-
99135
String timeDisplayTurnsOn = "06:30"; // 24 Hour Format HH:MM -- Leave blank for always on. (ie 05:30)
100136
String timeDisplayTurnsOff = "23:00"; // 24 Hour Format HH:MM -- Leave blank for always on. Both must be set to work.
101137

@@ -124,8 +160,9 @@ String MqttAuthUser, MqttAuthPass; // mqtt server authentication
124160
boolean ENABLE_OTA = true; // this will allow you to load firmware to the device over WiFi (see OTA for ESP8266)
125161
String OTA_Password = ""; // Set an OTA password here -- leave blank if you don't want to be prompted for password
126162

163+
//blue-grey
164+
String themeColor = "blue-grey"; // this can be changed later in the web interface.
165+
127166
//******************************
128167
// End Settings
129168
//******************************
130-
//blue-grey
131-
String themeColor = "blue-grey"; // this can be changed later in the web interface.

0 commit comments

Comments
 (0)