'failed to reset module' on Ubuntu

Discussion in 'Respiration Sensor' started by Herman Bergwerf, Dec 21, 2017.

  1. Herman Bergwerf

    Herman Bergwerf New Member

    I am using the X2M200 sensor. On Ubuntu I cannot connect with the sensor using the XeThru explorer. It gives me the error message: 'failed to reset module'. We also tried with a macbook and this was working as expected. I eventually want to connect it to a raspberry pi using https://github.com/mvolstad/xethru-python-driver. This Python driver is also giving the same error on my Ubuntu machine. How can I debug/fix this?
     
  2. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Herman,

    1. For your test on raspberry pi and Ubuntu, I would suggest you try Module Connector python examples. When you debug with these examples, you will see which step the problem happen.
    2. Pay attention to the version of operating system, only Ubuntu 16.0 and Raspbian Jessie have been tested.
    3. Try with different computer and sensors to see if it is hardware related.

    Good luck to you.
     
  3. Herman Bergwerf

    Herman Bergwerf New Member

    1. I am running the example script
    2. I am running Ubuntu 16.04 LTS
    3. I have only one sensor, we tried with a macbook so it does not seem hardware related.
     
  4. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Herman,
    Could you send me the error prompt when you run x2m200_respiration_example.py on Raspberry pi or Ubuntu?
     
  5. Herman Bergwerf

    Herman Bergwerf New Member

  6. Charlie Shao

    Charlie Shao Moderator Staff Member

  7. Herman Bergwerf

    Herman Bergwerf New Member

    Ok, I have installed the python 3.5 module in the unix zip. I got several errors when running this multiple times. One time the error was about a timeout but I did not copy the error.

    Command:
    python3 pymoduleconnector/examples/x2m200_respiration_example.py -d /dev/ttyACM0

    Errors:
    ------------------------

    Traceback (most recent call last):
    File "pymoduleconnector/examples/x2m200_respiration_example.py", line 161, in <module>
    main()
    File "pymoduleconnector/examples/x2m200_respiration_example.py", line 157, in main
    x2m200_respiration_message_example(**vars(options))
    File "pymoduleconnector/examples/x2m200_respiration_example.py", line 82, in x2m200_respiration_message_example
    for key, settings in plotdata.iteritems():
    AttributeError: 'dict' object has no attribute 'iteritems'

    ------------------------

    0.000250 : open: 50 -- Error opening file: /dev/ttyACM0
    system error: Device or resource busy

    0.000349 : module_io::eek:pen returned error
    Traceback (most recent call last):
    File "pymoduleconnector/examples/x2m200_respiration_example.py", line 161, in <module>
    main()
    File "pymoduleconnector/examples/x2m200_respiration_example.py", line 157, in main
    x2m200_respiration_message_example(**vars(options))
    File "pymoduleconnector/examples/x2m200_respiration_example.py", line 35, in x2m200_respiration_message_example
    mc = ModuleConnector(device_name, log_level=0)
    File "/usr/local/lib/python3.5/dist-packages/pymoduleconnector-1.4.3-py3.5.egg/pymoduleconnector/moduleconnector.py", line 73, in __init__
    super(ModuleConnector, self).__init__(device_name, log_level)
    File "/usr/local/lib/python3.5/dist-packages/pymoduleconnector-1.4.3-py3.5.egg/pymoduleconnector/moduleconnectorwrapper/__init__.py", line 3448, in __init__
    this = _moduleconnectorwrapper.new_PythonModuleConnector(*args)
    RuntimeError: unable to open file: /dev/ttyACM0
     
  8. Herman Bergwerf

    Herman Bergwerf New Member

    It seems however the python 2 example is working fine. I will proceed with that code for now. Maybe the python 3 version must be reviewed.
     
  9. Herman Bergwerf

    Herman Bergwerf New Member

    After a bit more investigation it seems that only the sleep profile can be loaded. When I try to load the respiration I get the following error (I also still get the timeout and resource busy errors for some reason):

    Traceback (most recent call last):
    File "test.py", line 162, in <module>
    main()
    File "test.py", line 158, in main
    x2m200_respiration_message_example(**vars(options))
    File "test.py", line 42, in x2m200_respiration_message_example
    x2m200.set_detection_zone(zstart, zend)
    File "/usr/local/lib/python2.7/dist-packages/pymoduleconnector-1.4.3-py2.7.egg/pymoduleconnector/moduleconnectorwrapper/__init__.py", line 4447, in set_detection_zone
    return _moduleconnectorwrapper.PyX2M200_set_detection_zone(self, start, end)
    RuntimeError: set_detection_zone failed


    (I only changed load_sleep_profile to load_respiration_profile)
     
  10. Taeho Kim

    Taeho Kim New Member

    I have a similar problem too. I used python3.5 file in linux.

    Command:

    python x2m200_respiration_example.py
    Errors:
    Traceback (most recent call last):
    File "x2m200_respiration_example.py", line 13, in <module>
    from pymoduleconnector import ModuleConnector
    ImportError: No module named 'pymoduleconnector'​
     
    Last edited: Feb 22, 2018
  11. Charlie Shao

    Charlie Shao Moderator Staff Member

    Did you installed pymoduleconnector?
    Hi Taecho,
    This error reminds that you pymoduleconnector is not be installed properly. Please make sure you have installed pymoduleconnector library. This can be done by running python setup.py install.