-
• #2
Using
require("Storage").erase("test");
sounds absolutely fine. When you say 'doesn't work' what do you mean? It just doesn't appear to get rid of the file, or it gives you an error?Are you using firmware 2v05?
-
• #3
doesn't get rid of the file
just to be sure - wher do I see the version?
-
• #4
wher do I see the version?
If you just type
reset()
on the left hand side of the IDE you should see it under the logo - orprocess.env
will tell you too. -
• #5
VERSION: "2v04", GIT_COMMIT: "3956264e", BOARD: "MDBT42Q",
FLASH: 524288, RAM: 65536, SERIAL: "3700071-fa641234", CONSOLE:
"Serial1", MODULES: "Flash,Storage,hea" ... "S,crypto,neopixel",
EXPTR: 536882364 }var res=process.memory(); console.log("Memory free - " + res.free); if(res.free<2000) { LED1.write(true); console.log(ScanResault); require("Storage").write("Test",JSON.stringify(ScanResault)); console.log("write"); GetData = JSON.parse(require("Storage").read("Test")); console.log("JSON.parse"); ScanResault.length=0; console.log("Clear Array finsih"); console.log(ScanResault.length); }
when I run the code
I get error thatUncaught Error: Unable to find or create file at line 35 col 63 ...JSON.stringify(ScanResault)); ^ in function called from system >
but when I run list I can see the file
console.log(require("Storage").list()); [ "Test", ".varimg" ] =undefined
maybe this is my problem?
and how could it be ?
-
• #6
As a first step, please could you try installing up to date firmware? Looks like you're on 2v04 and there is 2v05 which has a fix for some storage related issues
-
• #7
I need to be neat the device fot this - I see
I will do it latter and let you know
thank you Gordon ! -
• #8
sorry, the firmware update has failed.
The error was: TypeError: Failed to execute 'requestDevice' on
'Bluetooth': required member filters is undefined.Please try again, or check out the Troubleshooting page for what to do
next.I download the zip file - espruino_2v05_mdbt42q.zip
in the IDE selected
FLASHER
Advanced Firmware Update
selected the file
did what the message said
now the device red led is on
but I still get the error
what is wrong? -
• #9
Are you on Mac OS? Please could you try uploading firmware using the instructions at http://www.espruino.com/MDBT42Q#firmware-updates (so using the nRF Connect app on Android/iOS instead)
-
• #10
Using WIndows7
don't have MAC or android device here -
• #11
Windows 7 doesn't even support Web Bluetooth I'm afraid, so the firmware updater built into the IDE won't work.
Do you have an iOS device available? Or do you have no smartphone/tablet that can be used at all?
-
• #12
yes I do
tablet with android 7 - will this works?I have also have a computer with win10 - better?
-
• #13
tablet with android 7 - will this works?
Yes, that'd be perfect. Just use that to do firmware updates.
I have also have a computer with win10 - better?
That would be better for doing development, as you could use the online IDE at https://www.espruino.com/ide/
However for firmware updates the Android devices are actually faster
-
• #14
OK
update the firmware to 2.05
now how to continue?Thanks,
-
• #15
Try
require("Storage").eraseAll()
to clear Storage to a fresh state - then see if you still have the problem?
Hello ,
as I understadn I can use about 40kb~ of memory in the MDBT42
I have code that save into RAM and then move it to the flash
I can see the RAM is clear without a problem
then I send this information to another devcie and after a while I want to clear the flahs
but I'm unable to do this
this is the command I'm using :
but it doesn't work
why?