Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Wipy 2.0 and save data on my pc, not in flash memory

    Scheduled Pinned Locked Moved WiPy 2&3
    wipy2.0i2cpycompythonsaving data
    100 Posts 2 Posters 25.6k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • robert-hhR Offline
      robert-hh @VFlorio94
      last edited by

      @vflorio94 Are there any other files in the subdirectories, like in lib?

      V 1 Reply Last reply Reply Quote 0
      • V Offline
        VFlorio94 @robert-hh
        last edited by

        @robert-hh No, there aren't any file in the subdirectory. But Yesterday it run program and saved them on memory.
        after I collected data I deleted immediately file.txt. But now I have this error.
        Probably do not filezilla really delete file?

        robert-hhR 1 Reply Last reply Reply Quote 0
        • robert-hhR Offline
          robert-hh @VFlorio94
          last edited by

          @vflorio94 At the REPL prompt, you can also get the file list and free space with:
          import uos
          uos.listdir()
          uos.getfree("/flash")

          V 1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @VFlorio94
            last edited by

            @vflorio94 Filezilla just sends commands to the ftp server of the FiPy.

            1 Reply Last reply Reply Quote 0
            • V Offline
              VFlorio94 @robert-hh
              last edited by robert-hh

              @robert-hh I use the command that you wrote and it gives me the message:

              import uos
              print(uos.listdir())
              print(uos.getfree("/flash"))
              
              
              
              >>>
              ['main.py', 'sending.py', 'sys', 'lib', 'cert', 'boot.py', 'datiprova_tempo20.txt', 'lib_imu.py', 'interval_position.py']
              0
              ╝╝>```
              

              but it's incredible, just Yesterday it run. and I don't know what can I do now?!

              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @VFlorio94
                last edited by

                @vflorio94 You can tell the size ofdatiprova_tempo20.txt with:
                import uos
                uos.stat('datiprova_tempo20.txt')

                Every time you call your script this file will get larger, since you open that in append mode "a". I am just wondering why this file is not shown in the FileZilla screen dump.

                V 1 Reply Last reply Reply Quote 0
                • V Offline
                  VFlorio94 @robert-hh
                  last edited by

                  @robert-hh said in Wipy 2.0 and save data on my pc, not in flash memory:

                  You can tell the size ofdatiprova_tempo20.txt with:
                  import uos
                  uos.stat('datiprova_tempo20.txt')
                  Every time you call your script this file will get larger, since you open that in append mode "a". I am just wondering why this file is not shown in the FileZilla screen dump.

                  now I delete also the function 'interval.py' and 'sending.py' but it continue to give me the same error.

                  robert-hhR 1 Reply Last reply Reply Quote 0
                  • robert-hhR Offline
                    robert-hh @VFlorio94
                    last edited by

                    @vflorio94 But how large is 'datiprova_tempo20.txt'? That is the file which grows by about 50kBytes on every execution of your script.

                    V 1 Reply Last reply Reply Quote 0
                    • V Offline
                      VFlorio94 @robert-hh
                      last edited by

                      @robert-hh

                      (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

                      robert-hhR 1 Reply Last reply Reply Quote 0
                      • robert-hhR Offline
                        robert-hh @VFlorio94
                        last edited by

                        @vflorio94 OK. So the file size is 0. Did you change anything else? like the file name (even if that seems strange)?

                        V 1 Reply Last reply Reply Quote 0
                        • V Offline
                          VFlorio94 @robert-hh
                          last edited by

                          @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

                          robert-hhR 1 Reply Last reply Reply Quote 0
                          • robert-hhR Offline
                            robert-hh @VFlorio94
                            last edited by

                            @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.

                            V 1 Reply Last reply Reply Quote 0
                            • V Offline
                              VFlorio94 @robert-hh
                              last edited by

                              @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

                              robert-hhR 1 Reply Last reply Reply Quote 0
                              • robert-hhR Offline
                                robert-hh @VFlorio94
                                last edited by

                                @vflorio94 you did that already with the pycom updater tool.

                                V 1 Reply Last reply Reply Quote 0
                                • V Offline
                                  VFlorio94 @robert-hh
                                  last edited by

                                  @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.

                                  robert-hhR 1 Reply Last reply Reply Quote 0
                                  • robert-hhR Offline
                                    robert-hh @VFlorio94
                                    last edited by robert-hh

                                    @vflorio94 if the memory is short, then it is a different error. Is the error thrown during execution or when youe import the code?

                                    V 1 Reply Last reply Reply Quote 0
                                    • V Offline
                                      VFlorio94 @robert-hh
                                      last edited by

                                      @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.

                                      robert-hhR 1 Reply Last reply Reply Quote 0
                                      • robert-hhR Offline
                                        robert-hh @VFlorio94
                                        last edited by

                                        @vflorio94 Actually I have no clue what's happening and what was done.

                                        V 1 Reply Last reply Reply Quote 0
                                        • V Offline
                                          VFlorio94 @robert-hh
                                          last edited by

                                          @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

                                          robert-hhR 1 Reply Last reply Reply Quote 0
                                          • robert-hhR Offline
                                            robert-hh @VFlorio94
                                            last edited by

                                            @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.

                                            V 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 4 / 5
                                            • First post
                                              Last post

                                            Pycom on Twitter

                                            Pycom