Profile is resetting if I run XEP_config_and_run.cpp

Discussion in 'Module Connector (MC)' started by Chandni Aghera, Jun 11, 2018.

  1. Chandni Aghera

    Chandni Aghera New Member

    Profile is resetting if I am sending configuration setting command over UART.

    How to configure and save the profile using UART???
     
  2. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Chandni,
    Do you mean it works on USB but not UART? I also wonder how you define the profile when you run this example on X4driver level.
    According to XeThru Module Communication Protocol, XeThru sensors can run at two level, X4driver level and Application level. When sensor is running on X4driver level, there are no profiles enabled. I also want to remind you that the sensor will enter application level as default at reset, so it will not output radar raw data if you connect with UART without any configuration, it will output the message you have enabled on the Application level.
     
  3. Chandni Aghera

    Chandni Aghera New Member

    Hi Charlie,
    thanks for the information, i checked as mentioned above.
    please find the questions required more clarification.
    1.how to configure the parameters like sensitivity,detection zone,noise map,LED?
    2.what is the c++ code for above requirement?.
    3.how to differentiate the frames for presence and no presence?.
    4.procedure for UART command control?
     
  4. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Chandni,
    For you questions please read the XeThru Module Communication Protocol document, the functions to configure sensitivity,detection zone,noise map,LED have been implemented at Module Connector, please find them at ModuleConnector-win32_win64-1.4.3/doc/html/index.xhtml.
     
  5. Chandni Aghera

    Chandni Aghera New Member

    Hi Charlie,
    Thank you for the previous reply, it helps me.
    I have one more question,
    I am using X4M300 xethru board and one relay is connected with output pin(Pin no. 11 of 16 pin connector),
    I am getting some false detection, so I talk with our Hardware team related to this. As per Hardware people there is some interference due to ralay.
    How to reduce this interference???
     
  6. NSANGOU CHOUAIBOU

    NSANGOU CHOUAIBOU Active Member

    Hi Chandni Aghera,
    I would like to give you some inputs :

    1 - You can use a LED only as your sensor's output pin load without any relay connected. This test will help you know if your relay is the source of interferences or not. At the same time, you will be able to perform detection test and see the light status of the LED accordingly.
    See this post for more information about IO voltage levels :
    https://www.xethru.com/community/threads/x4m300-200-i-o-voltage-levels.380/

    2 - The coil of the relay is highly inductive and it is highly recommended to use a dedicated MOSFET (with built in flywheel diode) as a buffer for more security and robustness of your system.

    B.R
     
    Last edited: Jun 21, 2018
  7. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Chandni,
    If you test this module with a multimeter, it should output 3V when there is no presence.
    This is the internal structure of IO pin output at Atmel MCU. When you connect with LED there will be a big drop since pull-up resistor is 100Koms.

    [​IMG]
    Could this interference caused by week pull-up? you may need to add extra driver circuit between this pin and relay.
     
  8. Chandni Aghera

    Chandni Aghera New Member

    Hi Nsangou,
    The relay part no.we are using is YL303H-S-5VDC-12
     
  9. Chandni Aghera

    Chandni Aghera New Member

    Hi Charlie,
    I already added driver circuit and also checked without relay board its working well without relay board but when relay board is near to the xethru board getting false detection.
    Can you suggest me any interference material or any method to remove this interference???
     
  10. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Chandni,
    Do you mean the sensor also reports fault presence detection, not just relay output?
    As you may know, the relay contains mechanical part, I guess that the relay is inside detection zone in your setup. Try to move relay out of detection zone.
     
  11. NSANGOU CHOUAIBOU

    NSANGOU CHOUAIBOU Active Member

    Hi Chandni,
    After performing presence detection tests with the relay connected at output pin(Pin no. 11) of X4M300 presence sensor module, I was able detect the relay's contact movement without any presence at all.
    There is no RF (radio frequency) interferences generated by the relay. The sensor is just very very sensitive and accurate, it is able to detect the relay's contact movement and trigger the presence state. This is a normal detection behaviour of the xethru sensor.

    Here are some solutions to your problem :

    1 - Move the relay activated by the presence sensor's output pin far away from the sensor's detection zone as recommended by Charlie.

    2 - If it is mandatory for your relay to be installed next to the sensor, please use solid state relay to drive your load as it has no moving parts.

    P.S : For the false detection in your case, it is due to the fact that your relay's contact movement is retriggering presence state during the presence detection timer flow, before the end of the presence state or just after the end of presence detection timer flow, thus leaving no room for a stable no presence state (please see attached file ).


    B.R,
    Chouaibou.
     

    Attached Files:

    Last edited: Jun 21, 2018
    Charlie Shao likes this.
  12. Chandni Aghera

    Chandni Aghera New Member

    Hii Charlie,
    I have one more question...
    I want to use the function get_parameter_file,
    I m using like this in my code,

    string data;
    ModuleConnector mc(device_name, log_level);
    X4M300 & x4m300 = mc.get_x4m300();
    result=x4m300.get_parameter_file("getparameter.txt",&data);

    getting the result=1 means it's failing
    Can u give me any example for this ????
     
  13. Aksel Johnsby

    Aksel Johnsby Moderator Staff Member

    Hi Chandni Aghera,

    The fuction get_parameter_file() is currently not implemented. However it is possible to access the parameter file through the file system. Use the "get_file ( uint32_t type,uint32_t identifier,Bytes * result )" function from XEP. The identifiers can be found in the ids.py file in MC.

    X4M200_X4M300_manipulate_noisemap.py is an example that shows how this is done.

    I hope this helps :)
    --
    Aksel
     
  14. Chandni Aghera

    Chandni Aghera New Member

    Hi Charlie,
    Thank u so much for support till now.
    I come with one more question,
    Sensor is detecting presence when I throw some non-living object in the detection range.
    Also I check it for different sensitivity,
    So,For sensitivity 1, It is detecting some bigger non-living objects like chair and for sensitivity 3, It is also detecting the smaller object like book.
     
  15. Aksel Johnsby

    Aksel Johnsby Moderator Staff Member

    Inanimate static objects will eventually be filtered out. This will however take some time (20-30 sec) due to the adaptive noisemap. Moving objects in the detection zone will be detected as presence regardless if it is living or non-living.

    The sensitivity controls detection thresholds. Higher threshold may lead to more false detections but will provide a more sensitive presence detection. Lower thresholds might get rid of some false detections, but may result undetected movements. We recommend you try different sensitivities and see what suits your application best.

    Have a great day
    --
    Aksel
     
  16. Chandni Aghera

    Chandni Aghera New Member

    Hi Aksel
    I want to disable the log, for that I am using the this function,
    XeThru::ModuleConnector::ModuleConnector ( const std::string & device_name,int log_level )
    and setting log_level to 0, then also I am getting some log files.
    How to disable this logs??
    and is there any API to print my data in log file????
     
  17. Chandni Aghera

    Chandni Aghera New Member

    Waiting for the reply.......
     
  18. Aksel Johnsby

    Aksel Johnsby Moderator Staff Member

    Hi Chandni,
    The log_level controls the amount of debug info you get in real-time when running the sensor and the content of the debug files created. Setting the log_level to 0, which is the lowest level, will not give you any real-time feedback unless something goes wrong or the program running the sensor is closed incorrectly.

    If the log_level is set to 0:
    The debug.log file provides a short report of what went wrong if your program crashed or the module disconnected. Unfortunately, there is no easy way to disable it, but if you are closing the sensor connection properly for each time you run your sensor the debug files will stop appearing.
    Refer to the module connector examples to see how to properly close the connection between sensor and host.

    Sorry for the late response.

    Have a great day!
    --
    Aksel
     
  19. Chandni Aghera

    Chandni Aghera New Member

    Thank you so much Aksel
     
    Aksel Johnsby likes this.
  20. Chandni Aghera

    Chandni Aghera New Member

    Hi Aksel
    We don't need any debug log files to be generated. We are good with standard terminal output. As you said"there is no easy way to disable it,", we understand that. But we don't require for our use case. Can you suggest any solution/work around.