That 'free' paritition is actually in use! Or it's labelled as such as it's in the flash available list...
And 1 page for a single var is a littlw wasteful!
The wifi config is actually stored in esp-idf nvs (non-volatile-storage ) area. There is a partition set up for this (12K) .
So it would be easy to use this library to store blu config details.
However, as @Gordon has said above - the Storage module might be better.
@MaBe has ported the ESP8266 to store the wifi details in the Storage module:
So this might be the better way to go. I was considering porting the ESP32 wifi config to use this, as it we can extend the fuctionality to store multiple AP details etc.
Gordon >Use a 'file' in require("Storage") - so use jsfFindFile. jsfReadFile would be perfect but
you can't use it because you won't have any JsVars available :)
One way of dealing with this would be that if this setting is changed, the board saves the setting. Then a reboot - is forced - so the system then starts with the new setting?
The number of jsvars could be varied at this point.
Do we need a message during startup, that BLE is disabled ? and 3. Is there a way to make NRF, Bluetooth and others inactive, so they cannot be called by accident ?
Gordon > Not easily. You could add a if (!jsBleActive()) return 0 to every function, and then do:
How about undefining the BLE var ?
Then any use would fail... the exception could have a help message?
Is there an option to use of HWReset ?
You mean like a reboot - like I mentioned above?
I don't think it is unreasonable to reboot on a config change if you free up a heap of memory in the process.
what should be default setting, with or without BLE ?
Probably on - We have wifi and AP on at the moment and you have to turn off AP, so BLE on by default make sense.
© Espruino, powered by microcosm.
Report a problem