Commit Graph

594 Commits

Author SHA1 Message Date
Gregg 568c13fee3 Tested homeSpan.setStatusDevice() to create a reverseLED 2023-07-02 17:12:58 -05:00
Gregg 9a42f0885c Added [override] to onStep 2023-07-02 11:39:31 -05:00
Gregg 195095c891 Changed setAccel() and setStepType() to return StepperControl*
Allows for daisy-chaining of configuration parameters.

Also added initialization of upLinkData in motorTask to prevent time-outs if setMove() is never called (by initializing msDelay=10)
2023-07-02 11:13:55 -05:00
Gregg 6ab047b011 Update extras.ino 2023-07-01 09:01:11 -05:00
Gregg 9bfc07041d Creating Stepper Motor images 2023-06-25 21:50:10 -05:00
Gregg c5a40c6e34 Added ability to set cpu and priority for motor task using pair {} 2023-06-22 21:25:18 -05:00
Gregg e422d3c9de Updated StepperMotorControl Window Shade Example to use setPosition()
Example now saves window shade position in NVS and uses setPosition() accordingly upon initialization.
2023-06-20 21:23:03 -05:00
Gregg fe4d83140f Completed motor control setPosition()
Updated logic of setPosition(), move(), and moveTo() to use waitForAck() so that an initial acknowledgment is received from the motorTask() before proceeding.
2023-06-19 21:24:23 -05:00
HomeSpan 480af6cf85 Added setPosition() to StepperControl
Needs testing and debugging
2023-06-18 17:55:29 -05:00
Gregg 2eb70f1d1b Changed links from HomeStep to HomeSpan 2023-06-09 23:15:38 -05:00
Gregg 536de53075 Added Stepper_TB6612 and Stepper_A3967 directly to HomeSpan
HomeSpan now includes both drivers as part of the "extras" functionality.
The StepperMotorControl Window Shade Example has been updated accordingly to use the built-in TB6612 driver.
2023-06-09 23:11:38 -05:00
Gregg 44e48a4534 Update extras.ino 2023-06-04 09:20:37 -05:00
Gregg 5e1d65f436 Renamed SpanStep to StepperControl and moved into HoneSpan Extras
Also updated StepperMotorControl Example.
2023-05-30 05:05:51 -05:00
Gregg 21da828f83 Update HomeSpan.cpp 2023-05-13 15:39:01 -05:00
Gregg d33bbf2477 Update src.ino 2023-05-13 10:36:17 -05:00
Gregg 40bb97215f Added homeSpan methods setSerialInputDisable() and getSerialInputDisable()
Provides ability to disable HomeSpan from reading from Serial port (which is otherwise normally enabled)
2023-05-13 10:34:21 -05:00
Gregg de97faee37 Converted Serial.printf in extra classes to ESP_LOGI and ESP_LOGW
Changed Serial.printf() diagnostic messages to either ESP_LOGI() or ESP_LOGW() macros in Blinker, PWM (LedPin and ServoPin), Pixel, and RFControl class
2023-05-12 21:32:21 -05:00
Gregg 7bc885dd26 Completed initial migration of Serial.print to LOG0
Finished all applicable cases in main source code.
TO DO: apply LOG0 to extras
2023-05-10 22:12:21 -05:00
Gregg 66bb13af03 Continued change from Serial.print to LOG0() 2023-05-08 22:43:42 -05:00
Gregg 368ce12c04 Started work on converting all Serial.print() to LOG0() macro 2023-05-08 17:07:21 -05:00
Gregg d5eb2ceeb8 Update src.ino 2023-05-07 13:41:27 -05:00
Gregg 0f3b798fcc Bumped version to 1.7.3 2023-04-29 15:18:33 -05:00
Gregg ec1cd44382 Small tweaks to reset reasons in web log 2023-04-27 19:53:33 -05:00
HomeSpan 5e71e5b4d5
Merge pull request #566 from frankonski/dev
Added description of Reset Reason Code to WebLog.
2023-04-27 20:36:52 -04:00
Gregg beb79538e9 Update to WebLog TimeServer Logic
Acquiring time from a timeserver is now spawned as a separate task running in the background.  This avoids blocking HomeSpan while setting the time.

Default wait time has been extended from 10 seconds to 2 minutes, since there are no problems with blocking.
2023-04-27 19:29:05 -05:00
Francois 7e08e00734 Added description of Reset Reason Code to WebLog. 2023-04-26 13:51:42 -04:00
Gregg 2ce78fead6 Added charset=utf-8 to weblog to allow for utf-8 encoding 2023-04-23 15:14:57 -05:00
Gregg 947e2af012 Added homeSpan.setWebLogCSS(const char *css)
Allows user to define a custom style sheet to change the webLog output.  Style sheet is based on pre-defined class:

bod1 = main body of web page, including header (in format of <h2>)
tabl1 = top table showing general status
tab2 = bottom table showing all weblog entries
2023-04-23 10:01:00 -05:00
Gregg 6fca946dd5 Added Sodium and MbedTLS versions, and Pairing Status, to Web Log 2023-04-23 07:46:37 -05:00
HomeSpan 889a326e02 Address conflict between SpanButton and certain Adafruit Boards
Change enum from BUTTON and TOGGLE to HS_BUTTON and HS_TOGGLE to avoid conflict with #define BUTTON in certain Adafruit boards
2023-04-20 21:56:55 -04:00
Gregg 5853989651 Update src.ino 2023-04-08 17:17:47 -05:00
Gregg c287564aed Update HomeSpan.cpp 2023-04-03 17:15:51 -05:00
Gregg 2ba75c13ea Add CLI commands 'p' and 'P' to clone device pairing data 2023-04-03 08:28:51 -05:00
Gregg f466e12c7a some cleanup of LedPin comments in examples
Removed old references to "channels" which should have been deleted many versions ago
2023-04-01 12:16:15 -05:00
Gregg ce36174f93 Completed LED fading functionality; added new Fading LED example (in Other Examples) 2023-03-31 22:07:31 -05:00
Gregg fab94722d8 Revert "Added fadeTime parameter to LedPin::set()"
This reverts commit c2df57815c.
2023-03-26 07:48:22 -05:00
Gregg c2df57815c Added fadeTime parameter to LedPin::set() 2023-03-26 07:39:06 -05:00
Gregg a79b7569d1 Begin implementation of hardware LEDC fade 2023-03-25 23:05:22 -05:00
Gregg 6079b8edf7 Bump version to 1.7.2 2023-03-25 12:19:08 -05:00
Gregg ecd97e6e71 Added option to set Priority and CPU in autoPoll()
Also added vTaskDelay(5) in pollTask to make sure competing tasks can operate (for example, if priority was set to greater than 2, touch sensor did not operate).  Adding vTaskDelay(5) solved this problem.
2023-03-25 10:58:03 -05:00
Gregg 75930a1d6e Update FeatherPins.h
Changed from old ESP32-C3-DevKitM-1 to new ESP32-C3-DevKitC-02
2023-03-17 22:26:52 -05:00
Gregg cde3348b79 Update src.ino 2023-02-25 15:34:14 -06:00
Gregg 09063fb7dc Extended functionality of setValidValues() to allow INT, UINT8, UINT16, and UINT32 Characteristics 2023-02-25 15:07:02 -06:00
Gregg 7e3d26fe6e Removed initialization of WiFiClient in HAP.h
See #508 for details.
2023-02-18 22:21:54 -06:00
Gregg 69af3d59a3 Replaced Service definitions with macros CREATE_SERV and END_SERV
This has no effect on the code but the names of the macros can be used as flags for an external script to autogenerate documentation in the form of a list of all services and characteristics supported by HomeSpan
2023-02-16 07:23:22 -06:00
Gregg 0ecaf2ee7f Add CUSTOM_CHAR_HEADER logic
used to include custom Characteristics in a common header without redefining.
2023-02-12 13:24:19 -06:00
Gregg 22bd16e936 Added ability to set OTA password from within sketch
Adds second form of homeSpan.enableOTA(const char *pwd, boolean safeLoad=true)
2023-02-11 07:49:16 -06:00
Gregg 88897ee085 Updated copyright dates on source code 2023-02-04 11:41:57 -06:00
Gregg 2f713b3749 Update HomeSpan.h 2023-02-04 10:15:37 -06:00
Gregg e2678f5661 Added position() method to SpanToggle()
Created PushButton::OPEN and PushButton::CLOSED enums.

This completes all SpanToggle() functionality.  Will add a SpanToggle() to UnitTest.
2023-02-03 23:09:08 -06:00
Gregg c3d0c98e04 Created SpanToggle()
Derived from SpanButton()
2023-01-31 22:55:43 -06:00
Gregg 232362c807 Update Utils.h
Added comments for new toggled() functionality
2023-01-30 07:56:46 -06:00
Gregg 1a3887b6cf Added switch toggle logic to PushButton Class
Adds new method toggled() which is the analog of triggered().

Next step: Extend SpanButton to access this new logic.
2023-01-29 18:30:25 -06:00
Gregg 03ba061b9b Added logic to hide AP SSID from broadcasting when WIFI_AP_STA used for SpanPoint
This does NOT effect the HomeSpan Access Point from being broadcast as usual when launched.
2023-01-28 18:05:59 -06:00
Gregg eb53e7f6e7 Moved SpanPoint initialization message to main Info 'i' output
Created SpanPoint table within 'i' output
2023-01-25 22:22:49 -06:00
Gregg 7eca1e776b Add option to SpanPoint to use softAP MAC Address instead of STA
Needed to support ESP-NOW on ESP-8266 chips, which seem to only work if connecting into softAP MAC Address once HomeSpan is connected to WiFi network (prior to connection ESP-8266 will properly connect to normal STA address as well as softAP address).
2023-01-22 18:05:59 -06:00
Gregg 6d18d5a3dc Added "invert" option to LedPin()
If invert=true, PWM output will be phase-inverted.  This is useful when creating a pair of PWM pins that need to be out of phase by 180 degrees (e.g driving a piezo-electric buzzer via two PWM pins).
2023-01-07 20:44:19 -06:00
Gregg a8271c8724 Added homeSpan.refreshStatusDevice()
Provides for additional control over Status LED when a generic device has been used.  If the color of the device is changed, the change will only take effect when the LED is next turned on.  If the LED is blinking, the color changes upon the next blink.  But if the LED is ON, there is no next blink and color will not change.

This method check the status of the LED, and if it is ON, is calls the on() function again, which will result in an update of the color.  The method does nothing if the LED is OFF or BLINKING.
2023-01-07 17:09:22 -06:00
Gregg 9ef9a590da Added homeSpan.setStatusDevice()
Allows any Blinkable class to be used as the Status LED
2023-01-07 14:28:50 -06:00
Gregg 3cb8d27342 Added CUSTOM_CHAR_DATA() macro
Similar to CUSTOM_CHAR_STRING() macro, but does not include a parameter to set the default value (since the user can type an invalid string).  Instead, user setData after creating the Characteristic as needed.
2023-01-01 15:08:34 -06:00
Gregg 72b4ece64d Added DATA format
Includes 3 new methods: getData(), getNewData(), and setData()
2023-01-01 11:33:50 -06:00
Gregg 1f7c86621c Bumped version number to 1.7.1 2022-12-28 17:18:59 -06:00
Gregg eecce34848 Added NVS storage for last channel used in SpanPoint
Applicable only for remote devices (i.e. not a Hub device).  Last channel stored is used as initial channel upon reboot, provided that this channel is allowed by the channel mask (if not, the first allowed channel is selected instead).
2022-12-27 09:55:30 -06:00
Gregg 3fae9c24a9 Updated Television Characteristics
Removed Mute, Active, and Volume since they don't appear to do anything.
2022-12-23 18:39:14 -06:00
Gregg 7939624bf7 Added Service::TelevisionSpeaker
Also updated Television Example.  Volume buttons on remote now function as expected, though there does not seems to be a mute button
2022-12-23 16:51:55 -06:00
Gregg ea07da5ab0 Update HomeSpan.h
Fixed another compiler warning
2022-12-11 14:19:37 -06:00
Gregg 5daaf3d0cf Added #pragma once to extras header files 2022-12-03 11:12:30 -06:00
Gregg 484f1c4f2e Cleaned up compiler warnings
* Changed ~SpanService to virtual function to ensure any user-defined destructor is also called

* Found/corrected bug in error message related to defining a Characteristic without any Service

* Added warning/error ID numbers to warning/error messages

* Other misc changes to clean up compiler warnings
2022-12-02 17:49:54 -06:00
Gregg a761d992e8 Updated version number to 1.7.0 2022-11-08 05:37:25 -06:00
HomeSpan 5b1b9396a0 Update HomeSpan.h 2022-11-05 12:09:36 -04:00
Gregg dd3cc8ab3b Fixed bug in postPairingsURL logic 2022-10-31 21:08:45 -05:00
Gregg f775a63b7a Completed and tested all statusCallback and statusString logic 2022-10-30 08:49:53 -05:00
Gregg 0929a04270 Update HomeSpan.h 2022-10-29 18:38:01 -05:00
Gregg 05cbc03f12 Added homeSpan.statusString(HS_STATUS statusMessage)
Can be used in statusCallback to convert HS_STATUS to char string
2022-10-29 18:36:30 -05:00
HomeSpan 645c169a5e created STATUS_UPDATE macro
Combines statusLED updates with statusCallback updates
2022-10-29 11:34:48 -05:00
Gregg d55dad1529 Added more events to statusCallback() 2022-10-29 07:37:34 -05:00
HomeSpan bb1b599797 Completed homeSpan.setStatusCallback()
To Do: create documentation
2022-10-24 21:48:37 -04:00
HomeSpan 7ff91ccf02 Changed hsEventCallback to statusCallback 2022-10-24 19:03:15 -04:00
HomeSpan 4e23c5e357 Updating hsEventCallback with more events 2022-10-24 06:46:04 -04:00
HomeSpan 5b38c6a04a Started homeSpan.setEventCallback() 2022-10-23 21:26:41 -04:00
Gregg f8be2847bd Fixed bug in touch sensor logic that would cause failure to compile under 2.0.0-2.0.2
Verified that Unit Test compiles under all version 2.0.0 through 2.0.5 and works on 2.0.0 as well as 2.0.5
2022-10-22 15:25:31 -05:00
Gregg 74bbde2492 Changed SpanPoint::send(void *data) to SpanPoint::send(const void *data) 2022-10-16 16:53:11 -05:00
Gregg 2d411bab82 Updated SpanPoint so that WiFi_AP_STA is only used if receiveSize>0
Next up: explore power-reducing modes and sleep modes for remote sensors to extend battery life.
2022-10-03 22:04:51 -05:00
Gregg ab21a0c96c Created Other Examples - RemoteSensors
Created MainDevice and RemoteDevice sketches
2022-10-02 10:14:09 -05:00
Gregg 23afdb3711 Completed all SpanPoint code
Allows for bi-directional transmission between main HomeSpan device and one or more remote devices.

To Do:  Create and test with Temperature Sensor Example
2022-10-01 15:33:11 -05:00
Gregg b7317c3b5f Added SpanPoint::send() functionality
Works as expected.

Next Up:  Modify send() logic so that channels are NOT scanned if device is a main HomeSpan hub.
2022-09-30 22:20:32 -05:00
Gregg c819426dec Moving HomePoint.h back into HomeSpan.h
Added SpanPoint::setAsHub(), which is called after homeSpan.begin() to set device as Hub so SpanPoint knows not to change WiFi channel.

Also added check to make sure there are no SpanPoint objects instantiated before a call to homeSpan.begin() (if it is called at all).
2022-09-30 17:27:57 -05:00
Gregg 72294bde8b Move all SpanPoint code into separate HomePoint.cpp and HomePoint.h files
This enables SpanPoint to operate as a standalone library with no reliance on anything in HomeSpan.

To Do: migrate all HomePeer code into SpanPoint.  This will yield a universal standalone HomePoint library that can be used for BOTH the receiver and the sender (which automatically means two-way communication is always possible)
2022-09-28 21:16:29 -05:00
Gregg 58683586bc Added SpanPoint::get()
This completes SpanPoint.  Next: rename HomePeer to be HomePoint.
2022-09-26 22:00:32 -05:00
Gregg 4f983051ce Created SpanPoint
Verified ESP-NOW is communicating correctly with HomeSpan.  Verified encryption works.  Next step - create linkages between incoming data and Services; create queue structure to transfer data.
2022-09-25 13:53:54 -05:00
Gregg 22cfa130b4 Created HomePeer
This is a self-contained library that is used for remote devices set up as HomeSpan Peers via ESP-NOW.
2022-09-24 16:49:32 -05:00
Gregg dbe4c268f4 Modified folder structure for "extras"
This allows the "src.ino" test file to once again properly compile without requiring modifications to any existing HomeSpan sketches.  This was needed to ensure src.ino can find object code in "extras", which is now required to use the new statusDevice() method.  Since the Arduino IDE only copies files that are in "src" folders, "extras" needed to be moved to "src/extras".  For backwards compatibility with all other sketches, the "extras" directory now contains stubs for the ".h" include files.
2022-09-24 08:20:22 -05:00
Gregg 66160e7c6c continued development of espnow 2022-09-22 20:26:34 -05:00
Gregg 4a4a5f8a6b Started development of ESP-NOW
Also, added WiFi.begin("none") to make sure all WiFi data is erased when requested.
2022-09-05 18:42:37 -05:00
Gregg 677b9b673c Update FeatherPins.h
Added BUILTIN_PIXEL for S2, C3, and S3 chips
2022-09-04 10:03:59 -05:00
Gregg 8b9487b9d4 Created homeSpan.setStatusPixel(float h=0, float s=100, float v=100)
This is now the official API method to set an RGB NeoPixel as the status LED.  It defaults to bright red unless an HSV color is specified.
2022-09-04 07:31:08 -05:00
Gregg 546c87e3ec Added setOnColor to Pixel
Allows user to set the color to be used for Blinker
2022-09-03 16:47:02 -05:00
Gregg 355a2dfd4d Updated rest of code to reflect latest version of statusLED
Removed all checks to see if statusLED is defined, since it will now ALWAYS be defined, even if the statusDevice is set to NULL.
2022-09-02 18:47:15 -05:00
Gregg f2e1f5bc70 Updated Blinker Class to allow for NULL Blinkable Device
If NULL, all functions are ignored and getPin() returns -1
2022-09-02 18:15:53 -05:00
Gregg 6fecf2c29f updating main code to incorporate new Blinkable class/interface 2022-08-28 18:32:52 -05:00