Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream producers #713

Closed
wants to merge 111 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
6c806cc
Remove WiFiManager for good
mairas Apr 25, 2023
3ebd8e6
Replace old Async web server with esp-idf httpd
mairas Sep 26, 2023
eb516bd
Use esp-idf websockets library
mairas Sep 28, 2023
7d13ded
Remove the leftover AsyncTCP libraries
mairas Sep 28, 2023
0f649e9
Fix issues brought up by static analysis tools
mairas Nov 26, 2023
fcd3709
Remove the RemoteDebug dependency
mairas Sep 28, 2023
06c1534
Fix a typo in analogvoltage
mairas Oct 4, 2023
fb5694c
Fix editor indentation
mairas Oct 2, 2023
64ca988
Delete old web tree
mairas Sep 28, 2023
323bd39
Add an .eslintrc file
mairas Oct 10, 2023
4a6bd16
Implement new config UI
mairas Sep 28, 2023
bd9f4c3
Add backend API mocking
mairas Oct 1, 2023
7295780
Add SensESP logo
mairas Oct 1, 2023
e32fbd3
Add generated Bootstrap CSS files to .gitignore
mairas Nov 14, 2023
28a5a64
Add a plugin template
mairas Oct 12, 2023
ffe1f7a
Implement dynamic plugin loading
mairas Nov 14, 2023
fa95276
Add "mocked" remote plugin serving
mairas Nov 14, 2023
bbdaefd
Convert frontend dist files to C++ headers
mairas Sep 27, 2023
4e62782
Split the different API handlers into classes of their own
mairas Nov 19, 2023
50d552b
Decode URLs before matching to paths
mairas Feb 7, 2024
62e9901
Fix hostname UIOutput
mairas Feb 5, 2024
1bcda9b
Change UIOutput Json formatting semantics
mairas Nov 26, 2023
32d052c
Implement Configurable::clear_configuration
mairas Jan 5, 2024
6cc7dd7
Implement /api/routes endpoint
mairas Nov 26, 2023
cf6bbf2
Fix config schema handling
mairas Feb 6, 2024
8a7da88
Reimplement WiFi configuration and connection logic
mairas Jan 31, 2024
793e076
Connect all dynamic routes to the default root page
mairas Feb 5, 2024
9a2ff9b
Make hostname a persisting observable
mairas Feb 1, 2024
a63f09f
Fix task queue producer set signature
mairas Feb 2, 2024
7748654
Implement HTTP Digest Authentication
mairas Feb 5, 2024
9bb1d51
Provide SK delta TX and RX counters
mairas Feb 5, 2024
c8417a9
Fix ArduinoJson 7 deprecations
mairas Feb 5, 2024
50bab13
Lock dependency versions; refactor platformio.ini
mairas Feb 7, 2024
c3cfd29
Remove Startable class
mairas Feb 7, 2024
b64f6b9
Rename ValueConsumer::set_input to set
mairas Feb 7, 2024
f9fa536
Bump version: 2.7.1-alpha → 3.0.0-alpha1
mairas Feb 7, 2024
48e0031
Fix ws_client polling memory leak
mairas Feb 7, 2024
50ce192
Make Integrator emit its initial value
mairas Feb 7, 2024
8127bff
Update the examples
mairas Feb 7, 2024
7644575
Rename HTTPServerHandler to HTTPRequestHandler
mairas Feb 8, 2024
6711dd6
Implement a captive portal for the access point
mairas Feb 8, 2024
6579276
Implement Signal K setting UI
mairas Feb 13, 2024
c7d7a5c
Sort configurables properly
mairas Feb 27, 2024
952d381
Add customizable UI controls
mairas Feb 27, 2024
184b867
Fix editing JSON in textareas
mairas Feb 27, 2024
5174667
Fix RepeatSensor
mairas Feb 29, 2024
b04796c
Only list config items with a schema
mairas Feb 29, 2024
da6aabd
Remove debugging
mairas Feb 29, 2024
1963a72
Grow LambdaTransform schema buffer size
mairas Feb 29, 2024
05fabcd
Remove Configurable description and sort order constructor args
mairas Feb 29, 2024
3285c8c
Fix checkbox form items
mairas Feb 29, 2024
0f65c2f
Get default SSID from hostname. Also reformat.
mairas Mar 8, 2024
0695d50
Lower minimal encryption requirement. Clean up connection logic.
mairas Mar 8, 2024
f70d4ed
Increase config string buffer size
mairas Mar 8, 2024
22a2d47
Move WiFi watchdog to builder
mairas Mar 8, 2024
3f2faab
Use /dev/tty in sample platformio.ini
mairas Mar 8, 2024
31954c1
Allow setting admin username and password in the builder
mairas Mar 8, 2024
279de71
Don't use authentication for the soft AP interface
mairas Mar 8, 2024
bdbf7b6
Never provide configurable description or sort order in arguments
mairas Mar 8, 2024
050a81e
Rename redundant *T and *Template classes
mairas Mar 8, 2024
c8d7fb2
Fix constant sensor configuration schema typing
mairas Mar 8, 2024
398a696
Merge pull request #684 from SignalK/constant_sensor_config
mairas Mar 10, 2024
fbe2d86
Remove the obsolete and broken ts sample plugin code
mairas Mar 15, 2024
aa8a343
Merge pull request #685 from SignalK/remove_old_sample_plugin
mairas Mar 15, 2024
faea9b3
Breaking change: rename WSClient to SKWSClient
mairas Apr 16, 2024
8672fa2
Merge pull request #690 from SignalK/rename_wsclient
mairas Apr 16, 2024
f6f6c07
Pass received Json objects always by value
mairas Apr 16, 2024
cba868d
Merge pull request #691 from SignalK/sklistener
mairas Apr 16, 2024
b116f43
Remove ConstantSensor::get_value
mairas Apr 29, 2024
08c1ce3
Make ConstantSensor emit its value without delay to initialize the ou…
mairas Apr 29, 2024
60b49e2
Rename ConstantSensor::set_value to set for consistency
mairas Apr 29, 2024
e86c06f
Add the run script
mairas Apr 30, 2024
c184a19
Merge pull request #695 from SignalK/add_run_script
mairas Apr 30, 2024
662788e
Compile css files automatically as part of "run build-frontend"
mairas May 5, 2024
e195a0b
Merge pull request #696 from SignalK/run_script_fix_css
mairas May 5, 2024
697da4f
Ensure that the local logging libraries are at front
mairas May 25, 2024
7bfae34
Remove crud
mairas May 25, 2024
be7b248
Migrate to ESP-IDF logging facilities
mairas May 25, 2024
cc71419
Change deprecated ADC enum value
mairas May 25, 2024
f821a6e
Throw an error if CORE_DEBUG_LEVEL is not defined
mairas May 25, 2024
ccda8ea
Document the logging changes
mairas May 26, 2024
683f233
Update the default platformio.ini file
mairas May 26, 2024
3746425
Merge pull request #694 from SignalK/constantsensor_get
mairas Jun 1, 2024
a6d4706
Remove non-existent include
mairas Jun 1, 2024
17ccf34
Update examples
mairas Jun 1, 2024
80c922f
Also update test builds
mairas Jun 1, 2024
f41631c
Remove EDSP8266 CI platformio.ini
mairas Jun 1, 2024
8868449
Update GitHub Actions file
mairas Jun 1, 2024
a760b21
Merge pull request #699 from SignalK/esp_log
mairas Jun 1, 2024
7859ceb
Let the card list be empty
mairas May 26, 2024
a020cfd
Fix Position serialization
mairas Jun 1, 2024
01d0db7
Merge pull request #701 from SignalK/fix_empty_config_list
mairas Jun 1, 2024
62ee197
Add a convenience function to return the board serial number
mairas Jun 3, 2024
c7e1969
Add support for expiring values
mairas Jun 3, 2024
fd25416
Add new observers to the end of the observer list
mairas Jun 6, 2024
231d699
Implement different Repeat transforms
mairas Jun 6, 2024
f5a4e10
Implement join and zip "transforms"
mairas Jun 6, 2024
ead67b7
Implement a throttle transform
mairas Jun 6, 2024
dacc3c1
Make ObservableValue inherit from ValueConsumer
mairas Jun 13, 2024
a8c69ab
TaskQueueProducer set is missing input_channel
mairas Jun 13, 2024
6cf9348
Implement async configuration setting in Configurable
mairas Jun 13, 2024
fc17f83
Allow calling connect_to using a producer reference
mairas Jun 13, 2024
fa2bbef
Add error handling and reporting to async config setting
mairas Jun 16, 2024
3ff18d7
Remove input_channel feature altogether
mairas Jun 14, 2024
ee97683
Add an abstract base class for async commands
mairas Jun 18, 2024
159c2d7
Make ConfigurableResult an enum class and rename the values
mairas Jun 29, 2024
3d3144d
Implement save result polling
mairas Jul 13, 2024
ea7f3bc
Make ValueConsumer::set argument a const ref
mairas Jun 29, 2024
82efdd9
Set up hostname earlier in WiFi init to ensure it is applied to DHCP …
mairas Jul 13, 2024
19ce2b5
Implement separate set and push methods in TaskQueueProducer
mairas Jul 13, 2024
f675988
Implement stream producers that emit characters or lines
mairas Jul 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make hostname a persisting observable
mairas committed Feb 8, 2024
commit 9a2ff9bdcd73cc7b6ca19191355ffe0a335f4254
40 changes: 37 additions & 3 deletions src/sensesp/system/observablevalue.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _observablevalue_H
#define _observablevalue_H

#include "configurable.h"
#include "observable.h"
#include "valueproducer.h"

@@ -26,23 +27,56 @@ bool operator!=(ObservableValue<T> const& lhs, T const& rhs) {
template <class T>
class ObservableValue : public ValueProducer<T> {
public:
ObservableValue() {}
ObservableValue() : ValueProducer<T>() {}

ObservableValue(const T& value) { ValueProducer<T>::output = value; }
ObservableValue(const T& value) : ValueProducer<T>(value) {}

void set(const T& value) { this->ValueProducer<T>::emit(value); }
virtual void set(const T& value) { this->ValueProducer<T>::emit(value); }

const T& operator=(const T& value) {
set(value);
return value;
}

protected:
template <class U>
friend bool operator==(ObservableValue<U> const& lhs, U const& rhs);
template <class U>
friend bool operator!=(ObservableValue<U> const& lhs, U const& rhs);
};

template <class T>
class PersistingObservableValue : public ObservableValue<T>,
public Configurable {
public:
PersistingObservableValue() : Configurable() {}

PersistingObservableValue(const T& value, String config_path = "",
String description = "", int sort_order = 0)
: ObservableValue<T>(value),
Configurable(config_path, description, sort_order) {
load_configuration();
}

virtual void set(const T& value) override {
ObservableValue<T>::set(value);
this->save_configuration();
}

protected:
virtual void get_configuration(JsonObject& doc) override {
doc["value"] = this->output;
}

virtual bool set_configuration(const JsonObject& config) override {
if (!config.containsKey("value")) {
return false;
}
ObservableValue<T>::set(config["value"]);
return true;
}
};

} // namespace sensesp

#endif
1 change: 1 addition & 0 deletions src/sensesp/system/valueproducer.h
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ template <typename T>
class ValueProducer : virtual public Observable {
public:
ValueProducer() {}
ValueProducer(const T& initial_value) : output(initial_value) {}

/**
* Returns the current value of this producer
15 changes: 7 additions & 8 deletions src/sensesp_base_app.cpp
Original file line number Diff line number Diff line change
@@ -18,9 +18,14 @@ void SetupSerialDebug(uint32_t baudrate) {
SensESPBaseApp* SensESPBaseApp::instance_ = nullptr;

SensESPBaseApp::SensESPBaseApp() {
// initialize the filesystem
filesystem_ = new Filesystem();
// create the hostname_ observable - this needs to be done before
// the builder methods are called
hostname_ = new ObservableValue<String>(kDefaultHostname);
hostname_ = new PersistingObservableValue<String>(
kDefaultHostname, "/system/hostname", "Hostname", 0);
// create a remote debugger object
debug_output_ = new DebugOutput();
}

/**
@@ -36,13 +41,7 @@ SensESPBaseApp* SensESPBaseApp::get() { return instance_; }
* This should be only called from the builder!
*
*/
void SensESPBaseApp::setup() {
// initialize the filesystem
filesystem_ = new Filesystem();

// create a remote debugger object
debug_output_ = new DebugOutput();
}
void SensESPBaseApp::setup() {}

void SensESPBaseApp::start() {
// start all individual startable components
2 changes: 1 addition & 1 deletion src/sensesp_base_app.h
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ class SensESPBaseApp {

static SensESPBaseApp* instance_;

ObservableValue<String>* hostname_;
PersistingObservableValue<String>* hostname_;

Filesystem* filesystem_;
DebugOutput* debug_output_;