Export data from SD card

Hi,

I use the SD card to store historical logging value, all works well. I want to export data without using FTP server, I wan just insert SD card in my laptop and copy data, now I can’t because SD cart filesystem is EXT3 so Windows can’t read it!

My question: how can I export data from SD card with my laptop (windows 10)?

@SamFai

There are many 3rd party software tools to read an EXT3 formatted drive on Windows. One that I personally use can be found below. Please note, this is not an HMS Networks product.


https://www.diskinternals.com/linux-reader/

Thank’s Jordan this software works well.

know I have other question, do you have a script to move file from usr directoty (Flexy) to SD card when DI1=ON (DI1 = 1; when I press button)?

See the context:
in this application, the client should come with the SD card every week, insert the SD card into the Flexy and press a button to copy the report to the SD card, then take the card to the office and insert it on his computer to export the data.

@SamFai

You can use the one below, though it is just a wireframe and you will definitely need to tailor it for your needs. Basically I have a tag called di that when triggered will go to a subroutine called: WriteLog


Init Section:

ONCHANGE "di", "GOTO WriteLog" REM IF di changes go to WriteLog

WriteLog Section:
IF di@ = 1 THEN
    SETSYS INF, "LOAD"
    SDCardSize$ = GETSYS INF, "SDExtFree"
    SDCardSize_Int% = Val  SDCardSize$
    IF SDCardSize_Int% > 5000 THEN   // 5 MB remains
       EBD_STRING$ = "$dtHL$ftT$st_h4$et_s0"
       FILENAME$ = "/usr/sdext/DataReport" + TIME$ + ".txt"
       WRITEEBD  EBD_STRING$, FILENAME$
      ActionID% = GETSYS Prg, "ACTIONID"
    ELSE 
      LOGEVENT "EUM Card full or not present", -1
    ENDIF
ENDIF

Basically what the above script does is when the di tag changes to a 1 it sends the last 4 hours of historical data to the SD card.

is not exactly what I need,
in fact, my report file already exists in Flexy memory (usr directory). I want just to copy this file to the SD card, is there a function in the Basic 'Basic IDE that does the file copy?

@SamFai

You can use the exact same steps however replace the EBD_STRING$ with the following:

yourFilename$ = ""
EBD_STRING$ = "$dtUF$uf" + yourFilename$
FILENAME$ = "/usr/sdext/DataReport" + TIME$ + ".txt"
WRITEEBD  EBD_STRING$, FILENAME$


This will export the file named in yourFilename to the SD card.

I am very close to the solution, something is missing

my file is here:
image

The script created the file in the SD card, but size = 0

image

see my script: (do you see somthing wrong?)

INIT:
ONCHANGE "DI2", "GOTO WriteLog" REM IF di changes go to WriteLog
NOTE: REM denotes a comment. It does not control anything programmatic and is merely there for informational purposes. 
fileName$ = "TESTFILE.CSV"
//PRINT fileName
i% = 1 REM - This INTEGER value controls the interval of our logging. 
TSET 1,1 //i% REM - Begin a 1 second interval timer. 
ONTIMER 1, "GOTO WriteRecord"
END

WriteLog:
IF DI2@ = 1 THEN
    SETSYS INF, "LOAD"
    SDCardSize$ = GETSYS INF, "SDExtFree"
    SDCardSize_Int% = Val  SDCardSize$
    IF SDCardSize_Int% > 5000 THEN   // 5 MB remains
       yourFilename$ = "TESTFILE.csv"
       EBD_STRING$ = "$dtUF$uf" + yourFilename$
       TESTFILESD$ = "/usr/sdext/TESTFILESD.csv"
       WRITEEBD  EBD_STRING$, TESTFILESD$
      ActionID% = GETSYS Prg, "ACTIONID"
    ELSE 
      LOGEVENT "EUM Card full or not present", -1
    ENDIF
ENDIF

@SamFai

You have a typo in your filename.

Your file is named: TESTFILE.CSV however you are using: TESTFILE.csv in your script. The entire filename is case sensitive. The .CSV is capitalized, not lowercase.