Access to USB
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,
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.
Thank you atreyu for your replay.
Originally Posted by atreyu
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.
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 ... ).
Originally Posted by teo_kan
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.