Comments (7)
from enigmaiot.
Actually registration will be longer as several random delays are placed to avoid registration collisions.
You idea makes sense but I did no implemented like this for a couple reasons:
- This data is written on every packet to update message counters. If you use SPIFFS to write so often it may happen that it wears out too soon. Remember that each flash position may be written about 10000 times.
- Having session key on flash may reduce security in case an attacker have physical access to your device. Then key may be easily read. Then it may be used to decode commands and messages.
If you have all this in mind, it may be some situations that this may be a good idea, either.
Nodes that send a message not too often may be completely off to improve battery duration significatively.
Let me think if I can implement this with a parameter in begin call of as a configuration in EnigmaIOTconfig.h
from enigmaiot.
I've added a new branch to implement this (https://github.com/gmag11/EnigmaIOT/tree/flash_storage)
@quangvankts Test it if you like. This feature is controlled by a parameter on EnigmaIoTconfigAdvanced.h
#define USE_FLASH_INSTEAD_RTC 1
If it is 1 context data will be stored on flash, if it is 0 it will be stored on RTC mem.
Storing data on flash adds around 10 ms to processing time
Notice that you should increase MAX_KEY_VALIDITY and MAX_NODE_INACTIVITY on EnigmaIoTconfig.h according message frequency.
Remember that flash may be stressed if messages are sent too often. Actually, I do not know how fast the flash would degrade. If you can sacrify one esp8266 flash module you may do a burn test :))))))
from enigmaiot.
Thanks !
Yes I just want to try EnigmaIOT in a very specific case where timing and battery life is more important than security. So using flash instead of RTC is very helpful. I have some further questions:
- Does gateway need the same save RTC to flash implementation for this to work as well (in case gateway is not always power on) ? If yes can you add this to gateway ?
- Is there a way to save RTC to flash only after node registration is done, and not every time a message is sent if I don't use message counter ? (same for gateway)
- Will defining MAX_KEY_VALIDITY and MAX_NODE_INACTIVITY as -1 make shared key last forever ? If not how do I do so ?
from enigmaiot.
Here my answers
- Gateway does not store node related data persistently, it is only on RAM. So, it it is restarted all nodes will have to reconnect again, what may take something between 1 and 10 seconds, depending the number of nodes that try to register at the same time.
- Not easily, Context is updated at least on every message because each one is tagged with a counter. I have included the possibility to disable counter but context is still updated. I may study if adding a condition can reduce the number of writes.
- No, but it is a nice idea. I'll check if there is any type conflict doing that. Having infinite MAX_NODE_INACTIVITY may force to reboot gateway if you remove a node from network. Adding a management panel on Gateway my be a solution but I'm really far from implementing that feature yet.
If you test last development successfully let me know to include it in next release. I've tested on ESP8266 and works fine. I have to do same test on ESP32 yet.
from enigmaiot.
- I've noticed that this was already implemented. This requires that Gateway is compiled with counter checking disabled. You may use
EnigmaIOTGateway.begin (&Espnow_hal,NULL,false);
to start gateway insetup ()
. You need to do the same on every node withEnigmaIOTNode.begin (&Espnow_hal,NULL,NULL,false);
. - Commit 0a0d909 adds this feature. Setting MAX_NODE_INACTIVITY or MAX_KEY_VALIDITY to 0 makes them infinite.
from enigmaiot.
Integrated in main branch on release 0.9.5. @quangvankts Let me know if you find any bug.
from enigmaiot.
Related Issues (20)
- Support for BMP280 sensor HOT 3
- EnigmaIOT beginner's guide or help sources? HOT 4
- trying to build MQTT-noSSL HOT 1
- Errors when DEBUG enabled HOT 2
- ESP32 WiFi won't connect HOT 1
- GatewayAPI.cpp getNodeInfo() compile error HOT 3
- Bootloop in new nodes HOT 1
- Can’t work with EnigmaIOT HOT 4
- MQTT command line to switch LED off/on HOT 3
- esp8266 do not have enough RAM to run the default examples due to NUM_NODE mostly HOT 2
- Issue building for an esp32 with version 0.9.7 HOT 4
- Node without name HOT 1
- Portal recovery problem
- Instructions from howto.md does not work HOT 1
- Having trouble compiling gateway HOT 1
- FailSafe.h HOT 1
- Notice when a node is connected or disconnected from EnigmaIOT network
- FR: Is there a way to seperate MQTT client from ESP-Now controller? HOT 5
- El Gateway MQTT EnigmaIOT no funciona correctamente. HOT 7
- Nodes outside range of gateway but within range of another node
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 enigmaiot.