Closed gmag11 closed 4 years ago
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:
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
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 :))))))
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:
Here my answers
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.
EnigmaIOTGateway.begin (&Espnow_hal,NULL,false);
to start gateway in setup ()
. You need to do the same on every node with EnigmaIOTNode.begin (&Espnow_hal,NULL,NULL,false);
.My ESP8266 node works great ! With message counter on and 200+ messages sent so far no problem. Will try disable counter tonight Thanks a lot !
On Mon, 19 Oct 2020 at 00:00 Germán Martín notifications@github.com wrote:
- 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 in setup (). You need to do the same on every node with EnigmaIOTNode.begin (&Espnow_hal,NULL,NULL,false);.
- Commit 0a0d909 https://github.com/gmag11/EnigmaIOT/commit/0a0d9098b0879fef1c10edf4f7c751dcc7dbcfe2 adds this feature. Setting MAX_NODE_INACTIVITY or MAX_KEY_VALIDITY to 0 makes it infinite.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gmag11/EnigmaIOT/issues/13#issuecomment-711290623, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM34LCQREILUPTWNI73I5BDSLMNKFANCNFSM4SL33WUQ .
Integrated in main branch on release 0.9.5. @quangvankts Let me know if you find any bug.
@quangvankts asked in #11
How do I save complete nodes and gateway current data into flash (including shared key, valid status etc) so they can load it up, skip registration and exchange data straightaway after a cold boot (I know it only takes 200ms to register but I want to experiment how fast nodes can work)