Commit Graph

1905 Commits

Author SHA1 Message Date
Gregg 7d8a91f13b Updated prior Examples and eliminated ServiceType 2020-09-27 17:42:56 -05:00
Gregg fa8c5934ea Eliminated ServiceType from Library and Example 11
Next up - update Examples 12+ to delete ServiceType
2020-09-27 15:56:48 -05:00
Gregg 814d751e71 Created SpanService::setPrimary() and setHidden()
These optional methods can be "chained" when instantiating a new SpanService to configure the Service as Primary or Hidden (or both).  This alleviates the need to ServiceType to be propogated through the Service constructor.

Next Up:  Eliminate ServiceType construct and update Examples to use setPrimary instead.
2020-09-27 14:51:31 -05:00
Gregg 538a3a9531 Added PushButton::primed()
Allows you to determine if short-press has occured but button not yet released.
2020-09-27 14:33:38 -05:00
Gregg a40447b8f8 Created methods to set Control and Status Pins
Created separate init() methods for PushButton and Blinker.  Created HomeSpan:setControlPin and HomeSpan:setStatusPin that can be called from main setup() to modify the defaults.  All default settings being migrated to Settings.h
2020-09-27 13:41:02 -05:00
Gregg ac25b94b67 Fully implemented Generic PushButton
Generic PushButton now used for all device control functions.
2020-09-26 17:13:17 -05:00
Gregg b7de0cf710 Created Generic PushButton
Wll be used for control button.  Nothing to do with buttons that control Accessories, which are handled by SpanButton.
2020-09-26 16:23:44 -05:00
Gregg 6a2d0741aa Finished 'U' unparing routines
Next Up:  Add method to break out of WiFi connection loop by using push button in case WiFi SSID/PWD has changed but there is no desire to unpair controllers.  To Do:  Move blinking status light setting to named macros.
2020-09-24 09:29:52 -05:00
Gregg 69c7d939b8 Update HomeSpan.cpp
Setup Code now saved after serialConfig() or apConfig().

Next up: Create 'U' command to unpair controller.  Change function of control button so it unpairs (short press) or resets WiFi (long press).

To do:  Revisit statusLED blinking paterns to make sure they are clear and consistent - save them as macros in settings.h
2020-09-23 08:51:13 -05:00
Gregg 7d19df3f69 Added 'S' command to change setup code
Verified all functionality works as expected.  Next Up:  Add this code to both serial and AP network configurations.  To Do: alter 'H' command so it removes controllers (unpairs) but retains HAP ID and other data. - perhaps make this 'U' command?
2020-09-22 08:14:02 -05:00
Gregg c9a661573d Made NVS Handles static variables of HAPClient
Now have nvs_handle hapNVS, wifiNVS, and srpNVS.  All three are opened once in HAPClient::init()
2020-09-22 07:28:02 -05:00
Gregg 49b1aa277d Create SRP6A:loadVerifyCode()
And updated other SRP routines to complete implementation of use of stored verification code instead of live setup code.

Next up: Add method to change setup code in serial interface and implement similar code after network configuration routines.
2020-09-21 07:10:23 -05:00
Gregg 446679abab Created SRP6A:createVerifyCode()
This generates an SRP verification code from a setupCode and randomly-generated salt.  Function creates the salt internally and returns both the resulting verification code and salt that was used.  These are stored in NVS permanently.

Next Step: create SRP6A:loadVerifycode()
2020-09-20 22:00:01 -05:00
Gregg b0307c9ab0 Completed WiFi credentials code
WiFi data now set/resest/saved as needed.  Next up: saving/resetting Setup Code.
2020-09-20 08:25:16 -05:00
Gregg d93c45c0bc Updated Network:apConfigure
Improved Robustness - all functionality now completed.
2020-09-19 08:39:27 -05:00
Gregg dd6c8d904a Completed Network::apConfig() 2020-09-15 07:00:31 -05:00
Gregg 123e2924a5 Completed Network::serialConfigure()
Next up: update and complete Network::apConfigure()
2020-09-12 10:06:44 -05:00
Gregg 4a6c737c72 Moving serial wifi update into Network.cpp 2020-09-07 11:02:44 -05:00
Gregg fd68164917 continued to build out Network() 2020-09-06 14:38:02 -05:00
Gregg 3da2b9a311 Change Config.cpp to Network.cpp
Move all configuration code into Network.cpp, eliminating any calls or connection to HAP.cpp.  Network.cpp is now standalone for HomeSpan.cpp to call directly to handle ALL apects of WiFI and Setup Code initialization.

Also move TempBuffer from HAP.h to Utils.h so it can be used by Network.h
2020-09-06 08:24:13 -05:00
Gregg af3c093cdc updated configure() 2020-09-04 22:19:14 -05:00
Gregg de897557eb updating 2020-09-04 19:51:12 -05:00
Gregg a5e0b1c0ad cleaning up Configure()
TO DO: Add max length to other form inputs;  try limiting number of connections to exactly 1.  Next:  parse form data and initiate wifi connection.
2020-09-04 07:27:50 -05:00
Gregg 4e2c28bcf8 Update Configure.cpp 2020-09-03 21:56:52 -05:00
Gregg 9a80b8fa41 Moved all captive code into Configure.cpp 2020-09-03 21:48:08 -05:00
Gregg b957b540c0 created struct Configure 2020-09-03 21:24:27 -05:00
Gregg fd3b00ecd5 created get wifi-status 2020-09-03 07:07:07 -05:00
Gregg b64bd3a230 continued updates to captive access functionality 2020-09-02 21:10:56 -05:00
Gregg efe33fcdb9 Created captiveAccessURL()
Developing captive AP routines inside HAP.cpp
2020-09-01 22:08:51 -05:00
Gregg cd5b3115f5 Further updates to Captive AP Mode 2020-09-01 08:34:59 -05:00
Gregg 705a0922e1 Started work on CaptiveAP
Added span::config(hostName) to provide CaptiveAP at start-up.
2020-08-30 22:07:16 -05:00
Gregg 8c8168fe34 Update ZephyrHood3.ino
Switched pins for fan<->light
2020-08-26 17:45:00 -05:00
Gregg 30905c4ade Completed Zephyr3
Logic simplified and more robust, but brightness is NOT tracked.  Good compromise.
2020-08-24 12:15:03 -05:00
Gregg 7987cdaf48 FInal Version of Zephyr2
Includes abilty to change brightness of light through HomeKit as well as with button.  However, the vent light is too unstable to do this perfectly, and increasing brightness by stepping through multiple decreases is annoying.   To do:  Create Zephyr3 without brightness control and test to see how it works in practice.
2020-08-24 07:42:50 -05:00
Gregg e5fd2a200f Update DEV_Zephyr.h 2020-08-23 20:37:11 -05:00
Gregg 35280ccf53 Created Zephyr2
Create logic to track whether fan and light is on, withouth needing to rely on emulated pushbuttons.
2020-08-23 18:57:11 -05:00
Gregg 054d4dbf64 Completed Zephyr Vent Hood Example 2020-08-23 13:03:14 -05:00
Gregg 9f7e9a51e5 Created Zephyr Vent Hood Example 2020-08-23 08:21:56 -05:00
Gregg b42dd9dfba Implemented Reset Button
Allows for reset of HAP (press for 5 seconds, but less than 10) or Factory reset (press for 10 second).  Use  setResetPin to change from default of pint 21.
2020-08-23 08:14:31 -05:00
Gregg 2172ac1ce6 Implemented Blinker statusLED
Replaced manual blinking with automated Blinker statusLED
2020-08-22 21:52:25 -05:00
Gregg 9952b48950 Created Blinker Class
Generic blinking class for LEDs that uses Alarm Timer interrupts that work in background.  Will be used to replace and extend HAP blinking of Builtin_LED to convey status of HomeSpan at varioud points in the code.
2020-08-22 13:22:19 -05:00
Gregg e298f32cbf Completed Example 15
All commentary finsihed.
2020-08-21 09:30:59 -05:00
Gregg f056b6ae82 Completed SpanButton()
And finished code for Example 15 to verify SpanButton() works as expected.  To Do: add comments and notes to Example 15.
2020-08-20 21:39:13 -05:00
Gregg c997ca3462 Created Example 15
Initial implementation of SpanButton PushButton object and check() logic
2020-08-20 07:29:15 -05:00
Gregg 9bbea69816 Re-organized Example Files into Tutorial Subfolders 2020-08-18 20:53:22 -05:00
Gregg 7fd21f2bed Completed Example 13
Fully documented Garage Door Opener and motorized Window Shade examples.
2020-08-18 20:36:40 -05:00
Gregg 6c5a5835e6 Eliminated TimedResets from Library
This is no longer needed since PushButtons can be easily emulated from within a Service loop() as per Example 14.  Library is now fully up-to-date: TimedResets and SpanEvents have been fully removed.
2020-08-17 21:54:43 -05:00
Gregg 258882fe6d Renamed Example 14 to EmulatePushButton
AND updated Example 13 to reflect new loop() framework in place of SpanEvents.  ALSO found a bunch of inconsistencies with WindowCovering HAP documentation.  PositonState and HoldPosition are NOT used by HomeKit.  However, HomeKit has a full slider for controlling shades which makes a Hold Button no longer needed.  See Example 13 for details.  Open to do:  add commentary to Example 13 and eliminate SpanEvents from library!
2020-08-17 21:42:58 -05:00
Gregg a905ac4ef3 Renumbered Examples
Renumbered Example 11 (RGB_LED) to Example 10; Example 12 (ServiceOptions) to Example 11; Example 13 (ServiceLoops) to Example 12; and Example 14 (TargetStates) to Example 13.  Example 14 is now the PushButton example (previously the TimedReset Example).

To do:  Must update Door and Window code in Example 13 (TargetStates) to utilize new loop() framework.  Must also delete all references to TimedResets in library code.
2020-08-17 07:14:01 -05:00
Gregg d5ff5c506d Example 10NEW -> Example 14
Updated Example 10NEW to fully reflect the use of loop() methods instead of TimedResets to emulate a push button.  Renamed Example 10 to Example 14, since it must come after we introduce loops().  Deleted both original Example 10 and Example 10NEW
2020-08-17 07:00:47 -05:00