22. Troubleshooting
22.1. Where to start?
If it is the first time that you use a Yoctopuce module and you do not really know where to start, have
a look at the Yoctopuce blog. There is a section dedicated to beginners
1
.
22.2. Linux and USB
To work correctly under Linux, the the library needs to have write access to all the Yoctopuce USB
peripherals. However, by default under Linux, USB privileges of the non-root users are limited to read
access. To avoid having to run the
VirtualHub
as root, you need to create a new
udev
rule to
authorize one or several users to have write access to the Yoctopuce peripherals.
To add a new
udev
rule to your installation, you must add a file with a name following the "
##-
arbitraryName.rules
" format, in the "
/etc/udev/rules.d
" directory. When the system is
starting,
udev
reads all the files with a "
.rules
" extension in this directory, respecting the
alphabetical order (for example, the "
51-custom.rules
" file is interpreted AFTER the "
50-
udev-default.rules
" file).
The "
50-udev-default
" file contains the system default
udev
rules. To modify the default
behavior, you therefore need to create a file with a name that starts with a number larger than 50,
that will override the system default rules. Note that to add a rule, you need a root access on the
system.
In the
udev_conf
directory of the
VirtualHub
for Linux
2
archive, there are two rule examples which
you can use as a basis.
Example 1: 51-yoctopuce.rules
This rule provides all the users with read and write access to the Yoctopuce USB peripherals. Access
rights for all other peripherals are not modified. If this scenario suits you, you only need to copy the
"
51-yoctopuce_all.rules
" file into the "
/etc/udev/rules.d
" directory and to restart your
system.
# udev rules to allow write access to all users
# for Yoctopuce USB devices
1
see: http://www.yoctopuce.com/EN/blog_by_categories/for-the-beginners
2
http://www.yoctopuce.com/FR/virtualhub.php
www.yoctopuce.com
479
Содержание Yocto-RangeFinder
Страница 1: ...Yocto RangeFinder User s guide...
Страница 2: ......
Страница 18: ...12 www yoctopuce com...
Страница 26: ...20 www yoctopuce com...
Страница 42: ...36 www yoctopuce com...
Страница 70: ...gcc lyocto lm lpthread lusb 1 0 lstdc 10 Using Yocto RangeFinder with C 64 www yoctopuce com...
Страница 90: ...84 www yoctopuce com...
Страница 120: ...114 www yoctopuce com...
Страница 130: ...124 www yoctopuce com...
Страница 158: ...21 High level API Reference On failure throws an exception or returns a negative error code 152 www yoctopuce com...
Страница 484: ...478 www yoctopuce com...
Страница 488: ...482 www yoctopuce com...
Страница 490: ...23 Characteristics 484 www yoctopuce com...
Страница 491: ......
Страница 492: ......