• For the sake of making the firmware simpler/smaller I wonder if the wifi.save() could simple store wifi config script instead of the the JSON it does now?

    This could still be constructing and saving a string and perhaps it would be more bytes written to the .wificfg in the end but I think the benefit of not having to translate the JSON to other setup could make it simpler (the following two functions would not need to exist):

    libs/network/esp32/jswrap_esp32_network.­c:1359:void jswrap_wifi_restore(void) {
    libs/network/esp8266/jswrap_esp8266_netw­ork.c:902:void jswrap_wifi_restore(void) {
    

    I mean like making wifi.save() save something like this to .wificfg:

    (function(w) {
        w.stopAP()
        w.setHostname(...)
        w.connect(..)
    })(require('Wifi'))
    

    Or perhaps we don't need any wifi.save at all with the .bootX automatic loading?

  • You mean, move it from firmware to javascript?

    Well, sure it's possible, but to be honest there are more heavy part we should discuss to remove to have more free heap and figure out why the firmware has less heap with each esp-idf update.

    My first test results with esp-idf 4.1 based on JumJum's work to make it happen is

    sdkVersion: "v4.2-dev-521-g6fd855ab8",
    freeHeap: 9924, BLE: true, Wifi: true, minHeap: 8280 }
    

    and it is missing TLS at the moment.

    Have you used EFEU? It is an online firmware build tool maintained by JumJum which allows to build a firmware with stuff you need for your project.

  • You mean, move it from firmware to javascript?

    Well, sure it's possible ...

    With the aim to completely unify board Wifi support I think it would be worth doing as well as perhaps also making it compatible with the http://www.espruino.com/Reference#t_Ethe­rnet interface e.g. the getIP() to be usable with a callback. @Gordon what do you think?

    I agree on the memory issues to be fairly pressing but I'd move the related discussion to another forum topic.

  • With the aim to completely unify board Wifi support I think it would be worth doing as well as perhaps also making it compatible with the http://www.espruino.com/Reference#t_Ethe­rnet interface e.g. the getIP() to be usable with a callback.

    Yes, I completely argree!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Simplify wifi.save() to be able to drop jswrap_wifi_restore

Posted by Avatar for opichals @opichals

Actions