Modules connectors TCP-IP support

Discussion in 'Module Connector (MC)' started by NSANGOU CHOUAIBOU, Sep 26, 2017.

  1. NSANGOU CHOUAIBOU

    NSANGOU CHOUAIBOU Active Member

    Hi,
    There is TCP-IP support added in modules connectors to date. Please could you provide more information about this feature ?

    Best regards,
    Chouaibou NSANGOU.
     
  2. Aksel Johnsby

    Aksel Johnsby Moderator Staff Member

    Hi Chouaibou
    If you set up a TCP/IP server, that is able to forward read and write, you can connect your module using functions and classes described in the documentation. With matlab and python you can additionally specify the device name as tcp://ip: port to make it connect. I will post some examples in this thread when they are ready.

    Aksel
     
  3. NSANGOU CHOUAIBOU

    NSANGOU CHOUAIBOU Active Member

    Hi Aksel,
    Many thanks for your reply. I really appreciate it. I am very excited and looking foward to your TCP/IP examples.

    B.R
    Chouaibou.
     
  4. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Chouaibou,

    I have attached the TCP/IP example script for you. The XEP_TCPIP_server.py runs on the host connected with XeThru sensor, it fetches sensor data and workes as a TCP/IP server to transfer data to TCP/IP client.

    The TCP/IP client is a host which wants to get sensor data through TCP/IP protocol remotely, you just need to run existing examples on it and remember to replace device name from the serial port like "COM3" to TCP/IP address like "tcp://127.0.0.1:3000". I have done some tests, most of them can work well except the example need transfer baseband data(needs large bandwidth), will work more to fix it later.
     

    Attached Files:

    Last edited: Oct 25, 2017
  5. NSANGOU CHOUAIBOU

    NSANGOU CHOUAIBOU Active Member

    Hi Charlie,
    Many thanks for the TCP-IP example script of py module connector. Don't worry for baseband data transfer. This is the first step and I am confident that you will improve this feature.

    B.R
    Chouaibou.
     
  6. Charlie Shao

    Charlie Shao Moderator Staff Member

    I found a software called socat, user just needs to run the following command to set up server, it has been tested on RPI.
    § socat TCP-LISTEN:3000,fork,reuseaddr FILE:/dev/ttyACM1,b115200,raw
     
    Last edited: Jan 10, 2018
  7. NSANGOU CHOUAIBOU

    NSANGOU CHOUAIBOU Active Member

    Hi Charlie,
    Many thanks for new input on TCP/IP support thread. I will perform tests with socat.
    B.R,
    Chouaibou.
     
  8. NSANGOU CHOUAIBOU

    NSANGOU CHOUAIBOU Active Member

    Hi,
    For the test with socat, please could you let me know what socat package you have used in RPI (server side) ? Did you made installation in cygwin environment ? If yes, what package ? If no, could you give more details if possible ?
    In the client side (I suppose your PC), launching XEP_TCPIP_server.py in Anaconda Spyder is it all you have done to fetch data from RPI or did you also need socat ?

    Best regards,
    Chouaibou.
     
  9. Charlie Shao

    Charlie Shao Moderator Staff Member

    1. socat can be installed by running "sudo apt-get install socat" on RPI
    2. Then you need to run
    § socat TCP-LISTEN:3000,fork,reuseaddr FILE:/dev/ttyACM1,b115200,raw
    to set up serial port to TCP conversion server.
    3. Do not run XEP-TCPIP_server.py on your client side, run general Module Connect example with a TCP device name. For example" python X4M300_printout_presence_state.py -d tcp://192.168.0.100:3000", remember to replace the IP address with your server(RPI in this case) IP.
     
    Last edited: Jan 10, 2018
  10. NSANGOU CHOUAIBOU

    NSANGOU CHOUAIBOU Active Member

    Hi Charlie,
    Great ! It is now cristal clear.
    Many thanks,

    B.R,
    Chouaibou.