commit d20e5703774d139edf640710ef95f5fed77496f5
Author: marcusferl This sketch scrolls a custom message on a MAX7219 driven 8x8 pixel display units chained one after the other. Change text
+######Migration von JavaScript zu Python
+
+### Config
+
+- in der matrix.ino dein Wlan Name und Passwort eintragen
+```
+host = 'Device Ip'
+garbage = 'true' or 'false'
+```
+- die .ino auf dein Gerät lasen (eventuell noch die Librarys installieren)
+```
+const char* ssid = "your ssid";
+const char* password = "your password";
+```
+- in der config.py deine Daten angeben
+- events in der events.json eintragen
+
+```json
+{
+ "type": "fixed",
+ "date": {
+ "day": 8,
+ "month": 2,
+ "year": 1989
+ },
+ "name": "Ines {{years}}. Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+}
+```
+
+- wenn du einen Müllkalender benutzt, achte auf das format und den Filenamen 'muell.json'
+
+
+```json
+{
+ "tag": "Di",
+ "date": {
+ "day": "16",
+ "month": "02",
+ "year": "2022"
+ },
+ "name": "Restmuell"
+}
+```
+
+- hier findest du ein Beispiel, wie du ihn umwandeln kannst
+ https://git.weifer.org/weifer/Kalender_zu_JSON
+
+
+
+######Author: Marcus Ferl, marcus@weifer.de
diff --git a/config.py b/config.py
new file mode 100644
index 0000000..666e93b
--- /dev/null
+++ b/config.py
@@ -0,0 +1,6 @@
+host = 'Device Ip' # ur device ip, where u upload the matrix.ino
+garbage = 'true' # set true if u have a formated Json file
+
+
+
+get_request = '/set?text=' # dont touch this line
\ No newline at end of file
diff --git a/eventboard.py b/eventboard.py
new file mode 100644
index 0000000..368c4cb
--- /dev/null
+++ b/eventboard.py
@@ -0,0 +1,47 @@
+"""
+Eventboard script in Python
+Author: Marcus Ferl
+Email: marcus@weifer.de
+"""
+
+import json
+from datetime import date
+import requests
+import config
+
+
+# Get current Date
+def get_current_date():
+ currentDate = date.today()
+ day = str('{:02d}'.format(currentDate.day))
+ month = str('{:02d}'.format(currentDate.month))
+ year = str(currentDate.year)
+ return [day, month, year]
+
+
+# Raw data from Json file
+def read_JSON(filename):
+ f = open(filename)
+ data = json.load(f)
+ f.close()
+ return data
+
+# Returns the Garbage
+def create_Message():
+ if config.garbage == 'true':
+ for i in read_JSON('muell.json'):
+ day = i['date']['day']
+ month = i['date']['month']
+ year = i['date']['year']
+
+ if day == get_current_date()[0] and \
+ month == get_current_date()[1] and \
+ year == get_current_date()[2]:
+ return i['name']
+
+# Send Message to the Device
+def matrixRequest():
+ requests.get('http://' + config.host + config.get_request + create_Message())
+
+
+matrixRequest()
diff --git a/events.json b/events.json
new file mode 100644
index 0000000..3837f76
--- /dev/null
+++ b/events.json
@@ -0,0 +1,154 @@
+{
+ "events": [
+{
+ "type": "fixed",
+ "date": {
+ "day": 21,
+ "month": 11,
+ "year": 2021
+ },
+ "name": "Lottas {{years}}. Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 8,
+ "month": 2,
+ "year": 1989
+ },
+ "name": "Ines {{years}}. Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 2,
+ "month": 5,
+ "year": 1961
+ },
+ "name": "Rudis {{years}}. Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+{
+ "type": "fixed",
+ "date": {
+ "day": 1,
+ "month": 2,
+ "year": 1936
+ },
+ "name": "Oma Ferls {{years}}. Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 24,
+ "month": 5,
+ "year": 1967
+ },
+ "name": "Haikes {{years}}. Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 19,
+ "month": 2,
+ "year": 1966
+ },
+ "name": "Marios {{years}}. Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 24,
+ "month": 12,
+ "year": 2021
+ },
+ "name": "{{years}}. Verlobungstag",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 21,
+ "month": 2,
+ "year": 1985
+ },
+ "name": "Susannes {{years}}. Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 26,
+ "month": 3,
+ "year": 1971
+ },
+ "name": "Christians Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 21,
+ "month": 4,
+ "year": 1999
+ },
+ "name": "Steffens {{years}}. Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 17,
+ "month": 1,
+ "year": 1986
+ },
+ "name": "Marcus Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis zu {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 18,
+ "month": 9,
+ "year": 1943
+ },
+ "name": "Erikas Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 20,
+ "month": 9,
+ "year": 1967
+ },
+ "name": "Michaelas Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 26,
+ "month": 9,
+ "year": 1966
+ },
+ "name": "Markus Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": {
+ "day": 8,
+ "month": 11,
+ "year": 1995
+ },
+ "name": "Viviennes {{years}}. Geburtstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ }
+ ]
+}
diff --git a/holidays.json b/holidays.json
new file mode 100644
index 0000000..53ef752
--- /dev/null
+++ b/holidays.json
@@ -0,0 +1,202 @@
+{
+ "holidays": [
+ {
+ "type": "fixed",
+ "date": { "day": 1, "month": 1, "year": 0 },
+ "name": "Neujahr",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": { "day": 1, "month": 5, "year": 1946 },
+ "name": "Tag der Arbeit",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": { "day": 3, "month": 10, "year": 1990 },
+ "name": "Tag der deutschen Einheit",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": { "day": 31, "month": 10, "year": 1850 },
+ "name": "Halloween{1}",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": { "day": 1, "month": 11, "year": 1833 },
+ "name": "Allerheiligen",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": { "day": 11, "month": 11, "year": 1833 },
+ "name": "Fastnacht",
+ "message": "Nur noch {{hours}} Stunden bis die {{name}} beginnt!"
+ },
+ {
+ "type": "fixed",
+ "date": { "day": 24, "month": 12, "year": 0 },
+ "name": "Heilig Abend",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": { "day": 25, "month": 12, "year": 0 },
+ "name": "1. Weihhnachtstag",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": { "day": 26, "month": 12, "year": 0 },
+ "name": "2. Weihhnachtstag",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+ },
+ {
+ "type": "fixed",
+ "date": { "day": 31, "month": 12, "year": 0 },
+ "name": "Silvester",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "advent",
+ "days": 0,
+ "name": "1. Advent",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+
+ },
+ {
+ "type": "dynamic",
+ "base": "advent",
+ "days": 7,
+ "name": "2. Advent",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+
+ },
+ {
+ "type": "dynamic",
+ "base": "advent",
+ "days": 14,
+ "name": "3. Advent",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+
+ },
+ {
+ "type": "dynamic",
+ "base": "advent",
+ "days": 21,
+ "name": "4. Advent",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+
+ },
+ {
+ "type": "dynamic",
+ "base": "advent",
+ "days": -14,
+ "name": "Volkstrauertag",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+
+ },
+ {
+ "type": "dynamic",
+ "base": "advent",
+ "days": -11,
+ "name": "Buß- und Bettag",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "advent",
+ "days": -7,
+ "name": "Totensonntag",
+ "message": "Nur noch {{hours}} Stunden bis zum {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": -52,
+ "name": "Weiberfastnacht",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": -48,
+ "name": "Rosenmontag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": -47,
+ "name": "Fastnachtsdienstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": -46,
+ "name": "Aschermittwoch",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": -3,
+ "name": "Gründonnerstag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": -2,
+ "name": "Karfreitag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": 0,
+ "name": "Ostersonntag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": 1,
+ "name": "Ostermontag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": 39,
+ "name": "Christi Himmelfahrt",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": 49,
+ "name": "Pfingstsonntag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": 50,
+ "name": "Pfingstmontag",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ },
+ {
+ "type": "dynamic",
+ "base": "easter",
+ "days": 60,
+ "name": "Fronleichnam",
+ "message": "Nur noch {{hours}} Stunden bis {{name}}!"
+ }
+ ]
+}
diff --git a/matrix.ino b/matrix.ino
new file mode 100644
index 0000000..46879be
--- /dev/null
+++ b/matrix.ino
@@ -0,0 +1,201 @@
+// Simple text scroller project with Web server configuration
+// Author: Csongor Varga
+// Github: https://github.com/nygma2004/max7219scroller
+
+// Using the MAX7219 library of:
+// MAX7219_Dot_Matrix library - sideways scrolling
+// Author: Nick Gammon
+// Date: 2 October 2015
+
+/*
+Used: C:\Users\MAX7219 Display and Text Scroller
Current text: ";
+ webPage += message;
+ webPage += "
Change scroll speed
Current delay: ";
+ webPage += MOVE_INTERVAL;
+ webPage += "
Change to: 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100";
+ webPage += "
Change brightness
Current brightness: ";
+ webPage += intensity;
+ webPage += "
Change to: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15";
+ webPage += "
RSSI: ";
+ webStat += WiFi.RSSI();
+ webStat += "
";
+ webStat += "Uptime [min]: ";
+ webStat += millis() / (1000*60);
+ webStat += "