Announcement

Collapse
No announcement yet.

File Transfer over serial (Programming) cable Utility

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    With the app on the display, the user is able to save some parameters : that's what I call memory.

    The memories are text files, store on the SD card. The final goal is to be able to transfert those memories from one display to another.
    Because of the architecture of my system, the only way to do that, is in two steps :
    Step 1: Copy the files from the display to a computer
    Step 2: Copy the memories from the computer to a new display.

    At the moment, I am working on Step 1.
    I tried your code above, and got some promissing results. I managed to get the memories on the PC (in the root directory, which is not what I wanted, but not a big deal).
    I also managed to get it working with an external text file, that contains the list of all the files I want to get.

    Now, this is only working with the UI on. When adding the /Q, to run the UI on the background, it fails.
    Works :
    Code:
    start /w FileTransfer $"files.txt" /b115200 /cCOM%myCom% /R
    Fails:
    Code:
    start /w FileTransfer $"files.txt" /b115200 /cCOM%myCom% /R /Q


    One otherthing : if the user does has not saved a memory, I will try to get a file that does not exists on the SD card.
    When the UI is ON, I just get a warning message "file does not exists", that I need to click ok.
    Is there a way to get the list of all the files present on the SD, so that I only try to read the existing files ?

    Comment


    • #47
      Hi Vincent,

      Thank you for the additional information.

      I tried your code above, and got some promissing results. I managed to get the memories on the PC (in the root directory, which is not what I wanted, but not a big deal).
      Thank you for the message. I am glad you have managed to get the files from the display.

      I also managed to get it working with an external text file, that contains the list of all the files I want to get.
      Can you post here how did you manage to execute this?

      Now, this is only working with the UI on. When adding the /Q, to run the UI on the background, it fails.
      This has been updated on the new version of the "FileTransfer.exe". You can now read the files on quiet mode.
      However, it looks like that you are reading a list of files, so I am unsure if this works well on your application.

      ​​​​​​​When the UI is ON, I just get a warning message "file does not exists", that I need to click ok.
      When receiving a file on quiet mode, a warning message will now pop up.

      Is there a way to get the list of all the files present on the SD, so that I only try to read the existing files ?
      You could check if the file is present on the uSD card. You could also check the number of files existing on the uSD card.
      The return value will be displayed on the console. Can I ask if this is what you meant? Or if that works out for you?
      This feature is also added to the new version.

      I hope this helps.

      Best Regards,
      Kevin

      Comment


      • #48
        Hi Kevin,

        I am coming back a bit late. Been stuck on some other projects in the meantime.
        I re-downloaded the FTR program, just to make sure I was using the latest one : Ftr103, from the 1st post of this thread (not updated recently)

        As I said earlier, have a command line that works, but only in "normal" mode. As soon as I add the /Q to hide the UI, the program crashes. I actually get bug report which I could send if it can help.
        When running with the UI, I can see that the files are being transfered to my PC before that the SD contents get updated. This seem a bit odd to me. See the attached screenshot to understand what I mean.

        Anyway, as before, this works:
        Code:
        start /w FileTransfer $"files.txt" /b115200 /cCOM%myCom% /R
        and this fails:
        Code:
        start /w FileTransfer $"files.txt" /b115200 /cCOM%myCom% /R /Q
        The "file.txt" is just a text file with 3 lines at the moment. Each line containing the name of the file on the SD and on PC, separated by a space.
        Code:
        myFile1.txt myFile1.txt
        myFile2.txt myFile2.txt
        myFile3.txt myFile3.txt

        Originally posted by John Kevin View Post
        You could check if the file is present on the uSD card.
        [ ... ]
        Can I ask if this is what you meant?
        Yep, that's exactly what I need.
        Actually, I can go with two options here:
        - Either I am able to have a list of files present on the SD, and I will try to load the ones that exists
        - Or, I try to load on my PC a list of files, but in case some of them do not exists on SD, I don't get any error
        Attached Files

        Comment


        • #49
          Hi Vincent,

          Attached is the new version of File Transfer.
          Some features that I have mentioned above have been added to this version.

          Best Regards,
          Kevin
          Last edited by ESPsupport; 1 week ago. Reason: Attachment removed:Superceded

          Comment


          • #50
            Thanks Kevin for this new version.
            Reading in quiet mode works great now !

            I tried the /F option, but I am running into issue with the result. I am not sure if I am looking at the right return value.
            I am supposed to check the ERRORLEVEL, right ?

            Here is what I tried:
            Code:
            start /w FileTransfer $"findFiles.txt" /b115200 /cCOM85 /F /Q
            ECHO Returned value :
            ECHO %errorlevel%
            Here is the results:
            - With a single file name in findFiles.txt, I get 0 or 1, according to the presence of this file on the SD
            - With two file names (that exist on the SD) in findFiles.txt (separated by \r\n), I get :17970
            - With two file names (1 that exist, 1 that does not) in findFiles.txt (separated by \r\n), I get the same result :17970
            - With two file names (that exist on the SD) in findFiles.txt (separated by \r\n), I get : 29815
            - With two file names (2 that exist, 1 that does not) in findFiles.txt (separated by \r\n), I get the same result :29815

            Comment


            • #51
              /F is not designed to work with a file list, you can say *.* as the filename to get a count of all files on the card, or some other wildcard filename.

              Do you want/need to use a file list?
              Mark

              Comment


              • #52
                Actually, my final goal to is to know whether a file exists on the SD card or not.
                I can see two ways of doing this :

                #1 : Getting the list of all the file on the SD, with the details (size, time/date), just like what I get when I connect using the UI.
                Just like if was using command "dir" for the SD card.
                This option is more universal, I already know it can help me for another project.
                Click image for larger version

Name:	screenshot.png
Views:	28
Size:	85.6 KB
ID:	70799

                #2: Provide a list of file to the command, and get the the result for each file.

                For example : FileTransfer $"File1.txt File2.txt File3.txt" /b115200 /cCOM85 /F /Q
                Gives result : 101 (or simply File1.txt File3.txt) > File2.txt does not exists on the SD, but the File1 and File3 do.

                Attached Files

                Comment


                • #53
                  Option1 will have to be to written to a file. This is because Filetransfer is a GUI mode program and the gods that be have provided no way for a GUI mode program to write to a console (if you start it from a console it creates a separate process, 'detached' from the console). Similarly they did not allow for 'dual mode' programs (oddly enough the linker half supports this but windows 'simply' calls the GUI entry point if it's there, or the Console entry point if it isn't).

                  Option2, of course can only handle 32 files, but, none the less, is quite neat.

                  Give me a few days.
                  Mark

                  Comment


                  • #54
                    The attached has three new options /a, /l and /x. Hopefully you will be able to do everything you need with those.
                    Attached Files
                    Mark

                    Comment

                    Working...
                    X