Geting vital sign data from X4M200

Discussion in 'Respiration Sensor' started by Yunze, Aug 28, 2018.

  1. Yunze

    Yunze New Member

    Hello,
    I am using Python 2.7 with X4M200. I would like to print out the vital sign data (e.g. heart rate) using python script. Below is my procedure to get the data.
    - reset X4M200
    - set it in running mode: x4m200.set_sensor_mode(0x01, 0)
    - load x4m200 respiration detection profile: x4m200.load_profile(0x47fabeba)
    - set the output control to XTS_ID_VITAL_SIGNS: x4m200.set_output_control(0x20020102,1)
    - read vital sign data: x4m200.read_message_vital_signs()
    However, when I tried to print the vital sign data, there is nothing shown on my screen. Is vital sign monitoring enable in current X4M200?

    Thanks,
    Yunze
     
  2. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Yunze,
    The X4M200 does not support heart rate data output, but you can still get respiration from vital sign message.
    Please try the attached script. It is an ModuleConnector example.
     

    Attached Files:

  3. Anwar Elhadad

    Anwar Elhadad Member

    I am getting this error when trying the example:
    upload_2018-8-29_12-41-46.png
     
  4. Charlie Shao

    Charlie Shao Moderator Staff Member

  5. Anwar Elhadad

    Anwar Elhadad Member

    Thanks. I was wondering what does raspiration confidance represents? and is the raspiration rate what I should plot vs time to to get the plot similar to the one from the Xethru software for raspiration?.
    do you have any any tips to catch the raspiration of a person in the best way possible? As you can see from the image the raspiration rate is constant so I do not know if it locked on me?
    ***************
    message_respiration_sleep: frame_counter: 3264 sensor_state: BREATHING respiration_rate: 17.1126804352 distance: 0.632692217827 movement_slow: 4.9055390358 movement_fast: 33.7635040283
    message_vital_signs: frame_counter: 3264 sensor_state: BREATHING respiration_rate: 17.1126804352 respiration_distance: 0.632692217827 respiration_confidence: 0.0 heart_rate: nan heart_distance: nan heart_confidence: nan
    message_respiration_sleep: frame_counter: 3281 sensor_state: BREATHING respiration_rate: 17.1126804352 distance: 0.632692217827 movement_slow: 11.389008522 movement_fast: 40.3961601257
    message_vital_signs: frame_counter: 3281 sensor_state: BREATHING respiration_rate: 17.1126804352 respiration_distance: 0.632692217827 respiration_confidence: 0.0 heart_rate: nan heart_distance: nan heart_confidence: nan
    message_respiration_sleep: frame_counter: 3298 sensor_state: BREATHING respiration_rate: 17.1126804352 distance: 0.632692217827 movement_slow: 14.9098329544 movement_fast: 42.8871536255
     
  6. Charlie Shao

    Charlie Shao Moderator Staff Member

  7. Anwar Elhadad

    Anwar Elhadad Member

    is there a way to generate the same raspiration plot form a python code?. I do not want to use the Xethru software, it is too heavy. i want to tell the X4M200 to send me the same plot for raspiration by running a python file.
    Thanks.
     
  8. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Anwar,
    The ModuleConnector API is designed to make developers' life easy. It can be used on most computer systems, so developers do not need to spend time on basic function implement and just focus on application development of the sensor. I believe that, when you think the MC is heavy, you mean it provides every possible function needed by developers for all XeThru modules. This is how a good API should be. You just need to use the function you need for your development.

    Which application are you going to use? Which kind of lighter API do you need for your application?
    We have an application note which provides all detail of low-level communication commands, so it is possible to redesign your custom API based on this app note:
    https://www.xethru.com/community/resources/xethru-module-communication-protocol.130/

    Best regards,
    Charlie