Commit Graph

1176 Commits

Author SHA1 Message Date
HomeSpan 1475301855
Update Reference.md 2022-03-16 06:30:41 -05:00
HomeSpan 29b02c4f38
Update Reference.md 2022-03-15 22:47:07 -05:00
HomeSpan f813894d00
Update Reference.md 2022-03-15 21:02:03 -05:00
Gregg 057901b5bb Update src.ino 2022-03-14 22:14:59 -05:00
Gregg 6409157180 Completed all SpanOTA safemode logic and cleaned up previous iterations of the logic
Must document in safemode in API as well as discuss in OTA documentation.
2022-03-14 22:01:28 -05:00
Gregg ffdf0296c6 Dramatically simplified OTA enable check in safemode
Rather than auto-enable OTA if not already enabled in safemode, changed the logic to simply rollback to previous app if OTA was used to download a sketch that does not itself have OTA enabled, unless OTA was previously enabled without safemode.

To do:  Delete all complicated SpanOTA logic that (unsuccessfully) tried to track OTA status and check SHA246 partition codes to determine if reboot was OTA or Serial.  None of this is need, but some of the code may be useful for other things in the future.
2022-03-14 21:46:37 -05:00
Gregg 1b0c4835cb Progress on additional SafeMode logic to Auto-enable OTA 2022-03-13 14:42:19 -05:00
Gregg b6eb5afcbf Started work on auto-enabling OTA to start even if not enabled. 2022-03-13 10:19:11 -05:00
Gregg eac06129fc Moved all OTA logic into SpanOTA and completed "safeLoad" protocol 2022-03-12 16:31:50 -06:00
Gregg f3d5092340 SpanOTA in progress 2022-03-12 14:31:15 -06:00
Gregg 2f1044b013 Adding Custom Magic Cookie to OTA Partition
Will prevent uploading a non-HomeSpan sketch via OTA to an existing HomeSpan device.
2022-03-12 08:24:01 -06:00
Gregg 7ddbfd55cc Slight OTA cleanup plus confirmed that you cannot enable ROLLBACK in Arduino-ESP32
Since much of the Arduino-ESP32 library is precompiled, you cannot use -DCONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE to define this during compile time (it gets defined but is not used by the precompiled libraries).

TO DO:  create an NVS entry that flags whether last update was via OTA.  If so, automatically enable OTA regardless of enableOTA setting.  This would ensure that OTA cannot be disabled accidentally by uploading a non-enabledOTA sketch to  remote device.
2022-03-07 22:02:23 -06:00
Gregg 3336ac7fbe Small clean-up of OTA
Researching potential use of rollback of OTA.
2022-03-06 18:39:05 -06:00
Gregg db3bea3b5c Completed Example 19 - Web Logs
Also updated SpanWebLog::addLog() so that the log message is also output to the Serial Monitor if the HomeSpan Log Level is set to 1 or greater.

To do: DOCUMENT ALL THIS!
2022-03-06 09:25:17 -06:00
Gregg 1be40ad6fc Converted LOG1() and LOG2() to variadic macros!
If LOG1() or LOG2() is only provided with a SINGLE argument, then Serial.print() is called.  This allows you to continue using LOG1() and LOG2() to directly print any variable or object that is handled by Serial.print(), such as an int, double, or even an IPAddress.

If LOG1() or LOG2() is provided with multiple arguments, the first is considered the format and Serial.printf(format...) is called.  This allows you to use printf-like functionality within LOG1() and LOG2().
2022-03-06 07:48:12 -06:00
Gregg 682e65129d Added new Example #19 showing Web Logging
Based on Example 5 (Two Working LEDs)
2022-03-05 23:08:14 -06:00
Gregg 33042f191e Added logURL to MDNS broadcast
Broadcast as "logURL" only if Web Logging is enabled.
2022-03-05 22:34:30 -06:00
Gregg f37889f8da Added ClientIP as permanent part of Web Log ; DELETED homeSpan.getClientIP()
ClientIP will show as "0.0.0.0" if log message is not related to client request
2022-03-05 22:24:23 -06:00
Gregg cf22ff1a92 Added homeSpan.getClientIP()
Gets IP address (as char *) of last client to send a request.  Useful as part of web log messages.  Will return 0.0.0.0 if used outside of any code that is responding to a client request.
2022-03-05 22:06:34 -06:00
Gregg e3b9ed99cb Added homeSpan.setTimeServerTimeout(uint32_t tSec);
Sets timeout when connecting to Time Server (default is 10 seconds if not specified)
2022-03-05 20:35:01 -06:00
Gregg 2787966c48 Converted webLog.addLog() to variadic form
Also created WEBLOG() variadic macro
2022-03-05 18:13:27 -06:00
Gregg d9a9e6f31c Changed webLog in HomeSpan from pointer to instantiated variable
Added isEnabled to SpanWebLog to indicate whether Web Log has been enabled.  This allows the use of homeSpan.webLog.addLog() without ever enabling (in which case the log entries are ignored).
2022-03-05 12:50:20 -06:00
Gregg acc64f863a Added addLog(const char *) to SpanWebLog()
Also included logic so that clockTime is set to "Unknown" is addLog() is called prior to WiFi being established.

Next up: replace addLog(const char *) with a variadic set of parameters with dynamic storage allocation.
2022-03-05 10:40:01 -06:00
Gregg 168be05586 Progress on SpanWebLog() 2022-03-05 10:03:13 -06:00
Gregg 91ab626d6c Update HomeSpan.h 2022-03-04 06:15:48 -06:00
Gregg b6c019d1a8 Finished Time Stamping - Started Web Log Structure 2022-03-03 21:37:20 -06:00
Gregg 20ce79ef34 Added check to ensure time server is available
If not, homeSpan.timeServer is reset to NULL
2022-03-02 21:41:06 -06:00
Gregg 571bc55852 Added optional homeSpan.setTimeServer() method
If specified, HomeSpan will try to get internet time after establishing WiFi connection.  Consumes one socket connection.
2022-02-27 18:29:58 -06:00
Gregg ae4b6e8df1 Initial creation of getStatusURL() web log
Built basic framework to response to "GET /status".  Next up:  Add timeclock.
2022-02-27 18:04:12 -06:00
HomeSpan 71071198c3
Update FAQ.md 2022-02-27 16:23:02 -06:00
HomeSpan eb49f606ce
Update FAQ.md 2022-02-27 16:18:55 -06:00
HomeSpan ead3ba6747
Update Reference.md 2022-02-27 10:29:37 -06:00
Gregg e51320cced Create CustomService.ino
Added to Other Examples
2022-02-27 09:53:17 -06:00
Gregg 170e0b61b1 Add new macro CUSTOM_SERV() to created custom services
Also, updated error checking so that the UUID for both custom Services and custom Characteristics are checked for syntax.  A fatal error is thrown if an ill-formatted UUID is found, since this will definitely prevent pairing with the HomeApp.

The UUID for HAP Services and Characteristics are NOT error checked, since these are fixed in HomeSpan.

Also, the custom Characteristics are not validated against the optional list for a service.  If the user adds a custom Characteristic to a HAP Service, it is assumed to be valid.  Similarly, none of the Characteristics (HAP of Custom) in a Custom Service are validated at all.
2022-02-27 09:51:27 -06:00
Gregg bf2e1354b1 Added second version of SpanUserCommand() that takes a void *arg
Useful for passing a pointer to a Service that can be used in the CLI command.
2022-02-22 21:53:17 -06:00
Gregg ea09e5c8f3 Create FeatherPins.h
For developer use only - facilitates testing the same code across an ESP32, ESP32-S2, and ESP32-C3 without re-wiring by using an Adafruit FeatherBoard as a common jig.
2022-02-21 15:08:19 -06:00
Gregg fbbfd3f4a6 Update Pixel tutorial to refresh update() twice on initialization for DotStar
Seems to be required to "sync" LEDs
2022-02-21 10:57:35 -06:00
HomeSpan 49ba6a2e3e
Update FAQ.md 2022-02-20 13:46:04 -06:00
HomeSpan 9c53e7e025
Update FAQ.md 2022-02-20 13:32:47 -06:00
HomeSpan f247f66071
Update GettingStarted.md 2022-02-20 13:15:30 -06:00
Gregg 02d841390c Updated License Dates 2022-02-20 13:05:03 -06:00
HomeSpan 3efe5e6077
Update README.md 2022-02-20 13:00:25 -06:00
HomeSpan 7408379b9a
Update README.md 2022-02-20 12:29:42 -06:00
HomeSpan fd0936d91c
Update README.md 2022-02-20 12:29:14 -06:00
HomeSpan 76d86b6500
Updated to version 1.5.0 2022-02-20 12:10:30 -06:00
Gregg 7bfc1d48fb Updated version to 1.5.0 2022-02-20 12:09:03 -06:00
HomeSpan f7014ff154
Update Reference.md 2022-02-20 11:57:36 -06:00
HomeSpan 7bb028b17c
Update README.md 2022-02-20 08:58:40 -06:00
HomeSpan 019c774fb3 Merge branch 'dev' of https://github.com/HomeSpan/HomeSpan into dev 2022-02-20 07:50:54 -06:00
HomeSpan 9e6989782d Delete Extras.md 2022-02-20 07:50:43 -06:00