Add service commands, update CHANGELOG and About #283

This commit is contained in:
fvanroie 2022-01-17 05:13:58 +01:00
parent 4d337da0e3
commit f2b7a722ee
7 changed files with 1761 additions and 1691 deletions

View File

@ -50,6 +50,9 @@ Update libraries to ArduinoJson 6.19.1, TFT_eSPI 2.4.25, LovyanGFX 0.4.11 and Ad
### Objects
- Add `antiburn` command to prevent static parts of the screen to create a *ghosting* effect in some LCDs or conditions
## Services
- Add SimpleFTPServer to easily upload and download files to the plate *(one simultanious connection only)*
### Devices
- Add Analog touch driver for Unoshield displays (thanks @wesleygas)
- Add Arduitouch MOD ESP32 with 2.4" or 2.8"

View File

@ -1 +1 @@
function aref(e){setTimeout(function(){ref("")},1e3*e)}function ref(e){var o=(new Date).getTime();return document.getElementById("bmp").src="?a="+e+"&q="+o,!1}function about(){document.getElementById("doc").innerHTML='<h3>openHASP</h3>Copyright&copy; 2019-2021 Francis Van Roie</br>MIT License</p><p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p><p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p><p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p><hr><p>Based on the previous work of the following open source developers:</p><h3>HASwitchPlate</h3><p>Copyright&copy; 2019 Allen Derusha allen @derusha.org</b></br>MIT License</p><h3>LVGL</h3><p>Copyright&copy; 2021 LVGL Kft</br>MIT License</p><h3>zi Font Engine</h3><p>Copyright&copy; 2020-2021 Francis Van Roie</br>MIT License</p><h3>TFT_eSPI Library</h3><p>Copyright&copy; 2020 Bodmer (https://github.com/Bodmer) All rights reserved.</br>FreeBSD License</p><p><i>includes parts from the <b>Adafruit_GFX library</b></br>Copyright&copy; 2012 Adafruit Industries. All rights reserved</br>BSD License</i></p><h3>ArduinoJson</h3><p>Copyright&copy; 2014-2021 Benoit BLANCHON</br>MIT License</p><h3>PubSubClient</h3><p>Copyright&copy; 2008-2015 Nicholas O&apos;Leary</br>MIT License</p><h3>ArduinoLog</h3><p>Copyright&copy; 2017,2018 Thijs Elenbaas, MrRobot62, rahuldeo2047, NOX73, dhylands, Josha blemasle, mfalkvidd</br>MIT License</p><h3>QR Code generator</h3><p>Copyright&copy; Project Nayuki</br>MIT License</p><h3>AceButton</h3><p>Copyright&copy; 2018 Brian T. Park</br>MIT License</p>'}
function aref(e){setTimeout(function(){ref("")},1e3*e)}function ref(e){var o=(new Date).getTime();return document.getElementById("bmp").src="?a="+e+"&q="+o,!1}function about(){document.getElementById("doc").innerHTML='<h3>openHASP</h3>Copyright&copy; 2019-2021 Francis Van Roie</br>MIT License</p><p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p><p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p><p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p><hr><p>Based on the previous work of the following open source developers:</p><h3>HASwitchPlate</h3><p>Copyright&copy; 2019 Allen Derusha allen @derusha.org</b></br>MIT License</p><h3>LVGL</h3><p>Copyright&copy; 2021 LVGL Kft</br>MIT License</p><h3>zi Font Engine</h3><p>Copyright&copy; 2020-2021 Francis Van Roie</br>MIT License</p><h3>TFT_eSPI Library</h3><p>Copyright&copy; 2020 Bodmer (https://github.com/Bodmer) All rights reserved.</br>FreeBSD License</p><p><i>includes parts from the <b>Adafruit_GFX library</b></br>Copyright&copy; 2012 Adafruit Industries. All rights reserved</br>BSD License</i></p><h3>ArduinoJson</h3><p>Copyright&copy; 2014-2021 Benoit BLANCHON</br>MIT License</p><h3>PubSubClient</h3><p>Copyright&copy; 2008-2015 Nicholas O&apos;Leary</br>MIT License</p><h3>ArduinoLog</h3><p>Copyright&copy; 2017,2018 Thijs Elenbaas, MrRobot62, rahuldeo2047, NOX73, dhylands, Josha blemasle, mfalkvidd</br>MIT License</p><h3>QR Code generator</h3><p>Copyright&copy; Project Nayuki</br>MIT License</p><h3>SimpleFTPServer</h3><p>Copyright&copy; 2017 Renzo Mischianti www.mischianti.org All right reserved.</br>MIT License</p><h3>AceButton</h3><p>Copyright&copy; 2018 Brian T. Park</br>MIT License</p>'}

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -453,6 +453,7 @@ public:
FtpServer( uint16_t _cmdPort = FTP_CMD_PORT, uint16_t _pasvPort = FTP_DATA_PORT_PASV );
void begin( const char * _user = FTP_USER, const char * _pass = FTP_PASS, const char * welcomeMessage = "Welcome to Simply FTP server" );
void end();
void credentials( const char * _user, const char * _pass );
uint8_t handleFTP();

View File

@ -1279,6 +1279,14 @@ void dispatch_service(const char*, const char* payload, uint8_t source)
}
#endif
#if HASP_USE_FTP > 0
if(!strcmp_P(payload, "start ftp")) {
ftpStart();
} else if(!strcmp_P(payload, "stop ftp")) {
ftpStop();
}
#endif
#if HASP_USE_HTTP > 0 || HASP_USE_HTTP_ASYNC > 0
if(!strcmp_P(payload, "start http")) {
httpStart();

View File

@ -16,19 +16,15 @@
#include "FtpServerKey.h"
#include "SimpleFTPServer.h"
#if HASP_USE_HTTP > 0 || HASP_USE_HTTP_ASYNC > 0
extern hasp_http_config_t http_config;
#endif
FtpServer ftpSrv; // set #define FTP_DEBUG in ESP8266FtpServer.h to see ftp verbose on serial
uint16_t ftpPort = 23;
uint8_t ftpEnabled = true; // Enable telnet debug output
#if HASP_USE_HTTP > 0 || HASP_USE_HTTP_ASYNC > 0
extern hasp_http_config_t http_config;
static inline bool telnet_has_password()
{
return (strlen(http_config.username) != 0) || (strlen(http_config.password) != 0);
}
#endif
void _callback(FtpOperation ftpOperation, unsigned int freeSpace, unsigned int totalSpace)
{
switch(ftpOperation) {
@ -81,16 +77,25 @@ void _transferCallback(FtpTransferOperation ftpOperation, const char* name, unsi
};
void ftpStop(void)
{}
{
// LOG_WARNING(TAG_FTP, F("Service cannot be stopped"));
ftpSrv.end();
LOG_INFO(TAG_FTP, F(D_SERVICE_STOPPED));
}
void ftpStart()
{
LOG_TRACE(TAG_TFT, F(D_SERVICE_STARTING));
LOG_TRACE(TAG_FTP, F(D_SERVICE_STARTING));
ftpSrv.setCallback(_callback);
ftpSrv.setTransferCallback(_transferCallback);
ftpSrv.begin("esp8266", "esp8266"); // username, password for ftp. (default 21, 50009 for PASV)
LOG_INFO(TAG_TFT, F(D_SERVICE_STARTED));
#if HASP_USE_HTTP > 0 || HASP_USE_HTTP_ASYNC > 0
ftpSrv.begin(http_config.username, http_config.password); // Password must be non-empty
#else
ftpSrv.begin("ftpuser", "haspadmin"); // username, password for ftp. (default 21, 50009 for PASV)
#endif
LOG_INFO(TAG_FTP, F(D_SERVICE_STARTED));
}
void ftpSetup()