Invoking HTTP POST without a request-body results in a request which
incorrectly has content-type and content-length set.
This results from a missing check if a body is provided as an argument.
Add this missing check in order to allow POST requests without a message
body to work.
Signed-off-by: David Bauer <mail@david-bauer.net>
* OTA for W800
Removed unnecessary (and wasting resources) fetching of "index?status=1" on pages not using "state" div
Added simple "internal OTA" (just POST-ing a file)
Basic tests done - try avoiding other TCP connections to save memory
Somtimes there are memory related messages in log like "Thread create HTTP Client - errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY".
OTA working in most cases, somtimes device crashes during update.
Device will immediatly reboot after OTA completion, even printfs after writing last bytes was not visible in console.
* Add some more warnings
Make file selector accepting images on extension for platform
For Beken: Check magic "RBL" and future Platform name in header
* Changed way to verify firmware files: must match OBK file structure for the platform
As suggested by @NonPIayerCharacter added "NO_PLATFORM_OTA" in obk_config.h
For platforms w/o OTA the page will be only showing a hint.
* Fix page for non OTA devices
* streamlined tests
moved platform dependent #define for OTA extension to obk_config.h
* Optimized JS code
Only show hint for ".rbl" file on Beken platforms
Added a #define OBK_OTA_NAME_EXTENSION, actually only for LN882H
(here UART and OTA file are identicaly except an "_OTA" in the file name).
Otherwise the UART file would also match the template
(this file would not be flashed because of additional checks, but if we can prevent this ...)
* Add commands to check if actual time is in DST or not
New command "clock_calcDST nthWeekEnd monthEnd dayEnd hourEnd nthWeekStart monthStart dayStart hourStart"
to set the DST start and end rule.
$isDST will return 1 if DST is active, 0 else
It's enabled with
* switched from strftime to ctime to get smaller memory footprint
* disabled feature by default in obk_config.h (enabled for Windows for possible testing)
* try selftest for DST
* enable Test_NTP_DST() in win_main.c
* fix missing NTP offset settings, fix LOG
* Add possibility to set g_ntpTime according to DST settings
tried to reduce image sizes by avoiding mktime
still image size for this feature varies very much:
LN882H: 2.2k in bin / 1.5k in OTA
Beken: 4.3k in rbl
BL602: 21.4k in bin / 9.7k in ota
This commit has feature enabled, to get images for testing, will change it to disabled by default in next release
* disable feature for all plattforms but windows (to allow tests)
* Fix selftest - all DST changes are now done by the system!
* Fix selftest - setsimulated time must also call setDST as "real" ntp setting
* Next try to fix selftests
* For testing switch back to mktime
* New try to reduce image by avoiding time functions
Fix own leap year calculation
* Disable feature for all platforms but Windows (to keep selftest)