-
• #2
What's the module you're requiring? Espruino's IDE won't pull in modules from NPM, it will only pull in the modules on the Espruino site. http://www.espruino.com/Modules
Also, you may be trying to use the module on the left-hand side of the IDE without having uploaded code in the right hand side that uses it? http://www.espruino.com/Troubleshooting#i-get-uncaught-error-module-xyz-not-found-
-
• #3
Solved, I type the script on left-hand side of the IDE before.
Thanks.How can I save the modules (.js file) on board storage, and require it from board storage directly without internet access ?
-
• #4
You can add a SD card w/ adapter and store the module there. The SD card has to be mounted when the code has to run. In order to prevent the loading on upload of your program you pass the module name in a string variable. When doing so, the uploader does not find the pattern with regular expression:
var mn, m; // ...some code, including the mounting of the SD card mn="moduleName"; m=require(mn); // ...some more code
If you want to do that, you can inline the module or stick into the module cache in the code you upload. See Module Development and Module creation at runtime.
And I'm sure there are more options...
-
• #5
I connect SD Card to ESP8266 via SPI, and try to init SD Card by:
var spi = new SPI(); spi.setup({mosi:D13, miso:D12, sck:D14}); E.connectSDCard(spi, D15);
but appear "Uncaught Error: Function "connectSDCard" not found!"
Is't the "connectSDCard" function only available on some Original Espruino board build ?Thanks.
-
• #6
...could be... since ESP8266 is not only application CPU cycle constraint but also memory wise.
In addition to resource constraints, ESP8266 does not have USART, SPI, I2C,... implemented the hardware / appliances way as the STM32 based Espruino boards have, and software-only - bit banging - USART, SPI, I2C,... put an extra stress on the already tight resources. This manifests also in the way of lower / limited baud rate and lesser accuracy in timing.
What is the particular reason that you cannot use the IDE's way of uploading modules on upload?
I use ESPRUINO WEB IDE native Windows 64bit application, but appear "Uncaught Error: Module XXX not found" always when I
except built-in Modules, e.g: DS18B20, DHT11 ... ... , the internet connection is fine, and I already try to Enable Offline mode and
download the Offline data, but not work always, what's the problem ?