/cwa-recover

Open Movement .CWA file recovery program (split into its own repository)

Primary LanguagePythonBSD 2-Clause "Simplified" LicenseBSD-2-Clause

Open Movement CWA Data Recovery

This repository is split from the main Open Movement repository.

If you have a AX device where the filesystem has been corrupted, or a file that might have been corrupted, it may be possible to salvage the data.

IMPORTANT: At no point should you accept any offer by Windows of fixing the drive, as this can make things worse!

Step 1: Attempt a manual copy

If the data is still on the device, you should first try to manually copy the file off the drive (otherwise, you can skip this step).

  1. Open Windows File Manager
  2. Click on This PC
  3. Connect the device and wait 10 seconds
  4. Identify the drive letter for the device and double-click it
  5. Locate the file CWA-DATA.CWA and drag-and-drop the file to another location to copy it.

If the copy completes, you have successfully downloaded the data file, and should not need any of the following steps.

If the copy does not complete successfully, or you suspect the file is incomplete, then try the steps below to run the recovery script.

Step 2: Getting started with the recovery scripts

  1. Check whether you have Python installed. e.g., on Windows: Windows+R: cmd /k python -- if you get an error message, you may not have Python installed. You can install Python from: python.org/downloads

  2. If you are on Windows or Mac and want to be able to create a disk image from the device itself, save this page: cwa-dump.py as a file on your computer named cwa-dump.py.

  3. Save this page: cwa-recover.py as a file on your computer named cwa-recover.py, in the same directory as the previous file.

  4. Open a terminal / command-line in the same folder as your downloaded files. For example:

    • Windows: Press Windows+R, type: cmd /k "cd Downloads" and press Enter.
    • macOS: Open Terminal, type: cd ~/Downloads and press Enter.

Step 3: Create a disk image from the device

If the data is still on the device: follow these steps to create an image file from the device -- this should be done even if you have previously copied off the file, as that data could be incomplete. If the data was cleared from the device, you can skip this step.

  • Windows/Mac: You can use the cwa-dump.py script (downloaded above) to read the drive to create a disk image.

    1. Make sure you have a single AX device attached.

    2. Run the cwa-dump script: python cwa-dump.py

    3. Wait for the script to complete -- this could take a long time

    The script will create a disk image file cwa-dump.img from the single attached AX device.

  • Windows (alternative): You could use imageUSB tool to Create image from USB drive.

  • macOS (alternative): Ensure the AX device is attached. Open the Terminal. List the connected drives with: diskutil list. Use the appropriate device name instead of the $DISK placeholder while running the following commands. Unmount the drive: diskutil unmountDisk /dev/$DISK -- now create the drive image (this will take a long time with no progress shown): sudo dd if=/dev/$DISK of=cwa-dump.img bs=512

  • Other OS: You can use the dd command to create a disk image.

Step 4: Recover a .cwa file

  1. Run the cwa-recover script, either for the disk image (cwa-dump.img):

    python cwa-recover.py

    ...or, for a possibly-corrupted .cwa file, type the line above, plus a space, then the full path name and surround with double quotes into the command prompt (on Windows, you can drag-and-drop your .cwa file into the command prompt window to write the full name). The full command should be something like this (where CWA-DATA.CWA is your filename):

    python cwa-recover.py "CWA-DATA.CWA"
  2. The script will attempt reconstruction and write a file: cwa-recover.cwa

  3. Inspect the cwa-recover.cwa file (e.g. setting the Working Directory in OmGui software) to gauge how successful the process was.

If you have both a disk image and a downloaded file, you can repeat this process for both files and compare the outputs, but you must rename the cwa-recover.cwa file between each attempt, so that it is not overwritten.

Step 5: Configure and test the device for reuse

These steps for when the original device, that was a source of the corrupt data, has not yet been cleared and tested.

Once the data is recovered, you can clear the data from the device so that it can be used to make a new recording:

To verify the performance of the device, it is strongly recommended that you make a test recording (e.g. a static device) using the same parameters as you would like to use in the future (i.e. initial charge level, sensor configuration, time delay, recording duration). This test recording should be indicative of future device performance.