-
So I was starting to have some problems uploading code. Code looked like it went over; but it wasn't changing. I ran the following code:
>s = require("Storage") =function () { [native code] } >s.eraseAll() =undefined
And then re-loaded my code over usb and no more memory errors. I am wondering if it is not cleaning itself out properly between loads with the newest version of the IDE (pulled from Git today)
-
That definitely helped with ram usage:
>process.memory() ={ "free": 833, "usage": 767, "total": 1600, "history": 7, "gc": 571, "gctime": 2.573 }
I was able to load the unminimized code (it previously failed to load where different levels of minimization would load; so i've been using it to test. I still get a message:
____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 1v96.5 (c) 2018 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016 > =undefined Loading 14495 bytes from flash... Execution Interrupted during event processing. New interpreter error: LOW_MEMORY,MEMORY
But the code is loaded and stored.
-
-
I'll try that.
Here is the response from my device on load:
____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 1v96.5 (c) 2018 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016 > =undefined Loading 14495 bytes from flash... Execution Interrupted during event processing. New interpreter error: LOW_MEMORY,MEMORY
On Boot:
>process.memory() ={ "free": 603, "usage": 997, "total": 1600, "history": 1, "gc": 485, "gctime": 2.459 }
On connect to wifi:
>process.memory() ={ "free": 624, "usage": 976, "total": 1600, "history": 4, "gc": 73, "gctime": 2.527 } >process.memory()
On start of ball bounce demo:
={ "free": 611, "usage": 989, "total": 1600, "history": 4, "gc": 146, "gctime": 2.581 } >
-
I'm using this ESP8266_4MB board with battery and oled screen . I am able to install my codebase with basic minification on, but get Low memory messages. I guess I will have to optimise a bit.
I plan to give these out at my schools summer STEM camp. Bought in bulk we can get it to around $10 a student with a battery and 3d print the case. I am writing a comprehensive demo to show them what they can do. It also makes sure I understand the platform; so I can answer questions. I just picked up JavaScript recently (Fitbit Ionic Development), so I am still getting comfortable with the language. I'll attach my demo so far.
-
-
I saw that...I was hoping for an example of saving an entire javascript program into storage and then loading it and executing it. Would I create a helper program to save the .js file as a really long string then onInit() read it back out and then somehow execute the string as Javascript?
Edit: I think I'm on the same page as you now....I will try playing with that tonight.
-
-
-
-
-
-
-
-
I have the LED and Screen Working; but the buttons are unreliable. I get a '1' when pressed the first time; but not after that...am I doing something wrong. I tried both
digitalRead(NodeMCU.D5)
and
NodeMCU.D5.read()
Same foro D6 and D7.
I am trying to use these for Students to use at STEM Camp this summer.
That makes a lot of sense! I pulled from github and wanted to make sure I had the most recent version of the IDE and couldn't remember which save on send I had. Thanks for the great support. I can't wait to have the kids at STEM camp playing with these!