Setting X3M200/300 to manual mode in MCPW

Discussion in 'Module Communication Protocol Wrapper (MCPW)' started by Michele Bavaro, Jul 25, 2019.

  1. Michele Bavaro

    Michele Bavaro New Member

    sorry for cross posting... I couldn't find a way to delete my thread in the X4M03 channel...

    Setting a X4M200/300 sensor to manual mode (just RAW radar frames) is easily done with ModuleConnector:
    Code:
    if (FWID != "XEP") {
    //Module X4M300 or X4M200
    std::string Module;
    X4M300 & x4m300 = mc.get_x4m300();
    x4m300.set_sensor_mode(XTID_SM_STOP,0);
    x4m300.set_sensor_mode(XTID_SM_MANUAL,0);
    xep.get_system_info(0x01, &Module);
    std::cout << "Module " << Module << " set to XEP mode"<< std::endl;
    }
    
    However, it's not so obvious how to do that with MCPW..
    Code:
      mcpw_set_sensor_mode(mcpw, XTS_SM_STOP, 0);
      if (MCPW_OK != mcpw_set_output_control(mcpw, XTS_ID_BASEBAND_IQ, XTID_OUTPUT_CONTROL_ENABLE))
       cout << "mcpw_set_output_control(XTS_ID_BASEBAND_IQ) failed." << endl;
      mcpw_set_sensor_mode(mcpw, XTS_SM_MANUAL, 0);
    
    does not work.
    One possible way would be to detect whether the module is X4M200/300 and set an appropriate application profile.. I tried `XTS_ID_APP_UNKNOWN` and `XTS_ID_APP_RADAR` and ` XTS_ID_APP_DECIM` but none of them seems to unlock either sensor.
     
  2. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Michele,
    Did you try the example in the generic folder? This example can run on any computer platform with C++ compiler.
    if you run the command like "mcpw_demo.exe comx XEP", you are able to get XEP mode running on X4 based sensor modules.
     
  3. Michele Bavaro

    Michele Bavaro New Member

    I tried on MacOS and Linux.
    Correct me if I am wrong but calling `mcpw_demo /dev/ttyACM0 XEP` the code path just calls `mcpw_demo_x4m300()`, which will not work with a X4M200 as it does
    Code:
    mcpw_load_profile(mcpw, XTS_ID_APP_PRESENCE_2)
    Sure the example outputs baseband AP or baseband IQ (if modified appropriately),
    but one is not able to change the output to any other frame rate than the one set by `mcpw_set_detection_zone()` and `mcpw_set_sensitivity()`.
    That is, fine-grained configuration of the radar does not seem to work, and FPS are just derived by whatever the sensor firmware sets internally. This is pretty different from what the ModuleConnector firmware does.
    Or am Im missing something?
     
  4. Charlie Shao

    Charlie Shao Moderator Staff Member

    Sorry for my mistake, you should use the latest MCPW from this repo. The latest version has support for XEP mode. It will run the mcpw_demo_xep(com_port) function for X4 configuration.
     
  5. Michele Bavaro

    Michele Bavaro New Member

    Ah! Didn't see that. Will give it a spin immediately, but I have no doubt it will work as expected. Thank you very much for your support.
     
  6. Michele Bavaro

    Michele Bavaro New Member

    Just to confirm that with a couple of tweaks here and there it works for me. I have not seen a great deal of differences between the repo version and the release version... mainly I needed to modify `readThreadMethod()`.