Wifi vs EspruinoWifi module

Posted on
  • Hi,

    I haven't been using Espruino for a few months but just purchased a couple more EspruinoWifi units.

    Documentation shows 'require("Wifi");' as the correct module import and I am sure this worked even a few days ago. That module is no longer available and the IDE shows 'Module Wifi not found".

    The code runs if I substitute require("EspruinoWifi"); but I am checking that this is correct as I remember there being subtle differences in the 2 libraries in the past.

    Thanks very much

  • It is the correct module you are using... you can check that by looking at the config values - ports / pins used to control ESP8266-ESP12 in the EspruinoWifi.js module and the schematics of Espruino-Wifi.

  • Thank you, the documentation implied that things have move the other way !

    More questions to follow I am afraid, so thanks to anyone who can help

  • Is your WiFi board's firmware up to date? I'm afraid they don't ship with the latest firmware.

    What happened was Espruino WiFi boards used to use require("EspruinoWiFi") but then to try and bring everything inline with other boards that run Espruino with WiFi, I changed it to require("WiFi"). It's still the same module and either module name should work on new firmwares.

    If you don't have new firmware it's well worth updating. On the WiFi especially there were some big speed/reliability changes (including a 'turbo' mode :) )

  • ...one is built-in - WiFi - where as the other is from the modules folder - EspruinoWiFi.

    In my original answer I had a draft about the initiative from a while ago to get all Espruino w/ WiFi boards do WiFi the same way, but could not find in time confirmingly that this already happened. Good to know that it is now in this state.

    I guess it would be a good thing to know which modules are built in... I'm aware of the section called *** Built-in Functionality *** Espruino also contains many built-in modules and classes that provide a lot of functionality on https://www.espruino.com/Modules page, but an explicit list could clear things up. I also know that it can depend on the build whether a module is built-in or not.

    The subject blows again the same horn about documentation... I'm thinking about how best it it could be done, in kind of a cross reference... Existing 'external' modules are easy to find - https://espruino.com/modules/ ... But how about the internal ones?

  • You can check pretty easily by just connecting to your Espruino board, then clicking the Settings icon in the Web IDE, going to Board Information and looking at MODULES (the same info is available via process.env too).

    I guess it might make sense to add something to the reference (as that changes each release) and to then link to that from the Modules page. It's still quite a lot of work to do though, and I'd rather not have a manual list as it'll be out of date a few weeks after it goes online :)

  • I just updated the Modules page a bit as well with info about built-in modules

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

Wifi vs EspruinoWifi module

Posted by Avatar for SteveHayles @SteveHayles