-
-
-
I tried the software SPI again and removed the "NodeMCU." before the pin. Like this:
var s = new SPI(); s.setup({mosi:D7, miso:D6, sck:D5}); E.connectSDCard(s, D2); console.log(require("fs").readdirSync());
And then i get this output. Maybe this says something to anyone?
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v86.113 Copyright 2016 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 1MB:512/512, manuf 0xe0 chip 0x4014 >echo(0); ERROR: Cannot change pins used for flash chip ERROR: Cannot change pins used for flash chip ERROR: Unable to mount SD card : NOT_READY undefined =undefined
Also with the Hardware SPI example, SPI1 is used. int the documentation it says that there should be options for SPI1,SPI2 and SPI3.
Can it be that i should use the SPI2, because of the flash memory beeing attached to SPI1?
Is SPI2 dissabled in the firmware from the earlier post, or is it a matter of the ESP8266 not beeing able to find the SPI2? -
I tried both. But in the first place i always try to copy-paste-enter it line by line in the left terminal frame.
Connected >> =undefined >var s = new SPI(); ={ } >s.setup({mosi:NodeMCU.D7,miso:NodeMCU.D6,sck:NodeMCU.D5}); =undefined >E.connectSDCard(s,NodeMCU.D2); =undefined >console.log(require("fs").readdirSync()); ERROR: Unable to mount SD card : NOT_READY undefined =undefined >
-
Ah, that worked great!
Seems i got my pin assignments correct.
>NodeMCU.D6.getInfo(); ={ "port": "D", "num": 12, "functions": { } } >NodeMCU.D5.getInfo(); ={ "port": "D", "num": 14, "functions": { } } >NodeMCU.D7.getInfo(); ={ "port": "D", "num": 13, "functions": { } } >NodeMCU.D2.getInfo(); ={ "port": "D", "num": 4, "functions": { } } >
-
-
I allready tried that first. And i tried again to be shure just now.
in the first section i did only your code from the last post, and the second i added one line to call for the FS library. Both didn't work... :(| __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v86.113 Copyright 2016 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 1MB:512/512, manuf 0xe0 chip 0x4014 >echo(0); =undefined >reset(); =undefined _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v86.113 Copyright 2016 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 1MB:512/512, manuf 0xe0 chip 0x4014 >echo(0); ERROR: Unable to mount SD card : NOT_READY undefined =undefined >
-
using this:
function onInit() { var s = new SPI(); E.connectSDCard(s, NodeMCU.D4); s.setup({mosi:NodeMCU.D13, miso:NodeMCU.D12, sck:NodeMCU.D14}); // see what's on the device console.log(require("fs").readdirSync()); } onInit();
i still get the same output:
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v86.113 Copyright 2016 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 1MB:512/512, manuf 0xe0 chip 0x4014 >echo(0); ERROR: Unable to mount SD card : NOT_READY undefined =undefined >
-
I tried changing the pin designation, but i get no change at all.
When i change the CS pin to pin 5 i get no "sd card" error except 'connection lost' in the terminal window.
i tried every possible pin combination. with and without the Nodemcu.D..
my wiring is correct because i have used the sd card in the arduino IDE and that works just fine.
-
this is my code:
function onPageRequest(req, res) { var a = url.parse(req.url, true); if (a.pathname.substr(-1)=="/") { // a slash at the end, list the directory res.writeHead(200, {'Content-Type': 'text/html'}); res.write("<html><body><p>Contents of "+a.pathname+"</p><ul>"); res.write('<li><a href="'+a.pathname+f+'">'+f+'</a></li>'); res.end("</ul></body></html>"); } else { // No slash, try and open file f = E.openFile(a.pathname, "r"); if (f !== undefined) { // File open succeeded - send it! res.writeHead(200, {'Content-Type': 'text/plain'}); f.pipe(res); // streams the file to the HTTP response } else { // couldn't open file // first check if this was a directory if (("E").readdir()!==undefined) { // it was a directory - forward us to a page with the '/' on the end res.writeHead(301, {'Location': a.pathname+"/", 'Content-Type': 'text/plain'}); res.end("Moved"); } else { // else not found - send a 404 message res.writeHead(404, {'Content-Type': 'text/plain'}); res.end("404: Page "+a.pathname+" not found"); } } } } var wlan; var f; function onInit() { // Wire up up MOSI, MISO, SCK and CS pins (along with 3.3v and GND) SPI1.setup({mosi:D12, miso:D13, sck:D14}); E.connectSDCard(SPI1, D4); // see what's on the device console.log(require("fs").readdirSync()); var wifi = require("Wifi"); wifi.connect("My_SSID", {password: "My_password"}); require("http").createServer(onPageRequest).listen(80); } onInit();
but the output i am getting from the terminal window:
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v86.113 Copyright 2016 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 1MB:512/512, manuf 0xe0 chip 0x4014 >echo(0); ERROR: Unable to mount SD card : NOT_READY undefined =undefined >
-
-
-
Next problem.... with my initial upload i followed a tutorial on the espruino main site.
There it said to flash using this line;
$ /path/to/esptool/esptool.py --port /dev/ttyUSB0 --baud 115200 \ write_flash --flash_freq 40m --flash_mode qio --flash_size 8m \ 0x0000 "boot_v1.85.bin" 0x1000 espruino_esp8266_user1.bin \ 0x7C000 esp_init_data_default.bin 0x7E000 blank.bin
however there is no user2.bin in this line. So how do i figure out what location i must flash it to?
-
-
-
-
-
I am desperately looking for help!
I just started using Espruino on the ESP8266 modules. Everything went as smooth as butter, but i keep getting error messages like "module "fs" not found.
After searching on the internet i found a post that said, that there is a possibility that these libraries are not available in the esp8266-espruino binaries and that you have to build/compile them yourself with the needed libraries.
That post was 1 year old and i wondered if this is still the case, and if someone has binaries that allready contain SD/uSD support.
Thanks in advance!
Indeed! it was formatted as FAT16 before and later formatted as FAT32.