File format problem of record.cpp

Discussion in 'Module Connector (MC)' started by EREN VARDARLI, Jan 28, 2018.


    EREN VARDARLI New Member

    When I compile and run the record.cpp file located in \ModuleConnector-win32_win64-1.4.3\examples folder, I get
    such files as output:


    I cannot open these file extensions and neither can playback_recording.cpp or read_recording.cpp

    Is there a way to get .dat or .csv file formats ?

    Thanks for your answer,
  2. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Eren,
    I did tests on this program, every time when I stop this program with CTRL+C, it will create .dat and .csv file. The files you got are just temporary files, so I wonder how you get those file, did you stop this program with CTRL+C?

    EREN VARDARLI New Member

    Hi Charlie,
    Yes I terminate with ctrl+c. I am using g++ compiler through a mingw64 shell on a windows 8. Could it be a platform issue ??
  4. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi EREN,

    It seems this is an issue with Ctrl+C handling in the terminal. It doesn't run the signal handler, thus killing the process before it has time to shut down properly.
    This is not our bug, but rather the particular environment doesn't behave nicely. (If this is the same issue, it seems it will be fixed soon: ).

    Here is the suggestion from our software engineer:
    A quick workaround for the problem is to switch the exit mechanism. Instead of
    while (!stop_recording) {



    which waits for the signal handler to tell it to stop, write:

    printf("Press enter to stop recording.\n");

    Last edited: Feb 5, 2018

    EREN VARDARLI New Member

    Hi Charlie ,

    Thanks for your support. I am switching to raspberry pi 3 as my platform . After I install the and try running the I came across a syntax error as shown below. Has anybody came across this type of error? Thanks...

    pi@raspberrypi:~/Downloads/python34-arm-linux-gnueabihf/pymoduleconnector/examples $ python
    Traceback (most recent call last):
    File "", line 9, in <module>
    from pymoduleconnector import ModuleConnector
    File "/usr/local/lib/python2.7/dist-packages/pymoduleconnector-1.4.3-py2.7.egg/pymoduleconnector/", line 2, in <module>
    from .moduleconnector import DataReader
    File "/usr/local/lib/python2.7/dist-packages/pymoduleconnector-1.4.3-py2.7.egg/pymoduleconnector/", line 5, in <module>
    from .moduleconnectorwrapper import \
    File "/usr/local/lib/python2.7/dist-packages/pymoduleconnector-1.4.3-py2.7.egg/pymoduleconnector/moduleconnectorwrapper/", line 107
    def value(self) -> "PyObject *":
    SyntaxError: invalid syntax
  6. Charlie Shao

    Charlie Shao Moderator Staff Member

    This seems caused by mismatched python version.
  7. Jameson

    Jameson New Member

    Hi Charlie,

    I am facing the same issue running the C++ code on a Raspberry pi. Running XEP_recorder, I am getting an output folder with xethru_recording_* and 4 files in there (so far so good...)
    I have tried to terminate the program as normal using Ctrl+c, and I have also modified the program to end upon hitting the enter button, and I am getting the data file renamed from a .writing to a .dat file, however the meta file is left as a .writing file, so that renders the data unreadable from what I understand. I have tried to edit the code per the suggestion above, and I have tried to use different signals (SIGTERM etc...) to call handle_sigint(), and I have also tried to manually set the stop_recording bit to 1 after an "Enter" press, but I haven't had any success in renaming the meta file from .writing file to a .dat.

    There was a possible solution mentioned previously (, however this doesn't seem to apply to the Pi.

    Could it be possible to manually call the functions necessary to close the meta file out and rename it to .dat in a way that won't corrupt the file?

  8. Harvord Sun

    Harvord Sun New Member

    Hello,would you like to tell me how to output .csv file?
  9. Charlie Shao

    Charlie Shao Moderator Staff Member

    This can be opened by MS Excel or any text editor. If you have the recording folder. You are able to palyback the recording data.
  10. Harvord Sun

    Harvord Sun New Member

    Thanks for your replying! I have tried to use the Excel to open xethru_recording_meta.dat file, but it turned out that I got whole messy code that could not be readable when the data format is baseband ap or iq. I wonder what the problem would be.


    Hi Harvord,
    .dat is an HEX file format. You cannot read it with Excel. Use an HEX file reader.

  12. Harvord Sun

    Harvord Sun New Member

    Thank you for your advice, I'll try soon.
  13. Harvord Sun

    Harvord Sun New Member

    I was recently using X4M200 to collect the baseband ap data of radar frame, and I got xethru_recording_meta.dat file and xethru_baseband_ap_XXXXXXX.dat file. I want to know that what information they express respectively. And I an trying to use the example of MC, playback_recording.cpp, to play back the information, what preparations should I make in advance? Namely, I want to know the detailed function and instructions of playback_recording.cpp example.
    Thank you very much!
    Looking forward to your replying!
  14. Charlie Shao

    Charlie Shao Moderator Staff Member

  15. Harvord Sun

    Harvord Sun New Member

    Hi Charlie Shao,

    I have tried xt_modules_print_record_playback_radar_raw_data_message.cpp to get raw data like this:[​IMG]
    but I have no idea what the data explains. Is this the echo from the radar?
  16. Charlie Shao

    Charlie Shao Moderator Staff Member

    It could be one frame of raw rf data or baseband data. Just google to learn about radar data type.