v0.46
- Adds HTTP API - Adds the option to set duration in custom apps - Adds sound item to onscreen menu - Adds wifi reconnect - Adds [hidden features](https://blueforcer.github.io/awtrix-light/#/dev) wich allows you for example to change the bootsound - Shows IP address on boot - Fixes a bug where deleting a custom app with empty payload doesnt work - Fixes a bug where autotransition doesnt start at its own closes #32
This commit is contained in:
@@ -14,7 +14,9 @@
|
||||
- [Timer](timer.md)
|
||||
- [Icons](icons.md)
|
||||
- [Sounds](sounds.md)
|
||||
- [Hidden features](dev.md)
|
||||
|
||||
- MQTT
|
||||
- API
|
||||
- [MQTT/HTTP](api.md)
|
||||
- [Custom Pages & Notifications](custom.md)
|
||||
- [Commands](mqtt.md)
|
||||
|
||||
|
||||
@@ -1,26 +1,40 @@
|
||||
# MQTT Commands
|
||||
# MQTT / HTTP API
|
||||
|
||||
|
||||
## Status
|
||||
In MQTT awtrix send its stats every 10s to `[PREFIX]/stats`
|
||||
With HTTP, make GET request to `http://[IP]/api/stats`
|
||||
|
||||
|
||||
## Add custom app
|
||||
create custom apps or notifications to display your own text and icons.
|
||||
Have a look at [this section](custom?id=custom-apps-and-notifications)
|
||||
|
||||
| Topic | URL | Payload/Body | HTTP Header | HTTP method |
|
||||
| --- | --- | --- |--- |--- |
|
||||
| `[PREFIX]/custom/[appname]` |`http://[IP]/api/custom` | JSON | name = [appname] | POST |
|
||||
|
||||
## Dismiss Notification
|
||||
Dismiss a notification which was set to "hold"=true.
|
||||
|
||||
| Topic | Payload |
|
||||
| --- | --- |
|
||||
| `[PREFIX]/notify/dismiss` | empty payload |
|
||||
| Topic | URL | Payload/Body | HTTP method |
|
||||
| --- | --- | --- | --- |
|
||||
| `[PREFIX]/custom/[appname]` |`http://[IP]/api/notify/dismiss` | empty payload/body | POST |
|
||||
|
||||
## Switch Apps
|
||||
Switch to next or previous app.
|
||||
|
||||
| Topic | Payload |
|
||||
| --- | --- |
|
||||
| `[PREFIX]/nextapp` | empty payload |
|
||||
| `[PREFIX]/previousapp` | empty payload |
|
||||
| Topic | URL | Payload/Body | HTTP method |
|
||||
| --- | --- | --- | --- |
|
||||
| `[PREFIX]/nextapp` | `http://[IP]/api/nextapp` | empty payload/body | POST |
|
||||
| `[PREFIX]/previousapp` | `http://[IP]/api/previousapp` | payload/body | POST |
|
||||
|
||||
## Switch to Specific App
|
||||
Switch to a specific app by name.
|
||||
|
||||
| Topic | Payload |
|
||||
| --- | --- |
|
||||
| `[PREFIX]/switch` | `{"name":"time"}` |
|
||||
| Topic | URL | Payload/Body | HTTP method |
|
||||
| --- | --- | --- | --- |
|
||||
| `[PREFIX]/switch` | `http://[IP]/api/switch` | `{"name":"time"}` | POST |
|
||||
|
||||
Built-in app names are:
|
||||
- `time`
|
||||
@@ -34,9 +48,9 @@ For custom apps, use the name you set in the topic. For example, if `[PREFIX]/cu
|
||||
## Add/remove and rearange apps
|
||||
|
||||
|
||||
| Topic |
|
||||
| --- |
|
||||
| `[PREFIX]/apps` |
|
||||
| Topic | URL | Payload/Body | HTTP method |
|
||||
| --- | --- | --- | --- |
|
||||
| `[PREFIX]/apps`|`http://[IP]/api/apps`| json | POST |
|
||||
|
||||
!> This function provides users with the ability to manage the apps on their device by adding, removing, and rearranging them. However, as it is an experimental feature, caution should be exercised, particularly when attempting to rearrange multiple apps at once, as this can lead to unintended consequences due to the resulting shifts in position of other apps.
|
||||
|
||||
@@ -98,15 +112,21 @@ In this example,
|
||||
- The "bat" app is inactive and will be removed,
|
||||
- and the "github" app is active and should be displayed in position 4.
|
||||
|
||||
## Add timer
|
||||
create custom apps or notifications to display your own text and icons.
|
||||
have a look at [this section](custom)
|
||||
|
||||
| Topic | URL | Payload/Body |HTTP method |
|
||||
| --- | --- | --- |--- |
|
||||
| `[PREFIX]/custom/[appname]` |`http://[IP]/api/notify/dismiss` | empty payload/body | POST |
|
||||
|
||||
|
||||
## Change Settings
|
||||
Change various settings related to the app display.
|
||||
|
||||
| Topic | Payload |
|
||||
| --- | --- |
|
||||
| `[PREFIX]/settings` | JSON properties |
|
||||
| Topic | URL | Payload/Body |HTTP method |
|
||||
| --- | --- | --- |--- |
|
||||
| `[PREFIX]/settings` |`http://[IP]/api/settings`| JSON | POST |
|
||||
|
||||
Each property is optional; you do not need to send all.
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
# Custom Apps & Notifications
|
||||
# Custom Apps and Notifications
|
||||
|
||||
With AWTRIX Light, you can create custom apps or notifications to display your own text and icons.
|
||||
Simply send a JSON object to the topic "awtrixlight/custom/[page]" where [page] is a the name of your page (without spaces).
|
||||
|
||||
With MQTT simply send a JSON object to the topic `[PREFIX]/custom/[page]` where [page] is a the name of your page (without spaces).
|
||||
With the [HTTP API](api?id=add-custom-app) you have to set the appname in the request header (`name = Appname`)
|
||||
|
||||
## JSON Properties
|
||||
|
||||
@@ -9,7 +11,7 @@ The JSON object has the following properties:
|
||||
|
||||
| Key | Type | Description | Default |
|
||||
| --- | ---- | ----------- | ------- |
|
||||
| `pos` | number | defines the position of your custompage in the loop, starting at 0 for the first position. This will only apply with your first push. You cant change the position afterwards with [this function](mqtt?id=addremove-and-rearange-apps) |
|
||||
| `pos` | number | defines the position of your custompage in the loop, starting at 0 for the first position. This will only apply with your first push. You cant change the position afterwards with [this function](api?id=addremove-and-rearange-apps) |
|
||||
| `text` | string | The text to display on the page. | |
|
||||
| `icon` | string | The icon ID or filename (without extension) to display on the page. | |
|
||||
| `repeat` | number | Sets how many times the text should be scrolled through the matrix before the display ends. | 1 |
|
||||
@@ -41,5 +43,6 @@ Here's an example JSON object to display the text "Hello, AWTRIX Light!" with th
|
||||
}
|
||||
```
|
||||
|
||||
## Delete a custom page
|
||||
To delelte a custom page simply send a empty payload to the same topic
|
||||
## Delete a custom app
|
||||
To delete a custom app simply send a empty payload/body to the same topic/url.
|
||||
You can also use [this API](api?id=addremove-and-rearange-apps)
|
||||
15
docs/dev.md
Normal file
15
docs/dev.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Hidden Features
|
||||
|
||||
Ok, now they are no longer hidden :).
|
||||
This section contains small setting options that the majority of users do not change or change very rarely and therefore saved the effort of creating an elaborate settings interface.
|
||||
|
||||
Create a `dev.json` in your filemanager.
|
||||
|
||||
## JSON Properties
|
||||
|
||||
The JSON object has the following properties:
|
||||
|
||||
| Key | Type | Description | Default |
|
||||
| --- | ---- | ----------- | ------- |
|
||||
| `bootsound` | string | Uses a custom melodie from the MELODIES folder | standart |
|
||||
| `uppercase` | boolean | Print every character in uppercase | true |
|
||||
@@ -18,5 +18,6 @@ Hold down the middle button for 2s to exit the current menu and to save your set
|
||||
| `WEEKDAY` | Allows selection of start of week. |
|
||||
| `TEMP` | Allows selection of temperature system (°C or °F). |
|
||||
| `APPS` | Allows to enable or disable internal apps |
|
||||
| `SOUND` | Allows to enable or disable sound output |
|
||||
| `UPDATE` | Check and download new firmware if available. |
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Quick start
|
||||
1. :computer: Connect your device to your PC or Mac and [use the online flahser](flasher.md)
|
||||
2. :signal_strength: After flashing, Awtrix will open an access point with the name "AWTRIX LIGHT". Connect with PW "12345678".
|
||||
3. :mag: Open a browser and navigate to 192.168.4.1. Enter your WiFi information and reboot the clock.
|
||||
4. :clock1: Your clock is accessible via http://awtrixlight.local/.
|
||||
3. :mag: Open a browser and navigate to 192.168.4.1. Enter your WiFi information and connect to your WiFi.
|
||||
4. :clock1: Your clock is accessible via the IP adress you see at connect.
|
||||
5. :gear: Set up your MQTT and other options in the web interface.
|
||||
6. :heavy_check_mark: You're ready to go.
|
||||
17
lib/DFMiniMp3-1.0.7-noChecksums/.gitattributes
vendored
Normal file
17
lib/DFMiniMp3-1.0.7-noChecksums/.gitattributes
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
79
lib/DFMiniMp3-1.0.7-noChecksums/.gitignore
vendored
Normal file
79
lib/DFMiniMp3-1.0.7-noChecksums/.gitignore
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
|
||||
# =========================
|
||||
# Operating System Files
|
||||
# =========================
|
||||
|
||||
# OSX
|
||||
# =========================
|
||||
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# Windows
|
||||
# =========================
|
||||
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
165
lib/DFMiniMp3-1.0.7-noChecksums/COPYING
Normal file
165
lib/DFMiniMp3-1.0.7-noChecksums/COPYING
Normal file
@@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
25
lib/DFMiniMp3-1.0.7-noChecksums/README.md
Normal file
25
lib/DFMiniMp3-1.0.7-noChecksums/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# DFPlayer Mini mp3
|
||||
|
||||
[](https://gitter.im/DFMiniMp3/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6AA97KE54UJR4)
|
||||
|
||||
Library for the DFPlayer Mini Mp3 module
|
||||
|
||||
This library allows your Arduino project to control the DFPlayer Mini MP3 module. It supports both hardware serial and software serial. It was designed to fit in the smallest Arduino hardware by consuming less code and memory space than other libraries.
|
||||
|
||||
Please read the product link before connecting your module, it will save you alot of time and effort.
|
||||
[DFRobot's DFPlayer Mini Mp3](http://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299)
|
||||
|
||||
## Documentation
|
||||
[See Wiki](https://github.com/Makuna/DFMiniMp3/wiki)
|
||||
|
||||
## Installing This Library (prefered, you just want to use it)
|
||||
Open the Library Manager and search for "DFPlayer Mini Mp3 by Makuna" and install.
|
||||
|
||||
## Installing This Library From GitHub (advanced, you want to contribute)
|
||||
Create a directory in your Arduino\Library folder named "DfMiniMp3"
|
||||
Clone (Git) this project into that folder.
|
||||
It should now show up in the import list when you restart Arduino IDE.
|
||||
|
||||
|
||||
79
lib/DFMiniMp3-1.0.7-noChecksums/keywords.txt
Normal file
79
lib/DFMiniMp3-1.0.7-noChecksums/keywords.txt
Normal file
@@ -0,0 +1,79 @@
|
||||
#######################################
|
||||
# Syntax Coloring Map for DFMiniMp3
|
||||
#######################################
|
||||
|
||||
#######################################
|
||||
# Datatypes (KEYWORD1)
|
||||
#######################################
|
||||
|
||||
DFMiniMp3 KEYWORD1
|
||||
DfMp3_PlaybackMode KEYWORD1
|
||||
DfMp3_Eq KEYWORD1
|
||||
DfMp3_PlaySource KEYWORD1
|
||||
DfMp3_PlaySources KEYWORD1
|
||||
|
||||
#######################################
|
||||
# Methods and Functions (KEYWORD2)
|
||||
#######################################
|
||||
|
||||
begin KEYWORD2
|
||||
loop KEYWORD2
|
||||
getPlaySources KEYWORD2
|
||||
playGlobalTrack KEYWORD2
|
||||
playMp3FolderTrack KEYWORD2
|
||||
playFolderTrack KEYWORD2
|
||||
playFolderTrack16 KEYWORD2
|
||||
playRandomTrackFromAll KEYWORD2
|
||||
nextTrack KEYWORD2
|
||||
prevTrack KEYWORD2
|
||||
getCurrentTrack KEYWORD2
|
||||
setVolume KEYWORD2
|
||||
getVolume KEYWORD2
|
||||
increaseVolume KEYWORD2
|
||||
decreaseVolume KEYWORD2
|
||||
loopGlobalTrack KEYWORD2
|
||||
loopFolder KEYWORD2
|
||||
getPlaybackMode KEYWORD2
|
||||
setRepeatPlayAllInRoot KEYWORD2
|
||||
setRepeatPlayCurrentTrack KEYWORD2
|
||||
setEq KEYWORD2
|
||||
getEq KEYWORD2
|
||||
setPlaybackSource KEYWORD2
|
||||
sleep KEYWORD2
|
||||
reset KEYWORD2
|
||||
start KEYWORD2
|
||||
pause KEYWORD2
|
||||
stop KEYWORD2
|
||||
getStatus KEYWORD2
|
||||
getFolderTrackCount KEYWORD2
|
||||
getTotalTrackCount KEYWORD2
|
||||
getTotalFolderCount KEYWORD2
|
||||
playAdvertisement KEYWORD2
|
||||
stopAdvertisement KEYWORD2
|
||||
enableDac KEYWORD2
|
||||
disableDac KEYWORD2
|
||||
isOnline KEYWORD2
|
||||
|
||||
#######################################
|
||||
# Constants (LITERAL1)
|
||||
#######################################
|
||||
|
||||
DfMp3_PlaybackMode_Repeat LITERAL1
|
||||
DfMp3_PlaybackMode_FolderRepeat LITERAL1
|
||||
DfMp3_PlaybackMode_SingleRepeat LITERAL1
|
||||
DfMp3_PlaybackMode_Random LITERAL1
|
||||
DfMp3_Eq_Normal LITERAL1
|
||||
DfMp3_Eq_Pop LITERAL1
|
||||
DfMp3_Eq_Rock LITERAL1
|
||||
DfMp3_Eq_Jazz LITERAL1
|
||||
DfMp3_Eq_Classic LITERAL1
|
||||
DfMp3_Eq_Bass LITERAL1
|
||||
DfMp3_PlaySource_Usb LITERAL1
|
||||
DfMp3_PlaySource_Sd LITERAL1
|
||||
DfMp3_PlaySource_Aux LITERAL1
|
||||
DfMp3_PlaySource_Sleep LITERAL1
|
||||
DfMp3_PlaySource_Flash LITERAL1
|
||||
DfMp3_PlaySources_Usb LITERAL1
|
||||
DfMp3_PlaySources_Sd LITERAL1
|
||||
DfMp3_PlaySources_Pc LITERAL1
|
||||
DfMp3_PlaySources_Flash LITERAL1
|
||||
9
lib/DFMiniMp3-1.0.7-noChecksums/library.properties
Normal file
9
lib/DFMiniMp3-1.0.7-noChecksums/library.properties
Normal file
@@ -0,0 +1,9 @@
|
||||
name=DFPlayer Mini Mp3 by Makuna
|
||||
version=1.0.7
|
||||
author=Michael C. Miller (makuna@live.com)
|
||||
maintainer=Michael C. Miller (makuna@live.com)
|
||||
sentence=Library for the DFPlayer Mini Mp3 module
|
||||
paragraph=This library allows your Arduino project to control the DFPlayer Mini MP3 module. It supports both hardware serial and software serial. It was designed to fit in the smallest Arduino hardware by consuming less code and memory space than other libraries.
|
||||
category=Device Control
|
||||
url=https://github.com/Makuna/DFMiniMp3/wiki
|
||||
architectures=*
|
||||
559
lib/DFMiniMp3-1.0.7-noChecksums/src/DFMiniMp3.h
Normal file
559
lib/DFMiniMp3-1.0.7-noChecksums/src/DFMiniMp3.h
Normal file
@@ -0,0 +1,559 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
DFMiniMp3 library
|
||||
|
||||
Written by Michael C. Miller.
|
||||
|
||||
I invest time and resources providing this open source code,
|
||||
please support me by dontating (see https://github.com/Makuna/DFMiniMp3)
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
This file is part of the Makuna/DFMiniMp3 library.
|
||||
|
||||
DFMiniMp3 is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
DFMiniMp3 is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with DFMiniMp3. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
-------------------------------------------------------------------------*/
|
||||
#pragma once
|
||||
|
||||
enum DfMp3_Error
|
||||
{
|
||||
// from device
|
||||
DfMp3_Error_Busy = 1,
|
||||
DfMp3_Error_Sleeping,
|
||||
DfMp3_Error_SerialWrongStack,
|
||||
DfMp3_Error_CheckSumNotMatch,
|
||||
DfMp3_Error_FileIndexOut,
|
||||
DfMp3_Error_FileMismatch,
|
||||
DfMp3_Error_Advertise,
|
||||
// from library
|
||||
DfMp3_Error_RxTimeout = 0x81,
|
||||
DfMp3_Error_PacketSize,
|
||||
DfMp3_Error_PacketHeader,
|
||||
DfMp3_Error_PacketChecksum,
|
||||
DfMp3_Error_General = 0xff
|
||||
};
|
||||
|
||||
enum DfMp3_PlaybackMode
|
||||
{
|
||||
DfMp3_PlaybackMode_Repeat,
|
||||
DfMp3_PlaybackMode_FolderRepeat,
|
||||
DfMp3_PlaybackMode_SingleRepeat,
|
||||
DfMp3_PlaybackMode_Random
|
||||
};
|
||||
|
||||
enum DfMp3_Eq
|
||||
{
|
||||
DfMp3_Eq_Normal,
|
||||
DfMp3_Eq_Pop,
|
||||
DfMp3_Eq_Rock,
|
||||
DfMp3_Eq_Jazz,
|
||||
DfMp3_Eq_Classic,
|
||||
DfMp3_Eq_Bass
|
||||
};
|
||||
|
||||
enum DfMp3_PlaySource // value - only one can be set
|
||||
{
|
||||
DfMp3_PlaySource_Usb = 1,
|
||||
DfMp3_PlaySource_Sd,
|
||||
DfMp3_PlaySource_Aux,
|
||||
DfMp3_PlaySource_Sleep,
|
||||
DfMp3_PlaySource_Flash
|
||||
};
|
||||
|
||||
enum DfMp3_PlaySources // bitfield - more than one can be set
|
||||
{
|
||||
DfMp3_PlaySources_Usb = 0x01,
|
||||
DfMp3_PlaySources_Sd = 0x02,
|
||||
DfMp3_PlaySources_Pc = 0x04,
|
||||
DfMp3_PlaySources_Flash = 0x08,
|
||||
};
|
||||
|
||||
template <class T_SERIAL_METHOD, class T_NOTIFICATION_METHOD>
|
||||
class DFMiniMp3
|
||||
{
|
||||
public:
|
||||
DFMiniMp3(T_SERIAL_METHOD &serial) : _serial(serial),
|
||||
_lastSendSpace(c_msSendSpace),
|
||||
_isOnline(false)
|
||||
{
|
||||
}
|
||||
|
||||
void begin(unsigned long baud = 9600)
|
||||
{
|
||||
_serial.begin(baud);
|
||||
_serial.setTimeout(10000);
|
||||
_lastSend = millis();
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
while (_serial.available() >= DfMp3_Packet_SIZE)
|
||||
{
|
||||
listenForReply(0x00);
|
||||
}
|
||||
}
|
||||
|
||||
// Does not work with all models.
|
||||
// YX5200-24SS - sends reply
|
||||
// MH2024K-24SS - sends NO reply --> results in error notification
|
||||
DfMp3_PlaySources getPlaySources()
|
||||
{
|
||||
drainResponses();
|
||||
sendPacket(0x3f);
|
||||
return static_cast<DfMp3_PlaySources>(listenForReply(0x3f));
|
||||
}
|
||||
|
||||
// the track as enumerated across all folders
|
||||
void playGlobalTrack(uint16_t track = 0)
|
||||
{
|
||||
sendPacket(0x03, track);
|
||||
}
|
||||
|
||||
// sd:/mp3/####track name
|
||||
void playMp3FolderTrack(uint16_t track)
|
||||
{
|
||||
sendPacket(0x12, track);
|
||||
}
|
||||
|
||||
// older devices: sd:/###/###track name
|
||||
// newer devices: sd:/##/###track name
|
||||
// folder and track numbers are zero padded
|
||||
void playFolderTrack(uint8_t folder, uint8_t track)
|
||||
{
|
||||
uint16_t arg = (folder << 8) | track;
|
||||
sendPacket(0x0f, arg);
|
||||
}
|
||||
|
||||
// sd:/##/####track name
|
||||
// track number must be four digits, zero padded
|
||||
void playFolderTrack16(uint8_t folder, uint16_t track)
|
||||
{
|
||||
uint16_t arg = (((uint16_t)folder) << 12) | track;
|
||||
sendPacket(0x14, arg);
|
||||
}
|
||||
|
||||
void playRandomTrackFromAll()
|
||||
{
|
||||
sendPacket(0x18);
|
||||
}
|
||||
|
||||
void nextTrack()
|
||||
{
|
||||
sendPacket(0x01);
|
||||
}
|
||||
|
||||
void prevTrack()
|
||||
{
|
||||
sendPacket(0x02);
|
||||
}
|
||||
|
||||
uint16_t getCurrentTrack(DfMp3_PlaySource source = DfMp3_PlaySource_Sd)
|
||||
{
|
||||
drainResponses();
|
||||
|
||||
uint8_t command;
|
||||
|
||||
switch (source)
|
||||
{
|
||||
case DfMp3_PlaySource_Usb:
|
||||
command = 0x4b;
|
||||
break;
|
||||
case DfMp3_PlaySource_Sd:
|
||||
command = 0x4c;
|
||||
break;
|
||||
case DfMp3_PlaySource_Flash:
|
||||
command = 0x4d;
|
||||
break;
|
||||
default:
|
||||
command = 0x4c;
|
||||
break;
|
||||
}
|
||||
|
||||
sendPacket(command);
|
||||
return listenForReply(command);
|
||||
}
|
||||
|
||||
// 0- 30
|
||||
void setVolume(uint8_t volume)
|
||||
{
|
||||
sendPacket(0x06, volume);
|
||||
}
|
||||
|
||||
uint8_t getVolume()
|
||||
{
|
||||
drainResponses();
|
||||
sendPacket(0x43);
|
||||
return static_cast<uint8_t>(listenForReply(0x43));
|
||||
}
|
||||
|
||||
void increaseVolume()
|
||||
{
|
||||
sendPacket(0x04);
|
||||
}
|
||||
|
||||
void decreaseVolume()
|
||||
{
|
||||
sendPacket(0x05);
|
||||
}
|
||||
|
||||
// useless, removed
|
||||
// 0-31
|
||||
/*
|
||||
void setVolume(bool mute, uint8_t volume)
|
||||
{
|
||||
uint16_t arg = (!mute << 8) | volume;
|
||||
sendPacket(0x10, arg);
|
||||
}
|
||||
*/
|
||||
|
||||
void loopGlobalTrack(uint16_t globalTrack)
|
||||
{
|
||||
sendPacket(0x08, globalTrack);
|
||||
}
|
||||
|
||||
// sd:/##/*
|
||||
// 0-99
|
||||
void loopFolder(uint8_t folder)
|
||||
{
|
||||
sendPacket(0x17, folder);
|
||||
}
|
||||
|
||||
DfMp3_PlaybackMode getPlaybackMode()
|
||||
{
|
||||
drainResponses();
|
||||
sendPacket(0x45);
|
||||
return static_cast<DfMp3_PlaybackMode>(listenForReply(0x45));
|
||||
}
|
||||
|
||||
void setRepeatPlayAllInRoot(bool repeat)
|
||||
{
|
||||
sendPacket(0x11, !!repeat);
|
||||
}
|
||||
|
||||
void setRepeatPlayCurrentTrack(bool repeat)
|
||||
{
|
||||
sendPacket(0x19, !repeat);
|
||||
}
|
||||
|
||||
void setEq(DfMp3_Eq eq)
|
||||
{
|
||||
sendPacket(0x07, eq);
|
||||
}
|
||||
|
||||
DfMp3_Eq getEq()
|
||||
{
|
||||
drainResponses();
|
||||
sendPacket(0x44);
|
||||
return static_cast<DfMp3_Eq>(listenForReply(0x44));
|
||||
}
|
||||
|
||||
void setPlaybackSource(DfMp3_PlaySource source)
|
||||
{
|
||||
sendPacket(0x09, source, 200);
|
||||
}
|
||||
|
||||
void sleep()
|
||||
{
|
||||
sendPacket(0x0a);
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
sendPacket(0x0c, 0, 600);
|
||||
_isOnline = false;
|
||||
}
|
||||
|
||||
void start()
|
||||
{
|
||||
sendPacket(0x0d);
|
||||
}
|
||||
|
||||
void pause()
|
||||
{
|
||||
sendPacket(0x0e);
|
||||
}
|
||||
|
||||
void stop()
|
||||
{
|
||||
sendPacket(0x16);
|
||||
}
|
||||
|
||||
uint16_t getStatus()
|
||||
{
|
||||
drainResponses();
|
||||
sendPacket(0x42);
|
||||
return listenForReply(0x42);
|
||||
}
|
||||
|
||||
uint16_t getFolderTrackCount(uint16_t folder)
|
||||
{
|
||||
drainResponses();
|
||||
sendPacket(0x4e, folder);
|
||||
return listenForReply(0x4e);
|
||||
}
|
||||
|
||||
uint16_t getTotalTrackCount(DfMp3_PlaySource source)
|
||||
{
|
||||
drainResponses();
|
||||
|
||||
uint8_t command;
|
||||
|
||||
switch (source)
|
||||
{
|
||||
case DfMp3_PlaySource_Usb:
|
||||
command = 0x47;
|
||||
break;
|
||||
case DfMp3_PlaySource_Sd:
|
||||
command = 0x48;
|
||||
break;
|
||||
case DfMp3_PlaySource_Flash:
|
||||
command = 0x49;
|
||||
break;
|
||||
default:
|
||||
command = 0x48;
|
||||
break;
|
||||
}
|
||||
|
||||
sendPacket(command);
|
||||
return listenForReply(command);
|
||||
}
|
||||
|
||||
uint16_t getTotalFolderCount()
|
||||
{
|
||||
drainResponses();
|
||||
sendPacket(0x4F);
|
||||
return listenForReply(0x4F);
|
||||
}
|
||||
|
||||
// sd:/advert/####track name
|
||||
void playAdvertisement(uint16_t track)
|
||||
{
|
||||
sendPacket(0x13, track);
|
||||
}
|
||||
|
||||
void stopAdvertisement()
|
||||
{
|
||||
sendPacket(0x15);
|
||||
}
|
||||
|
||||
void enableDac()
|
||||
{
|
||||
sendPacket(0x1A, 0x00);
|
||||
}
|
||||
|
||||
void disableDac()
|
||||
{
|
||||
sendPacket(0x1A, 0x01);
|
||||
}
|
||||
|
||||
bool isOnline() const
|
||||
{
|
||||
return _isOnline;
|
||||
}
|
||||
|
||||
private:
|
||||
static const uint16_t c_msSendSpace = 50;
|
||||
|
||||
// 7E FF 06 0F 00 01 01 xx xx EF
|
||||
// 0 -> 7E is start code
|
||||
// 1 -> FF is version
|
||||
// 2 -> 06 is length
|
||||
// 3 -> 0F is command
|
||||
// 4 -> 00 is no receive
|
||||
// 5~6 -> 01 01 is argument
|
||||
// 7~8 -> checksum = 0 - ( FF+06+0F+00+01+01 )
|
||||
// 9 -> EF is end code
|
||||
enum DfMp3_Packet
|
||||
{
|
||||
DfMp3_Packet_StartCode,
|
||||
DfMp3_Packet_Version,
|
||||
DfMp3_Packet_Length,
|
||||
DfMp3_Packet_Command,
|
||||
DfMp3_Packet_RequestAck,
|
||||
DfMp3_Packet_HiByteArgument,
|
||||
DfMp3_Packet_LowByteArgument,
|
||||
DfMp3_Packet_HiByteCheckSum,
|
||||
DfMp3_Packet_LowByteCheckSum,
|
||||
DfMp3_Packet_EndCode,
|
||||
DfMp3_Packet_SIZE
|
||||
};
|
||||
enum DfMp3_Packet_short
|
||||
{
|
||||
DfMp3_Packet_short_StartCode,
|
||||
DfMp3_Packet_short_Version,
|
||||
DfMp3_Packet_short_Length,
|
||||
DfMp3_Packet_short_Command,
|
||||
DfMp3_Packet_short_RequestAck,
|
||||
DfMp3_Packet_short_HiByteArgument,
|
||||
DfMp3_Packet_short_LowByteArgument,
|
||||
// DfMp3_Packet_short_HiByteCheckSum,
|
||||
// DfMp3_Packet_short_LowByteCheckSum,
|
||||
DfMp3_Packet_short_EndCode,
|
||||
DfMp3_Packet_short_SIZE
|
||||
};
|
||||
|
||||
T_SERIAL_METHOD &_serial;
|
||||
uint32_t _lastSend;
|
||||
uint16_t _lastSendSpace;
|
||||
bool _isOnline;
|
||||
|
||||
void drainResponses()
|
||||
{
|
||||
while (_serial.available() > 0)
|
||||
{
|
||||
listenForReply(0x00);
|
||||
}
|
||||
}
|
||||
|
||||
void sendPacket(uint8_t command, uint16_t arg = 0, uint16_t sendSpaceNeeded = c_msSendSpace)
|
||||
{
|
||||
uint8_t out[DfMp3_Packet_short_SIZE] = {0x7E,
|
||||
0xFF,
|
||||
06,
|
||||
command,
|
||||
00,
|
||||
static_cast<uint8_t>(arg >> 8),
|
||||
static_cast<uint8_t>(arg & 0x00ff),
|
||||
// 00,
|
||||
// 00,
|
||||
0xEF};
|
||||
|
||||
// setChecksum(out);
|
||||
|
||||
// wait for spacing since last send
|
||||
while (((millis() - _lastSend) < _lastSendSpace))
|
||||
{
|
||||
// check for event messages from the device while
|
||||
// we wait
|
||||
loop();
|
||||
delay(1);
|
||||
}
|
||||
|
||||
_lastSendSpace = sendSpaceNeeded;
|
||||
_serial.write(out, DfMp3_Packet_short_SIZE);
|
||||
|
||||
_lastSend = millis();
|
||||
}
|
||||
|
||||
bool readPacket(uint8_t *command, uint16_t *argument)
|
||||
{
|
||||
uint8_t in[DfMp3_Packet_SIZE] = {0};
|
||||
uint8_t read;
|
||||
|
||||
// init our out args always
|
||||
*command = 0;
|
||||
*argument = 0;
|
||||
|
||||
// try to sync our reads to the packet start
|
||||
do
|
||||
{
|
||||
// we use readBytes as it gives us the standard timeout
|
||||
read = _serial.readBytes(&(in[DfMp3_Packet_StartCode]), 1);
|
||||
|
||||
if (read != 1)
|
||||
{
|
||||
// nothing read
|
||||
*argument = DfMp3_Error_RxTimeout;
|
||||
|
||||
return false;
|
||||
}
|
||||
} while (in[DfMp3_Packet_StartCode] != 0x7e);
|
||||
|
||||
read += _serial.readBytes(in + 1, DfMp3_Packet_SIZE - 1);
|
||||
if (read < DfMp3_Packet_SIZE)
|
||||
{
|
||||
// not enough bytes, corrupted packet
|
||||
*argument = DfMp3_Error_PacketSize;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (in[DfMp3_Packet_Version] != 0xFF ||
|
||||
in[DfMp3_Packet_Length] != 0x06 ||
|
||||
in[DfMp3_Packet_EndCode] != 0xef)
|
||||
{
|
||||
// invalid version or corrupted packet
|
||||
*argument = DfMp3_Error_PacketHeader;
|
||||
return false;
|
||||
}
|
||||
|
||||
// if (!validateChecksum(in))
|
||||
// {
|
||||
// // checksum failed, corrupted packet
|
||||
// *argument = DfMp3_Error_PacketChecksum;
|
||||
// return false;
|
||||
// }
|
||||
|
||||
*command = in[DfMp3_Packet_Command];
|
||||
*argument = ((in[DfMp3_Packet_HiByteArgument] << 8) | in[DfMp3_Packet_LowByteArgument]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint16_t listenForReply(uint8_t command)
|
||||
{
|
||||
uint8_t replyCommand = 0;
|
||||
uint16_t replyArg = 0;
|
||||
|
||||
do
|
||||
{
|
||||
if (readPacket(&replyCommand, &replyArg))
|
||||
{
|
||||
if (command != 0 && command == replyCommand)
|
||||
{
|
||||
return replyArg;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (replyArg != 0)
|
||||
{
|
||||
|
||||
if (_serial.available() == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (command != 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// uint16_t calcChecksum(uint8_t *packet)
|
||||
// {
|
||||
// uint16_t sum = 0xFFFF;
|
||||
// for (int i = DfMp3_Packet_Version; i < DfMp3_Packet_HiByteCheckSum; i++)
|
||||
// {
|
||||
// sum -= packet[i];
|
||||
// }
|
||||
// return sum + 1;
|
||||
// }
|
||||
|
||||
// void setChecksum(uint8_t *out)
|
||||
// {
|
||||
// uint16_t sum = calcChecksum(out);
|
||||
|
||||
// out[DfMp3_Packet_HiByteCheckSum] = ((sum >> 8) & 0xFF);
|
||||
// out[DfMp3_Packet_LowByteCheckSum] = (sum & 0xff);
|
||||
// }
|
||||
|
||||
// bool validateChecksum(uint8_t *in)
|
||||
// {
|
||||
// uint16_t sum = calcChecksum(in);
|
||||
// return (sum == static_cast<uint16_t>((in[DfMp3_Packet_HiByteCheckSum] << 8) | in[DfMp3_Packet_LowByteCheckSum]));
|
||||
// }
|
||||
};
|
||||
320
lib/MatrixUI/Fonts/fallout.h
Normal file
320
lib/MatrixUI/Fonts/fallout.h
Normal file
@@ -0,0 +1,320 @@
|
||||
const uint8_t Fallout[] PROGMEM = {
|
||||
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x1F, 0xF8,
|
||||
0xF9, 0xCF, 0x9C, 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 0x3E,
|
||||
0x0F, 0x80, 0xF8, 0x0F, 0x80, 0x3E, 0x03, 0xE0, 0x3E, 0x03, 0xE0, 0x3E,
|
||||
0x00, 0x7F, 0x07, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFE, 0x0F, 0xE0, 0x07, 0xC0, 0x7C,
|
||||
0x07, 0xC0, 0x7C, 0x07, 0xC0, 0x1F, 0x01, 0xF0, 0x1F, 0x07, 0xC0, 0x7C,
|
||||
0x07, 0xC0, 0x7C, 0x07, 0xCF, 0xE0, 0xFE, 0x00, 0x3E, 0x0E, 0x7C, 0x1F,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x3E, 0x30, 0x7C, 0x00 };
|
||||
|
||||
const GFXglyph FalloutGlyphs[] PROGMEM = {
|
||||
{ 0, 1, 1, 12, 0, 0 }, // 0x20 ' '
|
||||
{ 1, 5, 17, 7, 0, -16 }, // 0x21 '!'
|
||||
{ 12, 12, 5, 15, 0, -19 }, // 0x22 '"'
|
||||
{ 20, 17, 17, 20, 0, -16 }, // 0x23 '#'
|
||||
{ 57, 15, 17, 17, 0, -16 }, // 0x24 '$'
|
||||
{ 89, 20, 17, 22, 0, -16 }, // 0x25 '%'
|
||||
{ 132, 17, 17, 20, 0, -16 }, // 0x26 '&'
|
||||
{ 169, 5, 5, 7, 0, -19 }, // 0x27 '''
|
||||
{ 173, 10, 17, 12, 0, -16 }, // 0x28 '('
|
||||
{ 195, 10, 17, 12, 0, -16 }, // 0x29 ')'
|
||||
{ 217, 17, 13, 20, 0, -14 }, // 0x2A '*'
|
||||
{ 245, 15, 13, 17, 0, -14 }, // 0x2B '+'
|
||||
{ 270, 7, 7, 10, 0, -4 }, // 0x2C ','
|
||||
{ 277, 15, 3, 17, 0, -9 }, // 0x2D '-'
|
||||
{ 283, 5, 5, 7, 0, -4 }, // 0x2E '.'
|
||||
{ 287, 15, 17, 17, 0, -16 }, // 0x2F '/'
|
||||
{ 319, 15, 17, 17, 0, -16 }, // 0x30 '0'
|
||||
{ 351, 10, 17, 12, 0, -16 }, // 0x31 '1'
|
||||
{ 373, 15, 17, 17, 0, -16 }, // 0x32 '2'
|
||||
{ 405, 15, 17, 17, 0, -16 }, // 0x33 '3'
|
||||
{ 437, 15, 17, 17, 0, -16 }, // 0x34 '4'
|
||||
{ 469, 15, 17, 17, 0, -16 }, // 0x35 '5'
|
||||
{ 501, 15, 17, 17, 0, -16 }, // 0x36 '6'
|
||||
{ 533, 15, 17, 17, 0, -16 }, // 0x37 '7'
|
||||
{ 565, 15, 17, 17, 0, -16 }, // 0x38 '8'
|
||||
{ 597, 15, 17, 17, 0, -16 }, // 0x39 '9'
|
||||
{ 629, 5, 15, 7, 0, -14 }, // 0x3A ':'
|
||||
{ 639, 7, 17, 10, 0, -14 }, // 0x3B ';'
|
||||
{ 654, 12, 17, 15, 0, -16 }, // 0x3C '<'
|
||||
{ 680, 15, 10, 17, 0, -11 }, // 0x3D '='
|
||||
{ 699, 12, 17, 15, 0, -16 }, // 0x3E '>'
|
||||
{ 725, 15, 17, 17, 0, -16 }, // 0x3F '?'
|
||||
{ 757, 17, 17, 20, 0, -16 }, // 0x40 '@'
|
||||
{ 794, 20, 17, 22, 0, -16 }, // 0x41 'A'
|
||||
{ 837, 17, 17, 20, 0, -16 }, // 0x42 'B'
|
||||
{ 874, 15, 17, 17, 0, -16 }, // 0x43 'C'
|
||||
{ 906, 17, 17, 20, 0, -16 }, // 0x44 'D'
|
||||
{ 943, 15, 17, 17, 0, -16 }, // 0x45 'E'
|
||||
{ 975, 15, 17, 17, 0, -16 }, // 0x46 'F'
|
||||
{ 1007, 17, 17, 20, 0, -16 }, // 0x47 'G'
|
||||
{ 1044, 17, 17, 20, 0, -16 }, // 0x48 'H'
|
||||
{ 1081, 5, 17, 7, 0, -16 }, // 0x49 'I'
|
||||
{ 1092, 17, 17, 20, 0, -16 }, // 0x4A 'J'
|
||||
{ 1129, 17, 17, 20, 0, -16 }, // 0x4B 'K'
|
||||
{ 1166, 15, 17, 17, 0, -16 }, // 0x4C 'L'
|
||||
{ 1198, 17, 17, 20, 0, -16 }, // 0x4D 'M'
|
||||
{ 1235, 17, 17, 20, 0, -16 }, // 0x4E 'N'
|
||||
{ 1272, 17, 17, 20, 0, -16 }, // 0x4F 'O'
|
||||
{ 1309, 17, 17, 20, 0, -16 }, // 0x50 'P'
|
||||
{ 1346, 17, 19, 20, 0, -16 }, // 0x51 'Q'
|
||||
{ 1387, 17, 17, 20, 0, -16 }, // 0x52 'R'
|
||||
{ 1424, 17, 17, 20, 0, -16 }, // 0x53 'S'
|
||||
{ 1461, 15, 17, 17, 0, -16 }, // 0x54 'T'
|
||||
{ 1493, 17, 17, 20, 0, -16 }, // 0x55 'U'
|
||||
{ 1530, 20, 17, 22, 0, -16 }, // 0x56 'V'
|
||||
{ 1573, 17, 17, 20, 0, -16 }, // 0x57 'W'
|
||||
{ 1610, 20, 17, 22, 0, -16 }, // 0x58 'X'
|
||||
{ 1653, 17, 17, 20, 0, -16 }, // 0x59 'Y'
|
||||
{ 1690, 17, 17, 20, 0, -16 }, // 0x5A 'Z'
|
||||
{ 1727, 10, 17, 12, 0, -16 }, // 0x5B '['
|
||||
{ 1749, 17, 17, 20, 0, -16 }, // 0x5C '\'
|
||||
{ 1786, 10, 17, 12, 0, -16 }, // 0x5D ']'
|
||||
{ 1808, 17, 10, 20, 0, -16 }, // 0x5E '^'
|
||||
{ 1830, 15, 2, 17, 0, -1 }, // 0x5F '_'
|
||||
{ 1834, 7, 7, 10, 0, -16 }, // 0x60 '`'
|
||||
{ 1841, 15, 12, 17, 0, -11 }, // 0x61 'a'
|
||||
{ 1864, 15, 17, 17, 0, -16 }, // 0x62 'b'
|
||||
{ 1896, 12, 12, 15, 0, -11 }, // 0x63 'c'
|
||||
{ 1914, 15, 17, 17, 0, -16 }, // 0x64 'd'
|
||||
{ 1946, 15, 12, 17, 0, -11 }, // 0x65 'e'
|
||||
{ 1969, 12, 17, 15, 0, -16 }, // 0x66 'f'
|
||||
{ 1995, 15, 17, 17, 0, -11 }, // 0x67 'g'
|
||||
{ 2027, 15, 17, 17, 0, -16 }, // 0x68 'h'
|
||||
{ 2059, 5, 12, 7, 0, -11 }, // 0x69 'i'
|
||||
{ 2067, 12, 17, 15, 0, -11 }, // 0x6A 'j'
|
||||
{ 2093, 15, 17, 17, 0, -16 }, // 0x6B 'k'
|
||||
{ 2125, 5, 17, 7, 0, -16 }, // 0x6C 'l'
|
||||
{ 2136, 17, 12, 20, 0, -11 }, // 0x6D 'm'
|
||||
{ 2162, 15, 12, 17, 0, -11 }, // 0x6E 'n'
|
||||
{ 2185, 15, 12, 17, 0, -11 }, // 0x6F 'o'
|
||||
{ 2208, 15, 17, 17, 0, -11 }, // 0x70 'p'
|
||||
{ 2240, 15, 17, 17, 0, -11 }, // 0x71 'q'
|
||||
{ 2272, 12, 12, 15, 0, -11 }, // 0x72 'r'
|
||||
{ 2290, 15, 12, 17, 0, -11 }, // 0x73 's'
|
||||
{ 2313, 15, 17, 17, 0, -16 }, // 0x74 't'
|
||||
{ 2345, 15, 12, 17, 0, -11 }, // 0x75 'u'
|
||||
{ 2368, 17, 12, 20, 0, -11 }, // 0x76 'v'
|
||||
{ 2394, 17, 12, 20, 0, -11 }, // 0x77 'w'
|
||||
{ 2420, 15, 12, 17, 0, -11 }, // 0x78 'x'
|
||||
{ 2443, 15, 17, 17, 0, -11 }, // 0x79 'y'
|
||||
{ 2475, 15, 12, 17, 0, -11 }, // 0x7A 'z'
|
||||
{ 2498, 12, 17, 15, 0, -16 }, // 0x7B '{'
|
||||
{ 2524, 5, 22, 7, 0, -19 }, // 0x7C '|'
|
||||
{ 2538, 12, 17, 15, 0, -16 }, // 0x7D '}'
|
||||
{ 2564, 15, 7, 17, 0, -11 } }; // 0x7E '~'
|
||||
|
||||
const GFXfont Fallout__1_20pt7b PROGMEM = {
|
||||
(uint8_t *)Fallout__1_20pt7bBitmaps,
|
||||
(GFXglyph *)Fallout__1_20pt7bGlyphs,
|
||||
0x20, 0x7E, 38 };
|
||||
|
||||
// Approx. 3250 bytes
|
||||
@@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#include "MatrixDisplayUi.h"
|
||||
#include "AwtrixFont.h"
|
||||
#include "Fonts/AwtrixFont.h"
|
||||
|
||||
MatrixDisplayUi::MatrixDisplayUi(FastLED_NeoMatrix *matrix)
|
||||
{
|
||||
|
||||
@@ -102,7 +102,6 @@ private:
|
||||
uint8_t updateInterval = 33;
|
||||
|
||||
uint8_t getnextAppNumber();
|
||||
void drawIndicator();
|
||||
void drawApp();
|
||||
void drawOverlays();
|
||||
void tick();
|
||||
@@ -110,7 +109,6 @@ private:
|
||||
|
||||
public:
|
||||
MatrixDisplayUi(FastLED_NeoMatrix *matrix);
|
||||
|
||||
uint8_t AppCount = 0;
|
||||
/**
|
||||
* Initialise the display
|
||||
|
||||
@@ -24,6 +24,12 @@ void FSWebServer::addHandler(const Uri &uri, HTTPMethod method, WebServerClass::
|
||||
webserver->on(uri, method, fn);
|
||||
}
|
||||
|
||||
|
||||
void FSWebServer::onNotFound(WebServerClass::THandlerFunction fn)
|
||||
{
|
||||
webserver->onNotFound(fn);
|
||||
}
|
||||
|
||||
void FSWebServer::addHandler(const Uri &uri, WebServerClass::THandlerFunction handler)
|
||||
{
|
||||
webserver->on(uri, HTTP_ANY, handler);
|
||||
@@ -163,6 +169,7 @@ IPAddress FSWebServer::startWiFi(uint32_t timeout, const char *apSSID, const cha
|
||||
WiFi.begin(_ssid, _pass);
|
||||
Serial.print(F("Connecting to "));
|
||||
Serial.println(_ssid);
|
||||
|
||||
uint32_t startTime = millis();
|
||||
while (WiFi.status() != WL_CONNECTED)
|
||||
{
|
||||
@@ -170,6 +177,8 @@ IPAddress FSWebServer::startWiFi(uint32_t timeout, const char *apSSID, const cha
|
||||
Serial.print(".");
|
||||
if (WiFi.status() == WL_CONNECTED)
|
||||
{
|
||||
WiFi.setAutoReconnect(true);
|
||||
WiFi.persistent(true);
|
||||
ip = WiFi.localIP();
|
||||
return ip;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <memory>
|
||||
#include <typeinfo>
|
||||
#include <base64.h>
|
||||
//#include <FS.h>
|
||||
// #include <FS.h>
|
||||
#include <LittleFS.h>
|
||||
|
||||
#define INCLUDE_EDIT_HTM
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
bool begin(const char *path = nullptr);
|
||||
|
||||
void run();
|
||||
void onNotFound(WebServerClass::THandlerFunction fn);
|
||||
|
||||
void addHandler(const Uri &uri, HTTPMethod method, WebServerClass::THandlerFunction fn);
|
||||
|
||||
@@ -255,13 +256,12 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
bool saveOptionValue(const char *label, T val)
|
||||
{
|
||||
// Öffne die Datei im Lesemodus, um den Inhalt des Dokuments beizubehalten
|
||||
File file = m_filesystem->open("/config.json", "r");
|
||||
DynamicJsonDocument doc(file.size()* 1.33);
|
||||
DynamicJsonDocument doc(file.size() * 1.33);
|
||||
|
||||
if (file)
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ lib_deps =
|
||||
fastled/FastLED@^3.5.0
|
||||
marcmerlin/FastLED NeoMatrix@^1.2
|
||||
knolleary/PubSubClient@^2.8
|
||||
plerup/EspSoftwareSerial@^8.0.1
|
||||
|
||||
[env:awtrix_upgrade]
|
||||
platform = https://github.com/platformio/platform-espressif32.git
|
||||
@@ -31,9 +32,10 @@ upload_speed = 921600
|
||||
framework = arduino
|
||||
build_flags = -DAWTRIX_UPGRADE -D MQTT_MAX_PACKET_SIZE=1024
|
||||
lib_deps =
|
||||
adafruit/Adafruit SHT31 Library@^2.2.0
|
||||
adafruit/Adafruit BME280 Library@^2.2.2
|
||||
bblanchon/ArduinoJson@^6.20.0
|
||||
evert-arias/EasyButton@^2.0.1
|
||||
fastled/FastLED@^3.5.0
|
||||
marcmerlin/FastLED NeoMatrix@^1.2
|
||||
knolleary/PubSubClient@^2.8
|
||||
plerup/EspSoftwareSerial@^8.0.1
|
||||
|
||||
133
src/Apps.h
133
src/Apps.h
@@ -36,6 +36,7 @@ struct CustomApp
|
||||
bool isGif;
|
||||
bool rainbow;
|
||||
bool soundPlayed;
|
||||
uint16_t duration = 0;
|
||||
String sound;
|
||||
int16_t repeat = 0;
|
||||
int16_t currentRepeat = 0;
|
||||
@@ -61,7 +62,7 @@ struct Notification
|
||||
bool isGif;
|
||||
bool flag = false;
|
||||
unsigned long startime = 0;
|
||||
unsigned long duration = 0;
|
||||
uint16_t duration = 0;
|
||||
int16_t repeat = -1;
|
||||
bool hold = false;
|
||||
byte pushIcon = 0;
|
||||
@@ -104,7 +105,7 @@ int findAppIndexByName(const String &name)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void TimeApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void TimeApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
if (notify.flag)
|
||||
return;
|
||||
@@ -152,7 +153,7 @@ void TimeApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x,
|
||||
}
|
||||
}
|
||||
|
||||
void DateApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void DateApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
if (notify.flag)
|
||||
return;
|
||||
@@ -180,7 +181,7 @@ void DateApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x,
|
||||
}
|
||||
}
|
||||
|
||||
void TempApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void TempApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
if (notify.flag)
|
||||
return;
|
||||
@@ -201,7 +202,7 @@ void TempApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x,
|
||||
}
|
||||
}
|
||||
|
||||
void HumApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void HumApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
if (notify.flag)
|
||||
return;
|
||||
@@ -214,7 +215,8 @@ void HumApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, i
|
||||
matrix->print("%");
|
||||
}
|
||||
|
||||
void BatApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
#ifdef ULANZI
|
||||
void BatApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
if (notify.flag)
|
||||
return;
|
||||
@@ -225,6 +227,7 @@ void BatApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, i
|
||||
matrix->print(BATTERY_PERCENT); // Ausgabe des Ladezustands
|
||||
matrix->print("%");
|
||||
}
|
||||
#endif
|
||||
|
||||
void MenuApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state)
|
||||
{
|
||||
@@ -273,7 +276,7 @@ void TimerApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state)
|
||||
}
|
||||
}
|
||||
|
||||
void ShowCustomApp(String name, FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void ShowCustomApp(String name, FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
// Abort if notify.flag is set
|
||||
if (notify.flag)
|
||||
@@ -290,8 +293,8 @@ void ShowCustomApp(String name, FastLED_NeoMatrix *matrix, MatrixDisplayUiState
|
||||
return;
|
||||
}
|
||||
|
||||
// reset custom App properties if last App
|
||||
if (lastApp)
|
||||
// reset custom App properties if last frame
|
||||
if (lastFrame)
|
||||
{
|
||||
ca->iconWasPushed = false;
|
||||
ca->scrollposition = 9;
|
||||
@@ -299,6 +302,14 @@ void ShowCustomApp(String name, FastLED_NeoMatrix *matrix, MatrixDisplayUiState
|
||||
ca->scrollDelay = 0;
|
||||
}
|
||||
|
||||
if (!DisplayManager.appIsSwitching)
|
||||
{
|
||||
if (ca->duration > 0)
|
||||
{
|
||||
DisplayManager.setAppTime(ca->duration);
|
||||
}
|
||||
}
|
||||
|
||||
CURRENT_APP = ca->name;
|
||||
currentCustomApp = name;
|
||||
|
||||
@@ -620,64 +631,126 @@ void NotifyApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state)
|
||||
DisplayManager.getInstance().resetTextColor();
|
||||
}
|
||||
|
||||
void CApp1(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
// Unattractive to have a function for every customapp wich does the same, but currently still no other option found TODO
|
||||
|
||||
void CApp1(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp1);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstApp, lastApp);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp2(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void CApp2(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp2);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstApp, lastApp);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp3(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void CApp3(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp3);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstApp, lastApp);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp4(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void CApp4(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp4);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstApp, lastApp);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp5(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void CApp5(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp5);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstApp, lastApp);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp6(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void CApp6(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp6);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstApp, lastApp);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp7(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void CApp7(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp7);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstApp, lastApp);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp8(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void CApp8(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp8);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstApp, lastApp);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp9(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void CApp9(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp9);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstApp, lastApp);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp10(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void CApp10(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp10);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstApp, lastApp);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp11(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp11);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp12(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp12);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp13(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp13);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp14(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp14);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp15(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp15);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp16(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp16);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp17(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp17);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp18(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp18);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp19(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp19);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
void CApp20(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
String name = getAppNameByFunction(CApp20);
|
||||
ShowCustomApp(name, matrix, state, x, y, firstFrame, lastFrame);
|
||||
}
|
||||
|
||||
const uint16_t *getWeatherIcon(int code)
|
||||
@@ -694,7 +767,7 @@ const uint16_t *getWeatherIcon(int code)
|
||||
}
|
||||
}
|
||||
|
||||
void WeatherApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstApp, bool lastApp)
|
||||
void WeatherApp(FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, bool firstFrame, bool lastFrame)
|
||||
{
|
||||
if (notify.flag)
|
||||
return;
|
||||
|
||||
@@ -50,11 +50,13 @@ extern const char HAhumName[];
|
||||
extern const char HAhumClass[];
|
||||
extern const char HAhumUnit[];
|
||||
|
||||
#ifdef ULANZI
|
||||
extern const char HAbatID[];
|
||||
extern const char HAbatIcon[];
|
||||
extern const char HAbatName[];
|
||||
extern const char HAbatClass[];
|
||||
extern const char HAbatUnit[];
|
||||
#endif
|
||||
|
||||
extern const char HAluxID[];
|
||||
extern const char HAluxIcon[];
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "ServerManager.h"
|
||||
#include "MenuManager.h"
|
||||
#include "Apps.h"
|
||||
#include "Dictionary.h"
|
||||
|
||||
Ticker AlarmTicker;
|
||||
Ticker TimerTicker;
|
||||
@@ -26,8 +27,6 @@ Ticker TimerTicker;
|
||||
#define MATRIX_WIDTH 32
|
||||
#define MATRIX_HEIGHT 8
|
||||
|
||||
bool appIsSwitching;
|
||||
|
||||
GifPlayer gif;
|
||||
|
||||
CRGB leds[MATRIX_WIDTH * MATRIX_HEIGHT];
|
||||
@@ -214,7 +213,7 @@ void pushCustomApp(String name, int position)
|
||||
if (customApps.count(name) == 0)
|
||||
{
|
||||
++customPagesCount;
|
||||
void (*customApps[10])(FastLED_NeoMatrix *, MatrixDisplayUiState *, int16_t, int16_t, bool, bool) = {CApp1, CApp2, CApp3, CApp4, CApp5, CApp6, CApp7, CApp8, CApp9, CApp10};
|
||||
void (*customApps[20])(FastLED_NeoMatrix *, MatrixDisplayUiState *, int16_t, int16_t, bool, bool) = {CApp1, CApp2, CApp3, CApp4, CApp5, CApp6, CApp7, CApp8, CApp9, CApp10, CApp11, CApp12, CApp13, CApp14, CApp15, CApp16, CApp17, CApp18, CApp19, CApp20};
|
||||
|
||||
if (position < 0) // Insert at the end of the vector
|
||||
{
|
||||
@@ -230,6 +229,7 @@ void pushCustomApp(String name, int position)
|
||||
}
|
||||
|
||||
ui.setApps(Apps); // Add Apps
|
||||
DisplayManager.getInstance().setAutoTransition(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,17 +238,15 @@ void removeCustomApp(const String &name)
|
||||
auto it = std::find_if(Apps.begin(), Apps.end(), [&name](const std::pair<String, AppCallback> &appPair)
|
||||
{ return appPair.first == name; });
|
||||
|
||||
if (it != Apps.end())
|
||||
{
|
||||
Apps.erase(it);
|
||||
ui.setApps(Apps);
|
||||
}
|
||||
Apps.erase(it);
|
||||
ui.setApps(Apps);
|
||||
}
|
||||
|
||||
void DisplayManager_::generateCustomPage(String name, const char *json)
|
||||
{
|
||||
if (json == "" && customApps.count(name))
|
||||
if (strcmp(json, "") == 0 && customApps.count(name))
|
||||
{
|
||||
Serial.println("delete");
|
||||
customApps.erase(customApps.find(name));
|
||||
removeCustomApp(name);
|
||||
return;
|
||||
@@ -295,6 +293,7 @@ void DisplayManager_::generateCustomPage(String name, const char *json)
|
||||
customApp.barSize = 0;
|
||||
}
|
||||
|
||||
customApp.duration = doc.containsKey("duration") ? doc["duration"].as<int>() * 1000 : -1;
|
||||
int pos = doc.containsKey("pos") ? doc["pos"].as<uint8_t>() : -1;
|
||||
customApp.rainbow = doc.containsKey("rainbow") ? doc["rainbow"] : false;
|
||||
customApp.pushIcon = doc.containsKey("pushIcon") ? doc["pushIcon"] : 0;
|
||||
@@ -503,8 +502,10 @@ void DisplayManager_::loadNativeApps()
|
||||
// Update the "hum" app at position 3
|
||||
updateApp("hum", HumApp, SHOW_HUM, 3);
|
||||
|
||||
#ifdef ULANZI
|
||||
// Update the "bat" app at position 4
|
||||
updateApp("bat", BatApp, SHOW_BAT, 4);
|
||||
#endif
|
||||
|
||||
ui.setApps(Apps);
|
||||
|
||||
@@ -513,6 +514,7 @@ void DisplayManager_::loadNativeApps()
|
||||
|
||||
void DisplayManager_::setup()
|
||||
{
|
||||
|
||||
TJpgDec.setCallback(jpg_output);
|
||||
FastLED.addLeds<NEOPIXEL, MATRIX_PIN>(leds, MATRIX_WIDTH * MATRIX_HEIGHT);
|
||||
gif.setMatrix(&matrix);
|
||||
@@ -530,17 +532,17 @@ void DisplayManager_::tick()
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.update();
|
||||
if (ui.getUiState()->appState == IN_TRANSITION && !appIsSwitching)
|
||||
{
|
||||
appIsSwitching = true;
|
||||
MQTTManager.setCurrentApp(CURRENT_APP);
|
||||
}
|
||||
else if (ui.getUiState()->appState == FIXED && appIsSwitching)
|
||||
{
|
||||
appIsSwitching = false;
|
||||
MQTTManager.setCurrentApp(CURRENT_APP);
|
||||
setAppTime(TIME_PER_APP);
|
||||
}
|
||||
ui.update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -782,7 +784,8 @@ void DisplayManager_::updateAppVector(const char *json)
|
||||
bool show = true;
|
||||
int position = -1;
|
||||
|
||||
if (app.containsKey("show"))
|
||||
if (app.containsKey("show"))
|
||||
|
||||
{
|
||||
show = app["show"].as<bool>();
|
||||
}
|
||||
@@ -813,11 +816,17 @@ void DisplayManager_::updateAppVector(const char *json)
|
||||
callback = HumApp;
|
||||
SHOW_HUM = show;
|
||||
}
|
||||
|
||||
#ifdef ULANZI
|
||||
|
||||
else if (name == "bat")
|
||||
{
|
||||
callback = BatApp;
|
||||
SHOW_BAT = show;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
else
|
||||
{
|
||||
// If the app is not one of the built-in apps, check if it's already in the vector
|
||||
@@ -877,3 +886,29 @@ void DisplayManager_::updateAppVector(const char *json)
|
||||
ui.setApps(Apps);
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
String DisplayManager_::getStat()
|
||||
{
|
||||
StaticJsonDocument<200> doc;
|
||||
char buffer[5];
|
||||
doc[BatKey] = BATTERY_PERCENT;
|
||||
doc[BatRawKey] = BATTERY_RAW;
|
||||
snprintf(buffer, 5, "%.0f", CURRENT_LUX);
|
||||
doc[LuxKey] = buffer;
|
||||
doc[LDRRawKey] = LDR_RAW;
|
||||
doc[BrightnessKey] = BRIGHTNESS;
|
||||
snprintf(buffer, 5, "%.0f", CURRENT_TEMP);
|
||||
doc[TempKey] = buffer;
|
||||
snprintf(buffer, 5, "%.0f", CURRENT_HUM);
|
||||
doc[HumKey] = buffer;
|
||||
doc[UpTimeKey] = PeripheryManager.readUptime();
|
||||
doc[SignalStrengthKey] = WiFi.RSSI();
|
||||
String jsonString;
|
||||
serializeJson(doc, jsonString);
|
||||
return jsonString;
|
||||
}
|
||||
|
||||
void DisplayManager_::setAppTime(uint16_t duration)
|
||||
{
|
||||
ui.setTimePerApp(duration);
|
||||
}
|
||||
@@ -11,8 +11,10 @@ private:
|
||||
|
||||
DisplayManager_() = default;
|
||||
|
||||
#ifdef ULANZI
|
||||
const int BatReadings = 10;
|
||||
uint16_t TotalBatReadings[10];
|
||||
#endif
|
||||
int readIndex = 0;
|
||||
uint16_t total = 0;
|
||||
uint16_t average = 0;
|
||||
@@ -24,6 +26,7 @@ private:
|
||||
|
||||
public:
|
||||
static DisplayManager_ &getInstance();
|
||||
bool appIsSwitching;
|
||||
void setup();
|
||||
void tick();
|
||||
void clear();
|
||||
@@ -46,7 +49,7 @@ public:
|
||||
void setFPS(uint8_t);
|
||||
void MatrixState(bool);
|
||||
void generateNotification(const char *json);
|
||||
void generateCustomPage(String, const char *json);
|
||||
void generateCustomPage(String name, const char *json);
|
||||
void printText(int16_t x, int16_t y, const char *text, bool centered, bool ignoreUppercase);
|
||||
bool setAutoTransition(bool active);
|
||||
void switchToApp(const char *json);
|
||||
@@ -58,6 +61,9 @@ public:
|
||||
void drawBMP(int16_t x, int16_t y, const uint16_t bitmap[], int16_t w, int16_t h);
|
||||
void drawBarChart(int16_t x, int16_t y, const int data[], byte dataSize, bool withIcon, uint16_t color);
|
||||
void updateAppVector(const char *json);
|
||||
void setMatrixLayout(int layout);
|
||||
void setAppTime(uint16_t duration);
|
||||
String getStat();
|
||||
};
|
||||
|
||||
extern DisplayManager_ &DisplayManager;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "Globals.h"
|
||||
#include "Preferences.h"
|
||||
#include <WiFi.h>
|
||||
#include <ArduinoJson.h>
|
||||
#include <LittleFS.h>
|
||||
|
||||
Preferences Settings;
|
||||
|
||||
@@ -13,8 +15,53 @@ char *getID()
|
||||
return macStr;
|
||||
}
|
||||
|
||||
void startLittleFS()
|
||||
{
|
||||
if (LittleFS.begin())
|
||||
{
|
||||
LittleFS.mkdir("/MELODIES");
|
||||
LittleFS.mkdir("/ICONS");
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.println("ERROR on mounting LittleFS. It will be formmatted!");
|
||||
LittleFS.format();
|
||||
ESP.restart();
|
||||
}
|
||||
}
|
||||
|
||||
void loadDevSettings()
|
||||
{
|
||||
Serial.println("laodSettings");
|
||||
File file = LittleFS.open("/dev.json", "r");
|
||||
if (!file)
|
||||
{
|
||||
return;
|
||||
}
|
||||
DynamicJsonDocument doc(128);
|
||||
DeserializationError error = deserializeJson(doc, file);
|
||||
if (error)
|
||||
{
|
||||
Serial.println(F("Failed to read dev settings"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (doc.containsKey("bootsound"))
|
||||
{
|
||||
BOOT_SOUND = doc["bootsound"].as<String>();
|
||||
}
|
||||
|
||||
if (doc.containsKey("bootsound"))
|
||||
{
|
||||
UPPERCASE_LETTERS = doc["uppercase"].as<bool>();
|
||||
}
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
void loadSettings()
|
||||
{
|
||||
startLittleFS();
|
||||
Settings.begin("awtrix", false);
|
||||
MATRIX_FPS = Settings.getUChar("FPS", 23);
|
||||
BRIGHTNESS = Settings.getUChar("BRI", 120);
|
||||
@@ -31,10 +78,15 @@ void loadSettings()
|
||||
SHOW_DATE = Settings.getBool("DAT", true);
|
||||
SHOW_TEMP = Settings.getBool("TEMP", true);
|
||||
SHOW_HUM = Settings.getBool("HUM", true);
|
||||
MATRIX_LAYOUT = Settings.getUInt("MAT", 0);
|
||||
#ifdef ULANZI
|
||||
SHOW_BAT = Settings.getBool("BAT", true);
|
||||
#endif
|
||||
SOUND_ACTIVE = Settings.getBool("SOUND", true);
|
||||
Settings.end();
|
||||
uniqueID = getID();
|
||||
MQTT_PREFIX = String(uniqueID);
|
||||
loadDevSettings();
|
||||
}
|
||||
|
||||
void saveSettings()
|
||||
@@ -55,7 +107,11 @@ void saveSettings()
|
||||
Settings.putBool("DAT", SHOW_DATE);
|
||||
Settings.putBool("TEMP", SHOW_TEMP);
|
||||
Settings.putBool("HUM", SHOW_HUM);
|
||||
Settings.putUInt("MAT", MATRIX_LAYOUT);
|
||||
#ifdef ULANZI
|
||||
Settings.putBool("BAT", SHOW_BAT);
|
||||
#endif
|
||||
Settings.putBool("SOUND", SOUND_ACTIVE);
|
||||
Settings.end();
|
||||
}
|
||||
|
||||
@@ -65,7 +121,7 @@ IPAddress gateway;
|
||||
IPAddress subnet;
|
||||
IPAddress primaryDNS;
|
||||
IPAddress secondaryDNS;
|
||||
const char *VERSION = "0.45";
|
||||
const char *VERSION = "0.46";
|
||||
String MQTT_HOST = "";
|
||||
uint16_t MQTT_PORT = 1883;
|
||||
String MQTT_USER;
|
||||
@@ -77,7 +133,9 @@ bool NET_STATIC = false;
|
||||
bool SHOW_TIME = true;
|
||||
bool SHOW_DATE = true;
|
||||
bool SHOW_WEATHER = true;
|
||||
#ifdef ULANZI
|
||||
bool SHOW_BAT = true;
|
||||
#endif
|
||||
bool SHOW_TEMP = true;
|
||||
bool SHOW_HUM = true;
|
||||
bool SHOW_SECONDS = true;
|
||||
@@ -102,8 +160,10 @@ float CURRENT_HUM;
|
||||
float CURRENT_LUX;
|
||||
uint8_t BRIGHTNESS = 120;
|
||||
uint8_t BRIGHTNESS_PERCENT;
|
||||
#ifdef ULANZI
|
||||
uint8_t BATTERY_PERCENT;
|
||||
uint16_t BATTERY_RAW;
|
||||
#endif
|
||||
uint16_t LDR_RAW;
|
||||
String TIME_FORMAT = "%H:%M:%S";
|
||||
String DATE_FORMAT = "%d.%m.%y";
|
||||
@@ -123,3 +183,8 @@ bool MATRIX_OFF;
|
||||
bool TIMER_ACTIVE;
|
||||
bool ALARM_ACTIVE;
|
||||
uint16_t TEXTCOLOR_565 = 0xFFFF;
|
||||
bool SOUND_ACTIVE;
|
||||
String BOOT_SOUND = "";
|
||||
uint8_t VOLUME;
|
||||
uint8_t VOLUME_PERCENT;
|
||||
int MATRIX_LAYOUT;
|
||||
@@ -20,7 +20,9 @@ extern bool NET_STATIC;
|
||||
extern bool SHOW_TIME;
|
||||
extern bool SHOW_DATE;
|
||||
extern bool SHOW_WEATHER;
|
||||
#ifdef ULANZI
|
||||
extern bool SHOW_BAT;
|
||||
#endif
|
||||
extern bool SHOW_TEMP;
|
||||
extern bool SHOW_HUM;
|
||||
extern bool SHOW_SECONDS;
|
||||
@@ -42,8 +44,10 @@ extern float CURRENT_HUM;
|
||||
extern float CURRENT_LUX;
|
||||
extern uint16_t LDR_RAW;
|
||||
extern String CURRENT_APP;
|
||||
#ifdef ULANZI
|
||||
extern uint8_t BATTERY_PERCENT;
|
||||
extern uint16_t BATTERY_RAW;
|
||||
#endif
|
||||
extern uint8_t BRIGHTNESS;
|
||||
extern uint8_t BRIGHTNESS_PERCENT;
|
||||
extern String TEXTCOLOR;
|
||||
@@ -62,7 +66,11 @@ extern String TIME_FORMAT;
|
||||
extern String DATE_FORMAT;
|
||||
extern bool START_ON_MONDAY;
|
||||
extern bool IS_CELSIUS;
|
||||
|
||||
extern bool SOUND_ACTIVE;
|
||||
extern String BOOT_SOUND;
|
||||
extern uint8_t VOLUME;
|
||||
extern uint8_t VOLUME_PERCENT;
|
||||
extern int MATRIX_LAYOUT;
|
||||
void loadSettings();
|
||||
void saveSettings();
|
||||
#endif // Globals_H
|
||||
@@ -6,8 +6,7 @@
|
||||
#include <WiFi.h>
|
||||
#include <ArduinoJson.h>
|
||||
#include "Dictionary.h"
|
||||
|
||||
unsigned long startTime;
|
||||
#include "PeripheryManager.h"
|
||||
|
||||
WiFiClient espClient;
|
||||
uint8_t lastBrightness;
|
||||
@@ -24,7 +23,9 @@ HAButton *nextApp = nullptr;
|
||||
HAButton *prevApp = nullptr;
|
||||
HASwitch *transition = nullptr;
|
||||
HASensor *curApp = nullptr;
|
||||
#ifdef ULANZI
|
||||
HASensor *battery = nullptr;
|
||||
#endif
|
||||
HASensor *temperature = nullptr;
|
||||
HASensor *humidity = nullptr;
|
||||
HASensor *illuminance = nullptr;
|
||||
@@ -201,7 +202,7 @@ void onMqttMessage(const char *topic, const uint8_t *payload, uint16_t length)
|
||||
void onMqttConnected()
|
||||
{
|
||||
String prefix = MQTT_PREFIX;
|
||||
const char* topics[] PROGMEM = {
|
||||
const char *topics[] PROGMEM = {
|
||||
"/brightness",
|
||||
"/notify/dismiss",
|
||||
"/notify",
|
||||
@@ -212,14 +213,16 @@ void onMqttConnected()
|
||||
"/previousapp",
|
||||
"/nextapp",
|
||||
"/nextapp",
|
||||
"/apps"
|
||||
};
|
||||
for (const char* topic : topics) {
|
||||
"/apps"};
|
||||
for (const char *topic : topics)
|
||||
{
|
||||
String fullTopic = prefix + topic;
|
||||
mqtt.subscribe(fullTopic.c_str());
|
||||
}
|
||||
Serial.println(F("MQTT Connected"));
|
||||
}
|
||||
|
||||
|
||||
void connect()
|
||||
{
|
||||
mqtt.onMessage(onMqttMessage);
|
||||
@@ -238,11 +241,14 @@ void connect()
|
||||
}
|
||||
|
||||
char matID[40], briID[40];
|
||||
char btnAID[40], btnBID[40], btnCID[40], appID[40], tempID[40], humID[40], luxID[40], verID[40], batID[40], ramID[40], upID[40], sigID[40], btnLID[40], btnMID[40], btnRID[40], transID[40];
|
||||
char btnAID[40], btnBID[40], btnCID[40], appID[40], tempID[40], humID[40], luxID[40], verID[40], ramID[40], upID[40], sigID[40], btnLID[40], btnMID[40], btnRID[40], transID[40];
|
||||
#ifdef ULANZI
|
||||
char batID[40];
|
||||
#endif
|
||||
|
||||
void MQTTManager_::setup()
|
||||
{
|
||||
startTime = millis();
|
||||
|
||||
if (HA_DISCOVERY)
|
||||
{
|
||||
Serial.println(F("Starting Homeassistant discorvery"));
|
||||
@@ -257,6 +263,8 @@ void MQTTManager_::setup()
|
||||
device.setManufacturer(HAmanufacturer);
|
||||
device.setModel(HAmodel);
|
||||
device.setAvailability(true);
|
||||
device.enableSharedAvailability();
|
||||
device.enableLastWill();
|
||||
|
||||
String uniqueIDWithSuffix;
|
||||
|
||||
@@ -330,12 +338,14 @@ void MQTTManager_::setup()
|
||||
humidity->setDeviceClass(HAhumClass);
|
||||
humidity->setUnitOfMeasurement(HAhumUnit);
|
||||
|
||||
#ifdef ULANZI
|
||||
sprintf(batID, HAbatID, macStr);
|
||||
battery = new HASensor(batID);
|
||||
battery->setIcon(HAbatIcon);
|
||||
battery->setName(HAbatName);
|
||||
battery->setDeviceClass(HAbatClass);
|
||||
battery->setUnitOfMeasurement(HAbatUnit);
|
||||
#endif
|
||||
|
||||
sprintf(luxID, HAluxID, macStr);
|
||||
illuminance = new HASensor(luxID);
|
||||
@@ -411,29 +421,15 @@ void MQTTManager_::setCurrentApp(String value)
|
||||
curApp->setValue(value.c_str());
|
||||
}
|
||||
|
||||
const char *readUptime()
|
||||
{
|
||||
static char uptime[25]; // Make the array static to keep it from being destroyed when the function returns
|
||||
unsigned long currentTime = millis();
|
||||
unsigned long elapsedTime = currentTime - startTime;
|
||||
unsigned long uptimeSeconds = elapsedTime / 1000;
|
||||
unsigned long uptimeMinutes = uptimeSeconds / 60;
|
||||
unsigned long uptimeHours = uptimeMinutes / 60;
|
||||
unsigned long uptimeDays = uptimeHours / 24;
|
||||
unsigned long hours = uptimeHours % 24;
|
||||
unsigned long minutes = uptimeMinutes % 60;
|
||||
unsigned long seconds = uptimeSeconds % 60;
|
||||
sprintf(uptime, "P%dDT%dH%dM%dS", uptimeDays, hours, minutes, seconds);
|
||||
return uptime;
|
||||
}
|
||||
|
||||
void MQTTManager_::sendStats()
|
||||
{
|
||||
if (HA_DISCOVERY)
|
||||
{
|
||||
char buffer[5];
|
||||
#ifdef ULANZI
|
||||
snprintf(buffer, 5, "%d", BATTERY_PERCENT);
|
||||
battery->setValue(buffer);
|
||||
#endif
|
||||
|
||||
snprintf(buffer, 5, "%.0f", CURRENT_TEMP);
|
||||
temperature->setValue(buffer);
|
||||
@@ -457,7 +453,7 @@ void MQTTManager_::sendStats()
|
||||
int freeHeapBytes = ESP.getFreeHeap();
|
||||
itoa(freeHeapBytes, rambuffer, 10);
|
||||
ram->setValue(rambuffer);
|
||||
uptime->setValue(readUptime());
|
||||
uptime->setValue(PeripheryManager.readUptime());
|
||||
version->setValue(VERSION);
|
||||
transition->setState(AUTO_TRANSITION, false);
|
||||
}
|
||||
@@ -465,23 +461,7 @@ void MQTTManager_::sendStats()
|
||||
{
|
||||
}
|
||||
|
||||
StaticJsonDocument<200> doc;
|
||||
char buffer[5];
|
||||
doc[BatKey] = BATTERY_PERCENT;
|
||||
doc[BatRawKey] = BATTERY_RAW;
|
||||
snprintf(buffer, 5, "%.0f", CURRENT_LUX);
|
||||
doc[LuxKey] = buffer;
|
||||
doc[LDRRawKey] = LDR_RAW;
|
||||
doc[BrightnessKey] = BRIGHTNESS;
|
||||
snprintf(buffer, 5, "%.0f", CURRENT_TEMP);
|
||||
doc[TempKey] = buffer;
|
||||
snprintf(buffer, 5, "%.0f", CURRENT_HUM);
|
||||
doc[HumKey] = buffer;
|
||||
doc[UpTimeKey] = readUptime();
|
||||
doc[SignalStrengthKey] = WiFi.RSSI();
|
||||
String jsonString;
|
||||
serializeJson(doc, jsonString);
|
||||
publish(StatsTopic, jsonString.c_str());
|
||||
publish(StatsTopic, DisplayManager.getStat().c_str());
|
||||
}
|
||||
|
||||
void MQTTManager_::sendButton(byte btn, bool state)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <Globals.h>
|
||||
#include <ServerManager.h>
|
||||
#include <DisplayManager.h>
|
||||
#include <PeripheryManager.h>
|
||||
#include <updater.h>
|
||||
#include <icons.h>
|
||||
|
||||
@@ -26,6 +27,8 @@ enum MenuState
|
||||
WeekdayMenu,
|
||||
TempMenu,
|
||||
Appmenu,
|
||||
SoundMenu,
|
||||
VolumeMenu
|
||||
};
|
||||
|
||||
const char *menuItems[] PROGMEM = {
|
||||
@@ -40,10 +43,11 @@ const char *menuItems[] PROGMEM = {
|
||||
"WEEKDAY",
|
||||
"TEMP",
|
||||
"APPS",
|
||||
"SOUND",
|
||||
"UPDATE"};
|
||||
|
||||
int8_t menuIndex = 0;
|
||||
uint8_t menuItemCount = 12;
|
||||
uint8_t menuItemCount = 13;
|
||||
|
||||
const char *timeFormat[] PROGMEM = {
|
||||
"%H:%M:%S",
|
||||
@@ -75,8 +79,12 @@ const char *appsItems[][2] PROGMEM = {
|
||||
{"13", "time"},
|
||||
{"1158", "date"},
|
||||
{"234", "temp"},
|
||||
#ifdef ULANZI
|
||||
{"2075", "hum"},
|
||||
{"1486", "bat"}};
|
||||
#else
|
||||
{"2075", "hum"}};
|
||||
#endif
|
||||
|
||||
int8_t appsIndex;
|
||||
uint8_t appsCount = 5;
|
||||
@@ -129,6 +137,8 @@ String MenuManager_::menutext()
|
||||
return "0x" + String(textColors[currentColor], HEX);
|
||||
case SwitchMenu:
|
||||
return AUTO_TRANSITION ? "ON" : "OFF";
|
||||
case SoundMenu:
|
||||
return SOUND_ACTIVE ? "ON" : "OFF";
|
||||
case TspeedMenu:
|
||||
return String(TIME_PER_TRANSITION / 1000.0, 1) + "s";
|
||||
case AppTimeMenu:
|
||||
@@ -173,9 +183,11 @@ String MenuManager_::menutext()
|
||||
case 3:
|
||||
DisplayManager.drawBMP(0, 0, get_icon(2075), 8, 8);
|
||||
return SHOW_HUM ? "ON" : "OFF";
|
||||
#ifdef ULANZI
|
||||
case 4:
|
||||
DisplayManager.drawBMP(0, 0, get_icon(1486), 8, 8);
|
||||
return SHOW_BAT ? "ON" : "OFF";
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -231,9 +243,16 @@ void MenuManager_::rightButton()
|
||||
case WeekdayMenu:
|
||||
START_ON_MONDAY = !START_ON_MONDAY;
|
||||
break;
|
||||
case SoundMenu:
|
||||
SOUND_ACTIVE = !SOUND_ACTIVE;
|
||||
break;
|
||||
case TempMenu:
|
||||
IS_CELSIUS = !IS_CELSIUS;
|
||||
break;
|
||||
case VolumeMenu:
|
||||
VOLUME_PERCENT = (VOLUME_PERCENT % 100) + 1;
|
||||
VOLUME = map(VOLUME_PERCENT, 0, 100, 0, 30);
|
||||
PeripheryManager.setVolume(VOLUME);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -291,6 +310,13 @@ void MenuManager_::leftButton()
|
||||
case TempMenu:
|
||||
IS_CELSIUS = !IS_CELSIUS;
|
||||
break;
|
||||
case SoundMenu:
|
||||
SOUND_ACTIVE = !SOUND_ACTIVE;
|
||||
break;
|
||||
case VolumeMenu:
|
||||
VOLUME_PERCENT = (VOLUME_PERCENT % 100) + 1;
|
||||
VOLUME = map(VOLUME_PERCENT, 0, 100, 0, 30);
|
||||
PeripheryManager.setVolume(VOLUME);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -342,6 +368,15 @@ void MenuManager_::selectButton()
|
||||
currentState = Appmenu;
|
||||
break;
|
||||
case 11:
|
||||
currentState = SoundMenu;
|
||||
break;
|
||||
case 12:
|
||||
#ifdef AWTRIX_UPGRADE
|
||||
currentState = VolumeMenu;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 13:
|
||||
if (FirmwareVersionCheck())
|
||||
{
|
||||
updateFirmware();
|
||||
@@ -374,9 +409,11 @@ void MenuManager_::selectButton()
|
||||
case 3:
|
||||
SHOW_HUM = !SHOW_HUM;
|
||||
break;
|
||||
#ifdef ULANZI
|
||||
case 4:
|
||||
SHOW_BAT = !SHOW_BAT;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -416,6 +453,12 @@ void MenuManager_::selectButtonLong()
|
||||
DisplayManager.applyAllSettings();
|
||||
saveSettings();
|
||||
break;
|
||||
case VolumeMenu:
|
||||
#ifdef AWTRIX_UPGRADE
|
||||
VOLUME = map(VOLUME_PERCENT, 0, 100, 0, 30);
|
||||
saveSettings();
|
||||
#endif
|
||||
break;
|
||||
case TimeFormatMenu:
|
||||
TIME_FORMAT = timeFormat[timeFormatIndex];
|
||||
saveSettings();
|
||||
@@ -424,6 +467,7 @@ void MenuManager_::selectButtonLong()
|
||||
DATE_FORMAT = dateFormat[dateFormatIndex];
|
||||
saveSettings();
|
||||
case WeekdayMenu:
|
||||
case SoundMenu:
|
||||
case TempMenu:
|
||||
saveSettings();
|
||||
break;
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#include <LightDependentResistor.h>
|
||||
#include <MenuManager.h>
|
||||
|
||||
#define SOUND_OFF false
|
||||
|
||||
#ifdef ULANZI
|
||||
// Pinouts für das ULANZI-Environment
|
||||
#define BATTERY_PIN 34
|
||||
@@ -21,7 +19,6 @@
|
||||
#define BUTTON_SELECT_PIN 27
|
||||
#else
|
||||
// Pinouts für das WEMOS_D1_MINI32-Environment
|
||||
#define BATTERY_PIN -1
|
||||
#define BUZZER_PIN -1
|
||||
#define LDR_PIN A0
|
||||
#define BUTTON_UP_PIN D0
|
||||
@@ -29,7 +26,19 @@
|
||||
#define BUTTON_SELECT_PIN D8
|
||||
#endif
|
||||
|
||||
#ifdef ULANZI
|
||||
Adafruit_SHT31 sht31;
|
||||
#else
|
||||
|
||||
class Mp3Notify
|
||||
{
|
||||
};
|
||||
Adafruit_BME280 bme280;
|
||||
SoftwareSerial mySoftwareSerial(D7, D5); // RX, TX
|
||||
typedef DFMiniMp3<SoftwareSerial, Mp3Notify> DfMp3;
|
||||
DfMp3 dfmp3(mySoftwareSerial);
|
||||
#endif
|
||||
|
||||
EasyButton button_left(BUTTON_UP_PIN);
|
||||
EasyButton button_right(BUTTON_DOWN_PIN);
|
||||
EasyButton button_select(BUTTON_SELECT_PIN);
|
||||
@@ -50,6 +59,7 @@ unsigned long previousMillis_LDR = 0;
|
||||
const unsigned long interval_BatTempHum = 10000;
|
||||
const unsigned long interval_LDR = 100;
|
||||
int total = 0;
|
||||
unsigned long startTime;
|
||||
|
||||
const int LDRReadings = 10;
|
||||
int TotalLDRReadings[LDRReadings];
|
||||
@@ -57,6 +67,11 @@ float sampleSum = 0.0;
|
||||
float sampleAverage = 0.0;
|
||||
float brightnessPercent = 0.0;
|
||||
|
||||
#ifdef awrtrix_upgrade
|
||||
class Mp3Notify;
|
||||
SoftwareSerial mySoftwareSerial(D7, D5); // RX, TX
|
||||
#endif
|
||||
|
||||
// The getter for the instantiated singleton instance
|
||||
PeripheryManager_ &PeripheryManager_::getInstance()
|
||||
{
|
||||
@@ -69,14 +84,36 @@ PeripheryManager_ &PeripheryManager = PeripheryManager.getInstance();
|
||||
|
||||
void left_button_pressed()
|
||||
{
|
||||
DisplayManager.leftButton();
|
||||
MenuManager.leftButton();
|
||||
if (AP_MODE)
|
||||
{
|
||||
--MATRIX_LAYOUT;
|
||||
if (MATRIX_LAYOUT < 0)
|
||||
MATRIX_LAYOUT = 2;
|
||||
saveSettings();
|
||||
ESP.restart();
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayManager.leftButton();
|
||||
MenuManager.leftButton();
|
||||
}
|
||||
}
|
||||
|
||||
void right_button_pressed()
|
||||
{
|
||||
DisplayManager.rightButton();
|
||||
MenuManager.rightButton();
|
||||
if (AP_MODE)
|
||||
{
|
||||
++MATRIX_LAYOUT;
|
||||
if (MATRIX_LAYOUT > 2)
|
||||
MATRIX_LAYOUT = 0;
|
||||
saveSettings();
|
||||
ESP.restart();
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayManager.rightButton();
|
||||
MenuManager.rightButton();
|
||||
}
|
||||
}
|
||||
|
||||
void select_button_pressed()
|
||||
@@ -105,40 +142,79 @@ void select_button_tripple()
|
||||
|
||||
void PeripheryManager_::playBootSound()
|
||||
{
|
||||
if (SOUND_OFF)
|
||||
if (!SOUND_ACTIVE)
|
||||
return;
|
||||
const int nNotes = 6;
|
||||
String notes[nNotes] = {"E5", "C5", "G4", "E4", "G4", "C5"};
|
||||
const int timeUnit = 150;
|
||||
Melody melody = MelodyFactory.load("Nice Melody", timeUnit, notes, nNotes);
|
||||
player.playAsync(melody);
|
||||
if (BOOT_SOUND == "")
|
||||
{
|
||||
#ifdef ULANZI
|
||||
const int nNotes = 6;
|
||||
String notes[nNotes] = {"E5", "C5", "G4", "E4", "G4", "C5"};
|
||||
const int timeUnit = 150;
|
||||
Melody melody = MelodyFactory.load("Bootsound", timeUnit, notes, nNotes);
|
||||
player.playAsync(melody);
|
||||
#else
|
||||
// no standardsound
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef ULANZI
|
||||
playFromFile("/MELODIES/" + BOOT_SOUND + ".txt");
|
||||
#else
|
||||
dfmp3.playMp3FolderTrack(BOOT_SOUND.toInt());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void PeripheryManager_::stopSound()
|
||||
{
|
||||
#ifdef ULANZI
|
||||
player.stop();
|
||||
#else
|
||||
dfmp3.stop();
|
||||
#endif
|
||||
}
|
||||
|
||||
void PeripheryManager_::setVolume(uint8_t vol)
|
||||
{
|
||||
#ifdef AWTRIX_UPGRADE
|
||||
dfmp3.setVolume(vol);
|
||||
#endif
|
||||
}
|
||||
|
||||
void PeripheryManager_::playFromFile(String file)
|
||||
{
|
||||
if (SOUND_OFF)
|
||||
if (!SOUND_ACTIVE)
|
||||
return;
|
||||
#ifdef ULANZI
|
||||
Melody melody = MelodyFactory.loadRtttlFile(file);
|
||||
player.playAsync(melody);
|
||||
#else
|
||||
dfmp3.playMp3FolderTrack(file.toInt());
|
||||
#endif
|
||||
}
|
||||
|
||||
bool PeripheryManager_::isPlaying()
|
||||
{
|
||||
#ifdef ULANZI
|
||||
return player.isPlaying();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void fistStart()
|
||||
{
|
||||
|
||||
#ifdef ULANZI
|
||||
uint16_t ADCVALUE = analogRead(BATTERY_PIN);
|
||||
|
||||
BATTERY_PERCENT = min((int)map(ADCVALUE, 490, 690, 0, 100), 100);
|
||||
BATTERY_RAW = ADCVALUE;
|
||||
sht31.readBoth(&CURRENT_TEMP, &CURRENT_HUM);
|
||||
CURRENT_TEMP -= 9.0;
|
||||
#else
|
||||
CURRENT_TEMP = bme280.readTemperature();
|
||||
CURRENT_HUM = bme280.readHumidity();
|
||||
#endif
|
||||
|
||||
uint16_t LDRVALUE = analogRead(LDR_PIN);
|
||||
brightnessPercent = LDRVALUE / 4095.0 * 100.0;
|
||||
@@ -148,6 +224,7 @@ void fistStart()
|
||||
|
||||
void PeripheryManager_::setup()
|
||||
{
|
||||
startTime = millis();
|
||||
pinMode(LDR_PIN, INPUT);
|
||||
pinMode(BUZZER_PIN, OUTPUT);
|
||||
digitalWrite(BUZZER_PIN, LOW);
|
||||
@@ -160,7 +237,12 @@ void PeripheryManager_::setup()
|
||||
button_select.onPressedFor(1000, select_button_pressed_long);
|
||||
button_select.onSequence(2, 300, select_button_tripple);
|
||||
Wire.begin(21, 22);
|
||||
#ifdef ULANZI
|
||||
sht31.begin(0x44);
|
||||
#else
|
||||
bme280.begin();
|
||||
dfmp3.begin();
|
||||
#endif
|
||||
photocell.setPhotocellPositionOnGround(false);
|
||||
fistStart();
|
||||
}
|
||||
@@ -176,11 +258,16 @@ void PeripheryManager_::tick()
|
||||
if (currentMillis_BatTempHum - previousMillis_BatTempHum >= interval_BatTempHum)
|
||||
{
|
||||
previousMillis_BatTempHum = currentMillis_BatTempHum;
|
||||
#ifdef ULANZI
|
||||
uint16_t ADCVALUE = analogRead(BATTERY_PIN);
|
||||
BATTERY_PERCENT = min((int)map(ADCVALUE, 475, 665, 0, 100), 100);
|
||||
BATTERY_RAW = ADCVALUE;
|
||||
sht31.readBoth(&CURRENT_TEMP, &CURRENT_HUM);
|
||||
CURRENT_TEMP -= 9.0;
|
||||
#else
|
||||
CURRENT_TEMP = bme280.readTemperature();
|
||||
CURRENT_HUM = bme280.readHumidity();
|
||||
#endif
|
||||
checkAlarms();
|
||||
MQTTManager.sendStats();
|
||||
}
|
||||
@@ -274,3 +361,19 @@ void PeripheryManager_::checkAlarms()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const char *PeripheryManager_::readUptime()
|
||||
{
|
||||
static char uptime[25]; // Make the array static to keep it from being destroyed when the function returns
|
||||
unsigned long currentTime = millis();
|
||||
unsigned long elapsedTime = currentTime - startTime;
|
||||
unsigned long uptimeSeconds = elapsedTime / 1000;
|
||||
unsigned long uptimeMinutes = uptimeSeconds / 60;
|
||||
unsigned long uptimeHours = uptimeMinutes / 60;
|
||||
unsigned long uptimeDays = uptimeHours / 24;
|
||||
unsigned long hours = uptimeHours % 24;
|
||||
unsigned long minutes = uptimeMinutes % 60;
|
||||
unsigned long seconds = uptimeSeconds % 60;
|
||||
sprintf(uptime, "P%dDT%dH%dM%dS", uptimeDays, hours, minutes, seconds);
|
||||
return uptime;
|
||||
}
|
||||
@@ -3,15 +3,23 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <EasyButton.h>
|
||||
#include "Adafruit_SHT31.h"
|
||||
#ifdef ULANZI
|
||||
#include "Adafruit_SHT31.h"
|
||||
#else
|
||||
#include "Adafruit_BME280.h"
|
||||
#include "SoftwareSerial.h"
|
||||
#include <DFMiniMp3.h>
|
||||
#endif
|
||||
|
||||
class PeripheryManager_
|
||||
{
|
||||
private:
|
||||
PeripheryManager_() = default;
|
||||
void checkAlarms();
|
||||
#ifdef ULANZI
|
||||
const int BatReadings = 10;
|
||||
uint16_t TotalBatReadings[10];
|
||||
#endif
|
||||
int readIndex = 0;
|
||||
uint16_t total = 0;
|
||||
uint16_t average = 0;
|
||||
@@ -29,6 +37,8 @@ public:
|
||||
void playFromFile(String file);
|
||||
bool isPlaying();
|
||||
void stopSound();
|
||||
void setVolume(uint8_t);
|
||||
const char *readUptime();
|
||||
};
|
||||
|
||||
extern PeripheryManager_ &PeripheryManager;
|
||||
|
||||
@@ -13,22 +13,6 @@
|
||||
WebServer server(80);
|
||||
FSWebServer mws(LittleFS, server);
|
||||
bool FSOPEN;
|
||||
void startLittleFS()
|
||||
{
|
||||
|
||||
if (LittleFS.begin())
|
||||
{
|
||||
LittleFS.mkdir("/MELODIES");
|
||||
LittleFS.mkdir("/ICONS");
|
||||
FSOPEN = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.println("ERROR on mounting LittleFS. It will be formmatted!");
|
||||
LittleFS.format();
|
||||
ESP.restart();
|
||||
}
|
||||
}
|
||||
|
||||
// The getter for the instantiated singleton instance
|
||||
ServerManager_ &ServerManager_::getInstance()
|
||||
@@ -49,26 +33,27 @@ void versionHandler()
|
||||
void saveHandler()
|
||||
{
|
||||
WebServerClass *webRequest = mws.getRequest();
|
||||
Serial.println("Save");
|
||||
ServerManager.getInstance().loadSettings();
|
||||
webRequest->send(200);
|
||||
}
|
||||
|
||||
|
||||
void ServerManager_::setup()
|
||||
{
|
||||
|
||||
if (!local_IP.fromString(NET_IP) || !gateway.fromString(NET_GW) || !subnet.fromString(NET_SN) || !primaryDNS.fromString(NET_PDNS) || !secondaryDNS.fromString(NET_SDNS))
|
||||
NET_STATIC = false;
|
||||
if (NET_STATIC)
|
||||
{
|
||||
WiFi.config(local_IP, gateway, subnet, primaryDNS, secondaryDNS);
|
||||
}
|
||||
IPAddress myIP = mws.startWiFi(10000, uniqueID, "12345678");
|
||||
myIP = mws.startWiFi(10000, uniqueID, "12345678");
|
||||
|
||||
isConnected = !(myIP == IPAddress(192, 168, 4, 1));
|
||||
Serial.println(myIP.toString());
|
||||
|
||||
if (isConnected)
|
||||
{
|
||||
|
||||
mws.addOptionBox("Network");
|
||||
mws.addOption("Static IP", NET_STATIC);
|
||||
mws.addOption("Local IP", NET_IP);
|
||||
@@ -91,11 +76,29 @@ void ServerManager_::setup()
|
||||
mws.addHTML(custom_html, "icon_html");
|
||||
mws.addCSS(custom_css);
|
||||
mws.addJavascript(custom_script);
|
||||
mws.addOptionBox("General");
|
||||
mws.addOption("Uppercase letters", UPPERCASE_LETTERS);
|
||||
mws.addHandler("/save", HTTP_GET, saveHandler);
|
||||
mws.addHandler("/save", HTTP_POST, saveHandler);
|
||||
mws.addHandler("/api/notify", HTTP_POST, []()
|
||||
{DisplayManager.generateNotification(mws.webserver->arg("plain").c_str()); mws.webserver->send(200,"OK"); });
|
||||
mws.addHandler("/api/nextapp", HTTP_POST, []()
|
||||
{DisplayManager.nextApp(); mws.webserver->send(200,"OK"); });
|
||||
mws.addHandler("/api/previousapp", HTTP_POST, []()
|
||||
{DisplayManager.previousApp(); mws.webserver->send(200,"OK"); });
|
||||
mws.addHandler("/api/timer", HTTP_POST, []()
|
||||
{ DisplayManager.gererateTimer(mws.webserver->arg("plain").c_str()); mws.webserver->send(200,"OK"); });
|
||||
mws.addHandler("/api/notify/dismiss", HTTP_POST, []()
|
||||
{ DisplayManager.dismissNotify(); mws.webserver->send(200,"OK"); });
|
||||
mws.addHandler("/api/apps", HTTP_POST, []()
|
||||
{ DisplayManager.updateAppVector(mws.webserver->arg("plain").c_str()); mws.webserver->send(200,"OK"); });
|
||||
mws.addHandler("/api/switch", HTTP_POST, []()
|
||||
{ DisplayManager.switchToApp(mws.webserver->arg("plain").c_str()); mws.webserver->send(200,"OK"); });
|
||||
mws.addHandler("/api/settings", HTTP_POST, []()
|
||||
{ DisplayManager.setNewSettings(mws.webserver->arg("plain").c_str()); mws.webserver->send(200,"OK"); });
|
||||
mws.addHandler("/api/custom", HTTP_POST, []()
|
||||
{ DisplayManager.generateCustomPage(mws.webserver->arg("name"),mws.webserver->arg("plain").c_str()); mws.webserver->send(200,"OK"); });
|
||||
mws.addHandler("/api/stats", HTTP_GET, []()
|
||||
{ mws.webserver->sendContent(DisplayManager.getStat()); });
|
||||
Serial.println("Webserver loaded");
|
||||
}
|
||||
|
||||
mws.addHandler("/version", HTTP_GET, versionHandler);
|
||||
mws.begin();
|
||||
|
||||
@@ -129,12 +132,10 @@ uint16_t stringToColor(const String &str)
|
||||
String gStr = str.substring(comma1 + 1, comma2);
|
||||
String bStr = str.substring(comma2 + 1);
|
||||
|
||||
|
||||
int r = rStr.toInt();
|
||||
int g = gStr.toInt();
|
||||
int b = bStr.toInt();
|
||||
|
||||
|
||||
if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255)
|
||||
{
|
||||
return 0xFFFF;
|
||||
@@ -164,9 +165,6 @@ String colorToString(uint16_t color)
|
||||
|
||||
void ServerManager_::loadSettings()
|
||||
{
|
||||
if (!FSOPEN)
|
||||
startLittleFS();
|
||||
|
||||
if (LittleFS.exists("/config.json"))
|
||||
{
|
||||
File file = LittleFS.open("/config.json", "r");
|
||||
@@ -189,7 +187,6 @@ void ServerManager_::loadSettings()
|
||||
NET_SN = doc["Subnet"].as<String>();
|
||||
NET_PDNS = doc["Primary DNS"].as<String>();
|
||||
NET_SDNS = doc["Secondary DNS"].as<String>();
|
||||
UPPERCASE_LETTERS = doc["Uppercase letters"];
|
||||
file.close();
|
||||
DisplayManager.applyAllSettings();
|
||||
Serial.println(F("Configuration loaded"));
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
void tick();
|
||||
void loadSettings();
|
||||
bool isConnected;
|
||||
void SaveSettings();
|
||||
IPAddress myIP;
|
||||
};
|
||||
|
||||
extern ServerManager_ &ServerManager;
|
||||
|
||||
12
src/main.cpp
12
src/main.cpp
@@ -73,13 +73,20 @@ void setup()
|
||||
{
|
||||
MQTTManager.setup();
|
||||
DisplayManager.loadNativeApps();
|
||||
StopTask = true;
|
||||
float x = 4;
|
||||
while (x >= -85)
|
||||
{
|
||||
DisplayManager.HSVtext(x, 6, ("AWTRIX " + ServerManager.myIP.toString()).c_str(), true);
|
||||
x -= 0.18;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AP_MODE = true;
|
||||
StopTask = true;
|
||||
}
|
||||
|
||||
StopTask = true;
|
||||
delay(200);
|
||||
DisplayManager.clearMatrix();
|
||||
}
|
||||
@@ -88,9 +95,10 @@ void loop()
|
||||
{
|
||||
ServerManager.tick();
|
||||
DisplayManager.tick();
|
||||
PeripheryManager.tick();
|
||||
if (ServerManager.isConnected)
|
||||
{
|
||||
PeripheryManager.tick();
|
||||
|
||||
MQTTManager.tick();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user