Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, I'm not that new to linux, but i'm just a normal user. My dissertation is about home automation and i'm going to use X10 cm15a which has a USB ...
  1. #1
    Just Joined!
    Join Date
    Dec 2010
    Posts
    3

    Listen USB port in ubuntu linux

    Hi,

    I'm not that new to linux, but i'm just a normal user.

    My dissertation is about home automation and i'm going to use X10 cm15a which has a USB connection.

    What i would like to know is how to make an 'anonymous' connection to this device and listen to data & reply back to identify its protocol.

    I have had some help that i could use the two lines below to make a connection to a serial port & send the data to a tcp connection.

    Code:
    stty -F /dev/ttyUSB0 4800 cs8 -parenb
    nohup socat /dev/ttyUSB0,raw,echo=0 TCP-LISTEN:5333 >/dev/null &
    The important thing is that i need to listen to this data from php so maybe if i can do it directly in PHP it would be fabolous but i don't think that's possible.

    But using the above method i could make a connection to a serial port and send the data to a tcp connection and then open a socket with that connection from php to communicate with the serial port.

    Is there anyone that could help me with this problem please ??

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,977
    Terms of use for these forums - we can't help you with your homework or school projects.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Dec 2010
    Posts
    3

    need help..

    Is there a particular reason for that ?

    I mean can you at least tell me if its possible to do so ? And then i'll try to figure out myself how, i mean i need to find another forum because its a bit difficult to find something like this on your own, i need some help to get started...

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,977
    It depends upon the X10. There is Linux/FOSS software to work with the X10 controllers, but I haven't worked with it. Have you looked on the X10 web site(s)? What about Google searches? Try these search terms: linux x10 software
    That comes up with a plethora of links to likely looking stuff.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Dec 2010
    Posts
    3
    I searched a lot throughout the web believe me. My problem is that i found a lot of software that does the job, but i want to build my own software, that's why i need to listen to a usb port.

    I found lots of resources of how to listen to a serial port including the one i posted in my first post. But not about listening to a USB port, that's the problem. And that's the reason i decided i could ask here, i mean its not plagarism to just ask for help to begin a thesis right ?

    I'm not somebody who rights the code for me, i was hoping to get some help of at least if i'm in the right way or not, because i'm feeling that its quite 'impossible' to listen to a usb and process it via php... But i believe there's a solution for everything and i'm not that experienced in linux to say there's not a way to do so, i know socat works for serial ports, why not for usb ports ?

    Thanks for your help, and i understand your first concern but as i told you i'm not expecting spoon feeding i'm just looking for some help.

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,977
    General advice we can give you. Specific help is not allowed. In any case, you are trying to use TCP/IP to listen on what is effectively a serial port, not a network port. You'll note that for USB modems that are network connections, they use the Point-To-Point Protocol (PPP), and the device connected has to cooperate. One of the nice things about FOSS (Free and Open Source Software) is that you can look at it and see how these things are accomplished. So, if the X10 hardware supports TCP/IP networking over a PPP connection, then you should be able to use normal network socket programming to access it. However, if it does not, then you will need to treat it as a standard USB serial port and interact with it however it is documented to do so. That's as far as I'm willing to take you on this journey at this point. Good luck. Do examine the source for some of these tools, and get the programming documentation from the X10 manufacturer's web site and/or other sources for it. They may have some support libraries and/or sample source code for programmers who want to interface with the devices and its network.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...