Commit Graph

77 Commits

Author SHA1 Message Date
Gregg 54b8374573 begin update of PushButton to make it more generic
Eliminated constructor that had no pin parameter.  Pin parameter is now always required.  Since PushButton was not part of HomeSpan API, these changes should not impact any users.
2022-08-11 06:12:41 -05:00
Gregg 57d791178c starting update of ControlPin logic to make it more generic 2022-08-10 06:20:50 -05:00
Gregg be3af3b14e Updated version number to 1.5.2 2022-07-23 21:05:08 -05:00
Gregg c891548ffa Updated webLog logic to print system messages as well as user messaages
User messages only printer is logLevel>0.  Also, user messages are prefixed in CLI with the word "WEBLOG: "
2022-07-23 08:19:25 -05:00
Gregg c5ba453a95 Converted Span to class; added homeSpan.getLogLevel() and homeSpan.addWebLog(fmt,...)
These functions are needed to provide public access to API now that Span is a class instead of a struct
2022-05-29 10:27:34 -05:00
HomeSpan 6d409e9b89 updated version check
requires version 2.X of the Arduino-ESP32 board manager
2022-05-22 08:57:23 -05:00
Gregg 98f812ba0c Updating examples 1-7 to conform with latest iOS changes 2022-04-04 06:13:30 -05:00
Gregg 240a995c86 Added LOG0() macro 2022-04-02 22:10:05 -05: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 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 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 168be05586 Progress on SpanWebLog() 2022-03-05 10:03:13 -06:00
Gregg 02d841390c Updated License Dates 2022-02-20 13:05:03 -06:00
Gregg 7bfc1d48fb Updated version to 1.5.0 2022-02-20 12:09:03 -06:00
Gregg ac88329d34 Deprecated setMaxConnections(); Added reserveSocketConnections()
Use homeSpan.reserveSocketConnections(n) to reserve n sockets *not* to be used for HAP.  Multiple calls can be used to cumulate a total number of reserved sockets.  This makes is easy to add reserveSocketConnections(n) at multiple point in the code whenever a certain number of sockets need to be reserved for use with that portion of the code.  For example enableOTA() calls reserveSocketConnections(1).

If both setMaxConnections(), and one or more reserveSocketConnections(), methods are called HomeSpan will use the more restrictive net value.
2022-02-10 21:55:03 -06:00
Gregg 6f4cea1b4d Updated version number to 1.4.3
Also updated Pixel example.
2022-01-10 22:52:08 -06:00
Gregg e8c7afae00 Increased default max number of connections to 14!
Reflects increase in max number of LWIP sockets from 10 (Arduino-ESP32 v2.0.0) to 16 (Arduino-ESP32 v2.0.1).  Since HomeSpan needs at least 2 (one for Server and 1 free for new connections), this leaves 14 connections for controllers.  A big improvement over only having 8!
2022-01-02 15:36:54 -06:00
Gregg bc5299cf57 Updated version number to 1.4.2
Ready for release!
2021-11-27 09:48:07 -06:00
HomeSpan a53d98070c Update version numbers to 1.4.1 2021-10-30 22:06:02 -05:00
HomeSpan 353749baea
Merge pull request #121 from unreality/master
add support for Televisions
2021-10-17 16:10:50 -05:00
Gregg 7d6265d543 Upgrade version number from 1.3.0 to 1.4.0 2021-10-09 08:12:29 -05:00
Gregg 7295803dde Remove LED_BUILTIN as default for statusPin
HomeSpan default is that there is NO control button and NO status LED.  Must use setStatusPin() or setControlPin() to enable.
2021-10-08 05:47:51 -05:00
Gregg 6de645216c CHANGED default settings for StatusPin and ControlPin
Re-worked code to allow for NO Status LED Pin and NO Control Pin.  If Control Pin is not set explicitly with homeSpan.setControlPin(), there will be no Control Pin.  There is no longer a default since there are too many board variations with S2 and C3 chips now supported.  Same for Status Pin - it will not be defined unless set explicitly with homeSpan.setStatusPin(), with the exception that if LED_BUILTIN is defined (i.e. there is a built-in LED), then the Status LED Pin will default to LED_BUILTIN if not explicitly defined.  MUST UPDATE DOCUMENTATION - THIS CHANGES DEFAULT BEHAVIOR OF HOMESPAN AND MAY REQUIRE UPDATES TO EXISTING SKETCHES
2021-10-05 21:10:24 -05:00
Gregg b95ebcb4fa Added ARDUINO_ESP_VERSION Macro
Will be "1.0.6", "2.0.0", etc.  Can be used as anywhere as a c-string
2021-10-05 20:08:34 -05:00
Raal Goff 38457c2b72 add HAP Services and Characteristics for Televisions 2021-08-03 21:43:32 +08:00
Gregg e94a9bba04 Updating Example 18; and set HomeSpan version to 1.3.0 2021-06-13 18:40:54 -05:00
Gregg b90f173a6f Set version number to 1.2.1 in preparation for release 2021-03-13 06:31:18 -06:00
Gregg c7447b061c Set Version to 1.2.0 2021-02-18 21:09:28 -06:00
Gregg 5c002708f9 Update version numbers 2021-02-07 19:25:59 -06:00
Gregg 29470e4dd9 Completed OTA logic
OTA pasword now stored in NVS.  Use 'O' command to change from default.  Note password is stored as MD5 hash, and is therefore unrecoverable.  Changes to password DO NOT take effect until next reboot.  Password CAN be changed even if OTA has not been enabled for sketch.  Blank passwords are not allowed.

Stored password can only be erased with 'E' command.
2021-02-07 09:58:52 -06:00
Gregg 208905419c Added OTA logic - enable with homeSpan.enableOTA();
TO DO:  Add password for OTA (and require it)
2021-02-06 18:10:48 -06:00
Gregg 9b71d6928a Added QR Code logic
HomeSpan now broadcasts a Hashed Setup ID as MDNS "sh", which is used when pairing with a QR Code instead of a Setup Code.  A text version of the resulting QR code is output to the Serial Monitor whenever the 9-digit Setup Code is generated or changed.  The text version of the QR code can then be input into any QR Code Generator to create a pairable QR Code.

The default Setup ID used to create the Hashed Setup ID is "HSPN".  This can be changed with homeSpan.setQRCode(const char *id), where id is exactly 4 alphanumeric characters.  If not, the request to change the Setup ID is silently ignored and remains "HSPN."
2021-01-24 18:46:55 -06:00
Gregg 78cbd926f1 Updated licenses and version number
Change copyright years to 2020-2021, and updated version number to 1.1.4 in preparation for next patch.
2021-01-24 12:02:24 -06:00
Gregg 750a658241 Added new method homeSpan.setPortNum(port)
HomeSpan defaults to running the HAP Server on port 80 (the standard HTTP port).  This method allows the user to over-ride the default and have HomeSpan run the HAP Server on any other port.

ALSO:  In updating this portion of the code, identified an additional parameter to the ESP32 version of WiFiServer that allows one to specify the number of simultaneous Server connections.  The ESP32 default is 4, which suggests that the ESP32 was internally juggling connections that HomeSpan was keeping open (since the HomeSpan default is 8 connections).

This WiFiServer call has been updated to now specify both the port number AND the number of maximum simultaneous connections (to match whatever has been set by HomeSpan).  This may or may not result in improving performance when more than 4 clients are connected.
2021-01-22 09:45:50 -06:00
Gregg dff13d4b08 Update version number to v1.1.3
Getting ready to release v1.1.3 patch
2021-01-09 12:55:31 -06:00
Gregg b8d4940772 Removed use of LED_BUILTIN in library and all examples
LED_BUILTIN is NOT defined for all ESP32 boards - some do not have a built-in LED!  Instead, Status LED now defaults to Pin 13, as opposed to LED_BUILTIN.  Also, added a new method, homeSpan.getStatusPin(), to return the pin number used for the Status LED, whether or not it remains the default (13) or is changed by user with homeSpan.setStatusPin(pin).  This method is now used in the DEV_Identify.h file for each example, instead of using LED_BUILTIN (which otherwise won't compile for boards without a built-in LED)
2021-01-09 12:51:35 -06:00
Gregg b9656fea37 Updated version to 1.1.2 - ready for release 2020-12-27 13:34:45 -06:00
Gregg 0b316de602 Added REQUIRED Macro
User can specifiy a REQUIRED minimum version on the HomeSpan Library for the sketch to compile.  If the library version is older, the pre-processor will halt the compilation with a #error output
2020-12-26 16:46:36 -06:00
Gregg 8b4d4cf32d Updated version to 1.1.1 2020-12-12 20:23:30 -06:00
Gregg 2b4e3bfcfd Update version number to 1.0.1 2020-11-28 07:51:16 -06:00
Gregg 89024bc555 Made first argument of homeSpan.begin() optional
Default is Category::Lighting
2020-11-21 13:52:04 -06:00
Gregg b6c5a6b68d Added License Info to all files 2020-11-02 20:09:09 -06:00
Gregg ba28d15d00 Update Settings.h 2020-10-15 20:06:26 -05:00
Gregg 43c04a7adf Minor tweaks to LED timings and placement of statusLED.start() in apConfig()
Ensures statusLED indicates a client is connected as soon as it received its first GET, even if the re-direction to /landing-page is yet to be accessed.  This was needed to trigger LED_AP_CONNECTED when connecting with QR code.
2020-10-12 18:48:25 -05:00
Gregg f3b1de2f6b Changed apConfig() to use fixed SSID of "HomeSpan-Configuration" 2020-10-12 07:55:07 -05:00
Gregg 8cfd9afa63 Minor tweaks to some LED patterns 2020-10-11 19:18:22 -05:00
Gregg e658d6d4eb Tweaks to blinker() to make sure delayTime ADDs to offTime 2020-10-10 16:40:53 -05:00
Gregg 3872d693a5 Updated Command Mode to include timeout and for apConfigure() to have more cancel options 2020-10-10 08:22:02 -05:00