Comments (9)
At first, Homie-ESP8266 was designed for NodeMCU v1.0, but this obviously has to evolve.
To sum up:
- We keep the NodeMCU button as the default reset trigger. Not sure about this, though
setResetTrigger(D4, HIGH, 6000)
customizes the reset triggersetResetFunction(func)
. if func() returns true, the device resets. ButsetResetFunction()
is already a function that allow to define a function to run (e.g. clean custom EEPROM) when a reset is triggered. Maybe we could rename this onesetResetHandler()
orsetResetHook
? The hook one is the most explicit, as it is actually an hookdisableResetTrigger()
disables the inner reset trigger only
from homie-esp8266.
It seems clever for me to keep the default reset trigger. Note that to have an ESP8266 to boot from flash (normal boot) you need to have GPIO0 high, so in most set-up GPIO 0 will be pullup.
For "manual" reset I was more thinking to a Homie.resetConfig()
method that can be called from the user code (basically from the loopHandler) that just directly trigger the reset...
from homie-esp8266.
The loopHandler is only called when the network is in a good state (connected to both Wi-FI and MQTT). So if you want to reset because you've changed your Wi-Fi credentials, you're stuck as the loopHandler will never be called. So a resetConfig
could eventually be called from the loop()
, but this is sad to add code there, where there is only a pretty Homie.loop()
call.
from homie-esp8266.
good point :)
Maybe one can add a warning about that in the doc !
So your solution with a callback fct is clearly better.
I'll need all this for one of my devices where all GPIO are used. So I'll work on this when I update the FW of that device (to make it use Homie). However I don't know when it will be...
from homie-esp8266.
I'll create a proper documentation, as the project is becoming more and more feature-rich. ;)
I don't know how I will implement those methods either!
from homie-esp8266.
Docs are more complete about the loopHandler now. More flexible reset is the next thing I will implement.
from homie-esp8266.
You can see the usage in the Wiki
from homie-esp8266.
Great ! Nice work 👍
I hope to have some time to test it one evening next week...
Thanks !
from homie-esp8266.
Take your time! Feel free to reopen if it does not work for you.
from homie-esp8266.
Related Issues (20)
- lint: fix warning "Using C-style cast" HOT 1
- Wemos D1 mini Pro crashes on boot up with debug flag enabled HOT 3
- Home Assistant integration
- Question: Delay between MQTT messages HOT 16
- [Request] Add support to save configure as json in web configurator
- Can't build with arduino-esp32 v2.0.2 (latest stable) HOT 4
- Public variables in PropertyInputHandler are undefined. HOT 2
- compilation failure on ESP32 HOT 3
- Get node property without intermediate variable HOT 1
- Compilation failure on ESP8266 HOT 2
- MQTT reconnect fails after Wifi-disconnect HOT 10
- Wrong MQTT topic used when advertising $unit HOT 1
- using ESP32 Serial1 interface triggers homie reset HOT 1
- Connection to HiveMQ Cloud not working
- 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url) HOT 3
- version 4 HOT 1
- Issue with ArduinoIDE and manually installed libraries
- PlatformIO [email protected] linker error HOT 2
- HomieSetting.setDefaultValue("") might be freed crashing the mcu HOT 3
- Range index control is not valid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homie-esp8266.