-
-
Hi @Gordon, thanks for your suggestion to comment out
"ifndef" : "SAVE_ON_FLASH"
, this actually works! I've removed allifndef
statements in thejswrap_storage.c
file and also removed'DEFINES += -DUSE_DEBUGGER -DUSE_TAB_COMPLETE',
line in theNRF51822DK.py
file. Now I can read/write stuff via Storage lib.var storage = require("Storage"); print("Initial: " + storage.getFree()); storage.write("MyFile", "Some data"); print(storage.read("MyFile")); print("After storing some data: " + storage.getFree());
This prints:
>Initial: 3072 >Some data After storing some data: 3044
It seems to me 3072 bytes is more than enough for storing some basic backup data.
BTW, could you please let me know what are these
USE_DEBUGGER
andUSE_TAB_COMPLETE
? Anything important/useful? Cheers -
Thank you guys for your answers. I've got a bunch of those nrf51822 boards that I want to make use of to build some very basic sensors, e.g. water meter, pir, temperature, humidity etc. Effectively, scripts are going to be very basic and small in size, however I need to store a number, e.g. rotation count etc, this is just a small number to back up readings in case of any power outages.
This is an experimental project as a part of Eclipse SmartHome/OpenHab Bluetooth binding and Java Bluetooth Manager development.
I will definitely try to enable Flash module first, if this fails, I'll get some nrf52 boards.
Or maybe someone has a better idea on how to store a small number/variable?
-
Hello, I'm new to Espruino, however I really like it!
I've built nrf51288-DK Espruino image to play with an nrf51288 chip. It mainly works, e.g. Bluetooth stuff, reading digital analog pins etc. However I can't get it to store something in EEPROM. I'm following some example where you need to load a module, e.g. Storage, Flash etc but non of them actually loads...
I've got a simple code that does:
require("Storage"); console.log(Storage.debug());
This print the following:
Uncaught Error: Module Storage not found at line 29 col 18 require("Storage"); ^
Does it mean that nrf581 chip does not support Storage?
PS. I've tried to load "Flash" module with the same result.
Thanks @fanoush, I've pushed
3
to4
, looks like working.When I build a new FW, it prints this:
Does it mean that I still can allocate even more space for storage? E.g. tune that
3
number so storage starts with 247628 (is it address right?)? If so, looks like I can get roughly another 10k (258048 - 247628 = 10420)? Cheers