Sleep mode missing in 1.1.0-Beta ?

Discussion in 'Respiration Sensor' started by Josh Gardiner, Sep 29, 2016.

  1. Josh Gardiner

    Josh Gardiner New Member

    I don't seem to be able to put the x2m200 into the sleep application mode instead it just returns respiration application stream, see below. Am I missing something here?

    DEBUG Write: 0x7d 0x22 0x5f 0x7e //RESET
    DEBUG Read: 0x7d 0x10 0x6d 0x7e //ACK OK
    DEBUG Write: 0x7d 0x21 0x17 0x7b 0xf1 0x00 0xc1 0x7e // LOAD SLEEP APP
    DEBUG Read: 0x7d 0x10 0x6d 0x7e //ACK OK
    DEBUG Write: 0x7d 0x24 0x02 0x00 0x5b0x7e //SET LED MODE
    DEBUG Read: 0x7d 0x10 0x6d 0x7e //ACK OK
    DEBUG Write: 0x7d 0x10 0x10 0x1c 0x0a 0xa1 0x96 0x66 0x66 0xe6 0x3f 0x00 0x00 0x20 0x40 0xe5 0x7e //SET DETECTION ZONE
    DEBUG Read: 0x7d 0x10 0x6d 0x7e //ACK OK
    DEBUG Write: 0x7d 0x10 0x10 0x2b 0x11 0xa5 0x10 0x09 0x00 0x00 0x00 0xfb 0x7e // SET SENSITIVITY
    DEBUG Read: 0x7d 0x10 0x6d 0x7e //ACK OK
    DEBUG Write: 0x7d 0x20 0x01 0x5c 0x7e // SET EXECUTE MODE RUN
    DEBUG Read: 0x7d 0x10 0x6d 0x7e //ACK OK
    DEBUG Read: 0x7d 0x50 0x26 0xfe 0x75 0x23 0x01 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xa7 0x7e //RESPIRATION INITIALIZING
    DEBUG Read: 0x7d 0x50 0x26 0xfe 0x75 0x23 0x02 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xa4 0x7e //RESPIRATION INITIALIZING
    DEBUG Read: 0x7d 0x50 0x26 0xfe 0x75 0x23 0x03 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xa5 0x7e //RESPIRATION INITIALIZING
    DEBUG Read: 0x7d 0x50 0x26 0xfe 0x75 0x23 0x04 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xa1 0x7e //RESPIRATION INITIALIZING
    DEBUG Read: 0x7d 0x50 0x26 0xfe 0x75 0x23 0x05 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xa0 0x7e //RESPIRATION INITIALIZING
    DEBUG Read: 0x7d 0x50 0x26 0xfe 0x75 0x23 0x06 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xa3 0x7e //RESPIRATION INITIALIZING
    ... etc, once it is done initializing it still stays in respiration mode.

    Shouldn't the stream frame ID header be [0x6c 0xa1 0x75 0x23](XTS_ID_SLEEP_STATUS) instead of [0x26 0xfe 0x75 0x23](XTS_ID_RESP_STATUS) as well as being 4 bytes longer?
     
  2. Christian Asserson

    Christian Asserson New Member Staff Member

    Hi Josh,

    The respiration packets are also enabled by default in sleep application.
    You can turn that off whit this command:

    {0x7d, 0x90, 0x71, 0x11, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x8c, 0x7e}

    The sleep status need time (approx. 20 s) before it is ready so you will
    have to wait more than 20 seconds before you receive any of these packets.

    I hope this answers your question.

    Regards,
    Christian
     
    Josh Gardiner likes this.
  3. Josh Gardiner

    Josh Gardiner New Member

    Christian,
    Ahh I see it now. It's only being emitting once every second. I was loosing it in my DEBUG of the resp and baseband streams, and I had an error in my parser.

    Thanks.
    -Josh

    $ tail -f *.json
    ==> respiration.json <==
    {"Time":1475588125029721100,"Status":"respApp","Counter":4367,"State":"tracking","RPM":0,"Distance":0,"SignalQuality":0,"Movement":0}
    {"Time":1475588125080310756,"Status":"respApp","Counter":4368,"State":"tracking","RPM":0,"Distance":0,"SignalQuality":0,"Movement":0}
    {"Time":1475588125129795306,"Status":"respApp","Counter":4369,"State":"tracking","RPM":0,"Distance":0,"SignalQuality":0,"Movement":0}

    ==> sleep.json <==
    {"Time":1475588125216752437,"Status":"sleepAPP","Counter":4370,"State":"movement","RPM":0,"Distance":0,"SignalQuality":0,"MovementSlow":6.900495529174805,"MovementFast":0.8064516186714172}

    ==> respiration.json <==
    {"Time":1475588125230796962,"Status":"respApp","Counter":4370,"State":"tracking","RPM":0,"Distance":0,"SignalQuality":0,"Movement":0}
    {"Time":1475588125233811514,"Status":"respApp","Counter":4371,"State":"tracking","RPM":0,"Distance":0,"SignalQuality":0,"Movement":0}
    {"Time":1475588125279789594,"Status":"respApp","Counter":4372,"State":"tracking","RPM":0,"Distance":0,"SignalQuality":0,"Movement":0}

    Sweet...