Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: USB Device Permissions

  1. #1
    Join Date
    Aug 2006
    Location
    Cambridge
    Beans
    101
    Distro
    Ubuntu 10.04 Lucid Lynx

    USB Device Permissions

    I'm writing a python app using pyusb which needs access to a USB device (it's a data logger with no linux driver). The python script works but have to run it as root to give it access to the USB Device.

    Does anyone know how to change the permissions to allow my user full access to the device (and ideally but less importantly allow the virtualbox user full access).
    Favourite Quote (following an Apple related debate on slashdot): "You wrote that on your MacBook sitting in a coffee shop, didn't you."

  2. #2
    Join Date
    Aug 2006
    Location
    Cambridge
    Beans
    101
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: USB Device Permissions

    Anyone?
    Favourite Quote (following an Apple related debate on slashdot): "You wrote that on your MacBook sitting in a coffee shop, didn't you."

  3. #3
    Join Date
    Apr 2009
    Location
    Barcelona
    Beans
    38

    Re: USB Device Permissions

    Don´t know if i get right your question but what if you do chmod 775 (read execute) or chmod 777 (read write execute)and then the path to the usb?

  4. #4
    Join Date
    Apr 2009
    Location
    Barcelona
    Beans
    38

    Re: USB Device Permissions

    As for the numbers after the chmod command look here:
    http://ss64.com/bash/chmod.html
    Last edited by kostaben; December 3rd, 2009 at 01:17 PM.

  5. #5
    Join Date
    Aug 2006
    Location
    Cambridge
    Beans
    101
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: USB Device Permissions

    Thanks for the reply, do you know how I find the path to the relevant USB device?
    Favourite Quote (following an Apple related debate on slashdot): "You wrote that on your MacBook sitting in a coffee shop, didn't you."

  6. #6
    Join Date
    Apr 2009
    Location
    Barcelona
    Beans
    38

    Re: USB Device Permissions

    if you right click on the usb and choose properties, you can find it in there. Should be in /media but i am not sure and i dont have a linux machine here.

  7. #7
    Join Date
    Aug 2006
    Location
    Cambridge
    Beans
    101
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: USB Device Permissions

    Thanks, think is it's not a mass storage device or similar. It's a data logger (made by Lascar) and there aren't any linux drivers for it. I used SnoopyPro in windows to see which commands are sent to it when various operations are performed on it and then pyusb in Python to simulate these commands under linux. The script works great but can only access the USB device if run using sudo. Because the script is going to be built into a much larger project it isn't feasable to just run the whole thing as root so I need to allow the logged in user access to the device if that makes any sense!
    Favourite Quote (following an Apple related debate on slashdot): "You wrote that on your MacBook sitting in a coffee shop, didn't you."

  8. #8
    Join Date
    Feb 2007
    Location
    Apeldoorn, NL
    Beans
    595
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: USB Device Permissions

    Quote Originally Posted by lazerradial2003 View Post
    I'm writing a python app using pyusb which needs access to a USB device (it's a data logger with no linux driver). The python script works but have to run it as root to give it access to the USB Device.

    Does anyone know how to change the permissions to allow my user full access to the device (and ideally but less importantly allow the virtualbox user full access).

    In Ubuntu, the usb permissions are arranged in:

    /etc/udev/rules.d

    You can't just chown the usb device directly.


    First you run:

    lsusb

    This gives you the device id. Example:
    Bus 001 Device 005: ID 03f0:3404 Hewlett-Packard DeskJet 6122

    You need the vendor id, in this example: 03f0
    and the device id, in this example: 3404

    Now add a textfile called 50-datalogger.rules to the folder /etc/udev/rules.d containing:
    (change yourusername to your username)

    cut---------------------------------------------------------------


    SUBSYSTEM !="usb_device", ACTION !="add", GOTO="datalogger_rules_end"

    SYSFS{idVendor} =="03f0", SYSFS{idProduct} =="3404", SYMLINK+="datalogger"

    MODE="0666", OWNER="yourusername", GROUP="root"

    LABEL="datalogger_rules_end"


    cut----------------------------------------------------------------


    and execute:
    chmod 4755 /path/yourapplication
    chown yourusername /path/yourapplication

    No 100% guarantee, but I think this is how it works...
    Last edited by stefangr1; December 3rd, 2009 at 02:58 PM.

  9. #9
    Join Date
    Jun 2010
    Beans
    1

    Re: USB Device Permissions

    Some lascar usb data loggers seem to be very similar (I assume same manafacturer, though I can't tell who is the original) to ones by measurement computing (mccdaq.com) and they list this site as having linux drivers for them: ftp://lx10.tx.ncsu.edu/pub/Linux/drivers/

    Hopefully that helps.

  10. #10
    Join Date
    Aug 2007
    Location
    Minneapolis, MN
    Beans
    5
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: USB Device Permissions

    I tried doing this with a Velleman K8055 kit, and I was unable to get the permissions set correctly. Since it's a different topic, I started a new thread, and if anyone is able to help, I'd really appreciate it.

    http://ubuntuforums.org/showthread.php?t=1660136

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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