Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The 'copy module to SD' and 'copy binary/bmp' functionality isn't working in the Project dialog #125

Open
dmcnaugh opened this issue Jan 9, 2016 · 3 comments

Comments

@dmcnaugh
Copy link

dmcnaugh commented Jan 9, 2016

Under the Projects -> Modules tab, if the save/copy module to SD icon is clicked then a file of zero length (0 bytes) is written to the SD card on the espruino under /node_modules/ with the correct name e.g. myModule.js.

By suppressing the echo(0) I see the following code sent to the espruino:

echo(0);
;var fs = require("fs");fs.unlink("node_modules/esp-uri.js");fs.writeFile("node_modules/esp-uri.js",""); 
fs.appendFile("node_modules/esp-uri.js",""); 
echo(1); 

As you can see the file content being written is an empty string, but this file definitely has content.

The problem is different with the Projects -> Binaries tab. A file is written to the SD card on the espruino under /node_binaries/ with the correct name e.g. coin.bmp but the file is incomplete and the espruinio has frozen and cant be woken-up with <ctrl-c> on the terminal and must be power-cycled.

Also a further problem here is that I would expect BMP images to be written to /images/, not /node_binaries/

@gfwilliams
Copy link
Member

Probably [Ctrl-C] + echo(1) + [enter] will bring it back to life - I guess if you turn on throttling that will help - this is with the original Espruino?

The 'write to SD card' code was an addition by @jumjum123 - maybe he's got some ideas about the empty files?

From the look of it, just adding a newline after each command would help. As it is, all that code gets shoved in the input buffer and then executed all at once.

@dmcnaugh
Copy link
Author

This is on a Pico. I will try your suggestions and see if I get anywhere.
It's a low priority for me to resolve, but I thought I'd let you know that I'd found a problem.

@gfwilliams
Copy link
Member

Ahh, ok. So you've had to disable reset() first, so that you can keep the SD card set up correctly? It makes it more surprising that you have issues, as the Pico's USB is pretty stable now.

Thanks - yes, it's good to have these things reported somewhere.

I'm afraid these kind of things end up being quite low priority for me - I'm stretched thin enough handling Espruino, Web IDE, CLI, tutorials, forum, etc - trying to debug and fix some of the extra functionality that got added to the Web IDE just ends up being too much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants