Wipy 2.0 and save data on my pc, not in flash memory
-
@vflorio94 You have to put that in boot.py or main.py in flash, because that is executed in first place.
-
@robert-hh I try to update my main.py and my lib.py on sd card but I can't understand where i have to put the command that you wrote.
-
@vflorio94 A python script is a text file, just with the extension .py. You can start that from sd card with two methods:
a) change the active directory to the card before import
mount the card
os.chdir("/sd")
import file
b) change the system path.
If you
import sys
print(sys.path)
you get something like ['', '/flash', '/flash/lib'], which is the list of places where the python scripts are looked for. '' is the actual directory. You can add "/sd" to that path with:
sys.path.append("/sd")
you can also directly set sys.path to the list of places.
-
@robert-hh Hi, I need to ask you one more time. Do you know if there is a way to save on micro SD not only file.txt but also file.py?
thank you!!
-
@vflorio94 pymakr.conf is local file on your PC, configuring pymakr. Why should you not be able to modify it. You may have to restart Atom after that.
-
@robert-hh yes, i see it, but i don't know if I can modify it and if i have to upload also this pymakr.conf ?
-
@vflorio94 Looks like the seeting of "safe_boot_on_upload": false
-
@robert-hh can be something in project settings? but I didn't modify it
-
@vflorio94 I do not know what pymakr is doing. It can force a sfae boot via Ctrl-F, but that has to be configured somewhere in pymakr.
-
@robert-hh but the message in the second line what means? when I upload file is necessary a safe booting? and here it isn't in safe booting
-
@vflorio94 Actually I have no clue what's happening and what was done.
-
@robert-hh yes, probably something occours
Uploading project (main folder)... Not safe booting, disabled in settings Reading file status [1/2] Writing file lib_imu.py Failed to write file, trying again... Failed to write file, trying again... Filecheck failed [2/2] Writing file main.py Upload done, resetting board…
but I don't understand what.
-
@vflorio94 if the memory is short, then it is a different error. Is the error thrown during execution or when youe import the code?
-
@robert-hh I reflash wipy with the command:
import os os.mkfs('/flash')
after this I upload on the device a simple main and the library that i have to use, but when I run the simple code that has to write data on file it immediately give me the same error, but now the memory used is short.
-
@vflorio94 you did that already with the pycom updater tool.
-
@robert-hh said in Wipy 2.0 and save data on my pc, not in flash memory:
So where are these files? if the local file system of your wipy is corrupted, you can always reflash the device with the option to clear the file system, at which point it will be recreated.
I deleted those files Yesterday. I think that it's bettere if I'll try to reflash the device.
Which is the command that i have to use?
thank you
-
@vflorio94 So where are these files? if the local file system of your wipy is corrupted, you can always reflash the device with the option to clear the file system, at which point it will be recreated.
-
@robert-hh said in Wipy 2.0 and save data on my pc, not in flash memory:
OK. So the file size is 0. Did you change anything else? like the file name (even if that seems strange)?
Yes, I change the name of my file.txt each time that I collect data, but Yesterday I run this script about 20 times , also the day before, And it worked
-
@vflorio94 OK. So the file size is 0. Did you change anything else? like the file name (even if that seems strange)?
-
(32768, 0, 0, 0, 0, 0, 0, 315535722, 315535722, 315535722) ╝Traceback (most recent call last): File "<stdin>", line 27, in <module> OSError: 28 ╝> MicroPython v1.8.6-849-56d00234 on 2018-05-18; WiPy with ESP32 Type "help()" for more information.
But Yesterday i did a test of 1200 s and it worked. now i delete everything from flash except the necessary function