Find the answer to your Linux question:
Results 1 to 4 of 4
Hi everybody, I am not sure if there is the best place to ask my question, because is a "twilight zone". It is about a Linux machine (Debian Lenny) where ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    4

    Access to USB


    Hi everybody,

    I am not sure if there is the best place to ask my question, because is a "twilight zone".
    It is about a Linux machine (Debian Lenny) where is running an Apache server for my own web site, at home.
    I already do some little things around with php sending/receiving data through a serial port (tty) to some electronics.

    Now is coming the question!

    How can I do the same thing with USB? (Not USB to serial!)
    Examples: accessing a Bluetooth dongle on USB port, accessing data on a USB flash, etc...

    Thank you for your time,
    teo_kan

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Hi,

    Can you be a little more specific about what you want to do?

    The way I am reading it, you want your web server to be able to access a USB drive that is plugged into the server (not plugged into a client that is accessing the webserver)?

    If so, then the user running the webserver (usually some non-root account like "apache" or "nobody") needs super-user access to the physical devices. This is usually accomplished with the use of sudo. Set up sudo to run the specific commands you need. Or even better, write a simple script that does all you need and perhaps takes arguments so that it can behave more dynamically, and then configure the apache user to be able to run that via sudo.

  3. #3
    Just Joined!
    Join Date
    Jan 2009
    Posts
    4
    Quote Originally Posted by atreyu View Post

    Can you be a little more specific about what you want to do?
    Thank you atreyu for your replay.
    This give me an idea how to deal with the access rights for usb. The very same problem I had with the serial port. But there is only half of the solution (for that reason I was saying this is "twilight zone") because I need to do this with a php script.
    In fact I do some commands over Internet to some electric stuff at home and I want to pass from the serial wires to wireless (Bluetooth, whatever...). As I am digging now the serial can be accessed, let say, native-ly but, but for whatever the usb device does, there should be a driver and for me here is the main issue: I want to access physically the usb (to control myself the commands and data to/from usb).

    Once more, thank you for your time.

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by teo_kan View Post
    As I am digging now the serial can be accessed, let say, native-ly but, but for whatever the usb device does, there should be a driver and for me here is the main issue: I want to access physically the usb (to control myself the commands and data to/from usb).
    Can you be specific about the USB device? Again, if it is USB thumbdrive, this is a straight forward issue. You need to be root to be able to mount a USB drive, and you can achieve this using sudo commands (e.g., sudo mount ... ).

    However, if this is for example a USB serial device, then perhaps your real question is "how do I program a USB serial device in Linux?" which is an entirely different question.

Posting Permissions

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