1. Should we use partition free, or is there a better place ?

    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) .

    http://esp-idf.readthedocs.io/en/latest/­api-reference/storage/nvs_flash.html?hig­hlight=nvs

    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:
    https://github.com/MaBecker/Espruino/blo­b/33fa7dcfbb30a2e253416c7e73a89a3fe922ef­e8/libs/network/esp8266/jswrap_esp8266_n­etwork.c#L870-L887

    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.

    1. 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?

    2. 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.

    3. 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.

About

Avatar for Wilberforce @Wilberforce started