Module Connector - Raspberry Pi 1.4.2

SW used to communicate with all XeThru modules on a host computer

  1. admin

    admin Administrator Staff Member

  2. Nicholas McBrid e

    Nicholas McBrid e New Member

    When I install the setup.py I get this

    Traceback (most recent call last):
    File "setup.py", line 30, in <module>
    from pymoduleconnector.version import version as __version__
    File "/home/pi/Desktop/xethruconnector/python/pymoduleconnector/__init__.py", line 2, in <module>
    from pymoduleconnector.moduleconnector import DataReader
    File "/home/pi/Desktop/xethruconnector/python/pymoduleconnector/moduleconnector.py", line 5, in <module>
    from pymoduleconnector.moduleconnectorwrapper import \
    File "/home/pi/Desktop/xethruconnector/python/pymoduleconnector/moduleconnectorwrapper/__init__.py", line 7, in <module>
    import _moduleconnectorwrapper
    ImportError: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/pi/Desktop/xethruconnector/python/pymoduleconnector/moduleconnectorwrapper/_moduleconnectorwrapper.so)
     
  3. Christian Asserson

    Christian Asserson New Member Staff Member

    Hi Nicholas,

    We are aware of this problem. There is a rpi-readme.txt in the zip file with a workaround.
    We are working on a more permanent solution that we will release soon.
    Please let us know if you have problems with the workaround in described rpi-readme.txt.

    Regards,
    Christian
     
  4. Nicholas McBrid e

    Nicholas McBrid e New Member

    When I overwrite / usr/lib/arm-linux-gnueabihf/libstdc++.so.6.0.20 i get the same error

    what do you mean
    Execute python like this:
    LD_PRELOAD=libstdc++.so.6.0.22 python program.py
     
    Last edited: Feb 3, 2017
  5. Christian Asserson

    Christian Asserson New Member Staff Member

    Hi Nicholas,

    Here is a simple way to get you started running ModuleConnector on the Raspberry Pi.
    Unzip ModuleConnector-rpi-1.0.0.zip somewhere on your Raspberry Pi.

    In a command shell type the following:
    export LD_LIBRARY_PATH=<path to unzipped ModuleConnector folder>/lib/
    export PYTHONPATH=<path to unzipped ModuleConnector folder>/python/

    you should now be able to run the example scripts and/or your own script using ModuleConnector.

    Hope this works out for you.

    Please let us now if you have any problems.

    Regards,
    Christian
     
  6. BC1

    BC1 New Member

    Hi guys,

    I am a student from belgium and with 2 other colleagues we are working on a project involving the x2m200 module. So there is a chance you will be hearing a lot from me.

    Yesterday our module arrived and we start bij testing the module with the xeplorer Software. It worked quite well. Now we like to monitor breathing on the raspberry pi.

    I dit some research and just like to check if i am on the right track. So if I am correct you make a connection from the raspberry pi to the x2m200 module using a usb cable. Then you download the moduleconnector and install setup.py on the pi. Then you start the x2m200_respiration_example.py and afer that it will be possible to detect respiration?

    Is this the correct way to get the best results? I don't expect it will work from the first try but we have some experience with the pi, so if we get on the right track it will be possible to make it work I guess.

    Regards,
    Brent
     
  7. BC1

    BC1 New Member

    I had the same problem, but managed after a long time to install it.
    This is what I did.

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: <path to unzipped ModuleConnector folder>/lib/

    export PYTHONPATH=$PYTHONPATH: <path to unzipped ModuleConnector folder>/python/

    LD_PRELOAD=libstdc++.so.6.0.22 python setup.py install

    Then I received the next error.
    upload_2017-2-14_15-39-40.png

    This can be solved with the next code.

    sudo chown -R $USER /usr/local/lib/python2.7

    sudo chown -R $USER /usr/local/bin

    Finally I was able to install the program by using the code that was mentioned before.

    LD_PRELOAD=libstdc++.so.6.0.22 python setup.py install

    upload_2017-2-14_15-43-52.png
     
    Last edited: Feb 15, 2017
  8. BC1

    BC1 New Member

    When i try to make a connection between the raspberry pi and the xethru module by the following code.

    from pymoduleconnector import ModuleConnector
    device_name = "COM4" # The module device name.
    mc = ModuleConnector(device_name, log_level = 0)
    x2m200 = mc.get_x2m200()
    x2m200.set_sensor_mode_idle()
    pong = x2m200.ping()
    print "Received pong, value is:", hex(pong)


    I get the following error.
    upload_2017-2-16_9-19-55.png

    Version GLIBCXX_3.4.22 not found. I did some reserch and this is suppose to help.

    sudo apt-get update
    sudo apt-get dist-upgrade

    Unfortunately I get the same error.

    When I try the following.

    upload_2017-2-16_9-23-36.png

    You can clearly see there is no GLIBCXX_3.4.22 version.

    Any suggestions how I can solve this problem?
     
    Jimmy Y. Huo likes this.
  9. BC1

    BC1 New Member

    Hi guys,

    I am able to receive a pong message from the xethru module with the following code:

    from pymoduleconnector import ModuleConnector
    device_name = "/dev/ttyACM0" # The module device name.
    mc = ModuleConnector(device_name, log_level = 0)
    x2m200 = mc.get_x2m200()
    x2m200.set_sensor_mode_idle()
    pong = x2m200.ping()
    print "Received pong, value is:", hex(pong)

    I receive the message "Received pong, value is: 0xaaeeaeeal

    So I am assuming this is correct and there is a connection between the raspberry pi and the xethru module.

    When i try the x2m200_respiration_example wich you can find in the download file i get the following error.
    AttributeError: Values instance has no attribute 'device_name'
    How can i solve this problem?

    Regards,
    Brent Convens
     
  10. Olav Liseth

    Olav Liseth Administrator Staff Member

    Hi Brent,

    Here are two different ways of starting the example, from a python interpreter:
    or from the command line:

    The device is mounted at COM17 on my Windows machine, you should use /dev/ttyACM0.
    The example has more dependencies than ModuleConnector, you will need matplotlib and numpy.

    Olav
     
  11. Christian Asserson

    Christian Asserson New Member Staff Member

    Hi Everyone,

    Here comes a recipe for how to setup and use ModuleConnector on Rasberry Pi 2(Jessie).

    1. Download and unzip the ModuleConnector-rpi-1.0.0.zip file.
    For this description we use MC_PATH as the path to the unzipped ModuleConnector directory.

    2. In ${MC_PATH}/lib make a symbolic link to the bundled c++ standard library
    ln -s libstdc++.so.6.0.22 libstdc++.so.6

    3. Set LD_LIBRARY_PATH to point to ${MC_PATH}/lib
    export LD_LIBRARY_PATH=${MC_PATH}/lib

    4. Now you can install using the setup.py from the ${MC_PATH}/python subfolder
    sudo python setup.py install

    5. Remember to always have LD_LIBRARY_PATH point to ${MC_PATH}/lib even after installation.

    Hope this is helpful.

    Regards,
    Christian
     
    admin likes this.
  12. Vivek R

    Vivek R New Member

    Can we use this module connector on any OS on Raspberry Pi 3? Does it have to be Rasbian?
     
  13. Christian Asserson

    Christian Asserson New Member Staff Member

    Hi Vivek,

    We currently only support Raspbian Jessie on the Raspberry PI 2. It might work with other releases though.

    Christian
     
  14. Christian Asserson

    Christian Asserson New Member Staff Member

    Hi,

    Here are alternative steps in case you have problems after installing pymoduleconnector with python setup.py install.

    download and unzip ModuleConnector-rpi-1.0.0.zip
    export LD_LIBRARY_PATH=<absolute path to ModuleConnector-rpi/lib/>
    export PYTHONPATH=<absolute path to ModuleConnector-rpi/python/>

    You may now run some of the examples or your own python script using pymoduleconnector.

    Christian
     
  15. Charles I.

    Charles I. New Member

    Just in case any one still had issues with all the above and still getting the:
    "ImportError: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/pi/Desktop/xethruconnector/python/pymoduleconnector/moduleconnectorwrapper/_moduleconnectorwrapper.so)" ​
    error, I fixed the problem by running the commands below. Please read through this entire post before running the commands. I am just sharing the process that worked for me, it may or may not work for you. First I start by exporting the library and pythonpath:

    export LD_LIBRARY_PATH=<absolute path to ModuleConnector-rpi/lib/>
    export PYTHONPATH=<absolute path to ModuleConnector-rpi/python/>​

    next I backup the user library file that is bolded above:

    sudo mv /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.backup​

    and then performed a copy operation to user library from the library provided in the moduleconnector:

    sudo cp <absolute path to ModuleConnector-rpi/lib/libstdc++.so.6.0.22> /usr/lib/arm-linux-gnueabihf/libstdc++.so.6​

    where a sample absolute path would look like "/home/pi/ModuleConnector/lib/libstdc++.so.6.0.22". Also note that the path in bold above is the path we are moving the lib file to. Make the proper changes if yours is different. If this happens to not work OR affects another program that requires the original library you can rerun the mv command to restore the backup using:

    sudo mv /usr/lib/arm-linux-gnueabihf/libstdc++.so.6.backup /usr/lib/arm-linux-gnueabihf/libstdc++.so.6​

    The error stopped coming up when I ran the example code.
     
  16. Jeonyu

    Jeonyu New Member

    [Raspberry Pi 3]

    How can i solve this problem?

    pi@raspberrypi:~/ModuleConnector-rpi-1.1.5/examples $ make
    OS: Linux
    g++ ping.o ../lib/libModuleConnector64.so -o ping
    ping.o: In function `ping(std::string const&)':
    ping.cpp : (.text+0x5c): undefined reference to `XeThru::ModuleConnector::ModuleConnector(std::string const&, int)'
    collect2: error: ld returned 1 exit status

    Makefile:27: recipe for target 'ping' failed
    make: *** [ping] Error 1
     
    Last edited: May 18, 2017
    benbair and R.Adam like this.
  17. Christian Asserson

    Christian Asserson New Member Staff Member

  18. admin

    admin Administrator Staff Member

    admin updated Module Connector - Raspberry Pi with a new update entry:

    Module Connector V 1.1.8

    Read the rest of this update entry...
     
  19. admin

    admin Administrator Staff Member

    admin updated Module Connector - Raspberry Pi with a new update entry:

    Module Connector V 1.2.2

    Read the rest of this update entry...
     
  20. Christian Rødli Amble

    Christian Rødli Amble New Member Staff Member

    Christian Rødli Amble updated Module Connector - Raspberry Pi with a new update entry:

    ModuleConnector v 1.4.0

    Read the rest of this update entry...